@hyperframes/studio 0.8.17 → 0.8.18
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/dist/assets/{hyperframes-player-DejBDgXB.js → hyperframes-player-DzRNJZAz.js} +1 -1
- package/dist/assets/{index-CklNVmi3.js → index-B4qse6wy.js} +1 -1
- package/dist/assets/{index-CU6o8PuW.js → index-F-PUkOVc.js} +4 -4
- package/dist/assets/{index-uu4Zd3BU.js → index-SGl0bb71.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/nle/useCompositionStack.test.tsx +69 -0
- package/src/components/nle/useCompositionStack.ts +8 -2
- package/src/webmcp/useStudioAgentTools.test.tsx +4 -4
|
@@ -46,7 +46,7 @@ var Gwe=Object.defineProperty;var Uwe=(t,e,n)=>e in t?Gwe(t,e,{enumerable:!0,con
|
|
|
46
46
|
`+Ee[D].replace(" at new "," at ");return g.displayName&&Ge.includes("<anonymous>")&&(Ge=Ge.replace("<anonymous>",g.displayName)),Ge}while(1<=D&&0<=V);break}}}finally{ge=!1,Error.prepareStackTrace=C}return(C=g?g.displayName||g.name:"")?pe(C):""}function ve(g,A){switch(g.tag){case 26:case 27:case 5:return pe(g.type);case 16:return pe("Lazy");case 13:return g.child!==A&&A!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return Pe(g.type,!1);case 11:return Pe(g.type.render,!1);case 1:return Pe(g.type,!0);case 31:return pe("Activity");default:return""}}function xe(g){try{var A="",C=null;do A+=ve(g,C),C=g,g=g.return;while(g);return A}catch(D){return`
|
|
47
47
|
Error generating stack: `+D.message+`
|
|
48
48
|
`+D.stack}}var we=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,Me=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,tt=t.unstable_requestPaint,Ze=t.unstable_now,qe=t.unstable_getCurrentPriorityLevel,pt=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,vt=t.unstable_NormalPriority,Ot=t.unstable_LowPriority,Kt=t.unstable_IdlePriority,qt=t.log,fn=t.unstable_setDisableYieldValue,Jt=null,Je=null;function St(g){if(typeof qt=="function"&&fn(g),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(Jt,g)}catch{}}var At=Math.clz32?Math.clz32:We,Ke=Math.log,Be=Math.LN2;function We(g){return g>>>=0,g===0?32:31-(Ke(g)/Be|0)|0}var Ye=256,Zt=262144,Te=4194304;function De(g){var A=g&42;if(A!==0)return A;switch(g&-g){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return g&261888;case 262144:case 524288:case 1048576:case 2097152:return g&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return g&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return g}}function ze(g,A,C){var D=g.pendingLanes;if(D===0)return 0;var V=0,G=g.suspendedLanes,ae=g.pingedLanes;g=g.warmLanes;var de=D&134217727;return de!==0?(D=de&~G,D!==0?V=De(D):(ae&=de,ae!==0?V=De(ae):C||(C=de&~g,C!==0&&(V=De(C))))):(de=D&~G,de!==0?V=De(de):ae!==0?V=De(ae):C||(C=D&~g,C!==0&&(V=De(C)))),V===0?0:A!==0&&A!==V&&(A&G)===0&&(G=V&-V,C=A&-A,G>=C||G===32&&(C&4194048)!==0)?A:V}function st(g,A){return(g.pendingLanes&~(g.suspendedLanes&~g.pingedLanes)&A)===0}function Gt(g,A){switch(g){case 1:case 2:case 4:case 8:case 64:return A+250;case 16:case 32: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 A+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ln(){var g=Te;return Te<<=1,(Te&62914560)===0&&(Te=4194304),g}function Yt(g){for(var A=[],C=0;31>C;C++)A.push(g);return A}function Mn(g,A){g.pendingLanes|=A,A!==268435456&&(g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0)}function Pr(g,A,C,D,V,G){var ae=g.pendingLanes;g.pendingLanes=C,g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0,g.expiredLanes&=C,g.entangledLanes&=C,g.errorRecoveryDisabledLanes&=C,g.shellSuspendCounter=0;var de=g.entanglements,Ee=g.expirationTimes,Le=g.hiddenUpdates;for(C=ae&~C;0<C;){var Ge=31-At(C),Xe=1<<Ge;de[Ge]=0,Ee[Ge]=-1;var Fe=Le[Ge];if(Fe!==null)for(Le[Ge]=null,Ge=0;Ge<Fe.length;Ge++){var He=Fe[Ge];He!==null&&(He.lane&=-536870913)}C&=~Xe}D!==0&&mt(g,D,0),G!==0&&V===0&&g.tag!==0&&(g.suspendedLanes|=G&~(ae&~A))}function mt(g,A,C){g.pendingLanes|=A,g.suspendedLanes&=~A;var D=31-At(A);g.entangledLanes|=A,g.entanglements[D]=g.entanglements[D]|1073741824|C&261930}function vn(g,A){var C=g.entangledLanes|=A;for(g=g.entanglements;C;){var D=31-At(C),V=1<<D;V&A|g[D]&A&&(g[D]|=A),C&=~V}}function mn(g,A){var C=A&-A;return C=(C&42)!==0?1:En(C),(C&(g.suspendedLanes|A))!==0?0:C}function En(g){switch(g){case 2:g=1;break;case 8:g=4;break;case 32:g=16;break;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:g=128;break;case 268435456:g=134217728;break;default:g=0}return g}function jn(g){return g&=-g,2<g?8<g?(g&134217727)!==0?32:268435456:8:2}function et(){var g=J.p;return g!==0?g:(g=window.event,g===void 0?32:Zz(g.type))}function qn(g,A){var C=J.p;try{return J.p=g,A()}finally{J.p=C}}var Mt=Math.random().toString(36).slice(2),hn="__reactFiber$"+Mt,Ht="__reactProps$"+Mt,dn="__reactContainer$"+Mt,er="__reactEvents$"+Mt,In="__reactListeners$"+Mt,yr="__reactHandles$"+Mt,tr="__reactResources$"+Mt,gt="__reactMarker$"+Mt;function nr(g){delete g[hn],delete g[Ht],delete g[er],delete g[In],delete g[yr]}function On(g){var A=g[hn];if(A)return A;for(var C=g.parentNode;C;){if(A=C[dn]||C[hn]){if(C=A.alternate,A.child!==null||C!==null&&C.child!==null)for(g=Pz(g);g!==null;){if(C=g[hn])return C;g=Pz(g)}return A}g=C,C=g.parentNode}return null}function _n(g){if(g=g[hn]||g[dn]){var A=g.tag;if(A===5||A===6||A===13||A===31||A===26||A===27||A===3)return g}return null}function xt(g){var A=g.tag;if(A===5||A===26||A===27||A===6)return g.stateNode;throw Error(r(33))}function Ut(g){var A=g[tr];return A||(A=g[tr]={hoistableStyles:new Map,hoistableScripts:new Map}),A}function Ct(g){g[gt]=!0}var ur=new Set,Dt={};function wt(g,A){gn(g,A),gn(g+"Capture",A)}function gn(g,A){for(Dt[g]=A,g=0;g<A.length;g++)ur.add(A[g])}var Lt=RegExp("^[: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]*$"),rn={},fs={};function Ln(g){return we.call(fs,g)?!0:we.call(rn,g)?!1:Lt.test(g)?fs[g]=!0:(rn[g]=!0,!1)}function ni(g,A,C){if(Ln(A))if(C===null)g.removeAttribute(A);else{switch(typeof C){case"undefined":case"function":case"symbol":g.removeAttribute(A);return;case"boolean":var D=A.toLowerCase().slice(0,5);if(D!=="data-"&&D!=="aria-"){g.removeAttribute(A);return}}g.setAttribute(A,""+C)}}function cn(g,A,C){if(C===null)g.removeAttribute(A);else{switch(typeof C){case"undefined":case"function":case"symbol":case"boolean":g.removeAttribute(A);return}g.setAttribute(A,""+C)}}function Cn(g,A,C,D){if(D===null)g.removeAttribute(C);else{switch(typeof D){case"undefined":case"function":case"symbol":case"boolean":g.removeAttribute(C);return}g.setAttributeNS(A,C,""+D)}}function rr(g){switch(typeof g){case"bigint":case"boolean":case"number":case"string":case"undefined":return g;case"object":return g;default:return""}}function Ti(g){var A=g.type;return(g=g.nodeName)&&g.toLowerCase()==="input"&&(A==="checkbox"||A==="radio")}function Kr(g,A,C){var D=Object.getOwnPropertyDescriptor(g.constructor.prototype,A);if(!g.hasOwnProperty(A)&&typeof D<"u"&&typeof D.get=="function"&&typeof D.set=="function"){var V=D.get,G=D.set;return Object.defineProperty(g,A,{configurable:!0,get:function(){return V.call(this)},set:function(ae){C=""+ae,G.call(this,ae)}}),Object.defineProperty(g,A,{enumerable:D.enumerable}),{getValue:function(){return C},setValue:function(ae){C=""+ae},stopTracking:function(){g._valueTracker=null,delete g[A]}}}}function Bi(g){if(!g._valueTracker){var A=Ti(g)?"checked":"value";g._valueTracker=Kr(g,A,""+g[A])}}function hs(g){if(!g)return!1;var A=g._valueTracker;if(!A)return!0;var C=A.getValue(),D="";return g&&(D=Ti(g)?g.checked?"true":"false":g.value),g=D,g!==C?(A.setValue(g),!0):!1}function Mr(g){if(g=g||(typeof document<"u"?document:void 0),typeof g>"u")return null;try{return g.activeElement||g.body}catch{return g.body}}var Ha=/[\n"\\]/g;function xi(g){return g.replace(Ha,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Sa(g,A,C,D,V,G,ae,de){g.name="",ae!=null&&typeof ae!="function"&&typeof ae!="symbol"&&typeof ae!="boolean"?g.type=ae:g.removeAttribute("type"),A!=null?ae==="number"?(A===0&&g.value===""||g.value!=A)&&(g.value=""+rr(A)):g.value!==""+rr(A)&&(g.value=""+rr(A)):ae!=="submit"&&ae!=="reset"||g.removeAttribute("value"),A!=null?Ae(g,ae,rr(A)):C!=null?Ae(g,ae,rr(C)):D!=null&&g.removeAttribute("value"),V==null&&G!=null&&(g.defaultChecked=!!G),V!=null&&(g.checked=V&&typeof V!="function"&&typeof V!="symbol"),de!=null&&typeof de!="function"&&typeof de!="symbol"&&typeof de!="boolean"?g.name=""+rr(de):g.removeAttribute("name")}function ft(g,A,C,D,V,G,ae,de){if(G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"&&(g.type=G),A!=null||C!=null){if(!(G!=="submit"&&G!=="reset"||A!=null)){Bi(g);return}C=C!=null?""+rr(C):"",A=A!=null?""+rr(A):C,de||A===g.value||(g.value=A),g.defaultValue=A}D=D??V,D=typeof D!="function"&&typeof D!="symbol"&&!!D,g.checked=de?g.checked:!!D,g.defaultChecked=!!D,ae!=null&&typeof ae!="function"&&typeof ae!="symbol"&&typeof ae!="boolean"&&(g.name=ae),Bi(g)}function Ae(g,A,C){A==="number"&&Mr(g.ownerDocument)===g||g.defaultValue===""+C||(g.defaultValue=""+C)}function _e(g,A,C,D){if(g=g.options,A){A={};for(var V=0;V<C.length;V++)A["$"+C[V]]=!0;for(C=0;C<g.length;C++)V=A.hasOwnProperty("$"+g[C].value),g[C].selected!==V&&(g[C].selected=V),V&&D&&(g[C].defaultSelected=!0)}else{for(C=""+rr(C),A=null,V=0;V<g.length;V++){if(g[V].value===C){g[V].selected=!0,D&&(g[V].defaultSelected=!0);return}A!==null||g[V].disabled||(A=g[V])}A!==null&&(A.selected=!0)}}function ot(g,A,C){if(A!=null&&(A=""+rr(A),A!==g.value&&(g.value=A),C==null)){g.defaultValue!==A&&(g.defaultValue=A);return}g.defaultValue=C!=null?""+rr(C):""}function bt(g,A,C,D){if(A==null){if(D!=null){if(C!=null)throw Error(r(92));if(Y(D)){if(1<D.length)throw Error(r(93));D=D[0]}C=D}C==null&&(C=""),A=C}C=rr(A),g.defaultValue=C,D=g.textContent,D===C&&D!==""&&D!==null&&(g.value=D),Bi(g)}function en(g,A){if(A){var C=g.firstChild;if(C&&C===g.lastChild&&C.nodeType===3){C.nodeValue=A;return}}g.textContent=A}var Tn=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $r(g,A,C){var D=A.indexOf("--")===0;C==null||typeof C=="boolean"||C===""?D?g.setProperty(A,""):A==="float"?g.cssFloat="":g[A]="":D?g.setProperty(A,C):typeof C!="number"||C===0||Tn.has(A)?A==="float"?g.cssFloat=C:g[A]=(""+C).trim():g[A]=C+"px"}function or(g,A,C){if(A!=null&&typeof A!="object")throw Error(r(62));if(g=g.style,C!=null){for(var D in C)!C.hasOwnProperty(D)||A!=null&&A.hasOwnProperty(D)||(D.indexOf("--")===0?g.setProperty(D,""):D==="float"?g.cssFloat="":g[D]="");for(var V in A)D=A[V],A.hasOwnProperty(V)&&C[V]!==D&&$r(g,V,D)}else for(var G in A)A.hasOwnProperty(G)&&$r(g,G,A[G])}function bi(g){if(g.indexOf("-")===-1)return!1;switch(g){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 ds=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ul=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Br(g){return Ul.test(""+g)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":g}function vs(){}var Lc=null;function Iu(g){return g=g.target||g.srcElement||window,g.correspondingUseElement&&(g=g.correspondingUseElement),g.nodeType===3?g.parentNode:g}var wa=null,Oa=null;function Fc(g){var A=_n(g);if(A&&(g=A.stateNode)){var C=g[Ht]||null;e:switch(g=A.stateNode,A.type){case"input":if(Sa(g,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name),A=C.name,C.type==="radio"&&A!=null){for(C=g;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll('input[name="'+xi(""+A)+'"][type="radio"]'),A=0;A<C.length;A++){var D=C[A];if(D!==g&&D.form===g.form){var V=D[Ht]||null;if(!V)throw Error(r(90));Sa(D,V.value,V.defaultValue,V.defaultValue,V.checked,V.defaultChecked,V.type,V.name)}}for(A=0;A<C.length;A++)D=C[A],D.form===g.form&&hs(D)}break e;case"textarea":ot(g,C.value,C.defaultValue);break e;case"select":A=C.value,A!=null&&_e(g,!!C.multiple,A,!1)}}}var _u=!1;function Xl(g,A,C){if(_u)return g(A,C);_u=!0;try{var D=g(A);return D}finally{if(_u=!1,(wa!==null||Oa!==null)&&(iO(),wa&&(A=wa,g=Oa,Oa=wa=null,Fc(A),g)))for(A=0;A<g.length;A++)Fc(g[A])}}function Wl(g,A){var C=g.stateNode;if(C===null)return null;var D=C[Ht]||null;if(D===null)return null;C=D[A];e:switch(A){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(g=g.type,D=!(g==="button"||g==="input"||g==="select"||g==="textarea")),g=!D;break e;default:g=!1}if(g)return null;if(C&&typeof C!="function")throw Error(r(231,A,typeof C));return C}var _s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ru=!1;if(_s)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){Ru=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{Ru=!1}var lt=null,kt=null,vi=null;function fh(){if(vi)return vi;var g,A=kt,C=A.length,D,V="value"in lt?lt.value:lt.textContent,G=V.length;for(g=0;g<C&&A[g]===V[g];g++);var ae=C-g;for(D=1;D<=ae&&A[C-D]===V[G-D];D++);return vi=V.slice(g,1<D?1-D:void 0)}function tm(g){var A=g.keyCode;return"charCode"in g?(g=g.charCode,g===0&&A===13&&(g=13)):g=A,g===10&&(g=13),32<=g||g===13?g:0}function nm(){return!0}function fw(){return!1}function Rs(g){function A(C,D,V,G,ae){this._reactName=C,this._targetInst=V,this.type=D,this.nativeEvent=G,this.target=ae,this.currentTarget=null;for(var de in g)g.hasOwnProperty(de)&&(C=g[de],this[de]=C?C(G):G[de]);return this.isDefaultPrevented=(G.defaultPrevented!=null?G.defaultPrevented:G.returnValue===!1)?nm:fw,this.isPropagationStopped=fw,this}return f(A.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=nm)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=nm)},persist:function(){},isPersistent:nm}),A}var ju={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(g){return g.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qd=Rs(ju),hh=f({},ju,{view:0,detail:0}),u5=Rs(hh),Gy,rm,dh,im=f({},hh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sm,button:0,buttons:0,relatedTarget:function(g){return g.relatedTarget===void 0?g.fromElement===g.srcElement?g.toElement:g.fromElement:g.relatedTarget},movementX:function(g){return"movementX"in g?g.movementX:(g!==dh&&(dh&&g.type==="mousemove"?(Gy=g.screenX-dh.screenX,rm=g.screenY-dh.screenY):rm=Gy=0,dh=g),Gy)},movementY:function(g){return"movementY"in g?g.movementY:rm}}),Uy=Rs(im),f5=f({},im,{dataTransfer:0}),h5=Rs(f5),Xy=f({},hh,{relatedTarget:0}),Wy=Rs(Xy),d5=f({},ju,{animationName:0,elapsedTime:0,pseudoElement:0}),qy=Rs(d5),p5=f({},ju,{clipboardData:function(g){return"clipboardData"in g?g.clipboardData:window.clipboardData}}),m5=Rs(p5),hw=f({},ju,{data:0}),dw=Rs(hw),g5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y5={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"},x5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yd(g){var A=this.nativeEvent;return A.getModifierState?A.getModifierState(g):(g=x5[g])?!!A[g]:!1}function sm(){return Yd}var b5=f({},hh,{key:function(g){if(g.key){var A=g5[g.key]||g.key;if(A!=="Unidentified")return A}return g.type==="keypress"?(g=tm(g),g===13?"Enter":String.fromCharCode(g)):g.type==="keydown"||g.type==="keyup"?y5[g.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sm,charCode:function(g){return g.type==="keypress"?tm(g):0},keyCode:function(g){return g.type==="keydown"||g.type==="keyup"?g.keyCode:0},which:function(g){return g.type==="keypress"?tm(g):g.type==="keydown"||g.type==="keyup"?g.keyCode:0}}),te=Rs(b5),T=f({},im,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S=Rs(T),P=f({},hh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sm}),R=Rs(P),X=f({},ju,{propertyName:0,elapsedTime:0,pseudoElement:0}),oe=Rs(X),ce=f({},im,{deltaX:function(g){return"deltaX"in g?g.deltaX:"wheelDeltaX"in g?-g.wheelDeltaX:0},deltaY:function(g){return"deltaY"in g?g.deltaY:"wheelDeltaY"in g?-g.wheelDeltaY:"wheelDelta"in g?-g.wheelDelta:0},deltaZ:0,deltaMode:0}),ye=Rs(ce),Se=f({},ju,{newState:0,oldState:0}),ke=Rs(Se),$e=[9,13,27,32],nt=_s&&"CompositionEvent"in window,at=null;_s&&"documentMode"in document&&(at=document.documentMode);var Nt=_s&&"TextEvent"in window&&!at,Bn=_s&&(!nt||at&&8<at&&11>=at),Or=" ",pn=!1;function xr(g,A){switch(g){case"keyup":return $e.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $c(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var Ca=!1;function pw(g,A){switch(g){case"compositionend":return $c(A);case"keypress":return A.which!==32?null:(pn=!0,Or);case"textInput":return g=A.data,g===Or&&pn?null:g;default:return null}}function mw(g,A){if(Ca)return g==="compositionend"||!nt&&xr(g,A)?(g=fh(),vi=kt=lt=null,Ca=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(A.ctrlKey||A.altKey||A.metaKey)||A.ctrlKey&&A.altKey){if(A.char&&1<A.char.length)return A.char;if(A.which)return String.fromCharCode(A.which)}return null;case"compositionend":return Bn&&A.locale!=="ko"?null:A.data;default:return null}}var gw={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 Yy(g){var A=g&&g.nodeName&&g.nodeName.toLowerCase();return A==="input"?!!gw[g.type]:A==="textarea"}function Ky(g,A,C,D){wa?Oa?Oa.push(D):Oa=[D]:wa=D,A=fO(A,"onChange"),0<A.length&&(C=new qd("onChange","change",null,C,D),g.push({event:C,listeners:A}))}var ph=null,mh=null;function yw(g){mz(g,0)}function Kd(g){var A=xt(g);if(hs(A))return g}function Jy(g,A){if(g==="change")return A}var ex=!1;if(_s){var am;if(_s){var om="oninput"in document;if(!om){var tx=document.createElement("div");tx.setAttribute("oninput","return;"),om=typeof tx.oninput=="function"}am=om}else am=!1;ex=am&&(!document.documentMode||9<document.documentMode)}function nx(){ph&&(ph.detachEvent("onpropertychange",rx),mh=ph=null)}function rx(g){if(g.propertyName==="value"&&Kd(mh)){var A=[];Ky(A,mh,g,Iu(g)),Xl(yw,A)}}function xw(g,A,C){g==="focusin"?(nx(),ph=A,mh=C,ph.attachEvent("onpropertychange",rx)):g==="focusout"&&nx()}function bw(g){if(g==="selectionchange"||g==="keyup"||g==="keydown")return Kd(mh)}function vw(g,A){if(g==="click")return Kd(A)}function Aw(g,A){if(g==="input"||g==="change")return Kd(A)}function Sw(g,A){return g===A&&(g!==0||1/g===1/A)||g!==g&&A!==A}var ta=typeof Object.is=="function"?Object.is:Sw;function gh(g,A){if(ta(g,A))return!0;if(typeof g!="object"||g===null||typeof A!="object"||A===null)return!1;var C=Object.keys(g),D=Object.keys(A);if(C.length!==D.length)return!1;for(D=0;D<C.length;D++){var V=C[D];if(!we.call(A,V)||!ta(g[V],A[V]))return!1}return!0}function ix(g){for(;g&&g.firstChild;)g=g.firstChild;return g}function sx(g,A){var C=ix(g);g=0;for(var D;C;){if(C.nodeType===3){if(D=g+C.textContent.length,g<=A&&D>=A)return{node:C,offset:A-g};g=D}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=ix(C)}}function ax(g,A){return g&&A?g===A?!0:g&&g.nodeType===3?!1:A&&A.nodeType===3?ax(g,A.parentNode):"contains"in g?g.contains(A):g.compareDocumentPosition?!!(g.compareDocumentPosition(A)&16):!1:!1}function ox(g){g=g!=null&&g.ownerDocument!=null&&g.ownerDocument.defaultView!=null?g.ownerDocument.defaultView:window;for(var A=Mr(g.document);A instanceof g.HTMLIFrameElement;){try{var C=typeof A.contentWindow.location.href=="string"}catch{C=!1}if(C)g=A.contentWindow;else break;A=Mr(g.document)}return A}function lm(g){var A=g&&g.nodeName&&g.nodeName.toLowerCase();return A&&(A==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||A==="textarea"||g.contentEditable==="true")}var ww=_s&&"documentMode"in document&&11>=document.documentMode,Lu=null,v5=null,lx=null,A5=!1;function QV(g,A,C){var D=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;A5||Lu==null||Lu!==Mr(D)||(D=Lu,"selectionStart"in D&&lm(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),lx&&gh(lx,D)||(lx=D,D=fO(v5,"onSelect"),0<D.length&&(A=new qd("onSelect","select",null,A,C),g.push({event:A,listeners:D}),A.target=Lu)))}function Jd(g,A){var C={};return C[g.toLowerCase()]=A.toLowerCase(),C["Webkit"+g]="webkit"+A,C["Moz"+g]="moz"+A,C}var cm={animationend:Jd("Animation","AnimationEnd"),animationiteration:Jd("Animation","AnimationIteration"),animationstart:Jd("Animation","AnimationStart"),transitionrun:Jd("Transition","TransitionRun"),transitionstart:Jd("Transition","TransitionStart"),transitioncancel:Jd("Transition","TransitionCancel"),transitionend:Jd("Transition","TransitionEnd")},S5={},zV={};_s&&(zV=document.createElement("div").style,"AnimationEvent"in window||(delete cm.animationend.animation,delete cm.animationiteration.animation,delete cm.animationstart.animation),"TransitionEvent"in window||delete cm.transitionend.transition);function ep(g){if(S5[g])return S5[g];if(!cm[g])return g;var A=cm[g],C;for(C in A)if(A.hasOwnProperty(C)&&C in zV)return S5[g]=A[C];return g}var ZV=ep("animationend"),GV=ep("animationiteration"),UV=ep("animationstart"),kSe=ep("transitionrun"),ESe=ep("transitionstart"),TSe=ep("transitioncancel"),XV=ep("transitionend"),WV=new Map,w5="abort auxClick beforeToggle 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(" ");w5.push("scrollEnd");function ql(g,A){WV.set(g,A),wt(A,[g])}var Ow=typeof reportError=="function"?reportError:function(g){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g=="object"&&g!==null&&typeof g.message=="string"?String(g.message):String(g),error:g});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",g);return}console.error(g)},ll=[],um=0,O5=0;function Cw(){for(var g=um,A=O5=um=0;A<g;){var C=ll[A];ll[A++]=null;var D=ll[A];ll[A++]=null;var V=ll[A];ll[A++]=null;var G=ll[A];if(ll[A++]=null,D!==null&&V!==null){var ae=D.pending;ae===null?V.next=V:(V.next=ae.next,ae.next=V),D.pending=V}G!==0&&qV(C,V,G)}}function kw(g,A,C,D){ll[um++]=g,ll[um++]=A,ll[um++]=C,ll[um++]=D,O5|=D,g.lanes|=D,g=g.alternate,g!==null&&(g.lanes|=D)}function C5(g,A,C,D){return kw(g,A,C,D),Ew(g)}function tp(g,A){return kw(g,null,null,A),Ew(g)}function qV(g,A,C){g.lanes|=C;var D=g.alternate;D!==null&&(D.lanes|=C);for(var V=!1,G=g.return;G!==null;)G.childLanes|=C,D=G.alternate,D!==null&&(D.childLanes|=C),G.tag===22&&(g=G.stateNode,g===null||g._visibility&1||(V=!0)),g=G,G=G.return;return g.tag===3?(G=g.stateNode,V&&A!==null&&(V=31-At(C),g=G.hiddenUpdates,D=g[V],D===null?g[V]=[A]:D.push(A),A.lane=C|536870912),G):null}function Ew(g){if(50<Mx)throw Mx=0,_T=null,Error(r(185));for(var A=g.return;A!==null;)g=A,A=g.return;return g.tag===3?g.stateNode:null}var fm={};function PSe(g,A,C,D){this.tag=g,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=A,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function So(g,A,C,D){return new PSe(g,A,C,D)}function k5(g){return g=g.prototype,!(!g||!g.isReactComponent)}function Fu(g,A){var C=g.alternate;return C===null?(C=So(g.tag,A,g.key,g.mode),C.elementType=g.elementType,C.type=g.type,C.stateNode=g.stateNode,C.alternate=g,g.alternate=C):(C.pendingProps=A,C.type=g.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=g.flags&65011712,C.childLanes=g.childLanes,C.lanes=g.lanes,C.child=g.child,C.memoizedProps=g.memoizedProps,C.memoizedState=g.memoizedState,C.updateQueue=g.updateQueue,A=g.dependencies,C.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext},C.sibling=g.sibling,C.index=g.index,C.ref=g.ref,C.refCleanup=g.refCleanup,C}function YV(g,A){g.flags&=65011714;var C=g.alternate;return C===null?(g.childLanes=0,g.lanes=A,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=C.childLanes,g.lanes=C.lanes,g.child=C.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=C.memoizedProps,g.memoizedState=C.memoizedState,g.updateQueue=C.updateQueue,g.type=C.type,A=C.dependencies,g.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),g}function Tw(g,A,C,D,V,G){var ae=0;if(D=g,typeof g=="function")k5(g)&&(ae=1);else if(typeof g=="string")ae=_we(g,C,Z.current)?26:g==="html"||g==="head"||g==="body"?27:5;else e:switch(g){case _:return g=So(31,C,A,V),g.elementType=_,g.lanes=G,g;case d:return np(C.children,V,G,A);case v:ae=8,V|=24;break;case b:return g=So(12,C,A,V|2),g.elementType=b,g.lanes=G,g;case E:return g=So(13,C,A,V),g.elementType=E,g.lanes=G,g;case M:return g=So(19,C,A,V),g.elementType=M,g.lanes=G,g;default:if(typeof g=="object"&&g!==null)switch(g.$$typeof){case O:ae=10;break e;case w:ae=9;break e;case k:ae=11;break e;case N:ae=14;break e;case I:ae=16,D=null;break e}ae=29,C=Error(r(130,g===null?"null":typeof g,"")),D=null}return A=So(ae,C,A,V),A.elementType=g,A.type=D,A.lanes=G,A}function np(g,A,C,D){return g=So(7,g,D,A),g.lanes=C,g}function E5(g,A,C){return g=So(6,g,null,A),g.lanes=C,g}function KV(g){var A=So(18,null,null,0);return A.stateNode=g,A}function T5(g,A,C){return A=So(4,g.children!==null?g.children:[],g.key,A),A.lanes=C,A.stateNode={containerInfo:g.containerInfo,pendingChildren:null,implementation:g.implementation},A}var JV=new WeakMap;function cl(g,A){if(typeof g=="object"&&g!==null){var C=JV.get(g);return C!==void 0?C:(A={value:g,source:A,stack:xe(A)},JV.set(g,A),A)}return{value:g,source:A,stack:xe(A)}}var hm=[],dm=0,Pw=null,cx=0,ul=[],fl=0,yh=null,Bc=1,Vc="";function $u(g,A){hm[dm++]=cx,hm[dm++]=Pw,Pw=g,cx=A}function eH(g,A,C){ul[fl++]=Bc,ul[fl++]=Vc,ul[fl++]=yh,yh=g;var D=Bc;g=Vc;var V=32-At(D)-1;D&=~(1<<V),C+=1;var G=32-At(A)+V;if(30<G){var ae=V-V%5;G=(D&(1<<ae)-1).toString(32),D>>=ae,V-=ae,Bc=1<<32-At(A)+V|C<<V|D,Vc=G+g}else Bc=1<<G|C<<V|D,Vc=g}function P5(g){g.return!==null&&($u(g,1),eH(g,1,0))}function M5(g){for(;g===Pw;)Pw=hm[--dm],hm[dm]=null,cx=hm[--dm],hm[dm]=null;for(;g===yh;)yh=ul[--fl],ul[fl]=null,Vc=ul[--fl],ul[fl]=null,Bc=ul[--fl],ul[fl]=null}function tH(g,A){ul[fl++]=Bc,ul[fl++]=Vc,ul[fl++]=yh,Bc=A.id,Vc=A.overflow,yh=g}var js=null,ri=null,Yn=!1,xh=null,hl=!1,N5=Error(r(519));function bh(g){var A=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ux(cl(A,g)),N5}function nH(g){var A=g.stateNode,C=g.type,D=g.memoizedProps;switch(A[hn]=g,A[Ht]=D,C){case"dialog":Hn("cancel",A),Hn("close",A);break;case"iframe":case"object":case"embed":Hn("load",A);break;case"video":case"audio":for(C=0;C<Dx.length;C++)Hn(Dx[C],A);break;case"source":Hn("error",A);break;case"img":case"image":case"link":Hn("error",A),Hn("load",A);break;case"details":Hn("toggle",A);break;case"input":Hn("invalid",A),ft(A,D.value,D.defaultValue,D.checked,D.defaultChecked,D.type,D.name,!0);break;case"select":Hn("invalid",A);break;case"textarea":Hn("invalid",A),bt(A,D.value,D.defaultValue,D.children)}C=D.children,typeof C!="string"&&typeof C!="number"&&typeof C!="bigint"||A.textContent===""+C||D.suppressHydrationWarning===!0||bz(A.textContent,C)?(D.popover!=null&&(Hn("beforetoggle",A),Hn("toggle",A)),D.onScroll!=null&&Hn("scroll",A),D.onScrollEnd!=null&&Hn("scrollend",A),D.onClick!=null&&(A.onclick=vs),A=!0):A=!1,A||bh(g,!0)}function rH(g){for(js=g.return;js;)switch(js.tag){case 5:case 31:case 13:hl=!1;return;case 27:case 3:hl=!0;return;default:js=js.return}}function pm(g){if(g!==js)return!1;if(!Yn)return rH(g),Yn=!0,!1;var A=g.tag,C;if((C=A!==3&&A!==27)&&((C=A===5)&&(C=g.type,C=!(C!=="form"&&C!=="button")||WT(g.type,g.memoizedProps)),C=!C),C&&ri&&bh(g),rH(g),A===13){if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));ri=Tz(g)}else if(A===31){if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));ri=Tz(g)}else A===27?(A=ri,Ih(g.type)?(g=eP,eP=null,ri=g):ri=A):ri=js?pl(g.stateNode.nextSibling):null;return!0}function rp(){ri=js=null,Yn=!1}function D5(){var g=xh;return g!==null&&(Ga===null?Ga=g:Ga.push.apply(Ga,g),xh=null),g}function ux(g){xh===null?xh=[g]:xh.push(g)}var I5=q(null),ip=null,Bu=null;function vh(g,A,C){U(I5,A._currentValue),A._currentValue=C}function Vu(g){g._currentValue=I5.current,F(I5)}function _5(g,A,C){for(;g!==null;){var D=g.alternate;if((g.childLanes&A)!==A?(g.childLanes|=A,D!==null&&(D.childLanes|=A)):D!==null&&(D.childLanes&A)!==A&&(D.childLanes|=A),g===C)break;g=g.return}}function R5(g,A,C,D){var V=g.child;for(V!==null&&(V.return=g);V!==null;){var G=V.dependencies;if(G!==null){var ae=V.child;G=G.firstContext;e:for(;G!==null;){var de=G;G=V;for(var Ee=0;Ee<A.length;Ee++)if(de.context===A[Ee]){G.lanes|=C,de=G.alternate,de!==null&&(de.lanes|=C),_5(G.return,C,g),D||(ae=null);break e}G=de.next}}else if(V.tag===18){if(ae=V.return,ae===null)throw Error(r(341));ae.lanes|=C,G=ae.alternate,G!==null&&(G.lanes|=C),_5(ae,C,g),ae=null}else ae=V.child;if(ae!==null)ae.return=V;else for(ae=V;ae!==null;){if(ae===g){ae=null;break}if(V=ae.sibling,V!==null){V.return=ae.return,ae=V;break}ae=ae.return}V=ae}}function mm(g,A,C,D){g=null;for(var V=A,G=!1;V!==null;){if(!G){if((V.flags&524288)!==0)G=!0;else if((V.flags&262144)!==0)break}if(V.tag===10){var ae=V.alternate;if(ae===null)throw Error(r(387));if(ae=ae.memoizedProps,ae!==null){var de=V.type;ta(V.pendingProps.value,ae.value)||(g!==null?g.push(de):g=[de])}}else if(V===re.current){if(ae=V.alternate,ae===null)throw Error(r(387));ae.memoizedState.memoizedState!==V.memoizedState.memoizedState&&(g!==null?g.push(Lx):g=[Lx])}V=V.return}g!==null&&R5(A,g,C,D),A.flags|=262144}function Mw(g){for(g=g.firstContext;g!==null;){if(!ta(g.context._currentValue,g.memoizedValue))return!0;g=g.next}return!1}function sp(g){ip=g,Bu=null,g=g.dependencies,g!==null&&(g.firstContext=null)}function Ls(g){return iH(ip,g)}function Nw(g,A){return ip===null&&sp(g),iH(g,A)}function iH(g,A){var C=A._currentValue;if(A={context:A,memoizedValue:C,next:null},Bu===null){if(g===null)throw Error(r(308));Bu=A,g.dependencies={lanes:0,firstContext:A},g.flags|=524288}else Bu=Bu.next=A;return C}var MSe=typeof AbortController<"u"?AbortController:function(){var g=[],A=this.signal={aborted:!1,addEventListener:function(C,D){g.push(D)}};this.abort=function(){A.aborted=!0,g.forEach(function(C){return C()})}},NSe=t.unstable_scheduleCallback,DSe=t.unstable_NormalPriority,Yi={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function j5(){return{controller:new MSe,data:new Map,refCount:0}}function fx(g){g.refCount--,g.refCount===0&&NSe(DSe,function(){g.controller.abort()})}var hx=null,L5=0,gm=0,ym=null;function ISe(g,A){if(hx===null){var C=hx=[];L5=0,gm=BT(),ym={status:"pending",value:void 0,then:function(D){C.push(D)}}}return L5++,A.then(sH,sH),A}function sH(){if(--L5===0&&hx!==null){ym!==null&&(ym.status="fulfilled");var g=hx;hx=null,gm=0,ym=null;for(var A=0;A<g.length;A++)(0,g[A])()}}function _Se(g,A){var C=[],D={status:"pending",value:null,reason:null,then:function(V){C.push(V)}};return g.then(function(){D.status="fulfilled",D.value=A;for(var V=0;V<C.length;V++)(0,C[V])(A)},function(V){for(D.status="rejected",D.reason=V,V=0;V<C.length;V++)(0,C[V])(void 0)}),D}var aH=W.S;W.S=function(g,A){QQ=Ze(),typeof A=="object"&&A!==null&&typeof A.then=="function"&&ISe(g,A),aH!==null&&aH(g,A)};var ap=q(null);function F5(){var g=ap.current;return g!==null?g:Hr.pooledCache}function Dw(g,A){A===null?U(ap,ap.current):U(ap,A.pool)}function oH(){var g=F5();return g===null?null:{parent:Yi._currentValue,pool:g}}var xm=Error(r(460)),$5=Error(r(474)),Iw=Error(r(542)),_w={then:function(){}};function lH(g){return g=g.status,g==="fulfilled"||g==="rejected"}function cH(g,A,C){switch(C=g[C],C===void 0?g.push(A):C!==A&&(A.then(vs,vs),A=C),A.status){case"fulfilled":return A.value;case"rejected":throw g=A.reason,fH(g),g;default:if(typeof A.status=="string")A.then(vs,vs);else{if(g=Hr,g!==null&&100<g.shellSuspendCounter)throw Error(r(482));g=A,g.status="pending",g.then(function(D){if(A.status==="pending"){var V=A;V.status="fulfilled",V.value=D}},function(D){if(A.status==="pending"){var V=A;V.status="rejected",V.reason=D}})}switch(A.status){case"fulfilled":return A.value;case"rejected":throw g=A.reason,fH(g),g}throw lp=A,xm}}function op(g){try{var A=g._init;return A(g._payload)}catch(C){throw C!==null&&typeof C=="object"&&typeof C.then=="function"?(lp=C,xm):C}}var lp=null;function uH(){if(lp===null)throw Error(r(459));var g=lp;return lp=null,g}function fH(g){if(g===xm||g===Iw)throw Error(r(483))}var bm=null,dx=0;function Rw(g){var A=dx;return dx+=1,bm===null&&(bm=[]),cH(bm,g,A)}function px(g,A){A=A.props.ref,g.ref=A!==void 0?A:null}function jw(g,A){throw A.$$typeof===h?Error(r(525)):(g=Object.prototype.toString.call(A),Error(r(31,g==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":g)))}function hH(g){function A(Ie,Ne){if(g){var je=Ie.deletions;je===null?(Ie.deletions=[Ne],Ie.flags|=16):je.push(Ne)}}function C(Ie,Ne){if(!g)return null;for(;Ne!==null;)A(Ie,Ne),Ne=Ne.sibling;return null}function D(Ie){for(var Ne=new Map;Ie!==null;)Ie.key!==null?Ne.set(Ie.key,Ie):Ne.set(Ie.index,Ie),Ie=Ie.sibling;return Ne}function V(Ie,Ne){return Ie=Fu(Ie,Ne),Ie.index=0,Ie.sibling=null,Ie}function G(Ie,Ne,je){return Ie.index=je,g?(je=Ie.alternate,je!==null?(je=je.index,je<Ne?(Ie.flags|=67108866,Ne):je):(Ie.flags|=67108866,Ne)):(Ie.flags|=1048576,Ne)}function ae(Ie){return g&&Ie.alternate===null&&(Ie.flags|=67108866),Ie}function de(Ie,Ne,je,Ue){return Ne===null||Ne.tag!==6?(Ne=E5(je,Ie.mode,Ue),Ne.return=Ie,Ne):(Ne=V(Ne,je),Ne.return=Ie,Ne)}function Ee(Ie,Ne,je,Ue){var Wt=je.type;return Wt===d?Ge(Ie,Ne,je.props.children,Ue,je.key):Ne!==null&&(Ne.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===I&&op(Wt)===Ne.type)?(Ne=V(Ne,je.props),px(Ne,je),Ne.return=Ie,Ne):(Ne=Tw(je.type,je.key,je.props,null,Ie.mode,Ue),px(Ne,je),Ne.return=Ie,Ne)}function Le(Ie,Ne,je,Ue){return Ne===null||Ne.tag!==4||Ne.stateNode.containerInfo!==je.containerInfo||Ne.stateNode.implementation!==je.implementation?(Ne=T5(je,Ie.mode,Ue),Ne.return=Ie,Ne):(Ne=V(Ne,je.children||[]),Ne.return=Ie,Ne)}function Ge(Ie,Ne,je,Ue,Wt){return Ne===null||Ne.tag!==7?(Ne=np(je,Ie.mode,Ue,Wt),Ne.return=Ie,Ne):(Ne=V(Ne,je),Ne.return=Ie,Ne)}function Xe(Ie,Ne,je){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return Ne=E5(""+Ne,Ie.mode,je),Ne.return=Ie,Ne;if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case m:return je=Tw(Ne.type,Ne.key,Ne.props,null,Ie.mode,je),px(je,Ne),je.return=Ie,je;case y:return Ne=T5(Ne,Ie.mode,je),Ne.return=Ie,Ne;case I:return Ne=op(Ne),Xe(Ie,Ne,je)}if(Y(Ne)||B(Ne))return Ne=np(Ne,Ie.mode,je,null),Ne.return=Ie,Ne;if(typeof Ne.then=="function")return Xe(Ie,Rw(Ne),je);if(Ne.$$typeof===O)return Xe(Ie,Nw(Ie,Ne),je);jw(Ie,Ne)}return null}function Fe(Ie,Ne,je,Ue){var Wt=Ne!==null?Ne.key:null;if(typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint")return Wt!==null?null:de(Ie,Ne,""+je,Ue);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case m:return je.key===Wt?Ee(Ie,Ne,je,Ue):null;case y:return je.key===Wt?Le(Ie,Ne,je,Ue):null;case I:return je=op(je),Fe(Ie,Ne,je,Ue)}if(Y(je)||B(je))return Wt!==null?null:Ge(Ie,Ne,je,Ue,null);if(typeof je.then=="function")return Fe(Ie,Ne,Rw(je),Ue);if(je.$$typeof===O)return Fe(Ie,Ne,Nw(Ie,je),Ue);jw(Ie,je)}return null}function He(Ie,Ne,je,Ue,Wt){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return Ie=Ie.get(je)||null,de(Ne,Ie,""+Ue,Wt);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case m:return Ie=Ie.get(Ue.key===null?je:Ue.key)||null,Ee(Ne,Ie,Ue,Wt);case y:return Ie=Ie.get(Ue.key===null?je:Ue.key)||null,Le(Ne,Ie,Ue,Wt);case I:return Ue=op(Ue),He(Ie,Ne,je,Ue,Wt)}if(Y(Ue)||B(Ue))return Ie=Ie.get(je)||null,Ge(Ne,Ie,Ue,Wt,null);if(typeof Ue.then=="function")return He(Ie,Ne,je,Rw(Ue),Wt);if(Ue.$$typeof===O)return He(Ie,Ne,je,Nw(Ne,Ue),Wt);jw(Ne,Ue)}return null}function jt(Ie,Ne,je,Ue){for(var Wt=null,fr=null,Bt=Ne,Pn=Ne=0,Un=null;Bt!==null&&Pn<je.length;Pn++){Bt.index>Pn?(Un=Bt,Bt=null):Un=Bt.sibling;var hr=Fe(Ie,Bt,je[Pn],Ue);if(hr===null){Bt===null&&(Bt=Un);break}g&&Bt&&hr.alternate===null&&A(Ie,Bt),Ne=G(hr,Ne,Pn),fr===null?Wt=hr:fr.sibling=hr,fr=hr,Bt=Un}if(Pn===je.length)return C(Ie,Bt),Yn&&$u(Ie,Pn),Wt;if(Bt===null){for(;Pn<je.length;Pn++)Bt=Xe(Ie,je[Pn],Ue),Bt!==null&&(Ne=G(Bt,Ne,Pn),fr===null?Wt=Bt:fr.sibling=Bt,fr=Bt);return Yn&&$u(Ie,Pn),Wt}for(Bt=D(Bt);Pn<je.length;Pn++)Un=He(Bt,Ie,Pn,je[Pn],Ue),Un!==null&&(g&&Un.alternate!==null&&Bt.delete(Un.key===null?Pn:Un.key),Ne=G(Un,Ne,Pn),fr===null?Wt=Un:fr.sibling=Un,fr=Un);return g&&Bt.forEach(function(Fh){return A(Ie,Fh)}),Yn&&$u(Ie,Pn),Wt}function sn(Ie,Ne,je,Ue){if(je==null)throw Error(r(151));for(var Wt=null,fr=null,Bt=Ne,Pn=Ne=0,Un=null,hr=je.next();Bt!==null&&!hr.done;Pn++,hr=je.next()){Bt.index>Pn?(Un=Bt,Bt=null):Un=Bt.sibling;var Fh=Fe(Ie,Bt,hr.value,Ue);if(Fh===null){Bt===null&&(Bt=Un);break}g&&Bt&&Fh.alternate===null&&A(Ie,Bt),Ne=G(Fh,Ne,Pn),fr===null?Wt=Fh:fr.sibling=Fh,fr=Fh,Bt=Un}if(hr.done)return C(Ie,Bt),Yn&&$u(Ie,Pn),Wt;if(Bt===null){for(;!hr.done;Pn++,hr=je.next())hr=Xe(Ie,hr.value,Ue),hr!==null&&(Ne=G(hr,Ne,Pn),fr===null?Wt=hr:fr.sibling=hr,fr=hr);return Yn&&$u(Ie,Pn),Wt}for(Bt=D(Bt);!hr.done;Pn++,hr=je.next())hr=He(Bt,Ie,Pn,hr.value,Ue),hr!==null&&(g&&hr.alternate!==null&&Bt.delete(hr.key===null?Pn:hr.key),Ne=G(hr,Ne,Pn),fr===null?Wt=hr:fr.sibling=hr,fr=hr);return g&&Bt.forEach(function(Zwe){return A(Ie,Zwe)}),Yn&&$u(Ie,Pn),Wt}function Ir(Ie,Ne,je,Ue){if(typeof je=="object"&&je!==null&&je.type===d&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case m:e:{for(var Wt=je.key;Ne!==null;){if(Ne.key===Wt){if(Wt=je.type,Wt===d){if(Ne.tag===7){C(Ie,Ne.sibling),Ue=V(Ne,je.props.children),Ue.return=Ie,Ie=Ue;break e}}else if(Ne.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===I&&op(Wt)===Ne.type){C(Ie,Ne.sibling),Ue=V(Ne,je.props),px(Ue,je),Ue.return=Ie,Ie=Ue;break e}C(Ie,Ne);break}else A(Ie,Ne);Ne=Ne.sibling}je.type===d?(Ue=np(je.props.children,Ie.mode,Ue,je.key),Ue.return=Ie,Ie=Ue):(Ue=Tw(je.type,je.key,je.props,null,Ie.mode,Ue),px(Ue,je),Ue.return=Ie,Ie=Ue)}return ae(Ie);case y:e:{for(Wt=je.key;Ne!==null;){if(Ne.key===Wt)if(Ne.tag===4&&Ne.stateNode.containerInfo===je.containerInfo&&Ne.stateNode.implementation===je.implementation){C(Ie,Ne.sibling),Ue=V(Ne,je.children||[]),Ue.return=Ie,Ie=Ue;break e}else{C(Ie,Ne);break}else A(Ie,Ne);Ne=Ne.sibling}Ue=T5(je,Ie.mode,Ue),Ue.return=Ie,Ie=Ue}return ae(Ie);case I:return je=op(je),Ir(Ie,Ne,je,Ue)}if(Y(je))return jt(Ie,Ne,je,Ue);if(B(je)){if(Wt=B(je),typeof Wt!="function")throw Error(r(150));return je=Wt.call(je),sn(Ie,Ne,je,Ue)}if(typeof je.then=="function")return Ir(Ie,Ne,Rw(je),Ue);if(je.$$typeof===O)return Ir(Ie,Ne,Nw(Ie,je),Ue);jw(Ie,je)}return typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint"?(je=""+je,Ne!==null&&Ne.tag===6?(C(Ie,Ne.sibling),Ue=V(Ne,je),Ue.return=Ie,Ie=Ue):(C(Ie,Ne),Ue=E5(je,Ie.mode,Ue),Ue.return=Ie,Ie=Ue),ae(Ie)):C(Ie,Ne)}return function(Ie,Ne,je,Ue){try{dx=0;var Wt=Ir(Ie,Ne,je,Ue);return bm=null,Wt}catch(Bt){if(Bt===xm||Bt===Iw)throw Bt;var fr=So(29,Bt,null,Ie.mode);return fr.lanes=Ue,fr.return=Ie,fr}finally{}}}var cp=hH(!0),dH=hH(!1),Ah=!1;function B5(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function V5(g,A){g=g.updateQueue,A.updateQueue===g&&(A.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,callbacks:null})}function Sh(g){return{lane:g,tag:0,payload:null,callback:null,next:null}}function wh(g,A,C){var D=g.updateQueue;if(D===null)return null;if(D=D.shared,(mr&2)!==0){var V=D.pending;return V===null?A.next=A:(A.next=V.next,V.next=A),D.pending=A,A=Ew(g),qV(g,null,C),A}return kw(g,D,A,C),Ew(g)}function mx(g,A,C){if(A=A.updateQueue,A!==null&&(A=A.shared,(C&4194048)!==0)){var D=A.lanes;D&=g.pendingLanes,C|=D,A.lanes=C,vn(g,C)}}function H5(g,A){var C=g.updateQueue,D=g.alternate;if(D!==null&&(D=D.updateQueue,C===D)){var V=null,G=null;if(C=C.firstBaseUpdate,C!==null){do{var ae={lane:C.lane,tag:C.tag,payload:C.payload,callback:null,next:null};G===null?V=G=ae:G=G.next=ae,C=C.next}while(C!==null);G===null?V=G=A:G=G.next=A}else V=G=A;C={baseState:D.baseState,firstBaseUpdate:V,lastBaseUpdate:G,shared:D.shared,callbacks:D.callbacks},g.updateQueue=C;return}g=C.lastBaseUpdate,g===null?C.firstBaseUpdate=A:g.next=A,C.lastBaseUpdate=A}var Q5=!1;function gx(){if(Q5){var g=ym;if(g!==null)throw g}}function yx(g,A,C,D){Q5=!1;var V=g.updateQueue;Ah=!1;var G=V.firstBaseUpdate,ae=V.lastBaseUpdate,de=V.shared.pending;if(de!==null){V.shared.pending=null;var Ee=de,Le=Ee.next;Ee.next=null,ae===null?G=Le:ae.next=Le,ae=Ee;var Ge=g.alternate;Ge!==null&&(Ge=Ge.updateQueue,de=Ge.lastBaseUpdate,de!==ae&&(de===null?Ge.firstBaseUpdate=Le:de.next=Le,Ge.lastBaseUpdate=Ee))}if(G!==null){var Xe=V.baseState;ae=0,Ge=Le=Ee=null,de=G;do{var Fe=de.lane&-536870913,He=Fe!==de.lane;if(He?(Gn&Fe)===Fe:(D&Fe)===Fe){Fe!==0&&Fe===gm&&(Q5=!0),Ge!==null&&(Ge=Ge.next={lane:0,tag:de.tag,payload:de.payload,callback:null,next:null});e:{var jt=g,sn=de;Fe=A;var Ir=C;switch(sn.tag){case 1:if(jt=sn.payload,typeof jt=="function"){Xe=jt.call(Ir,Xe,Fe);break e}Xe=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=sn.payload,Fe=typeof jt=="function"?jt.call(Ir,Xe,Fe):jt,Fe==null)break e;Xe=f({},Xe,Fe);break e;case 2:Ah=!0}}Fe=de.callback,Fe!==null&&(g.flags|=64,He&&(g.flags|=8192),He=V.callbacks,He===null?V.callbacks=[Fe]:He.push(Fe))}else He={lane:Fe,tag:de.tag,payload:de.payload,callback:de.callback,next:null},Ge===null?(Le=Ge=He,Ee=Xe):Ge=Ge.next=He,ae|=Fe;if(de=de.next,de===null){if(de=V.shared.pending,de===null)break;He=de,de=He.next,He.next=null,V.lastBaseUpdate=He,V.shared.pending=null}}while(!0);Ge===null&&(Ee=Xe),V.baseState=Ee,V.firstBaseUpdate=Le,V.lastBaseUpdate=Ge,G===null&&(V.shared.lanes=0),Th|=ae,g.lanes=ae,g.memoizedState=Xe}}function pH(g,A){if(typeof g!="function")throw Error(r(191,g));g.call(A)}function mH(g,A){var C=g.callbacks;if(C!==null)for(g.callbacks=null,g=0;g<C.length;g++)pH(C[g],A)}var vm=q(null),Lw=q(0);function gH(g,A){g=qu,U(Lw,g),U(vm,A),qu=g|A.baseLanes}function z5(){U(Lw,qu),U(vm,vm.current)}function Z5(){qu=Lw.current,F(vm),F(Lw)}var wo=q(null),dl=null;function Oh(g){var A=g.alternate;U(Vi,Vi.current&1),U(wo,g),dl===null&&(A===null||vm.current!==null||A.memoizedState!==null)&&(dl=g)}function G5(g){U(Vi,Vi.current),U(wo,g),dl===null&&(dl=g)}function yH(g){g.tag===22?(U(Vi,Vi.current),U(wo,g),dl===null&&(dl=g)):Ch()}function Ch(){U(Vi,Vi.current),U(wo,wo.current)}function Oo(g){F(wo),dl===g&&(dl=null),F(Vi)}var Vi=q(0);function Fw(g){for(var A=g;A!==null;){if(A.tag===13){var C=A.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||KT(C)||JT(C)))return A}else if(A.tag===19&&(A.memoizedProps.revealOrder==="forwards"||A.memoizedProps.revealOrder==="backwards"||A.memoizedProps.revealOrder==="unstable_legacy-backwards"||A.memoizedProps.revealOrder==="together")){if((A.flags&128)!==0)return A}else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===g)break;for(;A.sibling===null;){if(A.return===null||A.return===g)return null;A=A.return}A.sibling.return=A.return,A=A.sibling}return null}var Hu=0,kn=null,Nr=null,Ki=null,$w=!1,Am=!1,up=!1,Bw=0,xx=0,Sm=null,RSe=0;function Pi(){throw Error(r(321))}function U5(g,A){if(A===null)return!1;for(var C=0;C<A.length&&C<g.length;C++)if(!ta(g[C],A[C]))return!1;return!0}function X5(g,A,C,D,V,G){return Hu=G,kn=A,A.memoizedState=null,A.updateQueue=null,A.lanes=0,W.H=g===null||g.memoizedState===null?eQ:cT,up=!1,G=C(D,V),up=!1,Am&&(G=bH(A,C,D,V)),xH(g),G}function xH(g){W.H=Ax;var A=Nr!==null&&Nr.next!==null;if(Hu=0,Ki=Nr=kn=null,$w=!1,xx=0,Sm=null,A)throw Error(r(300));g===null||Ji||(g=g.dependencies,g!==null&&Mw(g)&&(Ji=!0))}function bH(g,A,C,D){kn=g;var V=0;do{if(Am&&(Sm=null),xx=0,Am=!1,25<=V)throw Error(r(301));if(V+=1,Ki=Nr=null,g.updateQueue!=null){var G=g.updateQueue;G.lastEffect=null,G.events=null,G.stores=null,G.memoCache!=null&&(G.memoCache.index=0)}W.H=tQ,G=A(C,D)}while(Am);return G}function jSe(){var g=W.H,A=g.useState()[0];return A=typeof A.then=="function"?bx(A):A,g=g.useState()[0],(Nr!==null?Nr.memoizedState:null)!==g&&(kn.flags|=1024),A}function W5(){var g=Bw!==0;return Bw=0,g}function q5(g,A,C){A.updateQueue=g.updateQueue,A.flags&=-2053,g.lanes&=~C}function Y5(g){if($w){for(g=g.memoizedState;g!==null;){var A=g.queue;A!==null&&(A.pending=null),g=g.next}$w=!1}Hu=0,Ki=Nr=kn=null,Am=!1,xx=Bw=0,Sm=null}function ka(){var g={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ki===null?kn.memoizedState=Ki=g:Ki=Ki.next=g,Ki}function Hi(){if(Nr===null){var g=kn.alternate;g=g!==null?g.memoizedState:null}else g=Nr.next;var A=Ki===null?kn.memoizedState:Ki.next;if(A!==null)Ki=A,Nr=g;else{if(g===null)throw kn.alternate===null?Error(r(467)):Error(r(310));Nr=g,g={memoizedState:Nr.memoizedState,baseState:Nr.baseState,baseQueue:Nr.baseQueue,queue:Nr.queue,next:null},Ki===null?kn.memoizedState=Ki=g:Ki=Ki.next=g}return Ki}function Vw(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bx(g){var A=xx;return xx+=1,Sm===null&&(Sm=[]),g=cH(Sm,g,A),A=kn,(Ki===null?A.memoizedState:Ki.next)===null&&(A=A.alternate,W.H=A===null||A.memoizedState===null?eQ:cT),g}function Hw(g){if(g!==null&&typeof g=="object"){if(typeof g.then=="function")return bx(g);if(g.$$typeof===O)return Ls(g)}throw Error(r(438,String(g)))}function K5(g){var A=null,C=kn.updateQueue;if(C!==null&&(A=C.memoCache),A==null){var D=kn.alternate;D!==null&&(D=D.updateQueue,D!==null&&(D=D.memoCache,D!=null&&(A={data:D.data.map(function(V){return V.slice()}),index:0})))}if(A==null&&(A={data:[],index:0}),C===null&&(C=Vw(),kn.updateQueue=C),C.memoCache=A,C=A.data[A.index],C===void 0)for(C=A.data[A.index]=Array(g),D=0;D<g;D++)C[D]=j;return A.index++,C}function Qu(g,A){return typeof A=="function"?A(g):A}function Qw(g){var A=Hi();return J5(A,Nr,g)}function J5(g,A,C){var D=g.queue;if(D===null)throw Error(r(311));D.lastRenderedReducer=C;var V=g.baseQueue,G=D.pending;if(G!==null){if(V!==null){var ae=V.next;V.next=G.next,G.next=ae}A.baseQueue=V=G,D.pending=null}if(G=g.baseState,V===null)g.memoizedState=G;else{A=V.next;var de=ae=null,Ee=null,Le=A,Ge=!1;do{var Xe=Le.lane&-536870913;if(Xe!==Le.lane?(Gn&Xe)===Xe:(Hu&Xe)===Xe){var Fe=Le.revertLane;if(Fe===0)Ee!==null&&(Ee=Ee.next={lane:0,revertLane:0,gesture:null,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null}),Xe===gm&&(Ge=!0);else if((Hu&Fe)===Fe){Le=Le.next,Fe===gm&&(Ge=!0);continue}else Xe={lane:0,revertLane:Le.revertLane,gesture:null,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null},Ee===null?(de=Ee=Xe,ae=G):Ee=Ee.next=Xe,kn.lanes|=Fe,Th|=Fe;Xe=Le.action,up&&C(G,Xe),G=Le.hasEagerState?Le.eagerState:C(G,Xe)}else Fe={lane:Xe,revertLane:Le.revertLane,gesture:Le.gesture,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null},Ee===null?(de=Ee=Fe,ae=G):Ee=Ee.next=Fe,kn.lanes|=Xe,Th|=Xe;Le=Le.next}while(Le!==null&&Le!==A);if(Ee===null?ae=G:Ee.next=de,!ta(G,g.memoizedState)&&(Ji=!0,Ge&&(C=ym,C!==null)))throw C;g.memoizedState=G,g.baseState=ae,g.baseQueue=Ee,D.lastRenderedState=G}return V===null&&(D.lanes=0),[g.memoizedState,D.dispatch]}function eT(g){var A=Hi(),C=A.queue;if(C===null)throw Error(r(311));C.lastRenderedReducer=g;var D=C.dispatch,V=C.pending,G=A.memoizedState;if(V!==null){C.pending=null;var ae=V=V.next;do G=g(G,ae.action),ae=ae.next;while(ae!==V);ta(G,A.memoizedState)||(Ji=!0),A.memoizedState=G,A.baseQueue===null&&(A.baseState=G),C.lastRenderedState=G}return[G,D]}function vH(g,A,C){var D=kn,V=Hi(),G=Yn;if(G){if(C===void 0)throw Error(r(407));C=C()}else C=A();var ae=!ta((Nr||V).memoizedState,C);if(ae&&(V.memoizedState=C,Ji=!0),V=V.queue,rT(wH.bind(null,D,V,g),[g]),V.getSnapshot!==A||ae||Ki!==null&&Ki.memoizedState.tag&1){if(D.flags|=2048,wm(9,{destroy:void 0},SH.bind(null,D,V,C,A),null),Hr===null)throw Error(r(349));G||(Hu&127)!==0||AH(D,A,C)}return C}function AH(g,A,C){g.flags|=16384,g={getSnapshot:A,value:C},A=kn.updateQueue,A===null?(A=Vw(),kn.updateQueue=A,A.stores=[g]):(C=A.stores,C===null?A.stores=[g]:C.push(g))}function SH(g,A,C,D){A.value=C,A.getSnapshot=D,OH(A)&&CH(g)}function wH(g,A,C){return C(function(){OH(A)&&CH(g)})}function OH(g){var A=g.getSnapshot;g=g.value;try{var C=A();return!ta(g,C)}catch{return!0}}function CH(g){var A=tp(g,2);A!==null&&Ua(A,g,2)}function tT(g){var A=ka();if(typeof g=="function"){var C=g;if(g=C(),up){St(!0);try{C()}finally{St(!1)}}}return A.memoizedState=A.baseState=g,A.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:g},A}function kH(g,A,C,D){return g.baseState=C,J5(g,Nr,typeof D=="function"?D:Qu)}function LSe(g,A,C,D,V){if(Gw(g))throw Error(r(485));if(g=A.action,g!==null){var G={payload:V,action:g,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ae){G.listeners.push(ae)}};W.T!==null?C(!0):G.isTransition=!1,D(G),C=A.pending,C===null?(G.next=A.pending=G,EH(A,G)):(G.next=C.next,A.pending=C.next=G)}}function EH(g,A){var C=A.action,D=A.payload,V=g.state;if(A.isTransition){var G=W.T,ae={};W.T=ae;try{var de=C(V,D),Ee=W.S;Ee!==null&&Ee(ae,de),TH(g,A,de)}catch(Le){nT(g,A,Le)}finally{G!==null&&ae.types!==null&&(G.types=ae.types),W.T=G}}else try{G=C(V,D),TH(g,A,G)}catch(Le){nT(g,A,Le)}}function TH(g,A,C){C!==null&&typeof C=="object"&&typeof C.then=="function"?C.then(function(D){PH(g,A,D)},function(D){return nT(g,A,D)}):PH(g,A,C)}function PH(g,A,C){A.status="fulfilled",A.value=C,MH(A),g.state=C,A=g.pending,A!==null&&(C=A.next,C===A?g.pending=null:(C=C.next,A.next=C,EH(g,C)))}function nT(g,A,C){var D=g.pending;if(g.pending=null,D!==null){D=D.next;do A.status="rejected",A.reason=C,MH(A),A=A.next;while(A!==D)}g.action=null}function MH(g){g=g.listeners;for(var A=0;A<g.length;A++)(0,g[A])()}function NH(g,A){return A}function DH(g,A){if(Yn){var C=Hr.formState;if(C!==null){e:{var D=kn;if(Yn){if(ri){t:{for(var V=ri,G=hl;V.nodeType!==8;){if(!G){V=null;break t}if(V=pl(V.nextSibling),V===null){V=null;break t}}G=V.data,V=G==="F!"||G==="F"?V:null}if(V){ri=pl(V.nextSibling),D=V.data==="F!";break e}}bh(D)}D=!1}D&&(A=C[0])}}return C=ka(),C.memoizedState=C.baseState=A,D={pending:null,lanes:0,dispatch:null,lastRenderedReducer:NH,lastRenderedState:A},C.queue=D,C=YH.bind(null,kn,D),D.dispatch=C,D=tT(!1),G=lT.bind(null,kn,!1,D.queue),D=ka(),V={state:A,dispatch:null,action:g,pending:null},D.queue=V,C=LSe.bind(null,kn,V,G,C),V.dispatch=C,D.memoizedState=g,[A,C,!1]}function IH(g){var A=Hi();return _H(A,Nr,g)}function _H(g,A,C){if(A=J5(g,A,NH)[0],g=Qw(Qu)[0],typeof A=="object"&&A!==null&&typeof A.then=="function")try{var D=bx(A)}catch(ae){throw ae===xm?Iw:ae}else D=A;A=Hi();var V=A.queue,G=V.dispatch;return C!==A.memoizedState&&(kn.flags|=2048,wm(9,{destroy:void 0},FSe.bind(null,V,C),null)),[D,G,g]}function FSe(g,A){g.action=A}function RH(g){var A=Hi(),C=Nr;if(C!==null)return _H(A,C,g);Hi(),A=A.memoizedState,C=Hi();var D=C.queue.dispatch;return C.memoizedState=g,[A,D,!1]}function wm(g,A,C,D){return g={tag:g,create:C,deps:D,inst:A,next:null},A=kn.updateQueue,A===null&&(A=Vw(),kn.updateQueue=A),C=A.lastEffect,C===null?A.lastEffect=g.next=g:(D=C.next,C.next=g,g.next=D,A.lastEffect=g),g}function jH(){return Hi().memoizedState}function zw(g,A,C,D){var V=ka();kn.flags|=g,V.memoizedState=wm(1|A,{destroy:void 0},C,D===void 0?null:D)}function Zw(g,A,C,D){var V=Hi();D=D===void 0?null:D;var G=V.memoizedState.inst;Nr!==null&&D!==null&&U5(D,Nr.memoizedState.deps)?V.memoizedState=wm(A,G,C,D):(kn.flags|=g,V.memoizedState=wm(1|A,G,C,D))}function LH(g,A){zw(8390656,8,g,A)}function rT(g,A){Zw(2048,8,g,A)}function $Se(g){kn.flags|=4;var A=kn.updateQueue;if(A===null)A=Vw(),kn.updateQueue=A,A.events=[g];else{var C=A.events;C===null?A.events=[g]:C.push(g)}}function FH(g){var A=Hi().memoizedState;return $Se({ref:A,nextImpl:g}),function(){if((mr&2)!==0)throw Error(r(440));return A.impl.apply(void 0,arguments)}}function $H(g,A){return Zw(4,2,g,A)}function BH(g,A){return Zw(4,4,g,A)}function VH(g,A){if(typeof A=="function"){g=g();var C=A(g);return function(){typeof C=="function"?C():A(null)}}if(A!=null)return g=g(),A.current=g,function(){A.current=null}}function HH(g,A,C){C=C!=null?C.concat([g]):null,Zw(4,4,VH.bind(null,A,g),C)}function iT(){}function QH(g,A){var C=Hi();A=A===void 0?null:A;var D=C.memoizedState;return A!==null&&U5(A,D[1])?D[0]:(C.memoizedState=[g,A],g)}function zH(g,A){var C=Hi();A=A===void 0?null:A;var D=C.memoizedState;if(A!==null&&U5(A,D[1]))return D[0];if(D=g(),up){St(!0);try{g()}finally{St(!1)}}return C.memoizedState=[D,A],D}function sT(g,A,C){return C===void 0||(Hu&1073741824)!==0&&(Gn&261930)===0?g.memoizedState=A:(g.memoizedState=C,g=ZQ(),kn.lanes|=g,Th|=g,C)}function ZH(g,A,C,D){return ta(C,A)?C:vm.current!==null?(g=sT(g,C,D),ta(g,A)||(Ji=!0),g):(Hu&42)===0||(Hu&1073741824)!==0&&(Gn&261930)===0?(Ji=!0,g.memoizedState=C):(g=ZQ(),kn.lanes|=g,Th|=g,A)}function GH(g,A,C,D,V){var G=J.p;J.p=G!==0&&8>G?G:8;var ae=W.T,de={};W.T=de,lT(g,!1,A,C);try{var Ee=V(),Le=W.S;if(Le!==null&&Le(de,Ee),Ee!==null&&typeof Ee=="object"&&typeof Ee.then=="function"){var Ge=_Se(Ee,D);vx(g,A,Ge,Eo(g))}else vx(g,A,D,Eo(g))}catch(Xe){vx(g,A,{then:function(){},status:"rejected",reason:Xe},Eo())}finally{J.p=G,ae!==null&&de.types!==null&&(ae.types=de.types),W.T=ae}}function BSe(){}function aT(g,A,C,D){if(g.tag!==5)throw Error(r(476));var V=UH(g).queue;GH(g,V,A,ne,C===null?BSe:function(){return XH(g),C(D)})}function UH(g){var A=g.memoizedState;if(A!==null)return A;A={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:ne},next:null};var C={};return A.next={memoizedState:C,baseState:C,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:C},next:null},g.memoizedState=A,g=g.alternate,g!==null&&(g.memoizedState=A),A}function XH(g){var A=UH(g);A.next===null&&(A=g.alternate.memoizedState),vx(g,A.next.queue,{},Eo())}function oT(){return Ls(Lx)}function WH(){return Hi().memoizedState}function qH(){return Hi().memoizedState}function VSe(g){for(var A=g.return;A!==null;){switch(A.tag){case 24:case 3:var C=Eo();g=Sh(C);var D=wh(A,g,C);D!==null&&(Ua(D,A,C),mx(D,A,C)),A={cache:j5()},g.payload=A;return}A=A.return}}function HSe(g,A,C){var D=Eo();C={lane:D,revertLane:0,gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},Gw(g)?KH(A,C):(C=C5(g,A,C,D),C!==null&&(Ua(C,g,D),JH(C,A,D)))}function YH(g,A,C){var D=Eo();vx(g,A,C,D)}function vx(g,A,C,D){var V={lane:D,revertLane:0,gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null};if(Gw(g))KH(A,V);else{var G=g.alternate;if(g.lanes===0&&(G===null||G.lanes===0)&&(G=A.lastRenderedReducer,G!==null))try{var ae=A.lastRenderedState,de=G(ae,C);if(V.hasEagerState=!0,V.eagerState=de,ta(de,ae))return kw(g,A,V,0),Hr===null&&Cw(),!1}catch{}finally{}if(C=C5(g,A,V,D),C!==null)return Ua(C,g,D),JH(C,A,D),!0}return!1}function lT(g,A,C,D){if(D={lane:2,revertLane:BT(),gesture:null,action:D,hasEagerState:!1,eagerState:null,next:null},Gw(g)){if(A)throw Error(r(479))}else A=C5(g,C,D,2),A!==null&&Ua(A,g,2)}function Gw(g){var A=g.alternate;return g===kn||A!==null&&A===kn}function KH(g,A){Am=$w=!0;var C=g.pending;C===null?A.next=A:(A.next=C.next,C.next=A),g.pending=A}function JH(g,A,C){if((C&4194048)!==0){var D=A.lanes;D&=g.pendingLanes,C|=D,A.lanes=C,vn(g,C)}}var Ax={readContext:Ls,use:Hw,useCallback:Pi,useContext:Pi,useEffect:Pi,useImperativeHandle:Pi,useLayoutEffect:Pi,useInsertionEffect:Pi,useMemo:Pi,useReducer:Pi,useRef:Pi,useState:Pi,useDebugValue:Pi,useDeferredValue:Pi,useTransition:Pi,useSyncExternalStore:Pi,useId:Pi,useHostTransitionStatus:Pi,useFormState:Pi,useActionState:Pi,useOptimistic:Pi,useMemoCache:Pi,useCacheRefresh:Pi};Ax.useEffectEvent=Pi;var eQ={readContext:Ls,use:Hw,useCallback:function(g,A){return ka().memoizedState=[g,A===void 0?null:A],g},useContext:Ls,useEffect:LH,useImperativeHandle:function(g,A,C){C=C!=null?C.concat([g]):null,zw(4194308,4,VH.bind(null,A,g),C)},useLayoutEffect:function(g,A){return zw(4194308,4,g,A)},useInsertionEffect:function(g,A){zw(4,2,g,A)},useMemo:function(g,A){var C=ka();A=A===void 0?null:A;var D=g();if(up){St(!0);try{g()}finally{St(!1)}}return C.memoizedState=[D,A],D},useReducer:function(g,A,C){var D=ka();if(C!==void 0){var V=C(A);if(up){St(!0);try{C(A)}finally{St(!1)}}}else V=A;return D.memoizedState=D.baseState=V,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:V},D.queue=g,g=g.dispatch=HSe.bind(null,kn,g),[D.memoizedState,g]},useRef:function(g){var A=ka();return g={current:g},A.memoizedState=g},useState:function(g){g=tT(g);var A=g.queue,C=YH.bind(null,kn,A);return A.dispatch=C,[g.memoizedState,C]},useDebugValue:iT,useDeferredValue:function(g,A){var C=ka();return sT(C,g,A)},useTransition:function(){var g=tT(!1);return g=GH.bind(null,kn,g.queue,!0,!1),ka().memoizedState=g,[!1,g]},useSyncExternalStore:function(g,A,C){var D=kn,V=ka();if(Yn){if(C===void 0)throw Error(r(407));C=C()}else{if(C=A(),Hr===null)throw Error(r(349));(Gn&127)!==0||AH(D,A,C)}V.memoizedState=C;var G={value:C,getSnapshot:A};return V.queue=G,LH(wH.bind(null,D,G,g),[g]),D.flags|=2048,wm(9,{destroy:void 0},SH.bind(null,D,G,C,A),null),C},useId:function(){var g=ka(),A=Hr.identifierPrefix;if(Yn){var C=Vc,D=Bc;C=(D&~(1<<32-At(D)-1)).toString(32)+C,A="_"+A+"R_"+C,C=Bw++,0<C&&(A+="H"+C.toString(32)),A+="_"}else C=RSe++,A="_"+A+"r_"+C.toString(32)+"_";return g.memoizedState=A},useHostTransitionStatus:oT,useFormState:DH,useActionState:DH,useOptimistic:function(g){var A=ka();A.memoizedState=A.baseState=g;var C={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return A.queue=C,A=lT.bind(null,kn,!0,C),C.dispatch=A,[g,A]},useMemoCache:K5,useCacheRefresh:function(){return ka().memoizedState=VSe.bind(null,kn)},useEffectEvent:function(g){var A=ka(),C={impl:g};return A.memoizedState=C,function(){if((mr&2)!==0)throw Error(r(440));return C.impl.apply(void 0,arguments)}}},cT={readContext:Ls,use:Hw,useCallback:QH,useContext:Ls,useEffect:rT,useImperativeHandle:HH,useInsertionEffect:$H,useLayoutEffect:BH,useMemo:zH,useReducer:Qw,useRef:jH,useState:function(){return Qw(Qu)},useDebugValue:iT,useDeferredValue:function(g,A){var C=Hi();return ZH(C,Nr.memoizedState,g,A)},useTransition:function(){var g=Qw(Qu)[0],A=Hi().memoizedState;return[typeof g=="boolean"?g:bx(g),A]},useSyncExternalStore:vH,useId:WH,useHostTransitionStatus:oT,useFormState:IH,useActionState:IH,useOptimistic:function(g,A){var C=Hi();return kH(C,Nr,g,A)},useMemoCache:K5,useCacheRefresh:qH};cT.useEffectEvent=FH;var tQ={readContext:Ls,use:Hw,useCallback:QH,useContext:Ls,useEffect:rT,useImperativeHandle:HH,useInsertionEffect:$H,useLayoutEffect:BH,useMemo:zH,useReducer:eT,useRef:jH,useState:function(){return eT(Qu)},useDebugValue:iT,useDeferredValue:function(g,A){var C=Hi();return Nr===null?sT(C,g,A):ZH(C,Nr.memoizedState,g,A)},useTransition:function(){var g=eT(Qu)[0],A=Hi().memoizedState;return[typeof g=="boolean"?g:bx(g),A]},useSyncExternalStore:vH,useId:WH,useHostTransitionStatus:oT,useFormState:RH,useActionState:RH,useOptimistic:function(g,A){var C=Hi();return Nr!==null?kH(C,Nr,g,A):(C.baseState=g,[g,C.queue.dispatch])},useMemoCache:K5,useCacheRefresh:qH};tQ.useEffectEvent=FH;function uT(g,A,C,D){A=g.memoizedState,C=C(D,A),C=C==null?A:f({},A,C),g.memoizedState=C,g.lanes===0&&(g.updateQueue.baseState=C)}var fT={enqueueSetState:function(g,A,C){g=g._reactInternals;var D=Eo(),V=Sh(D);V.payload=A,C!=null&&(V.callback=C),A=wh(g,V,D),A!==null&&(Ua(A,g,D),mx(A,g,D))},enqueueReplaceState:function(g,A,C){g=g._reactInternals;var D=Eo(),V=Sh(D);V.tag=1,V.payload=A,C!=null&&(V.callback=C),A=wh(g,V,D),A!==null&&(Ua(A,g,D),mx(A,g,D))},enqueueForceUpdate:function(g,A){g=g._reactInternals;var C=Eo(),D=Sh(C);D.tag=2,A!=null&&(D.callback=A),A=wh(g,D,C),A!==null&&(Ua(A,g,C),mx(A,g,C))}};function nQ(g,A,C,D,V,G,ae){return g=g.stateNode,typeof g.shouldComponentUpdate=="function"?g.shouldComponentUpdate(D,G,ae):A.prototype&&A.prototype.isPureReactComponent?!gh(C,D)||!gh(V,G):!0}function rQ(g,A,C,D){g=A.state,typeof A.componentWillReceiveProps=="function"&&A.componentWillReceiveProps(C,D),typeof A.UNSAFE_componentWillReceiveProps=="function"&&A.UNSAFE_componentWillReceiveProps(C,D),A.state!==g&&fT.enqueueReplaceState(A,A.state,null)}function fp(g,A){var C=A;if("ref"in A){C={};for(var D in A)D!=="ref"&&(C[D]=A[D])}if(g=g.defaultProps){C===A&&(C=f({},C));for(var V in g)C[V]===void 0&&(C[V]=g[V])}return C}function iQ(g){Ow(g)}function sQ(g){console.error(g)}function aQ(g){Ow(g)}function Uw(g,A){try{var C=g.onUncaughtError;C(A.value,{componentStack:A.stack})}catch(D){setTimeout(function(){throw D})}}function oQ(g,A,C){try{var D=g.onCaughtError;D(C.value,{componentStack:C.stack,errorBoundary:A.tag===1?A.stateNode:null})}catch(V){setTimeout(function(){throw V})}}function hT(g,A,C){return C=Sh(C),C.tag=3,C.payload={element:null},C.callback=function(){Uw(g,A)},C}function lQ(g){return g=Sh(g),g.tag=3,g}function cQ(g,A,C,D){var V=C.type.getDerivedStateFromError;if(typeof V=="function"){var G=D.value;g.payload=function(){return V(G)},g.callback=function(){oQ(A,C,D)}}var ae=C.stateNode;ae!==null&&typeof ae.componentDidCatch=="function"&&(g.callback=function(){oQ(A,C,D),typeof V!="function"&&(Ph===null?Ph=new Set([this]):Ph.add(this));var de=D.stack;this.componentDidCatch(D.value,{componentStack:de!==null?de:""})})}function QSe(g,A,C,D,V){if(C.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){if(A=C.alternate,A!==null&&mm(A,C,V,!0),C=wo.current,C!==null){switch(C.tag){case 31:case 13:return dl===null?sO():C.alternate===null&&Mi===0&&(Mi=3),C.flags&=-257,C.flags|=65536,C.lanes=V,D===_w?C.flags|=16384:(A=C.updateQueue,A===null?C.updateQueue=new Set([D]):A.add(D),LT(g,D,V)),!1;case 22:return C.flags|=65536,D===_w?C.flags|=16384:(A=C.updateQueue,A===null?(A={transitions:null,markerInstances:null,retryQueue:new Set([D])},C.updateQueue=A):(C=A.retryQueue,C===null?A.retryQueue=new Set([D]):C.add(D)),LT(g,D,V)),!1}throw Error(r(435,C.tag))}return LT(g,D,V),sO(),!1}if(Yn)return A=wo.current,A!==null?((A.flags&65536)===0&&(A.flags|=256),A.flags|=65536,A.lanes=V,D!==N5&&(g=Error(r(422),{cause:D}),ux(cl(g,C)))):(D!==N5&&(A=Error(r(423),{cause:D}),ux(cl(A,C))),g=g.current.alternate,g.flags|=65536,V&=-V,g.lanes|=V,D=cl(D,C),V=hT(g.stateNode,D,V),H5(g,V),Mi!==4&&(Mi=2)),!1;var G=Error(r(520),{cause:D});if(G=cl(G,C),Px===null?Px=[G]:Px.push(G),Mi!==4&&(Mi=2),A===null)return!0;D=cl(D,C),C=A;do{switch(C.tag){case 3:return C.flags|=65536,g=V&-V,C.lanes|=g,g=hT(C.stateNode,D,g),H5(C,g),!1;case 1:if(A=C.type,G=C.stateNode,(C.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Ph===null||!Ph.has(G))))return C.flags|=65536,V&=-V,C.lanes|=V,V=lQ(V),cQ(V,g,C,D),H5(C,V),!1}C=C.return}while(C!==null);return!1}var dT=Error(r(461)),Ji=!1;function Fs(g,A,C,D){A.child=g===null?dH(A,null,C,D):cp(A,g.child,C,D)}function uQ(g,A,C,D,V){C=C.render;var G=A.ref;if("ref"in D){var ae={};for(var de in D)de!=="ref"&&(ae[de]=D[de])}else ae=D;return sp(A),D=X5(g,A,C,ae,G,V),de=W5(),g!==null&&!Ji?(q5(g,A,V),zu(g,A,V)):(Yn&&de&&P5(A),A.flags|=1,Fs(g,A,D,V),A.child)}function fQ(g,A,C,D,V){if(g===null){var G=C.type;return typeof G=="function"&&!k5(G)&&G.defaultProps===void 0&&C.compare===null?(A.tag=15,A.type=G,hQ(g,A,G,D,V)):(g=Tw(C.type,null,D,A,A.mode,V),g.ref=A.ref,g.return=A,A.child=g)}if(G=g.child,!AT(g,V)){var ae=G.memoizedProps;if(C=C.compare,C=C!==null?C:gh,C(ae,D)&&g.ref===A.ref)return zu(g,A,V)}return A.flags|=1,g=Fu(G,D),g.ref=A.ref,g.return=A,A.child=g}function hQ(g,A,C,D,V){if(g!==null){var G=g.memoizedProps;if(gh(G,D)&&g.ref===A.ref)if(Ji=!1,A.pendingProps=D=G,AT(g,V))(g.flags&131072)!==0&&(Ji=!0);else return A.lanes=g.lanes,zu(g,A,V)}return pT(g,A,C,D,V)}function dQ(g,A,C,D){var V=D.children,G=g!==null?g.memoizedState:null;if(g===null&&A.stateNode===null&&(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),D.mode==="hidden"){if((A.flags&128)!==0){if(G=G!==null?G.baseLanes|C:C,g!==null){for(D=A.child=g.child,V=0;D!==null;)V=V|D.lanes|D.childLanes,D=D.sibling;D=V&~G}else D=0,A.child=null;return pQ(g,A,G,C,D)}if((C&536870912)!==0)A.memoizedState={baseLanes:0,cachePool:null},g!==null&&Dw(A,G!==null?G.cachePool:null),G!==null?gH(A,G):z5(),yH(A);else return D=A.lanes=536870912,pQ(g,A,G!==null?G.baseLanes|C:C,C,D)}else G!==null?(Dw(A,G.cachePool),gH(A,G),Ch(),A.memoizedState=null):(g!==null&&Dw(A,null),z5(),Ch());return Fs(g,A,V,C),A.child}function Sx(g,A){return g!==null&&g.tag===22||A.stateNode!==null||(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),A.sibling}function pQ(g,A,C,D,V){var G=F5();return G=G===null?null:{parent:Yi._currentValue,pool:G},A.memoizedState={baseLanes:C,cachePool:G},g!==null&&Dw(A,null),z5(),yH(A),g!==null&&mm(g,A,D,!0),A.childLanes=V,null}function Xw(g,A){return A=qw({mode:A.mode,children:A.children},g.mode),A.ref=g.ref,g.child=A,A.return=g,A}function mQ(g,A,C){return cp(A,g.child,null,C),g=Xw(A,A.pendingProps),g.flags|=2,Oo(A),A.memoizedState=null,g}function zSe(g,A,C){var D=A.pendingProps,V=(A.flags&128)!==0;if(A.flags&=-129,g===null){if(Yn){if(D.mode==="hidden")return g=Xw(A,D),A.lanes=536870912,Sx(null,g);if(G5(A),(g=ri)?(g=Ez(g,hl),g=g!==null&&g.data==="&"?g:null,g!==null&&(A.memoizedState={dehydrated:g,treeContext:yh!==null?{id:Bc,overflow:Vc}:null,retryLane:536870912,hydrationErrors:null},C=KV(g),C.return=A,A.child=C,js=A,ri=null)):g=null,g===null)throw bh(A);return A.lanes=536870912,null}return Xw(A,D)}var G=g.memoizedState;if(G!==null){var ae=G.dehydrated;if(G5(A),V)if(A.flags&256)A.flags&=-257,A=mQ(g,A,C);else if(A.memoizedState!==null)A.child=g.child,A.flags|=128,A=null;else throw Error(r(558));else if(Ji||mm(g,A,C,!1),V=(C&g.childLanes)!==0,Ji||V){if(D=Hr,D!==null&&(ae=mn(D,C),ae!==0&&ae!==G.retryLane))throw G.retryLane=ae,tp(g,ae),Ua(D,g,ae),dT;sO(),A=mQ(g,A,C)}else g=G.treeContext,ri=pl(ae.nextSibling),js=A,Yn=!0,xh=null,hl=!1,g!==null&&tH(A,g),A=Xw(A,D),A.flags|=4096;return A}return g=Fu(g.child,{mode:D.mode,children:D.children}),g.ref=A.ref,A.child=g,g.return=A,g}function Ww(g,A){var C=A.ref;if(C===null)g!==null&&g.ref!==null&&(A.flags|=4194816);else{if(typeof C!="function"&&typeof C!="object")throw Error(r(284));(g===null||g.ref!==C)&&(A.flags|=4194816)}}function pT(g,A,C,D,V){return sp(A),C=X5(g,A,C,D,void 0,V),D=W5(),g!==null&&!Ji?(q5(g,A,V),zu(g,A,V)):(Yn&&D&&P5(A),A.flags|=1,Fs(g,A,C,V),A.child)}function gQ(g,A,C,D,V,G){return sp(A),A.updateQueue=null,C=bH(A,D,C,V),xH(g),D=W5(),g!==null&&!Ji?(q5(g,A,G),zu(g,A,G)):(Yn&&D&&P5(A),A.flags|=1,Fs(g,A,C,G),A.child)}function yQ(g,A,C,D,V){if(sp(A),A.stateNode===null){var G=fm,ae=C.contextType;typeof ae=="object"&&ae!==null&&(G=Ls(ae)),G=new C(D,G),A.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,G.updater=fT,A.stateNode=G,G._reactInternals=A,G=A.stateNode,G.props=D,G.state=A.memoizedState,G.refs={},B5(A),ae=C.contextType,G.context=typeof ae=="object"&&ae!==null?Ls(ae):fm,G.state=A.memoizedState,ae=C.getDerivedStateFromProps,typeof ae=="function"&&(uT(A,C,ae,D),G.state=A.memoizedState),typeof C.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(ae=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),ae!==G.state&&fT.enqueueReplaceState(G,G.state,null),yx(A,D,G,V),gx(),G.state=A.memoizedState),typeof G.componentDidMount=="function"&&(A.flags|=4194308),D=!0}else if(g===null){G=A.stateNode;var de=A.memoizedProps,Ee=fp(C,de);G.props=Ee;var Le=G.context,Ge=C.contextType;ae=fm,typeof Ge=="object"&&Ge!==null&&(ae=Ls(Ge));var Xe=C.getDerivedStateFromProps;Ge=typeof Xe=="function"||typeof G.getSnapshotBeforeUpdate=="function",de=A.pendingProps!==de,Ge||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(de||Le!==ae)&&rQ(A,G,D,ae),Ah=!1;var Fe=A.memoizedState;G.state=Fe,yx(A,D,G,V),gx(),Le=A.memoizedState,de||Fe!==Le||Ah?(typeof Xe=="function"&&(uT(A,C,Xe,D),Le=A.memoizedState),(Ee=Ah||nQ(A,C,Ee,D,Fe,Le,ae))?(Ge||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount()),typeof G.componentDidMount=="function"&&(A.flags|=4194308)):(typeof G.componentDidMount=="function"&&(A.flags|=4194308),A.memoizedProps=D,A.memoizedState=Le),G.props=D,G.state=Le,G.context=ae,D=Ee):(typeof G.componentDidMount=="function"&&(A.flags|=4194308),D=!1)}else{G=A.stateNode,V5(g,A),ae=A.memoizedProps,Ge=fp(C,ae),G.props=Ge,Xe=A.pendingProps,Fe=G.context,Le=C.contextType,Ee=fm,typeof Le=="object"&&Le!==null&&(Ee=Ls(Le)),de=C.getDerivedStateFromProps,(Le=typeof de=="function"||typeof G.getSnapshotBeforeUpdate=="function")||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(ae!==Xe||Fe!==Ee)&&rQ(A,G,D,Ee),Ah=!1,Fe=A.memoizedState,G.state=Fe,yx(A,D,G,V),gx();var He=A.memoizedState;ae!==Xe||Fe!==He||Ah||g!==null&&g.dependencies!==null&&Mw(g.dependencies)?(typeof de=="function"&&(uT(A,C,de,D),He=A.memoizedState),(Ge=Ah||nQ(A,C,Ge,D,Fe,He,Ee)||g!==null&&g.dependencies!==null&&Mw(g.dependencies))?(Le||typeof G.UNSAFE_componentWillUpdate!="function"&&typeof G.componentWillUpdate!="function"||(typeof G.componentWillUpdate=="function"&&G.componentWillUpdate(D,He,Ee),typeof G.UNSAFE_componentWillUpdate=="function"&&G.UNSAFE_componentWillUpdate(D,He,Ee)),typeof G.componentDidUpdate=="function"&&(A.flags|=4),typeof G.getSnapshotBeforeUpdate=="function"&&(A.flags|=1024)):(typeof G.componentDidUpdate!="function"||ae===g.memoizedProps&&Fe===g.memoizedState||(A.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||ae===g.memoizedProps&&Fe===g.memoizedState||(A.flags|=1024),A.memoizedProps=D,A.memoizedState=He),G.props=D,G.state=He,G.context=Ee,D=Ge):(typeof G.componentDidUpdate!="function"||ae===g.memoizedProps&&Fe===g.memoizedState||(A.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||ae===g.memoizedProps&&Fe===g.memoizedState||(A.flags|=1024),D=!1)}return G=D,Ww(g,A),D=(A.flags&128)!==0,G||D?(G=A.stateNode,C=D&&typeof C.getDerivedStateFromError!="function"?null:G.render(),A.flags|=1,g!==null&&D?(A.child=cp(A,g.child,null,V),A.child=cp(A,null,C,V)):Fs(g,A,C,V),A.memoizedState=G.state,g=A.child):g=zu(g,A,V),g}function xQ(g,A,C,D){return rp(),A.flags|=256,Fs(g,A,C,D),A.child}var mT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gT(g){return{baseLanes:g,cachePool:oH()}}function yT(g,A,C){return g=g!==null?g.childLanes&~C:0,A&&(g|=ko),g}function bQ(g,A,C){var D=A.pendingProps,V=!1,G=(A.flags&128)!==0,ae;if((ae=G)||(ae=g!==null&&g.memoizedState===null?!1:(Vi.current&2)!==0),ae&&(V=!0,A.flags&=-129),ae=(A.flags&32)!==0,A.flags&=-33,g===null){if(Yn){if(V?Oh(A):Ch(),(g=ri)?(g=Ez(g,hl),g=g!==null&&g.data!=="&"?g:null,g!==null&&(A.memoizedState={dehydrated:g,treeContext:yh!==null?{id:Bc,overflow:Vc}:null,retryLane:536870912,hydrationErrors:null},C=KV(g),C.return=A,A.child=C,js=A,ri=null)):g=null,g===null)throw bh(A);return JT(g)?A.lanes=32:A.lanes=536870912,null}var de=D.children;return D=D.fallback,V?(Ch(),V=A.mode,de=qw({mode:"hidden",children:de},V),D=np(D,V,C,null),de.return=A,D.return=A,de.sibling=D,A.child=de,D=A.child,D.memoizedState=gT(C),D.childLanes=yT(g,ae,C),A.memoizedState=mT,Sx(null,D)):(Oh(A),xT(A,de))}var Ee=g.memoizedState;if(Ee!==null&&(de=Ee.dehydrated,de!==null)){if(G)A.flags&256?(Oh(A),A.flags&=-257,A=bT(g,A,C)):A.memoizedState!==null?(Ch(),A.child=g.child,A.flags|=128,A=null):(Ch(),de=D.fallback,V=A.mode,D=qw({mode:"visible",children:D.children},V),de=np(de,V,C,null),de.flags|=2,D.return=A,de.return=A,D.sibling=de,A.child=D,cp(A,g.child,null,C),D=A.child,D.memoizedState=gT(C),D.childLanes=yT(g,ae,C),A.memoizedState=mT,A=Sx(null,D));else if(Oh(A),JT(de)){if(ae=de.nextSibling&&de.nextSibling.dataset,ae)var Le=ae.dgst;ae=Le,D=Error(r(419)),D.stack="",D.digest=ae,ux({value:D,source:null,stack:null}),A=bT(g,A,C)}else if(Ji||mm(g,A,C,!1),ae=(C&g.childLanes)!==0,Ji||ae){if(ae=Hr,ae!==null&&(D=mn(ae,C),D!==0&&D!==Ee.retryLane))throw Ee.retryLane=D,tp(g,D),Ua(ae,g,D),dT;KT(de)||sO(),A=bT(g,A,C)}else KT(de)?(A.flags|=192,A.child=g.child,A=null):(g=Ee.treeContext,ri=pl(de.nextSibling),js=A,Yn=!0,xh=null,hl=!1,g!==null&&tH(A,g),A=xT(A,D.children),A.flags|=4096);return A}return V?(Ch(),de=D.fallback,V=A.mode,Ee=g.child,Le=Ee.sibling,D=Fu(Ee,{mode:"hidden",children:D.children}),D.subtreeFlags=Ee.subtreeFlags&65011712,Le!==null?de=Fu(Le,de):(de=np(de,V,C,null),de.flags|=2),de.return=A,D.return=A,D.sibling=de,A.child=D,Sx(null,D),D=A.child,de=g.child.memoizedState,de===null?de=gT(C):(V=de.cachePool,V!==null?(Ee=Yi._currentValue,V=V.parent!==Ee?{parent:Ee,pool:Ee}:V):V=oH(),de={baseLanes:de.baseLanes|C,cachePool:V}),D.memoizedState=de,D.childLanes=yT(g,ae,C),A.memoizedState=mT,Sx(g.child,D)):(Oh(A),C=g.child,g=C.sibling,C=Fu(C,{mode:"visible",children:D.children}),C.return=A,C.sibling=null,g!==null&&(ae=A.deletions,ae===null?(A.deletions=[g],A.flags|=16):ae.push(g)),A.child=C,A.memoizedState=null,C)}function xT(g,A){return A=qw({mode:"visible",children:A},g.mode),A.return=g,g.child=A}function qw(g,A){return g=So(22,g,null,A),g.lanes=0,g}function bT(g,A,C){return cp(A,g.child,null,C),g=xT(A,A.pendingProps.children),g.flags|=2,A.memoizedState=null,g}function vQ(g,A,C){g.lanes|=A;var D=g.alternate;D!==null&&(D.lanes|=A),_5(g.return,A,C)}function vT(g,A,C,D,V,G){var ae=g.memoizedState;ae===null?g.memoizedState={isBackwards:A,rendering:null,renderingStartTime:0,last:D,tail:C,tailMode:V,treeForkCount:G}:(ae.isBackwards=A,ae.rendering=null,ae.renderingStartTime=0,ae.last=D,ae.tail=C,ae.tailMode=V,ae.treeForkCount=G)}function AQ(g,A,C){var D=A.pendingProps,V=D.revealOrder,G=D.tail;D=D.children;var ae=Vi.current,de=(ae&2)!==0;if(de?(ae=ae&1|2,A.flags|=128):ae&=1,U(Vi,ae),Fs(g,A,D,C),D=Yn?cx:0,!de&&g!==null&&(g.flags&128)!==0)e:for(g=A.child;g!==null;){if(g.tag===13)g.memoizedState!==null&&vQ(g,C,A);else if(g.tag===19)vQ(g,C,A);else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===A)break e;for(;g.sibling===null;){if(g.return===null||g.return===A)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}switch(V){case"forwards":for(C=A.child,V=null;C!==null;)g=C.alternate,g!==null&&Fw(g)===null&&(V=C),C=C.sibling;C=V,C===null?(V=A.child,A.child=null):(V=C.sibling,C.sibling=null),vT(A,!1,V,C,G,D);break;case"backwards":case"unstable_legacy-backwards":for(C=null,V=A.child,A.child=null;V!==null;){if(g=V.alternate,g!==null&&Fw(g)===null){A.child=V;break}g=V.sibling,V.sibling=C,C=V,V=g}vT(A,!0,C,null,G,D);break;case"together":vT(A,!1,null,null,void 0,D);break;default:A.memoizedState=null}return A.child}function zu(g,A,C){if(g!==null&&(A.dependencies=g.dependencies),Th|=A.lanes,(C&A.childLanes)===0)if(g!==null){if(mm(g,A,C,!1),(C&A.childLanes)===0)return null}else return null;if(g!==null&&A.child!==g.child)throw Error(r(153));if(A.child!==null){for(g=A.child,C=Fu(g,g.pendingProps),A.child=C,C.return=A;g.sibling!==null;)g=g.sibling,C=C.sibling=Fu(g,g.pendingProps),C.return=A;C.sibling=null}return A.child}function AT(g,A){return(g.lanes&A)!==0?!0:(g=g.dependencies,!!(g!==null&&Mw(g)))}function ZSe(g,A,C){switch(A.tag){case 3:z(A,A.stateNode.containerInfo),vh(A,Yi,g.memoizedState.cache),rp();break;case 27:case 5:se(A);break;case 4:z(A,A.stateNode.containerInfo);break;case 10:vh(A,A.type,A.memoizedProps.value);break;case 31:if(A.memoizedState!==null)return A.flags|=128,G5(A),null;break;case 13:var D=A.memoizedState;if(D!==null)return D.dehydrated!==null?(Oh(A),A.flags|=128,null):(C&A.child.childLanes)!==0?bQ(g,A,C):(Oh(A),g=zu(g,A,C),g!==null?g.sibling:null);Oh(A);break;case 19:var V=(g.flags&128)!==0;if(D=(C&A.childLanes)!==0,D||(mm(g,A,C,!1),D=(C&A.childLanes)!==0),V){if(D)return AQ(g,A,C);A.flags|=128}if(V=A.memoizedState,V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),U(Vi,Vi.current),D)break;return null;case 22:return A.lanes=0,dQ(g,A,C,A.pendingProps);case 24:vh(A,Yi,g.memoizedState.cache)}return zu(g,A,C)}function SQ(g,A,C){if(g!==null)if(g.memoizedProps!==A.pendingProps)Ji=!0;else{if(!AT(g,C)&&(A.flags&128)===0)return Ji=!1,ZSe(g,A,C);Ji=(g.flags&131072)!==0}else Ji=!1,Yn&&(A.flags&1048576)!==0&&eH(A,cx,A.index);switch(A.lanes=0,A.tag){case 16:e:{var D=A.pendingProps;if(g=op(A.elementType),A.type=g,typeof g=="function")k5(g)?(D=fp(g,D),A.tag=1,A=yQ(null,A,g,D,C)):(A.tag=0,A=pT(null,A,g,D,C));else{if(g!=null){var V=g.$$typeof;if(V===k){A.tag=11,A=uQ(null,A,g,D,C);break e}else if(V===N){A.tag=14,A=fQ(null,A,g,D,C);break e}}throw A=Q(g)||g,Error(r(306,A,""))}}return A;case 0:return pT(g,A,A.type,A.pendingProps,C);case 1:return D=A.type,V=fp(D,A.pendingProps),yQ(g,A,D,V,C);case 3:e:{if(z(A,A.stateNode.containerInfo),g===null)throw Error(r(387));D=A.pendingProps;var G=A.memoizedState;V=G.element,V5(g,A),yx(A,D,null,C);var ae=A.memoizedState;if(D=ae.cache,vh(A,Yi,D),D!==G.cache&&R5(A,[Yi],C,!0),gx(),D=ae.element,G.isDehydrated)if(G={element:D,isDehydrated:!1,cache:ae.cache},A.updateQueue.baseState=G,A.memoizedState=G,A.flags&256){A=xQ(g,A,D,C);break e}else if(D!==V){V=cl(Error(r(424)),A),ux(V),A=xQ(g,A,D,C);break e}else{switch(g=A.stateNode.containerInfo,g.nodeType){case 9:g=g.body;break;default:g=g.nodeName==="HTML"?g.ownerDocument.body:g}for(ri=pl(g.firstChild),js=A,Yn=!0,xh=null,hl=!0,C=dH(A,null,D,C),A.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling}else{if(rp(),D===V){A=zu(g,A,C);break e}Fs(g,A,D,C)}A=A.child}return A;case 26:return Ww(g,A),g===null?(C=Iz(A.type,null,A.pendingProps,null))?A.memoizedState=C:Yn||(C=A.type,g=A.pendingProps,D=hO(ee.current).createElement(C),D[hn]=A,D[Ht]=g,$s(D,C,g),Ct(D),A.stateNode=D):A.memoizedState=Iz(A.type,g.memoizedProps,A.pendingProps,g.memoizedState),null;case 27:return se(A),g===null&&Yn&&(D=A.stateNode=Mz(A.type,A.pendingProps,ee.current),js=A,hl=!0,V=ri,Ih(A.type)?(eP=V,ri=pl(D.firstChild)):ri=V),Fs(g,A,A.pendingProps.children,C),Ww(g,A),g===null&&(A.flags|=4194304),A.child;case 5:return g===null&&Yn&&((V=D=ri)&&(D=Awe(D,A.type,A.pendingProps,hl),D!==null?(A.stateNode=D,js=A,ri=pl(D.firstChild),hl=!1,V=!0):V=!1),V||bh(A)),se(A),V=A.type,G=A.pendingProps,ae=g!==null?g.memoizedProps:null,D=G.children,WT(V,G)?D=null:ae!==null&&WT(V,ae)&&(A.flags|=32),A.memoizedState!==null&&(V=X5(g,A,jSe,null,null,C),Lx._currentValue=V),Ww(g,A),Fs(g,A,D,C),A.child;case 6:return g===null&&Yn&&((g=C=ri)&&(C=Swe(C,A.pendingProps,hl),C!==null?(A.stateNode=C,js=A,ri=null,g=!0):g=!1),g||bh(A)),null;case 13:return bQ(g,A,C);case 4:return z(A,A.stateNode.containerInfo),D=A.pendingProps,g===null?A.child=cp(A,null,D,C):Fs(g,A,D,C),A.child;case 11:return uQ(g,A,A.type,A.pendingProps,C);case 7:return Fs(g,A,A.pendingProps,C),A.child;case 8:return Fs(g,A,A.pendingProps.children,C),A.child;case 12:return Fs(g,A,A.pendingProps.children,C),A.child;case 10:return D=A.pendingProps,vh(A,A.type,D.value),Fs(g,A,D.children,C),A.child;case 9:return V=A.type._context,D=A.pendingProps.children,sp(A),V=Ls(V),D=D(V),A.flags|=1,Fs(g,A,D,C),A.child;case 14:return fQ(g,A,A.type,A.pendingProps,C);case 15:return hQ(g,A,A.type,A.pendingProps,C);case 19:return AQ(g,A,C);case 31:return zSe(g,A,C);case 22:return dQ(g,A,C,A.pendingProps);case 24:return sp(A),D=Ls(Yi),g===null?(V=F5(),V===null&&(V=Hr,G=j5(),V.pooledCache=G,G.refCount++,G!==null&&(V.pooledCacheLanes|=C),V=G),A.memoizedState={parent:D,cache:V},B5(A),vh(A,Yi,V)):((g.lanes&C)!==0&&(V5(g,A),yx(A,null,null,C),gx()),V=g.memoizedState,G=A.memoizedState,V.parent!==D?(V={parent:D,cache:D},A.memoizedState=V,A.lanes===0&&(A.memoizedState=A.updateQueue.baseState=V),vh(A,Yi,D)):(D=G.cache,vh(A,Yi,D),D!==V.cache&&R5(A,[Yi],C,!0))),Fs(g,A,A.pendingProps.children,C),A.child;case 29:throw A.pendingProps}throw Error(r(156,A.tag))}function Zu(g){g.flags|=4}function ST(g,A,C,D,V){if((A=(g.mode&32)!==0)&&(A=!1),A){if(g.flags|=16777216,(V&335544128)===V)if(g.stateNode.complete)g.flags|=8192;else if(WQ())g.flags|=8192;else throw lp=_w,$5}else g.flags&=-16777217}function wQ(g,A){if(A.type!=="stylesheet"||(A.state.loading&4)!==0)g.flags&=-16777217;else if(g.flags|=16777216,!Fz(A))if(WQ())g.flags|=8192;else throw lp=_w,$5}function Yw(g,A){A!==null&&(g.flags|=4),g.flags&16384&&(A=g.tag!==22?ln():536870912,g.lanes|=A,Em|=A)}function wx(g,A){if(!Yn)switch(g.tailMode){case"hidden":A=g.tail;for(var C=null;A!==null;)A.alternate!==null&&(C=A),A=A.sibling;C===null?g.tail=null:C.sibling=null;break;case"collapsed":C=g.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?A||g.tail===null?g.tail=null:g.tail.sibling=null:D.sibling=null}}function ii(g){var A=g.alternate!==null&&g.alternate.child===g.child,C=0,D=0;if(A)for(var V=g.child;V!==null;)C|=V.lanes|V.childLanes,D|=V.subtreeFlags&65011712,D|=V.flags&65011712,V.return=g,V=V.sibling;else for(V=g.child;V!==null;)C|=V.lanes|V.childLanes,D|=V.subtreeFlags,D|=V.flags,V.return=g,V=V.sibling;return g.subtreeFlags|=D,g.childLanes=C,A}function GSe(g,A,C){var D=A.pendingProps;switch(M5(A),A.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ii(A),null;case 1:return ii(A),null;case 3:return C=A.stateNode,D=null,g!==null&&(D=g.memoizedState.cache),A.memoizedState.cache!==D&&(A.flags|=2048),Vu(Yi),H(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(g===null||g.child===null)&&(pm(A)?Zu(A):g===null||g.memoizedState.isDehydrated&&(A.flags&256)===0||(A.flags|=1024,D5())),ii(A),null;case 26:var V=A.type,G=A.memoizedState;return g===null?(Zu(A),G!==null?(ii(A),wQ(A,G)):(ii(A),ST(A,V,null,D,C))):G?G!==g.memoizedState?(Zu(A),ii(A),wQ(A,G)):(ii(A),A.flags&=-16777217):(g=g.memoizedProps,g!==D&&Zu(A),ii(A),ST(A,V,g,D,C)),null;case 27:if(ue(A),C=ee.current,V=A.type,g!==null&&A.stateNode!=null)g.memoizedProps!==D&&Zu(A);else{if(!D){if(A.stateNode===null)throw Error(r(166));return ii(A),null}g=Z.current,pm(A)?nH(A):(g=Mz(V,D,C),A.stateNode=g,Zu(A))}return ii(A),null;case 5:if(ue(A),V=A.type,g!==null&&A.stateNode!=null)g.memoizedProps!==D&&Zu(A);else{if(!D){if(A.stateNode===null)throw Error(r(166));return ii(A),null}if(G=Z.current,pm(A))nH(A);else{var ae=hO(ee.current);switch(G){case 1:G=ae.createElementNS("http://www.w3.org/2000/svg",V);break;case 2:G=ae.createElementNS("http://www.w3.org/1998/Math/MathML",V);break;default:switch(V){case"svg":G=ae.createElementNS("http://www.w3.org/2000/svg",V);break;case"math":G=ae.createElementNS("http://www.w3.org/1998/Math/MathML",V);break;case"script":G=ae.createElement("div"),G.innerHTML="<script><\/script>",G=G.removeChild(G.firstChild);break;case"select":G=typeof D.is=="string"?ae.createElement("select",{is:D.is}):ae.createElement("select"),D.multiple?G.multiple=!0:D.size&&(G.size=D.size);break;default:G=typeof D.is=="string"?ae.createElement(V,{is:D.is}):ae.createElement(V)}}G[hn]=A,G[Ht]=D;e:for(ae=A.child;ae!==null;){if(ae.tag===5||ae.tag===6)G.appendChild(ae.stateNode);else if(ae.tag!==4&&ae.tag!==27&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===A)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===A)break e;ae=ae.return}ae.sibling.return=ae.return,ae=ae.sibling}A.stateNode=G;e:switch($s(G,V,D),V){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}D&&Zu(A)}}return ii(A),ST(A,A.type,g===null?null:g.memoizedProps,A.pendingProps,C),null;case 6:if(g&&A.stateNode!=null)g.memoizedProps!==D&&Zu(A);else{if(typeof D!="string"&&A.stateNode===null)throw Error(r(166));if(g=ee.current,pm(A)){if(g=A.stateNode,C=A.memoizedProps,D=null,V=js,V!==null)switch(V.tag){case 27:case 5:D=V.memoizedProps}g[hn]=A,g=!!(g.nodeValue===C||D!==null&&D.suppressHydrationWarning===!0||bz(g.nodeValue,C)),g||bh(A,!0)}else g=hO(g).createTextNode(D),g[hn]=A,A.stateNode=g}return ii(A),null;case 31:if(C=A.memoizedState,g===null||g.memoizedState!==null){if(D=pm(A),C!==null){if(g===null){if(!D)throw Error(r(318));if(g=A.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(557));g[hn]=A}else rp(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;ii(A),g=!1}else C=D5(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=C),g=!0;if(!g)return A.flags&256?(Oo(A),A):(Oo(A),null);if((A.flags&128)!==0)throw Error(r(558))}return ii(A),null;case 13:if(D=A.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(V=pm(A),D!==null&&D.dehydrated!==null){if(g===null){if(!V)throw Error(r(318));if(V=A.memoizedState,V=V!==null?V.dehydrated:null,!V)throw Error(r(317));V[hn]=A}else rp(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;ii(A),V=!1}else V=D5(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=V),V=!0;if(!V)return A.flags&256?(Oo(A),A):(Oo(A),null)}return Oo(A),(A.flags&128)!==0?(A.lanes=C,A):(C=D!==null,g=g!==null&&g.memoizedState!==null,C&&(D=A.child,V=null,D.alternate!==null&&D.alternate.memoizedState!==null&&D.alternate.memoizedState.cachePool!==null&&(V=D.alternate.memoizedState.cachePool.pool),G=null,D.memoizedState!==null&&D.memoizedState.cachePool!==null&&(G=D.memoizedState.cachePool.pool),G!==V&&(D.flags|=2048)),C!==g&&C&&(A.child.flags|=8192),Yw(A,A.updateQueue),ii(A),null);case 4:return H(),g===null&&zT(A.stateNode.containerInfo),ii(A),null;case 10:return Vu(A.type),ii(A),null;case 19:if(F(Vi),D=A.memoizedState,D===null)return ii(A),null;if(V=(A.flags&128)!==0,G=D.rendering,G===null)if(V)wx(D,!1);else{if(Mi!==0||g!==null&&(g.flags&128)!==0)for(g=A.child;g!==null;){if(G=Fw(g),G!==null){for(A.flags|=128,wx(D,!1),g=G.updateQueue,A.updateQueue=g,Yw(A,g),A.subtreeFlags=0,g=C,C=A.child;C!==null;)YV(C,g),C=C.sibling;return U(Vi,Vi.current&1|2),Yn&&$u(A,D.treeForkCount),A.child}g=g.sibling}D.tail!==null&&Ze()>nO&&(A.flags|=128,V=!0,wx(D,!1),A.lanes=4194304)}else{if(!V)if(g=Fw(G),g!==null){if(A.flags|=128,V=!0,g=g.updateQueue,A.updateQueue=g,Yw(A,g),wx(D,!0),D.tail===null&&D.tailMode==="hidden"&&!G.alternate&&!Yn)return ii(A),null}else 2*Ze()-D.renderingStartTime>nO&&C!==536870912&&(A.flags|=128,V=!0,wx(D,!1),A.lanes=4194304);D.isBackwards?(G.sibling=A.child,A.child=G):(g=D.last,g!==null?g.sibling=G:A.child=G,D.last=G)}return D.tail!==null?(g=D.tail,D.rendering=g,D.tail=g.sibling,D.renderingStartTime=Ze(),g.sibling=null,C=Vi.current,U(Vi,V?C&1|2:C&1),Yn&&$u(A,D.treeForkCount),g):(ii(A),null);case 22:case 23:return Oo(A),Z5(),D=A.memoizedState!==null,g!==null?g.memoizedState!==null!==D&&(A.flags|=8192):D&&(A.flags|=8192),D?(C&536870912)!==0&&(A.flags&128)===0&&(ii(A),A.subtreeFlags&6&&(A.flags|=8192)):ii(A),C=A.updateQueue,C!==null&&Yw(A,C.retryQueue),C=null,g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(C=g.memoizedState.cachePool.pool),D=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(D=A.memoizedState.cachePool.pool),D!==C&&(A.flags|=2048),g!==null&&F(ap),null;case 24:return C=null,g!==null&&(C=g.memoizedState.cache),A.memoizedState.cache!==C&&(A.flags|=2048),Vu(Yi),ii(A),null;case 25:return null;case 30:return null}throw Error(r(156,A.tag))}function USe(g,A){switch(M5(A),A.tag){case 1:return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 3:return Vu(Yi),H(),g=A.flags,(g&65536)!==0&&(g&128)===0?(A.flags=g&-65537|128,A):null;case 26:case 27:case 5:return ue(A),null;case 31:if(A.memoizedState!==null){if(Oo(A),A.alternate===null)throw Error(r(340));rp()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 13:if(Oo(A),g=A.memoizedState,g!==null&&g.dehydrated!==null){if(A.alternate===null)throw Error(r(340));rp()}return g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 19:return F(Vi),null;case 4:return H(),null;case 10:return Vu(A.type),null;case 22:case 23:return Oo(A),Z5(),g!==null&&F(ap),g=A.flags,g&65536?(A.flags=g&-65537|128,A):null;case 24:return Vu(Yi),null;case 25:return null;default:return null}}function OQ(g,A){switch(M5(A),A.tag){case 3:Vu(Yi),H();break;case 26:case 27:case 5:ue(A);break;case 4:H();break;case 31:A.memoizedState!==null&&Oo(A);break;case 13:Oo(A);break;case 19:F(Vi);break;case 10:Vu(A.type);break;case 22:case 23:Oo(A),Z5(),g!==null&&F(ap);break;case 24:Vu(Yi)}}function Ox(g,A){try{var C=A.updateQueue,D=C!==null?C.lastEffect:null;if(D!==null){var V=D.next;C=V;do{if((C.tag&g)===g){D=void 0;var G=C.create,ae=C.inst;D=G(),ae.destroy=D}C=C.next}while(C!==V)}}catch(de){kr(A,A.return,de)}}function kh(g,A,C){try{var D=A.updateQueue,V=D!==null?D.lastEffect:null;if(V!==null){var G=V.next;D=G;do{if((D.tag&g)===g){var ae=D.inst,de=ae.destroy;if(de!==void 0){ae.destroy=void 0,V=A;var Ee=C,Le=de;try{Le()}catch(Ge){kr(V,Ee,Ge)}}}D=D.next}while(D!==G)}}catch(Ge){kr(A,A.return,Ge)}}function CQ(g){var A=g.updateQueue;if(A!==null){var C=g.stateNode;try{mH(A,C)}catch(D){kr(g,g.return,D)}}}function kQ(g,A,C){C.props=fp(g.type,g.memoizedProps),C.state=g.memoizedState;try{C.componentWillUnmount()}catch(D){kr(g,A,D)}}function Cx(g,A){try{var C=g.ref;if(C!==null){switch(g.tag){case 26:case 27:case 5:var D=g.stateNode;break;case 30:D=g.stateNode;break;default:D=g.stateNode}typeof C=="function"?g.refCleanup=C(D):C.current=D}}catch(V){kr(g,A,V)}}function Hc(g,A){var C=g.ref,D=g.refCleanup;if(C!==null)if(typeof D=="function")try{D()}catch(V){kr(g,A,V)}finally{g.refCleanup=null,g=g.alternate,g!=null&&(g.refCleanup=null)}else if(typeof C=="function")try{C(null)}catch(V){kr(g,A,V)}else C.current=null}function EQ(g){var A=g.type,C=g.memoizedProps,D=g.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":C.autoFocus&&D.focus();break e;case"img":C.src?D.src=C.src:C.srcSet&&(D.srcset=C.srcSet)}}catch(V){kr(g,g.return,V)}}function wT(g,A,C){try{var D=g.stateNode;mwe(D,g.type,C,A),D[Ht]=A}catch(V){kr(g,g.return,V)}}function TQ(g){return g.tag===5||g.tag===3||g.tag===26||g.tag===27&&Ih(g.type)||g.tag===4}function OT(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||TQ(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.tag===27&&Ih(g.type)||g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function CT(g,A,C){var D=g.tag;if(D===5||D===6)g=g.stateNode,A?(C.nodeType===9?C.body:C.nodeName==="HTML"?C.ownerDocument.body:C).insertBefore(g,A):(A=C.nodeType===9?C.body:C.nodeName==="HTML"?C.ownerDocument.body:C,A.appendChild(g),C=C._reactRootContainer,C!=null||A.onclick!==null||(A.onclick=vs));else if(D!==4&&(D===27&&Ih(g.type)&&(C=g.stateNode,A=null),g=g.child,g!==null))for(CT(g,A,C),g=g.sibling;g!==null;)CT(g,A,C),g=g.sibling}function Kw(g,A,C){var D=g.tag;if(D===5||D===6)g=g.stateNode,A?C.insertBefore(g,A):C.appendChild(g);else if(D!==4&&(D===27&&Ih(g.type)&&(C=g.stateNode),g=g.child,g!==null))for(Kw(g,A,C),g=g.sibling;g!==null;)Kw(g,A,C),g=g.sibling}function PQ(g){var A=g.stateNode,C=g.memoizedProps;try{for(var D=g.type,V=A.attributes;V.length;)A.removeAttributeNode(V[0]);$s(A,D,C),A[hn]=g,A[Ht]=C}catch(G){kr(g,g.return,G)}}var Gu=!1,es=!1,kT=!1,MQ=typeof WeakSet=="function"?WeakSet:Set,As=null;function XSe(g,A){if(g=g.containerInfo,UT=bO,g=ox(g),lm(g)){if("selectionStart"in g)var C={start:g.selectionStart,end:g.selectionEnd};else e:{C=(C=g.ownerDocument)&&C.defaultView||window;var D=C.getSelection&&C.getSelection();if(D&&D.rangeCount!==0){C=D.anchorNode;var V=D.anchorOffset,G=D.focusNode;D=D.focusOffset;try{C.nodeType,G.nodeType}catch{C=null;break e}var ae=0,de=-1,Ee=-1,Le=0,Ge=0,Xe=g,Fe=null;t:for(;;){for(var He;Xe!==C||V!==0&&Xe.nodeType!==3||(de=ae+V),Xe!==G||D!==0&&Xe.nodeType!==3||(Ee=ae+D),Xe.nodeType===3&&(ae+=Xe.nodeValue.length),(He=Xe.firstChild)!==null;)Fe=Xe,Xe=He;for(;;){if(Xe===g)break t;if(Fe===C&&++Le===V&&(de=ae),Fe===G&&++Ge===D&&(Ee=ae),(He=Xe.nextSibling)!==null)break;Xe=Fe,Fe=Xe.parentNode}Xe=He}C=de===-1||Ee===-1?null:{start:de,end:Ee}}else C=null}C=C||{start:0,end:0}}else C=null;for(XT={focusedElem:g,selectionRange:C},bO=!1,As=A;As!==null;)if(A=As,g=A.child,(A.subtreeFlags&1028)!==0&&g!==null)g.return=A,As=g;else for(;As!==null;){switch(A=As,G=A.alternate,g=A.flags,A.tag){case 0:if((g&4)!==0&&(g=A.updateQueue,g=g!==null?g.events:null,g!==null))for(C=0;C<g.length;C++)V=g[C],V.ref.impl=V.nextImpl;break;case 11:case 15:break;case 1:if((g&1024)!==0&&G!==null){g=void 0,C=A,V=G.memoizedProps,G=G.memoizedState,D=C.stateNode;try{var jt=fp(C.type,V);g=D.getSnapshotBeforeUpdate(jt,G),D.__reactInternalSnapshotBeforeUpdate=g}catch(sn){kr(C,C.return,sn)}}break;case 3:if((g&1024)!==0){if(g=A.stateNode.containerInfo,C=g.nodeType,C===9)YT(g);else if(C===1)switch(g.nodeName){case"HEAD":case"HTML":case"BODY":YT(g);break;default:g.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((g&1024)!==0)throw Error(r(163))}if(g=A.sibling,g!==null){g.return=A.return,As=g;break}As=A.return}}function NQ(g,A,C){var D=C.flags;switch(C.tag){case 0:case 11:case 15:Xu(g,C),D&4&&Ox(5,C);break;case 1:if(Xu(g,C),D&4)if(g=C.stateNode,A===null)try{g.componentDidMount()}catch(ae){kr(C,C.return,ae)}else{var V=fp(C.type,A.memoizedProps);A=A.memoizedState;try{g.componentDidUpdate(V,A,g.__reactInternalSnapshotBeforeUpdate)}catch(ae){kr(C,C.return,ae)}}D&64&&CQ(C),D&512&&Cx(C,C.return);break;case 3:if(Xu(g,C),D&64&&(g=C.updateQueue,g!==null)){if(A=null,C.child!==null)switch(C.child.tag){case 27:case 5:A=C.child.stateNode;break;case 1:A=C.child.stateNode}try{mH(g,A)}catch(ae){kr(C,C.return,ae)}}break;case 27:A===null&&D&4&&PQ(C);case 26:case 5:Xu(g,C),A===null&&D&4&&EQ(C),D&512&&Cx(C,C.return);break;case 12:Xu(g,C);break;case 31:Xu(g,C),D&4&&_Q(g,C);break;case 13:Xu(g,C),D&4&&RQ(g,C),D&64&&(g=C.memoizedState,g!==null&&(g=g.dehydrated,g!==null&&(C=rwe.bind(null,C),wwe(g,C))));break;case 22:if(D=C.memoizedState!==null||Gu,!D){A=A!==null&&A.memoizedState!==null||es,V=Gu;var G=es;Gu=D,(es=A)&&!G?Wu(g,C,(C.subtreeFlags&8772)!==0):Xu(g,C),Gu=V,es=G}break;case 30:break;default:Xu(g,C)}}function DQ(g){var A=g.alternate;A!==null&&(g.alternate=null,DQ(A)),g.child=null,g.deletions=null,g.sibling=null,g.tag===5&&(A=g.stateNode,A!==null&&nr(A)),g.stateNode=null,g.return=null,g.dependencies=null,g.memoizedProps=null,g.memoizedState=null,g.pendingProps=null,g.stateNode=null,g.updateQueue=null}var li=null,Qa=!1;function Uu(g,A,C){for(C=C.child;C!==null;)IQ(g,A,C),C=C.sibling}function IQ(g,A,C){if(Je&&typeof Je.onCommitFiberUnmount=="function")try{Je.onCommitFiberUnmount(Jt,C)}catch{}switch(C.tag){case 26:es||Hc(C,A),Uu(g,A,C),C.memoizedState?C.memoizedState.count--:C.stateNode&&(C=C.stateNode,C.parentNode.removeChild(C));break;case 27:es||Hc(C,A);var D=li,V=Qa;Ih(C.type)&&(li=C.stateNode,Qa=!1),Uu(g,A,C),_x(C.stateNode),li=D,Qa=V;break;case 5:es||Hc(C,A);case 6:if(D=li,V=Qa,li=null,Uu(g,A,C),li=D,Qa=V,li!==null)if(Qa)try{(li.nodeType===9?li.body:li.nodeName==="HTML"?li.ownerDocument.body:li).removeChild(C.stateNode)}catch(G){kr(C,A,G)}else try{li.removeChild(C.stateNode)}catch(G){kr(C,A,G)}break;case 18:li!==null&&(Qa?(g=li,Cz(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,C.stateNode),Rm(g)):Cz(li,C.stateNode));break;case 4:D=li,V=Qa,li=C.stateNode.containerInfo,Qa=!0,Uu(g,A,C),li=D,Qa=V;break;case 0:case 11:case 14:case 15:kh(2,C,A),es||kh(4,C,A),Uu(g,A,C);break;case 1:es||(Hc(C,A),D=C.stateNode,typeof D.componentWillUnmount=="function"&&kQ(C,A,D)),Uu(g,A,C);break;case 21:Uu(g,A,C);break;case 22:es=(D=es)||C.memoizedState!==null,Uu(g,A,C),es=D;break;default:Uu(g,A,C)}}function _Q(g,A){if(A.memoizedState===null&&(g=A.alternate,g!==null&&(g=g.memoizedState,g!==null))){g=g.dehydrated;try{Rm(g)}catch(C){kr(A,A.return,C)}}}function RQ(g,A){if(A.memoizedState===null&&(g=A.alternate,g!==null&&(g=g.memoizedState,g!==null&&(g=g.dehydrated,g!==null))))try{Rm(g)}catch(C){kr(A,A.return,C)}}function WSe(g){switch(g.tag){case 31:case 13:case 19:var A=g.stateNode;return A===null&&(A=g.stateNode=new MQ),A;case 22:return g=g.stateNode,A=g._retryCache,A===null&&(A=g._retryCache=new MQ),A;default:throw Error(r(435,g.tag))}}function Jw(g,A){var C=WSe(g);A.forEach(function(D){if(!C.has(D)){C.add(D);var V=iwe.bind(null,g,D);D.then(V,V)}})}function za(g,A){var C=A.deletions;if(C!==null)for(var D=0;D<C.length;D++){var V=C[D],G=g,ae=A,de=ae;e:for(;de!==null;){switch(de.tag){case 27:if(Ih(de.type)){li=de.stateNode,Qa=!1;break e}break;case 5:li=de.stateNode,Qa=!1;break e;case 3:case 4:li=de.stateNode.containerInfo,Qa=!0;break e}de=de.return}if(li===null)throw Error(r(160));IQ(G,ae,V),li=null,Qa=!1,G=V.alternate,G!==null&&(G.return=null),V.return=null}if(A.subtreeFlags&13886)for(A=A.child;A!==null;)jQ(A,g),A=A.sibling}var Yl=null;function jQ(g,A){var C=g.alternate,D=g.flags;switch(g.tag){case 0:case 11:case 14:case 15:za(A,g),Za(g),D&4&&(kh(3,g,g.return),Ox(3,g),kh(5,g,g.return));break;case 1:za(A,g),Za(g),D&512&&(es||C===null||Hc(C,C.return)),D&64&&Gu&&(g=g.updateQueue,g!==null&&(D=g.callbacks,D!==null&&(C=g.shared.hiddenCallbacks,g.shared.hiddenCallbacks=C===null?D:C.concat(D))));break;case 26:var V=Yl;if(za(A,g),Za(g),D&512&&(es||C===null||Hc(C,C.return)),D&4){var G=C!==null?C.memoizedState:null;if(D=g.memoizedState,C===null)if(D===null)if(g.stateNode===null){e:{D=g.type,C=g.memoizedProps,V=V.ownerDocument||V;t:switch(D){case"title":G=V.getElementsByTagName("title")[0],(!G||G[gt]||G[hn]||G.namespaceURI==="http://www.w3.org/2000/svg"||G.hasAttribute("itemprop"))&&(G=V.createElement(D),V.head.insertBefore(G,V.querySelector("head > title"))),$s(G,D,C),G[hn]=g,Ct(G),D=G;break e;case"link":var ae=jz("link","href",V).get(D+(C.href||""));if(ae){for(var de=0;de<ae.length;de++)if(G=ae[de],G.getAttribute("href")===(C.href==null||C.href===""?null:C.href)&&G.getAttribute("rel")===(C.rel==null?null:C.rel)&&G.getAttribute("title")===(C.title==null?null:C.title)&&G.getAttribute("crossorigin")===(C.crossOrigin==null?null:C.crossOrigin)){ae.splice(de,1);break t}}G=V.createElement(D),$s(G,D,C),V.head.appendChild(G);break;case"meta":if(ae=jz("meta","content",V).get(D+(C.content||""))){for(de=0;de<ae.length;de++)if(G=ae[de],G.getAttribute("content")===(C.content==null?null:""+C.content)&&G.getAttribute("name")===(C.name==null?null:C.name)&&G.getAttribute("property")===(C.property==null?null:C.property)&&G.getAttribute("http-equiv")===(C.httpEquiv==null?null:C.httpEquiv)&&G.getAttribute("charset")===(C.charSet==null?null:C.charSet)){ae.splice(de,1);break t}}G=V.createElement(D),$s(G,D,C),V.head.appendChild(G);break;default:throw Error(r(468,D))}G[hn]=g,Ct(G),D=G}g.stateNode=D}else Lz(V,g.type,g.stateNode);else g.stateNode=Rz(V,D,g.memoizedProps);else G!==D?(G===null?C.stateNode!==null&&(C=C.stateNode,C.parentNode.removeChild(C)):G.count--,D===null?Lz(V,g.type,g.stateNode):Rz(V,D,g.memoizedProps)):D===null&&g.stateNode!==null&&wT(g,g.memoizedProps,C.memoizedProps)}break;case 27:za(A,g),Za(g),D&512&&(es||C===null||Hc(C,C.return)),C!==null&&D&4&&wT(g,g.memoizedProps,C.memoizedProps);break;case 5:if(za(A,g),Za(g),D&512&&(es||C===null||Hc(C,C.return)),g.flags&32){V=g.stateNode;try{en(V,"")}catch(jt){kr(g,g.return,jt)}}D&4&&g.stateNode!=null&&(V=g.memoizedProps,wT(g,V,C!==null?C.memoizedProps:V)),D&1024&&(kT=!0);break;case 6:if(za(A,g),Za(g),D&4){if(g.stateNode===null)throw Error(r(162));D=g.memoizedProps,C=g.stateNode;try{C.nodeValue=D}catch(jt){kr(g,g.return,jt)}}break;case 3:if(mO=null,V=Yl,Yl=dO(A.containerInfo),za(A,g),Yl=V,Za(g),D&4&&C!==null&&C.memoizedState.isDehydrated)try{Rm(A.containerInfo)}catch(jt){kr(g,g.return,jt)}kT&&(kT=!1,LQ(g));break;case 4:D=Yl,Yl=dO(g.stateNode.containerInfo),za(A,g),Za(g),Yl=D;break;case 12:za(A,g),Za(g);break;case 31:za(A,g),Za(g),D&4&&(D=g.updateQueue,D!==null&&(g.updateQueue=null,Jw(g,D)));break;case 13:za(A,g),Za(g),g.child.flags&8192&&g.memoizedState!==null!=(C!==null&&C.memoizedState!==null)&&(tO=Ze()),D&4&&(D=g.updateQueue,D!==null&&(g.updateQueue=null,Jw(g,D)));break;case 22:V=g.memoizedState!==null;var Ee=C!==null&&C.memoizedState!==null,Le=Gu,Ge=es;if(Gu=Le||V,es=Ge||Ee,za(A,g),es=Ge,Gu=Le,Za(g),D&8192)e:for(A=g.stateNode,A._visibility=V?A._visibility&-2:A._visibility|1,V&&(C===null||Ee||Gu||es||hp(g)),C=null,A=g;;){if(A.tag===5||A.tag===26){if(C===null){Ee=C=A;try{if(G=Ee.stateNode,V)ae=G.style,typeof ae.setProperty=="function"?ae.setProperty("display","none","important"):ae.display="none";else{de=Ee.stateNode;var Xe=Ee.memoizedProps.style,Fe=Xe!=null&&Xe.hasOwnProperty("display")?Xe.display:null;de.style.display=Fe==null||typeof Fe=="boolean"?"":(""+Fe).trim()}}catch(jt){kr(Ee,Ee.return,jt)}}}else if(A.tag===6){if(C===null){Ee=A;try{Ee.stateNode.nodeValue=V?"":Ee.memoizedProps}catch(jt){kr(Ee,Ee.return,jt)}}}else if(A.tag===18){if(C===null){Ee=A;try{var He=Ee.stateNode;V?kz(He,!0):kz(Ee.stateNode,!1)}catch(jt){kr(Ee,Ee.return,jt)}}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===g)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===g)break e;for(;A.sibling===null;){if(A.return===null||A.return===g)break e;C===A&&(C=null),A=A.return}C===A&&(C=null),A.sibling.return=A.return,A=A.sibling}D&4&&(D=g.updateQueue,D!==null&&(C=D.retryQueue,C!==null&&(D.retryQueue=null,Jw(g,C))));break;case 19:za(A,g),Za(g),D&4&&(D=g.updateQueue,D!==null&&(g.updateQueue=null,Jw(g,D)));break;case 30:break;case 21:break;default:za(A,g),Za(g)}}function Za(g){var A=g.flags;if(A&2){try{for(var C,D=g.return;D!==null;){if(TQ(D)){C=D;break}D=D.return}if(C==null)throw Error(r(160));switch(C.tag){case 27:var V=C.stateNode,G=OT(g);Kw(g,G,V);break;case 5:var ae=C.stateNode;C.flags&32&&(en(ae,""),C.flags&=-33);var de=OT(g);Kw(g,de,ae);break;case 3:case 4:var Ee=C.stateNode.containerInfo,Le=OT(g);CT(g,Le,Ee);break;default:throw Error(r(161))}}catch(Ge){kr(g,g.return,Ge)}g.flags&=-3}A&4096&&(g.flags&=-4097)}function LQ(g){if(g.subtreeFlags&1024)for(g=g.child;g!==null;){var A=g;LQ(A),A.tag===5&&A.flags&1024&&A.stateNode.reset(),g=g.sibling}}function Xu(g,A){if(A.subtreeFlags&8772)for(A=A.child;A!==null;)NQ(g,A.alternate,A),A=A.sibling}function hp(g){for(g=g.child;g!==null;){var A=g;switch(A.tag){case 0:case 11:case 14:case 15:kh(4,A,A.return),hp(A);break;case 1:Hc(A,A.return);var C=A.stateNode;typeof C.componentWillUnmount=="function"&&kQ(A,A.return,C),hp(A);break;case 27:_x(A.stateNode);case 26:case 5:Hc(A,A.return),hp(A);break;case 22:A.memoizedState===null&&hp(A);break;case 30:hp(A);break;default:hp(A)}g=g.sibling}}function Wu(g,A,C){for(C=C&&(A.subtreeFlags&8772)!==0,A=A.child;A!==null;){var D=A.alternate,V=g,G=A,ae=G.flags;switch(G.tag){case 0:case 11:case 15:Wu(V,G,C),Ox(4,G);break;case 1:if(Wu(V,G,C),D=G,V=D.stateNode,typeof V.componentDidMount=="function")try{V.componentDidMount()}catch(Le){kr(D,D.return,Le)}if(D=G,V=D.updateQueue,V!==null){var de=D.stateNode;try{var Ee=V.shared.hiddenCallbacks;if(Ee!==null)for(V.shared.hiddenCallbacks=null,V=0;V<Ee.length;V++)pH(Ee[V],de)}catch(Le){kr(D,D.return,Le)}}C&&ae&64&&CQ(G),Cx(G,G.return);break;case 27:PQ(G);case 26:case 5:Wu(V,G,C),C&&D===null&&ae&4&&EQ(G),Cx(G,G.return);break;case 12:Wu(V,G,C);break;case 31:Wu(V,G,C),C&&ae&4&&_Q(V,G);break;case 13:Wu(V,G,C),C&&ae&4&&RQ(V,G);break;case 22:G.memoizedState===null&&Wu(V,G,C),Cx(G,G.return);break;case 30:break;default:Wu(V,G,C)}A=A.sibling}}function ET(g,A){var C=null;g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(C=g.memoizedState.cachePool.pool),g=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(g=A.memoizedState.cachePool.pool),g!==C&&(g!=null&&g.refCount++,C!=null&&fx(C))}function TT(g,A){g=null,A.alternate!==null&&(g=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==g&&(A.refCount++,g!=null&&fx(g))}function Kl(g,A,C,D){if(A.subtreeFlags&10256)for(A=A.child;A!==null;)FQ(g,A,C,D),A=A.sibling}function FQ(g,A,C,D){var V=A.flags;switch(A.tag){case 0:case 11:case 15:Kl(g,A,C,D),V&2048&&Ox(9,A);break;case 1:Kl(g,A,C,D);break;case 3:Kl(g,A,C,D),V&2048&&(g=null,A.alternate!==null&&(g=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==g&&(A.refCount++,g!=null&&fx(g)));break;case 12:if(V&2048){Kl(g,A,C,D),g=A.stateNode;try{var G=A.memoizedProps,ae=G.id,de=G.onPostCommit;typeof de=="function"&&de(ae,A.alternate===null?"mount":"update",g.passiveEffectDuration,-0)}catch(Ee){kr(A,A.return,Ee)}}else Kl(g,A,C,D);break;case 31:Kl(g,A,C,D);break;case 13:Kl(g,A,C,D);break;case 23:break;case 22:G=A.stateNode,ae=A.alternate,A.memoizedState!==null?G._visibility&2?Kl(g,A,C,D):kx(g,A):G._visibility&2?Kl(g,A,C,D):(G._visibility|=2,Om(g,A,C,D,(A.subtreeFlags&10256)!==0||!1)),V&2048&&ET(ae,A);break;case 24:Kl(g,A,C,D),V&2048&&TT(A.alternate,A);break;default:Kl(g,A,C,D)}}function Om(g,A,C,D,V){for(V=V&&((A.subtreeFlags&10256)!==0||!1),A=A.child;A!==null;){var G=g,ae=A,de=C,Ee=D,Le=ae.flags;switch(ae.tag){case 0:case 11:case 15:Om(G,ae,de,Ee,V),Ox(8,ae);break;case 23:break;case 22:var Ge=ae.stateNode;ae.memoizedState!==null?Ge._visibility&2?Om(G,ae,de,Ee,V):kx(G,ae):(Ge._visibility|=2,Om(G,ae,de,Ee,V)),V&&Le&2048&&ET(ae.alternate,ae);break;case 24:Om(G,ae,de,Ee,V),V&&Le&2048&&TT(ae.alternate,ae);break;default:Om(G,ae,de,Ee,V)}A=A.sibling}}function kx(g,A){if(A.subtreeFlags&10256)for(A=A.child;A!==null;){var C=g,D=A,V=D.flags;switch(D.tag){case 22:kx(C,D),V&2048&&ET(D.alternate,D);break;case 24:kx(C,D),V&2048&&TT(D.alternate,D);break;default:kx(C,D)}A=A.sibling}}var Ex=8192;function Cm(g,A,C){if(g.subtreeFlags&Ex)for(g=g.child;g!==null;)$Q(g,A,C),g=g.sibling}function $Q(g,A,C){switch(g.tag){case 26:Cm(g,A,C),g.flags&Ex&&g.memoizedState!==null&&Rwe(C,Yl,g.memoizedState,g.memoizedProps);break;case 5:Cm(g,A,C);break;case 3:case 4:var D=Yl;Yl=dO(g.stateNode.containerInfo),Cm(g,A,C),Yl=D;break;case 22:g.memoizedState===null&&(D=g.alternate,D!==null&&D.memoizedState!==null?(D=Ex,Ex=16777216,Cm(g,A,C),Ex=D):Cm(g,A,C));break;default:Cm(g,A,C)}}function BQ(g){var A=g.alternate;if(A!==null&&(g=A.child,g!==null)){A.child=null;do A=g.sibling,g.sibling=null,g=A;while(g!==null)}}function Tx(g){var A=g.deletions;if((g.flags&16)!==0){if(A!==null)for(var C=0;C<A.length;C++){var D=A[C];As=D,HQ(D,g)}BQ(g)}if(g.subtreeFlags&10256)for(g=g.child;g!==null;)VQ(g),g=g.sibling}function VQ(g){switch(g.tag){case 0:case 11:case 15:Tx(g),g.flags&2048&&kh(9,g,g.return);break;case 3:Tx(g);break;case 12:Tx(g);break;case 22:var A=g.stateNode;g.memoizedState!==null&&A._visibility&2&&(g.return===null||g.return.tag!==13)?(A._visibility&=-3,eO(g)):Tx(g);break;default:Tx(g)}}function eO(g){var A=g.deletions;if((g.flags&16)!==0){if(A!==null)for(var C=0;C<A.length;C++){var D=A[C];As=D,HQ(D,g)}BQ(g)}for(g=g.child;g!==null;){switch(A=g,A.tag){case 0:case 11:case 15:kh(8,A,A.return),eO(A);break;case 22:C=A.stateNode,C._visibility&2&&(C._visibility&=-3,eO(A));break;default:eO(A)}g=g.sibling}}function HQ(g,A){for(;As!==null;){var C=As;switch(C.tag){case 0:case 11:case 15:kh(8,C,A);break;case 23:case 22:if(C.memoizedState!==null&&C.memoizedState.cachePool!==null){var D=C.memoizedState.cachePool.pool;D!=null&&D.refCount++}break;case 24:fx(C.memoizedState.cache)}if(D=C.child,D!==null)D.return=C,As=D;else e:for(C=g;As!==null;){D=As;var V=D.sibling,G=D.return;if(DQ(D),D===C){As=null;break e}if(V!==null){V.return=G,As=V;break e}As=G}}}var qSe={getCacheForType:function(g){var A=Ls(Yi),C=A.data.get(g);return C===void 0&&(C=g(),A.data.set(g,C)),C},cacheSignal:function(){return Ls(Yi).controller.signal}},YSe=typeof WeakMap=="function"?WeakMap:Map,mr=0,Hr=null,Vn=null,Gn=0,Cr=0,Co=null,Eh=!1,km=!1,PT=!1,qu=0,Mi=0,Th=0,dp=0,MT=0,ko=0,Em=0,Px=null,Ga=null,NT=!1,tO=0,QQ=0,nO=1/0,rO=null,Ph=null,ps=0,Mh=null,Tm=null,Yu=0,DT=0,IT=null,zQ=null,Mx=0,_T=null;function Eo(){return(mr&2)!==0&&Gn!==0?Gn&-Gn:W.T!==null?BT():et()}function ZQ(){if(ko===0)if((Gn&536870912)===0||Yn){var g=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),ko=g}else ko=536870912;return g=wo.current,g!==null&&(g.flags|=32),ko}function Ua(g,A,C){(g===Hr&&(Cr===2||Cr===9)||g.cancelPendingCommit!==null)&&(Pm(g,0),Nh(g,Gn,ko,!1)),Mn(g,C),((mr&2)===0||g!==Hr)&&(g===Hr&&((mr&2)===0&&(dp|=C),Mi===4&&Nh(g,Gn,ko,!1)),Qc(g))}function GQ(g,A,C){if((mr&6)!==0)throw Error(r(327));var D=!C&&(A&127)===0&&(A&g.expiredLanes)===0||st(g,A),V=D?ewe(g,A):jT(g,A,!0),G=D;do{if(V===0){km&&!D&&Nh(g,A,0,!1);break}else{if(C=g.current.alternate,G&&!KSe(C)){V=jT(g,A,!1),G=!1;continue}if(V===2){if(G=A,g.errorRecoveryDisabledLanes&G)var ae=0;else ae=g.pendingLanes&-536870913,ae=ae!==0?ae:ae&536870912?536870912:0;if(ae!==0){A=ae;e:{var de=g;V=Px;var Ee=de.current.memoizedState.isDehydrated;if(Ee&&(Pm(de,ae).flags|=256),ae=jT(de,ae,!1),ae!==2){if(PT&&!Ee){de.errorRecoveryDisabledLanes|=G,dp|=G,V=4;break e}G=Ga,Ga=V,G!==null&&(Ga===null?Ga=G:Ga.push.apply(Ga,G))}V=ae}if(G=!1,V!==2)continue}}if(V===1){Pm(g,0),Nh(g,A,0,!0);break}e:{switch(D=g,G=V,G){case 0:case 1:throw Error(r(345));case 4:if((A&4194048)!==A)break;case 6:Nh(D,A,ko,!Eh);break e;case 2:Ga=null;break;case 3:case 5:break;default:throw Error(r(329))}if((A&62914560)===A&&(V=tO+300-Ze(),10<V)){if(Nh(D,A,ko,!Eh),ze(D,0,!0)!==0)break e;Yu=A,D.timeoutHandle=wz(UQ.bind(null,D,C,Ga,rO,NT,A,ko,dp,Em,Eh,G,"Throttled",-0,0),V);break e}UQ(D,C,Ga,rO,NT,A,ko,dp,Em,Eh,G,null,-0,0)}}break}while(!0);Qc(g)}function UQ(g,A,C,D,V,G,ae,de,Ee,Le,Ge,Xe,Fe,He){if(g.timeoutHandle=-1,Xe=A.subtreeFlags,Xe&8192||(Xe&16785408)===16785408){Xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vs},$Q(A,G,Xe);var jt=(G&62914560)===G?tO-Ze():(G&4194048)===G?QQ-Ze():0;if(jt=jwe(Xe,jt),jt!==null){Yu=G,g.cancelPendingCommit=jt(tz.bind(null,g,A,G,C,D,V,ae,de,Ee,Ge,Xe,null,Fe,He)),Nh(g,G,ae,!Le);return}}tz(g,A,G,C,D,V,ae,de,Ee)}function KSe(g){for(var A=g;;){var C=A.tag;if((C===0||C===11||C===15)&&A.flags&16384&&(C=A.updateQueue,C!==null&&(C=C.stores,C!==null)))for(var D=0;D<C.length;D++){var V=C[D],G=V.getSnapshot;V=V.value;try{if(!ta(G(),V))return!1}catch{return!1}}if(C=A.child,A.subtreeFlags&16384&&C!==null)C.return=A,A=C;else{if(A===g)break;for(;A.sibling===null;){if(A.return===null||A.return===g)return!0;A=A.return}A.sibling.return=A.return,A=A.sibling}}return!0}function Nh(g,A,C,D){A&=~MT,A&=~dp,g.suspendedLanes|=A,g.pingedLanes&=~A,D&&(g.warmLanes|=A),D=g.expirationTimes;for(var V=A;0<V;){var G=31-At(V),ae=1<<G;D[G]=-1,V&=~ae}C!==0&&mt(g,C,A)}function iO(){return(mr&6)===0?(Nx(0),!1):!0}function RT(){if(Vn!==null){if(Cr===0)var g=Vn.return;else g=Vn,Bu=ip=null,Y5(g),bm=null,dx=0,g=Vn;for(;g!==null;)OQ(g.alternate,g),g=g.return;Vn=null}}function Pm(g,A){var C=g.timeoutHandle;C!==-1&&(g.timeoutHandle=-1,xwe(C)),C=g.cancelPendingCommit,C!==null&&(g.cancelPendingCommit=null,C()),Yu=0,RT(),Hr=g,Vn=C=Fu(g.current,null),Gn=A,Cr=0,Co=null,Eh=!1,km=st(g,A),PT=!1,Em=ko=MT=dp=Th=Mi=0,Ga=Px=null,NT=!1,(A&8)!==0&&(A|=A&32);var D=g.entangledLanes;if(D!==0)for(g=g.entanglements,D&=A;0<D;){var V=31-At(D),G=1<<V;A|=g[V],D&=~G}return qu=A,Cw(),C}function XQ(g,A){kn=null,W.H=Ax,A===xm||A===Iw?(A=uH(),Cr=3):A===$5?(A=uH(),Cr=4):Cr=A===dT?8:A!==null&&typeof A=="object"&&typeof A.then=="function"?6:1,Co=A,Vn===null&&(Mi=1,Uw(g,cl(A,g.current)))}function WQ(){var g=wo.current;return g===null?!0:(Gn&4194048)===Gn?dl===null:(Gn&62914560)===Gn||(Gn&536870912)!==0?g===dl:!1}function qQ(){var g=W.H;return W.H=Ax,g===null?Ax:g}function YQ(){var g=W.A;return W.A=qSe,g}function sO(){Mi=4,Eh||(Gn&4194048)!==Gn&&wo.current!==null||(km=!0),(Th&134217727)===0&&(dp&134217727)===0||Hr===null||Nh(Hr,Gn,ko,!1)}function jT(g,A,C){var D=mr;mr|=2;var V=qQ(),G=YQ();(Hr!==g||Gn!==A)&&(rO=null,Pm(g,A)),A=!1;var ae=Mi;e:do try{if(Cr!==0&&Vn!==null){var de=Vn,Ee=Co;switch(Cr){case 8:RT(),ae=6;break e;case 3:case 2:case 9:case 6:wo.current===null&&(A=!0);var Le=Cr;if(Cr=0,Co=null,Mm(g,de,Ee,Le),C&&km){ae=0;break e}break;default:Le=Cr,Cr=0,Co=null,Mm(g,de,Ee,Le)}}JSe(),ae=Mi;break}catch(Ge){XQ(g,Ge)}while(!0);return A&&g.shellSuspendCounter++,Bu=ip=null,mr=D,W.H=V,W.A=G,Vn===null&&(Hr=null,Gn=0,Cw()),ae}function JSe(){for(;Vn!==null;)KQ(Vn)}function ewe(g,A){var C=mr;mr|=2;var D=qQ(),V=YQ();Hr!==g||Gn!==A?(rO=null,nO=Ze()+500,Pm(g,A)):km=st(g,A);e:do try{if(Cr!==0&&Vn!==null){A=Vn;var G=Co;t:switch(Cr){case 1:Cr=0,Co=null,Mm(g,A,G,1);break;case 2:case 9:if(lH(G)){Cr=0,Co=null,JQ(A);break}A=function(){Cr!==2&&Cr!==9||Hr!==g||(Cr=7),Qc(g)},G.then(A,A);break e;case 3:Cr=7;break e;case 4:Cr=5;break e;case 7:lH(G)?(Cr=0,Co=null,JQ(A)):(Cr=0,Co=null,Mm(g,A,G,7));break;case 5:var ae=null;switch(Vn.tag){case 26:ae=Vn.memoizedState;case 5:case 27:var de=Vn;if(ae?Fz(ae):de.stateNode.complete){Cr=0,Co=null;var Ee=de.sibling;if(Ee!==null)Vn=Ee;else{var Le=de.return;Le!==null?(Vn=Le,aO(Le)):Vn=null}break t}}Cr=0,Co=null,Mm(g,A,G,5);break;case 6:Cr=0,Co=null,Mm(g,A,G,6);break;case 8:RT(),Mi=6;break e;default:throw Error(r(462))}}twe();break}catch(Ge){XQ(g,Ge)}while(!0);return Bu=ip=null,W.H=D,W.A=V,mr=C,Vn!==null?0:(Hr=null,Gn=0,Cw(),Mi)}function twe(){for(;Vn!==null&&!Ve();)KQ(Vn)}function KQ(g){var A=SQ(g.alternate,g,qu);g.memoizedProps=g.pendingProps,A===null?aO(g):Vn=A}function JQ(g){var A=g,C=A.alternate;switch(A.tag){case 15:case 0:A=gQ(C,A,A.pendingProps,A.type,void 0,Gn);break;case 11:A=gQ(C,A,A.pendingProps,A.type.render,A.ref,Gn);break;case 5:Y5(A);default:OQ(C,A),A=Vn=YV(A,qu),A=SQ(C,A,qu)}g.memoizedProps=g.pendingProps,A===null?aO(g):Vn=A}function Mm(g,A,C,D){Bu=ip=null,Y5(A),bm=null,dx=0;var V=A.return;try{if(QSe(g,V,A,C,Gn)){Mi=1,Uw(g,cl(C,g.current)),Vn=null;return}}catch(G){if(V!==null)throw Vn=V,G;Mi=1,Uw(g,cl(C,g.current)),Vn=null;return}A.flags&32768?(Yn||D===1?g=!0:km||(Gn&536870912)!==0?g=!1:(Eh=g=!0,(D===2||D===9||D===3||D===6)&&(D=wo.current,D!==null&&D.tag===13&&(D.flags|=16384))),ez(A,g)):aO(A)}function aO(g){var A=g;do{if((A.flags&32768)!==0){ez(A,Eh);return}g=A.return;var C=GSe(A.alternate,A,qu);if(C!==null){Vn=C;return}if(A=A.sibling,A!==null){Vn=A;return}Vn=A=g}while(A!==null);Mi===0&&(Mi=5)}function ez(g,A){do{var C=USe(g.alternate,g);if(C!==null){C.flags&=32767,Vn=C;return}if(C=g.return,C!==null&&(C.flags|=32768,C.subtreeFlags=0,C.deletions=null),!A&&(g=g.sibling,g!==null)){Vn=g;return}Vn=g=C}while(g!==null);Mi=6,Vn=null}function tz(g,A,C,D,V,G,ae,de,Ee){g.cancelPendingCommit=null;do oO();while(ps!==0);if((mr&6)!==0)throw Error(r(327));if(A!==null){if(A===g.current)throw Error(r(177));if(G=A.lanes|A.childLanes,G|=O5,Pr(g,C,G,ae,de,Ee),g===Hr&&(Vn=Hr=null,Gn=0),Tm=A,Mh=g,Yu=C,DT=G,IT=V,zQ=D,(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?(g.callbackNode=null,g.callbackPriority=0,swe(vt,function(){return az(),null})):(g.callbackNode=null,g.callbackPriority=0),D=(A.flags&13878)!==0,(A.subtreeFlags&13878)!==0||D){D=W.T,W.T=null,V=J.p,J.p=2,ae=mr,mr|=4;try{XSe(g,A,C)}finally{mr=ae,J.p=V,W.T=D}}ps=1,nz(),rz(),iz()}}function nz(){if(ps===1){ps=0;var g=Mh,A=Tm,C=(A.flags&13878)!==0;if((A.subtreeFlags&13878)!==0||C){C=W.T,W.T=null;var D=J.p;J.p=2;var V=mr;mr|=4;try{jQ(A,g);var G=XT,ae=ox(g.containerInfo),de=G.focusedElem,Ee=G.selectionRange;if(ae!==de&&de&&de.ownerDocument&&ax(de.ownerDocument.documentElement,de)){if(Ee!==null&&lm(de)){var Le=Ee.start,Ge=Ee.end;if(Ge===void 0&&(Ge=Le),"selectionStart"in de)de.selectionStart=Le,de.selectionEnd=Math.min(Ge,de.value.length);else{var Xe=de.ownerDocument||document,Fe=Xe&&Xe.defaultView||window;if(Fe.getSelection){var He=Fe.getSelection(),jt=de.textContent.length,sn=Math.min(Ee.start,jt),Ir=Ee.end===void 0?sn:Math.min(Ee.end,jt);!He.extend&&sn>Ir&&(ae=Ir,Ir=sn,sn=ae);var Ie=sx(de,sn),Ne=sx(de,Ir);if(Ie&&Ne&&(He.rangeCount!==1||He.anchorNode!==Ie.node||He.anchorOffset!==Ie.offset||He.focusNode!==Ne.node||He.focusOffset!==Ne.offset)){var je=Xe.createRange();je.setStart(Ie.node,Ie.offset),He.removeAllRanges(),sn>Ir?(He.addRange(je),He.extend(Ne.node,Ne.offset)):(je.setEnd(Ne.node,Ne.offset),He.addRange(je))}}}}for(Xe=[],He=de;He=He.parentNode;)He.nodeType===1&&Xe.push({element:He,left:He.scrollLeft,top:He.scrollTop});for(typeof de.focus=="function"&&de.focus(),de=0;de<Xe.length;de++){var Ue=Xe[de];Ue.element.scrollLeft=Ue.left,Ue.element.scrollTop=Ue.top}}bO=!!UT,XT=UT=null}finally{mr=V,J.p=D,W.T=C}}g.current=A,ps=2}}function rz(){if(ps===2){ps=0;var g=Mh,A=Tm,C=(A.flags&8772)!==0;if((A.subtreeFlags&8772)!==0||C){C=W.T,W.T=null;var D=J.p;J.p=2;var V=mr;mr|=4;try{NQ(g,A.alternate,A)}finally{mr=V,J.p=D,W.T=C}}ps=3}}function iz(){if(ps===4||ps===3){ps=0,tt();var g=Mh,A=Tm,C=Yu,D=zQ;(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?ps=5:(ps=0,Tm=Mh=null,sz(g,g.pendingLanes));var V=g.pendingLanes;if(V===0&&(Ph=null),jn(C),A=A.stateNode,Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(Jt,A,void 0,(A.current.flags&128)===128)}catch{}if(D!==null){A=W.T,V=J.p,J.p=2,W.T=null;try{for(var G=g.onRecoverableError,ae=0;ae<D.length;ae++){var de=D[ae];G(de.value,{componentStack:de.stack})}}finally{W.T=A,J.p=V}}(Yu&3)!==0&&oO(),Qc(g),V=g.pendingLanes,(C&261930)!==0&&(V&42)!==0?g===_T?Mx++:(Mx=0,_T=g):Mx=0,Nx(0)}}function sz(g,A){(g.pooledCacheLanes&=A)===0&&(A=g.pooledCache,A!=null&&(g.pooledCache=null,fx(A)))}function oO(){return nz(),rz(),iz(),az()}function az(){if(ps!==5)return!1;var g=Mh,A=DT;DT=0;var C=jn(Yu),D=W.T,V=J.p;try{J.p=32>C?32:C,W.T=null,C=IT,IT=null;var G=Mh,ae=Yu;if(ps=0,Tm=Mh=null,Yu=0,(mr&6)!==0)throw Error(r(331));var de=mr;if(mr|=4,VQ(G.current),FQ(G,G.current,ae,C),mr=de,Nx(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(Jt,G)}catch{}return!0}finally{J.p=V,W.T=D,sz(g,A)}}function oz(g,A,C){A=cl(C,A),A=hT(g.stateNode,A,2),g=wh(g,A,2),g!==null&&(Mn(g,2),Qc(g))}function kr(g,A,C){if(g.tag===3)oz(g,g,C);else for(;A!==null;){if(A.tag===3){oz(A,g,C);break}else if(A.tag===1){var D=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Ph===null||!Ph.has(D))){g=cl(C,g),C=lQ(2),D=wh(A,C,2),D!==null&&(cQ(C,D,A,g),Mn(D,2),Qc(D));break}}A=A.return}}function LT(g,A,C){var D=g.pingCache;if(D===null){D=g.pingCache=new YSe;var V=new Set;D.set(A,V)}else V=D.get(A),V===void 0&&(V=new Set,D.set(A,V));V.has(C)||(PT=!0,V.add(C),g=nwe.bind(null,g,A,C),A.then(g,g))}function nwe(g,A,C){var D=g.pingCache;D!==null&&D.delete(A),g.pingedLanes|=g.suspendedLanes&C,g.warmLanes&=~C,Hr===g&&(Gn&C)===C&&(Mi===4||Mi===3&&(Gn&62914560)===Gn&&300>Ze()-tO?(mr&2)===0&&Pm(g,0):MT|=C,Em===Gn&&(Em=0)),Qc(g)}function lz(g,A){A===0&&(A=ln()),g=tp(g,A),g!==null&&(Mn(g,A),Qc(g))}function rwe(g){var A=g.memoizedState,C=0;A!==null&&(C=A.retryLane),lz(g,C)}function iwe(g,A){var C=0;switch(g.tag){case 31:case 13:var D=g.stateNode,V=g.memoizedState;V!==null&&(C=V.retryLane);break;case 19:D=g.stateNode;break;case 22:D=g.stateNode._retryCache;break;default:throw Error(r(314))}D!==null&&D.delete(A),lz(g,C)}function swe(g,A){return Ce(g,A)}var lO=null,Nm=null,FT=!1,cO=!1,$T=!1,Dh=0;function Qc(g){g!==Nm&&g.next===null&&(Nm===null?lO=Nm=g:Nm=Nm.next=g),cO=!0,FT||(FT=!0,owe())}function Nx(g,A){if(!$T&&cO){$T=!0;do for(var C=!1,D=lO;D!==null;){if(g!==0){var V=D.pendingLanes;if(V===0)var G=0;else{var ae=D.suspendedLanes,de=D.pingedLanes;G=(1<<31-At(42|g)+1)-1,G&=V&~(ae&~de),G=G&201326741?G&201326741|1:G?G|2:0}G!==0&&(C=!0,hz(D,G))}else G=Gn,G=ze(D,D===Hr?G:0,D.cancelPendingCommit!==null||D.timeoutHandle!==-1),(G&3)===0||st(D,G)||(C=!0,hz(D,G));D=D.next}while(C);$T=!1}}function awe(){cz()}function cz(){cO=FT=!1;var g=0;Dh!==0&&ywe()&&(g=Dh);for(var A=Ze(),C=null,D=lO;D!==null;){var V=D.next,G=uz(D,A);G===0?(D.next=null,C===null?lO=V:C.next=V,V===null&&(Nm=C)):(C=D,(g!==0||(G&3)!==0)&&(cO=!0)),D=V}ps!==0&&ps!==5||Nx(g),Dh!==0&&(Dh=0)}function uz(g,A){for(var C=g.suspendedLanes,D=g.pingedLanes,V=g.expirationTimes,G=g.pendingLanes&-62914561;0<G;){var ae=31-At(G),de=1<<ae,Ee=V[ae];Ee===-1?((de&C)===0||(de&D)!==0)&&(V[ae]=Gt(de,A)):Ee<=A&&(g.expiredLanes|=de),G&=~de}if(A=Hr,C=Gn,C=ze(g,g===A?C:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),D=g.callbackNode,C===0||g===A&&(Cr===2||Cr===9)||g.cancelPendingCommit!==null)return D!==null&&D!==null&&Me(D),g.callbackNode=null,g.callbackPriority=0;if((C&3)===0||st(g,C)){if(A=C&-C,A===g.callbackPriority)return A;switch(D!==null&&Me(D),jn(C)){case 2:case 8:C=it;break;case 32:C=vt;break;case 268435456:C=Kt;break;default:C=vt}return D=fz.bind(null,g),C=Ce(C,D),g.callbackPriority=A,g.callbackNode=C,A}return D!==null&&D!==null&&Me(D),g.callbackPriority=2,g.callbackNode=null,2}function fz(g,A){if(ps!==0&&ps!==5)return g.callbackNode=null,g.callbackPriority=0,null;var C=g.callbackNode;if(oO()&&g.callbackNode!==C)return null;var D=Gn;return D=ze(g,g===Hr?D:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),D===0?null:(GQ(g,D,A),uz(g,Ze()),g.callbackNode!=null&&g.callbackNode===C?fz.bind(null,g):null)}function hz(g,A){if(oO())return null;GQ(g,A,!0)}function owe(){bwe(function(){(mr&6)!==0?Ce(pt,awe):cz()})}function BT(){if(Dh===0){var g=gm;g===0&&(g=Ye,Ye<<=1,(Ye&261888)===0&&(Ye=256)),Dh=g}return Dh}function dz(g){return g==null||typeof g=="symbol"||typeof g=="boolean"?null:typeof g=="function"?g:Br(""+g)}function pz(g,A){var C=A.ownerDocument.createElement("input");return C.name=A.name,C.value=A.value,g.id&&C.setAttribute("form",g.id),A.parentNode.insertBefore(C,A),g=new FormData(g),C.parentNode.removeChild(C),g}function lwe(g,A,C,D,V){if(A==="submit"&&C&&C.stateNode===V){var G=dz((V[Ht]||null).action),ae=D.submitter;ae&&(A=(A=ae[Ht]||null)?dz(A.formAction):ae.getAttribute("formAction"),A!==null&&(G=A,ae=null));var de=new qd("action","action",null,D,V);g.push({event:de,listeners:[{instance:null,listener:function(){if(D.defaultPrevented){if(Dh!==0){var Ee=ae?pz(V,ae):new FormData(V);aT(C,{pending:!0,data:Ee,method:V.method,action:G},null,Ee)}}else typeof G=="function"&&(de.preventDefault(),Ee=ae?pz(V,ae):new FormData(V),aT(C,{pending:!0,data:Ee,method:V.method,action:G},G,Ee))},currentTarget:V}]})}}for(var VT=0;VT<w5.length;VT++){var HT=w5[VT],cwe=HT.toLowerCase(),uwe=HT[0].toUpperCase()+HT.slice(1);ql(cwe,"on"+uwe)}ql(ZV,"onAnimationEnd"),ql(GV,"onAnimationIteration"),ql(UV,"onAnimationStart"),ql("dblclick","onDoubleClick"),ql("focusin","onFocus"),ql("focusout","onBlur"),ql(kSe,"onTransitionRun"),ql(ESe,"onTransitionStart"),ql(TSe,"onTransitionCancel"),ql(XV,"onTransitionEnd"),gn("onMouseEnter",["mouseout","mouseover"]),gn("onMouseLeave",["mouseout","mouseover"]),gn("onPointerEnter",["pointerout","pointerover"]),gn("onPointerLeave",["pointerout","pointerover"]),wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dx="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(" "),fwe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dx));function mz(g,A){A=(A&4)!==0;for(var C=0;C<g.length;C++){var D=g[C],V=D.event;D=D.listeners;e:{var G=void 0;if(A)for(var ae=D.length-1;0<=ae;ae--){var de=D[ae],Ee=de.instance,Le=de.currentTarget;if(de=de.listener,Ee!==G&&V.isPropagationStopped())break e;G=de,V.currentTarget=Le;try{G(V)}catch(Ge){Ow(Ge)}V.currentTarget=null,G=Ee}else for(ae=0;ae<D.length;ae++){if(de=D[ae],Ee=de.instance,Le=de.currentTarget,de=de.listener,Ee!==G&&V.isPropagationStopped())break e;G=de,V.currentTarget=Le;try{G(V)}catch(Ge){Ow(Ge)}V.currentTarget=null,G=Ee}}}}function Hn(g,A){var C=A[er];C===void 0&&(C=A[er]=new Set);var D=g+"__bubble";C.has(D)||(gz(A,g,2,!1),C.add(D))}function QT(g,A,C){var D=0;A&&(D|=4),gz(C,g,D,A)}var uO="_reactListening"+Math.random().toString(36).slice(2);function zT(g){if(!g[uO]){g[uO]=!0,ur.forEach(function(C){C!=="selectionchange"&&(fwe.has(C)||QT(C,!1,g),QT(C,!0,g))});var A=g.nodeType===9?g:g.ownerDocument;A===null||A[uO]||(A[uO]=!0,QT("selectionchange",!1,A))}}function gz(g,A,C,D){switch(Zz(A)){case 2:var V=$we;break;case 8:V=Bwe;break;default:V=sP}C=V.bind(null,A,C,g),V=void 0,!Ru||A!=="touchstart"&&A!=="touchmove"&&A!=="wheel"||(V=!0),D?V!==void 0?g.addEventListener(A,C,{capture:!0,passive:V}):g.addEventListener(A,C,!0):V!==void 0?g.addEventListener(A,C,{passive:V}):g.addEventListener(A,C,!1)}function ZT(g,A,C,D,V){var G=D;if((A&1)===0&&(A&2)===0&&D!==null)e:for(;;){if(D===null)return;var ae=D.tag;if(ae===3||ae===4){var de=D.stateNode.containerInfo;if(de===V)break;if(ae===4)for(ae=D.return;ae!==null;){var Ee=ae.tag;if((Ee===3||Ee===4)&&ae.stateNode.containerInfo===V)return;ae=ae.return}for(;de!==null;){if(ae=On(de),ae===null)return;if(Ee=ae.tag,Ee===5||Ee===6||Ee===26||Ee===27){D=G=ae;continue e}de=de.parentNode}}D=D.return}Xl(function(){var Le=G,Ge=Iu(C),Xe=[];e:{var Fe=WV.get(g);if(Fe!==void 0){var He=qd,jt=g;switch(g){case"keypress":if(tm(C)===0)break e;case"keydown":case"keyup":He=te;break;case"focusin":jt="focus",He=Wy;break;case"focusout":jt="blur",He=Wy;break;case"beforeblur":case"afterblur":He=Wy;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":He=Uy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=h5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=R;break;case ZV:case GV:case UV:He=qy;break;case XV:He=oe;break;case"scroll":case"scrollend":He=u5;break;case"wheel":He=ye;break;case"copy":case"cut":case"paste":He=m5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=S;break;case"toggle":case"beforetoggle":He=ke}var sn=(A&4)!==0,Ir=!sn&&(g==="scroll"||g==="scrollend"),Ie=sn?Fe!==null?Fe+"Capture":null:Fe;sn=[];for(var Ne=Le,je;Ne!==null;){var Ue=Ne;if(je=Ue.stateNode,Ue=Ue.tag,Ue!==5&&Ue!==26&&Ue!==27||je===null||Ie===null||(Ue=Wl(Ne,Ie),Ue!=null&&sn.push(Ix(Ne,Ue,je))),Ir)break;Ne=Ne.return}0<sn.length&&(Fe=new He(Fe,jt,null,C,Ge),Xe.push({event:Fe,listeners:sn}))}}if((A&7)===0){e:{if(Fe=g==="mouseover"||g==="pointerover",He=g==="mouseout"||g==="pointerout",Fe&&C!==Lc&&(jt=C.relatedTarget||C.fromElement)&&(On(jt)||jt[dn]))break e;if((He||Fe)&&(Fe=Ge.window===Ge?Ge:(Fe=Ge.ownerDocument)?Fe.defaultView||Fe.parentWindow:window,He?(jt=C.relatedTarget||C.toElement,He=Le,jt=jt?On(jt):null,jt!==null&&(Ir=s(jt),sn=jt.tag,jt!==Ir||sn!==5&&sn!==27&&sn!==6)&&(jt=null)):(He=null,jt=Le),He!==jt)){if(sn=Uy,Ue="onMouseLeave",Ie="onMouseEnter",Ne="mouse",(g==="pointerout"||g==="pointerover")&&(sn=S,Ue="onPointerLeave",Ie="onPointerEnter",Ne="pointer"),Ir=He==null?Fe:xt(He),je=jt==null?Fe:xt(jt),Fe=new sn(Ue,Ne+"leave",He,C,Ge),Fe.target=Ir,Fe.relatedTarget=je,Ue=null,On(Ge)===Le&&(sn=new sn(Ie,Ne+"enter",jt,C,Ge),sn.target=je,sn.relatedTarget=Ir,Ue=sn),Ir=Ue,He&&jt)t:{for(sn=hwe,Ie=He,Ne=jt,je=0,Ue=Ie;Ue;Ue=sn(Ue))je++;Ue=0;for(var Wt=Ne;Wt;Wt=sn(Wt))Ue++;for(;0<je-Ue;)Ie=sn(Ie),je--;for(;0<Ue-je;)Ne=sn(Ne),Ue--;for(;je--;){if(Ie===Ne||Ne!==null&&Ie===Ne.alternate){sn=Ie;break t}Ie=sn(Ie),Ne=sn(Ne)}sn=null}else sn=null;He!==null&&yz(Xe,Fe,He,sn,!1),jt!==null&&Ir!==null&&yz(Xe,Ir,jt,sn,!0)}}e:{if(Fe=Le?xt(Le):window,He=Fe.nodeName&&Fe.nodeName.toLowerCase(),He==="select"||He==="input"&&Fe.type==="file")var fr=Jy;else if(Yy(Fe))if(ex)fr=Aw;else{fr=bw;var Bt=xw}else He=Fe.nodeName,!He||He.toLowerCase()!=="input"||Fe.type!=="checkbox"&&Fe.type!=="radio"?Le&&bi(Le.elementType)&&(fr=Jy):fr=vw;if(fr&&(fr=fr(g,Le))){Ky(Xe,fr,C,Ge);break e}Bt&&Bt(g,Fe,Le),g==="focusout"&&Le&&Fe.type==="number"&&Le.memoizedProps.value!=null&&Ae(Fe,"number",Fe.value)}switch(Bt=Le?xt(Le):window,g){case"focusin":(Yy(Bt)||Bt.contentEditable==="true")&&(Lu=Bt,v5=Le,lx=null);break;case"focusout":lx=v5=Lu=null;break;case"mousedown":A5=!0;break;case"contextmenu":case"mouseup":case"dragend":A5=!1,QV(Xe,C,Ge);break;case"selectionchange":if(ww)break;case"keydown":case"keyup":QV(Xe,C,Ge)}var Pn;if(nt)e:{switch(g){case"compositionstart":var Un="onCompositionStart";break e;case"compositionend":Un="onCompositionEnd";break e;case"compositionupdate":Un="onCompositionUpdate";break e}Un=void 0}else Ca?xr(g,C)&&(Un="onCompositionEnd"):g==="keydown"&&C.keyCode===229&&(Un="onCompositionStart");Un&&(Bn&&C.locale!=="ko"&&(Ca||Un!=="onCompositionStart"?Un==="onCompositionEnd"&&Ca&&(Pn=fh()):(lt=Ge,kt="value"in lt?lt.value:lt.textContent,Ca=!0)),Bt=fO(Le,Un),0<Bt.length&&(Un=new dw(Un,g,null,C,Ge),Xe.push({event:Un,listeners:Bt}),Pn?Un.data=Pn:(Pn=$c(C),Pn!==null&&(Un.data=Pn)))),(Pn=Nt?pw(g,C):mw(g,C))&&(Un=fO(Le,"onBeforeInput"),0<Un.length&&(Bt=new dw("onBeforeInput","beforeinput",null,C,Ge),Xe.push({event:Bt,listeners:Un}),Bt.data=Pn)),lwe(Xe,g,Le,C,Ge)}mz(Xe,A)})}function Ix(g,A,C){return{instance:g,listener:A,currentTarget:C}}function fO(g,A){for(var C=A+"Capture",D=[];g!==null;){var V=g,G=V.stateNode;if(V=V.tag,V!==5&&V!==26&&V!==27||G===null||(V=Wl(g,C),V!=null&&D.unshift(Ix(g,V,G)),V=Wl(g,A),V!=null&&D.push(Ix(g,V,G))),g.tag===3)return D;g=g.return}return[]}function hwe(g){if(g===null)return null;do g=g.return;while(g&&g.tag!==5&&g.tag!==27);return g||null}function yz(g,A,C,D,V){for(var G=A._reactName,ae=[];C!==null&&C!==D;){var de=C,Ee=de.alternate,Le=de.stateNode;if(de=de.tag,Ee!==null&&Ee===D)break;de!==5&&de!==26&&de!==27||Le===null||(Ee=Le,V?(Le=Wl(C,G),Le!=null&&ae.unshift(Ix(C,Le,Ee))):V||(Le=Wl(C,G),Le!=null&&ae.push(Ix(C,Le,Ee)))),C=C.return}ae.length!==0&&g.push({event:A,listeners:ae})}var dwe=/\r\n?/g,pwe=/\u0000|\uFFFD/g;function xz(g){return(typeof g=="string"?g:""+g).replace(dwe,`
|
|
49
|
-
`).replace(pwe,"")}function bz(g,A){return A=xz(A),xz(g)===A}function Dr(g,A,C,D,V,G){switch(C){case"children":typeof D=="string"?A==="body"||A==="textarea"&&D===""||en(g,D):(typeof D=="number"||typeof D=="bigint")&&A!=="body"&&en(g,""+D);break;case"className":cn(g,"class",D);break;case"tabIndex":cn(g,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":cn(g,C,D);break;case"style":or(g,D,G);break;case"data":if(A!=="object"){cn(g,"data",D);break}case"src":case"href":if(D===""&&(A!=="a"||C!=="href")){g.removeAttribute(C);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){g.removeAttribute(C);break}D=Br(""+D),g.setAttribute(C,D);break;case"action":case"formAction":if(typeof D=="function"){g.setAttribute(C,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof G=="function"&&(C==="formAction"?(A!=="input"&&Dr(g,A,"name",V.name,V,null),Dr(g,A,"formEncType",V.formEncType,V,null),Dr(g,A,"formMethod",V.formMethod,V,null),Dr(g,A,"formTarget",V.formTarget,V,null)):(Dr(g,A,"encType",V.encType,V,null),Dr(g,A,"method",V.method,V,null),Dr(g,A,"target",V.target,V,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){g.removeAttribute(C);break}D=Br(""+D),g.setAttribute(C,D);break;case"onClick":D!=null&&(g.onclick=vs);break;case"onScroll":D!=null&&Hn("scroll",g);break;case"onScrollEnd":D!=null&&Hn("scrollend",g);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(C=D.__html,C!=null){if(V.children!=null)throw Error(r(60));g.innerHTML=C}}break;case"multiple":g.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":g.muted=D&&typeof D!="function"&&typeof D!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(D==null||typeof D=="function"||typeof D=="boolean"||typeof D=="symbol"){g.removeAttribute("xlink:href");break}C=Br(""+D),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",C);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":D!=null&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,""+D):g.removeAttribute(C);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":D&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,""):g.removeAttribute(C);break;case"capture":case"download":D===!0?g.setAttribute(C,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,D):g.removeAttribute(C);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?g.setAttribute(C,D):g.removeAttribute(C);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?g.removeAttribute(C):g.setAttribute(C,D);break;case"popover":Hn("beforetoggle",g),Hn("toggle",g),ni(g,"popover",D);break;case"xlinkActuate":Cn(g,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Cn(g,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Cn(g,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Cn(g,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Cn(g,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Cn(g,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":ni(g,"is",D);break;case"innerText":case"textContent":break;default:(!(2<C.length)||C[0]!=="o"&&C[0]!=="O"||C[1]!=="n"&&C[1]!=="N")&&(C=ds.get(C)||C,ni(g,C,D))}}function GT(g,A,C,D,V,G){switch(C){case"style":or(g,D,G);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(C=D.__html,C!=null){if(V.children!=null)throw Error(r(60));g.innerHTML=C}}break;case"children":typeof D=="string"?en(g,D):(typeof D=="number"||typeof D=="bigint")&&en(g,""+D);break;case"onScroll":D!=null&&Hn("scroll",g);break;case"onScrollEnd":D!=null&&Hn("scrollend",g);break;case"onClick":D!=null&&(g.onclick=vs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dt.hasOwnProperty(C))e:{if(C[0]==="o"&&C[1]==="n"&&(V=C.endsWith("Capture"),A=C.slice(2,V?C.length-7:void 0),G=g[Ht]||null,G=G!=null?G[C]:null,typeof G=="function"&&g.removeEventListener(A,G,V),typeof D=="function")){typeof G!="function"&&G!==null&&(C in g?g[C]=null:g.hasAttribute(C)&&g.removeAttribute(C)),g.addEventListener(A,D,V);break e}C in g?g[C]=D:D===!0?g.setAttribute(C,""):ni(g,C,D)}}}function $s(g,A,C){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Hn("error",g),Hn("load",g);var D=!1,V=!1,G;for(G in C)if(C.hasOwnProperty(G)){var ae=C[G];if(ae!=null)switch(G){case"src":D=!0;break;case"srcSet":V=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,A));default:Dr(g,A,G,ae,C,null)}}V&&Dr(g,A,"srcSet",C.srcSet,C,null),D&&Dr(g,A,"src",C.src,C,null);return;case"input":Hn("invalid",g);var de=G=ae=V=null,Ee=null,Le=null;for(D in C)if(C.hasOwnProperty(D)){var Ge=C[D];if(Ge!=null)switch(D){case"name":V=Ge;break;case"type":ae=Ge;break;case"checked":Ee=Ge;break;case"defaultChecked":Le=Ge;break;case"value":G=Ge;break;case"defaultValue":de=Ge;break;case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(r(137,A));break;default:Dr(g,A,D,Ge,C,null)}}ft(g,G,de,Ee,Le,ae,V,!1);return;case"select":Hn("invalid",g),D=ae=G=null;for(V in C)if(C.hasOwnProperty(V)&&(de=C[V],de!=null))switch(V){case"value":G=de;break;case"defaultValue":ae=de;break;case"multiple":D=de;default:Dr(g,A,V,de,C,null)}A=G,C=ae,g.multiple=!!D,A!=null?_e(g,!!D,A,!1):C!=null&&_e(g,!!D,C,!0);return;case"textarea":Hn("invalid",g),G=V=D=null;for(ae in C)if(C.hasOwnProperty(ae)&&(de=C[ae],de!=null))switch(ae){case"value":D=de;break;case"defaultValue":V=de;break;case"children":G=de;break;case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(91));break;default:Dr(g,A,ae,de,C,null)}bt(g,D,V,G);return;case"option":for(Ee in C)if(C.hasOwnProperty(Ee)&&(D=C[Ee],D!=null))switch(Ee){case"selected":g.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Dr(g,A,Ee,D,C,null)}return;case"dialog":Hn("beforetoggle",g),Hn("toggle",g),Hn("cancel",g),Hn("close",g);break;case"iframe":case"object":Hn("load",g);break;case"video":case"audio":for(D=0;D<Dx.length;D++)Hn(Dx[D],g);break;case"image":Hn("error",g),Hn("load",g);break;case"details":Hn("toggle",g);break;case"embed":case"source":case"link":Hn("error",g),Hn("load",g);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Le in C)if(C.hasOwnProperty(Le)&&(D=C[Le],D!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,A));default:Dr(g,A,Le,D,C,null)}return;default:if(bi(A)){for(Ge in C)C.hasOwnProperty(Ge)&&(D=C[Ge],D!==void 0&>(g,A,Ge,D,C,void 0));return}}for(de in C)C.hasOwnProperty(de)&&(D=C[de],D!=null&&Dr(g,A,de,D,C,null))}function mwe(g,A,C,D){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var V=null,G=null,ae=null,de=null,Ee=null,Le=null,Ge=null;for(He in C){var Xe=C[He];if(C.hasOwnProperty(He)&&Xe!=null)switch(He){case"checked":break;case"value":break;case"defaultValue":Ee=Xe;default:D.hasOwnProperty(He)||Dr(g,A,He,null,D,Xe)}}for(var Fe in D){var He=D[Fe];if(Xe=C[Fe],D.hasOwnProperty(Fe)&&(He!=null||Xe!=null))switch(Fe){case"type":G=He;break;case"name":V=He;break;case"checked":Le=He;break;case"defaultChecked":Ge=He;break;case"value":ae=He;break;case"defaultValue":de=He;break;case"children":case"dangerouslySetInnerHTML":if(He!=null)throw Error(r(137,A));break;default:He!==Xe&&Dr(g,A,Fe,He,D,Xe)}}Sa(g,ae,de,Ee,Le,Ge,G,V);return;case"select":He=ae=de=Fe=null;for(G in C)if(Ee=C[G],C.hasOwnProperty(G)&&Ee!=null)switch(G){case"value":break;case"multiple":He=Ee;default:D.hasOwnProperty(G)||Dr(g,A,G,null,D,Ee)}for(V in D)if(G=D[V],Ee=C[V],D.hasOwnProperty(V)&&(G!=null||Ee!=null))switch(V){case"value":Fe=G;break;case"defaultValue":de=G;break;case"multiple":ae=G;default:G!==Ee&&Dr(g,A,V,G,D,Ee)}A=de,C=ae,D=He,Fe!=null?_e(g,!!C,Fe,!1):!!D!=!!C&&(A!=null?_e(g,!!C,A,!0):_e(g,!!C,C?[]:"",!1));return;case"textarea":He=Fe=null;for(de in C)if(V=C[de],C.hasOwnProperty(de)&&V!=null&&!D.hasOwnProperty(de))switch(de){case"value":break;case"children":break;default:Dr(g,A,de,null,D,V)}for(ae in D)if(V=D[ae],G=C[ae],D.hasOwnProperty(ae)&&(V!=null||G!=null))switch(ae){case"value":Fe=V;break;case"defaultValue":He=V;break;case"children":break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:V!==G&&Dr(g,A,ae,V,D,G)}ot(g,Fe,He);return;case"option":for(var jt in C)if(Fe=C[jt],C.hasOwnProperty(jt)&&Fe!=null&&!D.hasOwnProperty(jt))switch(jt){case"selected":g.selected=!1;break;default:Dr(g,A,jt,null,D,Fe)}for(Ee in D)if(Fe=D[Ee],He=C[Ee],D.hasOwnProperty(Ee)&&Fe!==He&&(Fe!=null||He!=null))switch(Ee){case"selected":g.selected=Fe&&typeof Fe!="function"&&typeof Fe!="symbol";break;default:Dr(g,A,Ee,Fe,D,He)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var sn in C)Fe=C[sn],C.hasOwnProperty(sn)&&Fe!=null&&!D.hasOwnProperty(sn)&&Dr(g,A,sn,null,D,Fe);for(Le in D)if(Fe=D[Le],He=C[Le],D.hasOwnProperty(Le)&&Fe!==He&&(Fe!=null||He!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(r(137,A));break;default:Dr(g,A,Le,Fe,D,He)}return;default:if(bi(A)){for(var Ir in C)Fe=C[Ir],C.hasOwnProperty(Ir)&&Fe!==void 0&&!D.hasOwnProperty(Ir)&>(g,A,Ir,void 0,D,Fe);for(Ge in D)Fe=D[Ge],He=C[Ge],!D.hasOwnProperty(Ge)||Fe===He||Fe===void 0&&He===void 0||GT(g,A,Ge,Fe,D,He);return}}for(var Ie in C)Fe=C[Ie],C.hasOwnProperty(Ie)&&Fe!=null&&!D.hasOwnProperty(Ie)&&Dr(g,A,Ie,null,D,Fe);for(Xe in D)Fe=D[Xe],He=C[Xe],!D.hasOwnProperty(Xe)||Fe===He||Fe==null&&He==null||Dr(g,A,Xe,Fe,D,He)}function vz(g){switch(g){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gwe(){if(typeof performance.getEntriesByType=="function"){for(var g=0,A=0,C=performance.getEntriesByType("resource"),D=0;D<C.length;D++){var V=C[D],G=V.transferSize,ae=V.initiatorType,de=V.duration;if(G&&de&&vz(ae)){for(ae=0,de=V.responseEnd,D+=1;D<C.length;D++){var Ee=C[D],Le=Ee.startTime;if(Le>de)break;var Ge=Ee.transferSize,Xe=Ee.initiatorType;Ge&&vz(Xe)&&(Ee=Ee.responseEnd,ae+=Ge*(Ee<de?1:(de-Le)/(Ee-Le)))}if(--D,A+=8*(G+ae)/(V.duration/1e3),g++,10<g)break}}if(0<g)return A/g/1e6}return navigator.connection&&(g=navigator.connection.downlink,typeof g=="number")?g:5}var UT=null,XT=null;function hO(g){return g.nodeType===9?g:g.ownerDocument}function Az(g){switch(g){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sz(g,A){if(g===0)switch(A){case"svg":return 1;case"math":return 2;default:return 0}return g===1&&A==="foreignObject"?0:g}function WT(g,A){return g==="textarea"||g==="noscript"||typeof A.children=="string"||typeof A.children=="number"||typeof A.children=="bigint"||typeof A.dangerouslySetInnerHTML=="object"&&A.dangerouslySetInnerHTML!==null&&A.dangerouslySetInnerHTML.__html!=null}var qT=null;function ywe(){var g=window.event;return g&&g.type==="popstate"?g===qT?!1:(qT=g,!0):(qT=null,!1)}var wz=typeof setTimeout=="function"?setTimeout:void 0,xwe=typeof clearTimeout=="function"?clearTimeout:void 0,Oz=typeof Promise=="function"?Promise:void 0,bwe=typeof queueMicrotask=="function"?queueMicrotask:typeof Oz<"u"?function(g){return Oz.resolve(null).then(g).catch(vwe)}:wz;function vwe(g){setTimeout(function(){throw g})}function Ih(g){return g==="head"}function Cz(g,A){var C=A,D=0;do{var V=C.nextSibling;if(g.removeChild(C),V&&V.nodeType===8)if(C=V.data,C==="/$"||C==="/&"){if(D===0){g.removeChild(V),Rm(A);return}D--}else if(C==="$"||C==="$?"||C==="$~"||C==="$!"||C==="&")D++;else if(C==="html")_x(g.ownerDocument.documentElement);else if(C==="head"){C=g.ownerDocument.head,_x(C);for(var G=C.firstChild;G;){var ae=G.nextSibling,de=G.nodeName;G[gt]||de==="SCRIPT"||de==="STYLE"||de==="LINK"&&G.rel.toLowerCase()==="stylesheet"||C.removeChild(G),G=ae}}else C==="body"&&_x(g.ownerDocument.body);C=V}while(C);Rm(A)}function kz(g,A){var C=g;g=0;do{var D=C.nextSibling;if(C.nodeType===1?A?(C._stashedDisplay=C.style.display,C.style.display="none"):(C.style.display=C._stashedDisplay||"",C.getAttribute("style")===""&&C.removeAttribute("style")):C.nodeType===3&&(A?(C._stashedText=C.nodeValue,C.nodeValue=""):C.nodeValue=C._stashedText||""),D&&D.nodeType===8)if(C=D.data,C==="/$"){if(g===0)break;g--}else C!=="$"&&C!=="$?"&&C!=="$~"&&C!=="$!"||g++;C=D}while(C)}function YT(g){var A=g.firstChild;for(A&&A.nodeType===10&&(A=A.nextSibling);A;){var C=A;switch(A=A.nextSibling,C.nodeName){case"HTML":case"HEAD":case"BODY":YT(C),nr(C);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(C.rel.toLowerCase()==="stylesheet")continue}g.removeChild(C)}}function Awe(g,A,C,D){for(;g.nodeType===1;){var V=C;if(g.nodeName.toLowerCase()!==A.toLowerCase()){if(!D&&(g.nodeName!=="INPUT"||g.type!=="hidden"))break}else if(D){if(!g[gt])switch(A){case"meta":if(!g.hasAttribute("itemprop"))break;return g;case"link":if(G=g.getAttribute("rel"),G==="stylesheet"&&g.hasAttribute("data-precedence"))break;if(G!==V.rel||g.getAttribute("href")!==(V.href==null||V.href===""?null:V.href)||g.getAttribute("crossorigin")!==(V.crossOrigin==null?null:V.crossOrigin)||g.getAttribute("title")!==(V.title==null?null:V.title))break;return g;case"style":if(g.hasAttribute("data-precedence"))break;return g;case"script":if(G=g.getAttribute("src"),(G!==(V.src==null?null:V.src)||g.getAttribute("type")!==(V.type==null?null:V.type)||g.getAttribute("crossorigin")!==(V.crossOrigin==null?null:V.crossOrigin))&&G&&g.hasAttribute("async")&&!g.hasAttribute("itemprop"))break;return g;default:return g}}else if(A==="input"&&g.type==="hidden"){var G=V.name==null?null:""+V.name;if(V.type==="hidden"&&g.getAttribute("name")===G)return g}else return g;if(g=pl(g.nextSibling),g===null)break}return null}function Swe(g,A,C){if(A==="")return null;for(;g.nodeType!==3;)if((g.nodeType!==1||g.nodeName!=="INPUT"||g.type!=="hidden")&&!C||(g=pl(g.nextSibling),g===null))return null;return g}function Ez(g,A){for(;g.nodeType!==8;)if((g.nodeType!==1||g.nodeName!=="INPUT"||g.type!=="hidden")&&!A||(g=pl(g.nextSibling),g===null))return null;return g}function KT(g){return g.data==="$?"||g.data==="$~"}function JT(g){return g.data==="$!"||g.data==="$?"&&g.ownerDocument.readyState!=="loading"}function wwe(g,A){var C=g.ownerDocument;if(g.data==="$~")g._reactRetry=A;else if(g.data!=="$?"||C.readyState!=="loading")A();else{var D=function(){A(),C.removeEventListener("DOMContentLoaded",D)};C.addEventListener("DOMContentLoaded",D),g._reactRetry=D}}function pl(g){for(;g!=null;g=g.nextSibling){var A=g.nodeType;if(A===1||A===3)break;if(A===8){if(A=g.data,A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"||A==="F!"||A==="F")break;if(A==="/$"||A==="/&")return null}}return g}var eP=null;function Tz(g){g=g.nextSibling;for(var A=0;g;){if(g.nodeType===8){var C=g.data;if(C==="/$"||C==="/&"){if(A===0)return pl(g.nextSibling);A--}else C!=="$"&&C!=="$!"&&C!=="$?"&&C!=="$~"&&C!=="&"||A++}g=g.nextSibling}return null}function Pz(g){g=g.previousSibling;for(var A=0;g;){if(g.nodeType===8){var C=g.data;if(C==="$"||C==="$!"||C==="$?"||C==="$~"||C==="&"){if(A===0)return g;A--}else C!=="/$"&&C!=="/&"||A++}g=g.previousSibling}return null}function Mz(g,A,C){switch(A=hO(C),g){case"html":if(g=A.documentElement,!g)throw Error(r(452));return g;case"head":if(g=A.head,!g)throw Error(r(453));return g;case"body":if(g=A.body,!g)throw Error(r(454));return g;default:throw Error(r(451))}}function _x(g){for(var A=g.attributes;A.length;)g.removeAttributeNode(A[0]);nr(g)}var ml=new Map,Nz=new Set;function dO(g){return typeof g.getRootNode=="function"?g.getRootNode():g.nodeType===9?g:g.ownerDocument}var Ku=J.d;J.d={f:Owe,r:Cwe,D:kwe,C:Ewe,L:Twe,m:Pwe,X:Nwe,S:Mwe,M:Dwe};function Owe(){var g=Ku.f(),A=iO();return g||A}function Cwe(g){var A=_n(g);A!==null&&A.tag===5&&A.type==="form"?XH(A):Ku.r(g)}var Dm=typeof document>"u"?null:document;function Dz(g,A,C){var D=Dm;if(D&&typeof A=="string"&&A){var V=xi(A);V='link[rel="'+g+'"][href="'+V+'"]',typeof C=="string"&&(V+='[crossorigin="'+C+'"]'),Nz.has(V)||(Nz.add(V),g={rel:g,crossOrigin:C,href:A},D.querySelector(V)===null&&(A=D.createElement("link"),$s(A,"link",g),Ct(A),D.head.appendChild(A)))}}function kwe(g){Ku.D(g),Dz("dns-prefetch",g,null)}function Ewe(g,A){Ku.C(g,A),Dz("preconnect",g,A)}function Twe(g,A,C){Ku.L(g,A,C);var D=Dm;if(D&&g&&A){var V='link[rel="preload"][as="'+xi(A)+'"]';A==="image"&&C&&C.imageSrcSet?(V+='[imagesrcset="'+xi(C.imageSrcSet)+'"]',typeof C.imageSizes=="string"&&(V+='[imagesizes="'+xi(C.imageSizes)+'"]')):V+='[href="'+xi(g)+'"]';var G=V;switch(A){case"style":G=Im(g);break;case"script":G=_m(g)}ml.has(G)||(g=f({rel:"preload",href:A==="image"&&C&&C.imageSrcSet?void 0:g,as:A},C),ml.set(G,g),D.querySelector(V)!==null||A==="style"&&D.querySelector(Rx(G))||A==="script"&&D.querySelector(jx(G))||(A=D.createElement("link"),$s(A,"link",g),Ct(A),D.head.appendChild(A)))}}function Pwe(g,A){Ku.m(g,A);var C=Dm;if(C&&g){var D=A&&typeof A.as=="string"?A.as:"script",V='link[rel="modulepreload"][as="'+xi(D)+'"][href="'+xi(g)+'"]',G=V;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":G=_m(g)}if(!ml.has(G)&&(g=f({rel:"modulepreload",href:g},A),ml.set(G,g),C.querySelector(V)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(C.querySelector(jx(G)))return}D=C.createElement("link"),$s(D,"link",g),Ct(D),C.head.appendChild(D)}}}function Mwe(g,A,C){Ku.S(g,A,C);var D=Dm;if(D&&g){var V=Ut(D).hoistableStyles,G=Im(g);A=A||"default";var ae=V.get(G);if(!ae){var de={loading:0,preload:null};if(ae=D.querySelector(Rx(G)))de.loading=5;else{g=f({rel:"stylesheet",href:g,"data-precedence":A},C),(C=ml.get(G))&&tP(g,C);var Ee=ae=D.createElement("link");Ct(Ee),$s(Ee,"link",g),Ee._p=new Promise(function(Le,Ge){Ee.onload=Le,Ee.onerror=Ge}),Ee.addEventListener("load",function(){de.loading|=1}),Ee.addEventListener("error",function(){de.loading|=2}),de.loading|=4,pO(ae,A,D)}ae={type:"stylesheet",instance:ae,count:1,state:de},V.set(G,ae)}}}function Nwe(g,A){Ku.X(g,A);var C=Dm;if(C&&g){var D=Ut(C).hoistableScripts,V=_m(g),G=D.get(V);G||(G=C.querySelector(jx(V)),G||(g=f({src:g,async:!0},A),(A=ml.get(V))&&nP(g,A),G=C.createElement("script"),Ct(G),$s(G,"link",g),C.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},D.set(V,G))}}function Dwe(g,A){Ku.M(g,A);var C=Dm;if(C&&g){var D=Ut(C).hoistableScripts,V=_m(g),G=D.get(V);G||(G=C.querySelector(jx(V)),G||(g=f({src:g,async:!0,type:"module"},A),(A=ml.get(V))&&nP(g,A),G=C.createElement("script"),Ct(G),$s(G,"link",g),C.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},D.set(V,G))}}function Iz(g,A,C,D){var V=(V=ee.current)?dO(V):null;if(!V)throw Error(r(446));switch(g){case"meta":case"title":return null;case"style":return typeof C.precedence=="string"&&typeof C.href=="string"?(A=Im(C.href),C=Ut(V).hoistableStyles,D=C.get(A),D||(D={type:"style",instance:null,count:0,state:null},C.set(A,D)),D):{type:"void",instance:null,count:0,state:null};case"link":if(C.rel==="stylesheet"&&typeof C.href=="string"&&typeof C.precedence=="string"){g=Im(C.href);var G=Ut(V).hoistableStyles,ae=G.get(g);if(ae||(V=V.ownerDocument||V,ae={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},G.set(g,ae),(G=V.querySelector(Rx(g)))&&!G._p&&(ae.instance=G,ae.state.loading=5),ml.has(g)||(C={rel:"preload",as:"style",href:C.href,crossOrigin:C.crossOrigin,integrity:C.integrity,media:C.media,hrefLang:C.hrefLang,referrerPolicy:C.referrerPolicy},ml.set(g,C),G||Iwe(V,g,C,ae.state))),A&&D===null)throw Error(r(528,""));return ae}if(A&&D!==null)throw Error(r(529,""));return null;case"script":return A=C.async,C=C.src,typeof C=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=_m(C),C=Ut(V).hoistableScripts,D=C.get(A),D||(D={type:"script",instance:null,count:0,state:null},C.set(A,D)),D):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,g))}}function Im(g){return'href="'+xi(g)+'"'}function Rx(g){return'link[rel="stylesheet"]['+g+"]"}function _z(g){return f({},g,{"data-precedence":g.precedence,precedence:null})}function Iwe(g,A,C,D){g.querySelector('link[rel="preload"][as="style"]['+A+"]")?D.loading=1:(A=g.createElement("link"),D.preload=A,A.addEventListener("load",function(){return D.loading|=1}),A.addEventListener("error",function(){return D.loading|=2}),$s(A,"link",C),Ct(A),g.head.appendChild(A))}function _m(g){return'[src="'+xi(g)+'"]'}function jx(g){return"script[async]"+g}function Rz(g,A,C){if(A.count++,A.instance===null)switch(A.type){case"style":var D=g.querySelector('style[data-href~="'+xi(C.href)+'"]');if(D)return A.instance=D,Ct(D),D;var V=f({},C,{"data-href":C.href,"data-precedence":C.precedence,href:null,precedence:null});return D=(g.ownerDocument||g).createElement("style"),Ct(D),$s(D,"style",V),pO(D,C.precedence,g),A.instance=D;case"stylesheet":V=Im(C.href);var G=g.querySelector(Rx(V));if(G)return A.state.loading|=4,A.instance=G,Ct(G),G;D=_z(C),(V=ml.get(V))&&tP(D,V),G=(g.ownerDocument||g).createElement("link"),Ct(G);var ae=G;return ae._p=new Promise(function(de,Ee){ae.onload=de,ae.onerror=Ee}),$s(G,"link",D),A.state.loading|=4,pO(G,C.precedence,g),A.instance=G;case"script":return G=_m(C.src),(V=g.querySelector(jx(G)))?(A.instance=V,Ct(V),V):(D=C,(V=ml.get(G))&&(D=f({},C),nP(D,V)),g=g.ownerDocument||g,V=g.createElement("script"),Ct(V),$s(V,"link",D),g.head.appendChild(V),A.instance=V);case"void":return null;default:throw Error(r(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(D=A.instance,A.state.loading|=4,pO(D,C.precedence,g));return A.instance}function pO(g,A,C){for(var D=C.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),V=D.length?D[D.length-1]:null,G=V,ae=0;ae<D.length;ae++){var de=D[ae];if(de.dataset.precedence===A)G=de;else if(G!==V)break}G?G.parentNode.insertBefore(g,G.nextSibling):(A=C.nodeType===9?C.head:C,A.insertBefore(g,A.firstChild))}function tP(g,A){g.crossOrigin==null&&(g.crossOrigin=A.crossOrigin),g.referrerPolicy==null&&(g.referrerPolicy=A.referrerPolicy),g.title==null&&(g.title=A.title)}function nP(g,A){g.crossOrigin==null&&(g.crossOrigin=A.crossOrigin),g.referrerPolicy==null&&(g.referrerPolicy=A.referrerPolicy),g.integrity==null&&(g.integrity=A.integrity)}var mO=null;function jz(g,A,C){if(mO===null){var D=new Map,V=mO=new Map;V.set(C,D)}else V=mO,D=V.get(C),D||(D=new Map,V.set(C,D));if(D.has(g))return D;for(D.set(g,null),C=C.getElementsByTagName(g),V=0;V<C.length;V++){var G=C[V];if(!(G[gt]||G[hn]||g==="link"&&G.getAttribute("rel")==="stylesheet")&&G.namespaceURI!=="http://www.w3.org/2000/svg"){var ae=G.getAttribute(A)||"";ae=g+ae;var de=D.get(ae);de?de.push(G):D.set(ae,[G])}}return D}function Lz(g,A,C){g=g.ownerDocument||g,g.head.insertBefore(C,A==="title"?g.querySelector("head > title"):null)}function _we(g,A,C){if(C===1||A.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;switch(A.rel){case"stylesheet":return g=A.disabled,typeof A.precedence=="string"&&g==null;default:return!0}case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function Fz(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function Rwe(g,A,C,D){if(C.type==="stylesheet"&&(typeof D.media!="string"||matchMedia(D.media).matches!==!1)&&(C.state.loading&4)===0){if(C.instance===null){var V=Im(D.href),G=A.querySelector(Rx(V));if(G){A=G._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(g.count++,g=gO.bind(g),A.then(g,g)),C.state.loading|=4,C.instance=G,Ct(G);return}G=A.ownerDocument||A,D=_z(D),(V=ml.get(V))&&tP(D,V),G=G.createElement("link"),Ct(G);var ae=G;ae._p=new Promise(function(de,Ee){ae.onload=de,ae.onerror=Ee}),$s(G,"link",D),C.instance=G}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(C,A),(A=C.state.preload)&&(C.state.loading&3)===0&&(g.count++,C=gO.bind(g),A.addEventListener("load",C),A.addEventListener("error",C))}}var rP=0;function jwe(g,A){return g.stylesheets&&g.count===0&&xO(g,g.stylesheets),0<g.count||0<g.imgCount?function(C){var D=setTimeout(function(){if(g.stylesheets&&xO(g,g.stylesheets),g.unsuspend){var G=g.unsuspend;g.unsuspend=null,G()}},6e4+A);0<g.imgBytes&&rP===0&&(rP=62500*gwe());var V=setTimeout(function(){if(g.waitingForImages=!1,g.count===0&&(g.stylesheets&&xO(g,g.stylesheets),g.unsuspend)){var G=g.unsuspend;g.unsuspend=null,G()}},(g.imgBytes>rP?50:800)+A);return g.unsuspend=C,function(){g.unsuspend=null,clearTimeout(D),clearTimeout(V)}}:null}function gO(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xO(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var yO=null;function xO(g,A){g.stylesheets=null,g.unsuspend!==null&&(g.count++,yO=new Map,A.forEach(Lwe,g),yO=null,gO.call(g))}function Lwe(g,A){if(!(A.state.loading&4)){var C=yO.get(g);if(C)var D=C.get(null);else{C=new Map,yO.set(g,C);for(var V=g.querySelectorAll("link[data-precedence],style[data-precedence]"),G=0;G<V.length;G++){var ae=V[G];(ae.nodeName==="LINK"||ae.getAttribute("media")!=="not all")&&(C.set(ae.dataset.precedence,ae),D=ae)}D&&C.set(null,D)}V=A.instance,ae=V.getAttribute("data-precedence"),G=C.get(ae)||D,G===D&&C.set(null,V),C.set(ae,V),this.count++,D=gO.bind(this),V.addEventListener("load",D),V.addEventListener("error",D),G?G.parentNode.insertBefore(V,G.nextSibling):(g=g.nodeType===9?g.head:g,g.insertBefore(V,g.firstChild)),A.state.loading|=4}}var Lx={$$typeof:O,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Fwe(g,A,C,D,V,G,ae,de,Ee){this.tag=1,this.containerInfo=g,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=D,this.onUncaughtError=V,this.onCaughtError=G,this.onRecoverableError=ae,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ee,this.incompleteTransitions=new Map}function $z(g,A,C,D,V,G,ae,de,Ee,Le,Ge,Xe){return g=new Fwe(g,A,C,ae,Ee,Le,Ge,Xe,de),A=1,G===!0&&(A|=24),G=So(3,null,null,A),g.current=G,G.stateNode=g,A=j5(),A.refCount++,g.pooledCache=A,A.refCount++,G.memoizedState={element:D,isDehydrated:C,cache:A},B5(G),g}function Bz(g){return g?(g=fm,g):fm}function Vz(g,A,C,D,V,G){V=Bz(V),D.context===null?D.context=V:D.pendingContext=V,D=Sh(A),D.payload={element:C},G=G===void 0?null:G,G!==null&&(D.callback=G),C=wh(g,D,A),C!==null&&(Ua(C,g,A),mx(C,g,A))}function Hz(g,A){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var C=g.retryLane;g.retryLane=C!==0&&C<A?C:A}}function iP(g,A){Hz(g,A),(g=g.alternate)&&Hz(g,A)}function Qz(g){if(g.tag===13||g.tag===31){var A=tp(g,67108864);A!==null&&Ua(A,g,67108864),iP(g,67108864)}}function zz(g){if(g.tag===13||g.tag===31){var A=Eo();A=En(A);var C=tp(g,A);C!==null&&Ua(C,g,A),iP(g,A)}}var bO=!0;function $we(g,A,C,D){var V=W.T;W.T=null;var G=J.p;try{J.p=2,sP(g,A,C,D)}finally{J.p=G,W.T=V}}function Bwe(g,A,C,D){var V=W.T;W.T=null;var G=J.p;try{J.p=8,sP(g,A,C,D)}finally{J.p=G,W.T=V}}function sP(g,A,C,D){if(bO){var V=aP(D);if(V===null)ZT(g,A,D,vO,C),Gz(g,D);else if(Hwe(V,g,A,C,D))D.stopPropagation();else if(Gz(g,D),A&4&&-1<Vwe.indexOf(g)){for(;V!==null;){var G=_n(V);if(G!==null)switch(G.tag){case 3:if(G=G.stateNode,G.current.memoizedState.isDehydrated){var ae=De(G.pendingLanes);if(ae!==0){var de=G;for(de.pendingLanes|=2,de.entangledLanes|=2;ae;){var Ee=1<<31-At(ae);de.entanglements[1]|=Ee,ae&=~Ee}Qc(G),(mr&6)===0&&(nO=Ze()+500,Nx(0))}}break;case 31:case 13:de=tp(G,2),de!==null&&Ua(de,G,2),iO(),iP(G,2)}if(G=aP(D),G===null&&ZT(g,A,D,vO,C),G===V)break;V=G}V!==null&&D.stopPropagation()}else ZT(g,A,D,null,C)}}function aP(g){return g=Iu(g),oP(g)}var vO=null;function oP(g){if(vO=null,g=On(g),g!==null){var A=s(g);if(A===null)g=null;else{var C=A.tag;if(C===13){if(g=a(A),g!==null)return g;g=null}else if(C===31){if(g=o(A),g!==null)return g;g=null}else if(C===3){if(A.stateNode.current.memoizedState.isDehydrated)return A.tag===3?A.stateNode.containerInfo:null;g=null}else A!==g&&(g=null)}}return vO=g,null}function Zz(g){switch(g){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(qe()){case pt:return 2;case it:return 8;case vt:case Ot:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var lP=!1,_h=null,Rh=null,jh=null,Fx=new Map,$x=new Map,Lh=[],Vwe="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".split(" ");function Gz(g,A){switch(g){case"focusin":case"focusout":_h=null;break;case"dragenter":case"dragleave":Rh=null;break;case"mouseover":case"mouseout":jh=null;break;case"pointerover":case"pointerout":Fx.delete(A.pointerId);break;case"gotpointercapture":case"lostpointercapture":$x.delete(A.pointerId)}}function Bx(g,A,C,D,V,G){return g===null||g.nativeEvent!==G?(g={blockedOn:A,domEventName:C,eventSystemFlags:D,nativeEvent:G,targetContainers:[V]},A!==null&&(A=_n(A),A!==null&&Qz(A)),g):(g.eventSystemFlags|=D,A=g.targetContainers,V!==null&&A.indexOf(V)===-1&&A.push(V),g)}function Hwe(g,A,C,D,V){switch(A){case"focusin":return _h=Bx(_h,g,A,C,D,V),!0;case"dragenter":return Rh=Bx(Rh,g,A,C,D,V),!0;case"mouseover":return jh=Bx(jh,g,A,C,D,V),!0;case"pointerover":var G=V.pointerId;return Fx.set(G,Bx(Fx.get(G)||null,g,A,C,D,V)),!0;case"gotpointercapture":return G=V.pointerId,$x.set(G,Bx($x.get(G)||null,g,A,C,D,V)),!0}return!1}function Uz(g){var A=On(g.target);if(A!==null){var C=s(A);if(C!==null){if(A=C.tag,A===13){if(A=a(C),A!==null){g.blockedOn=A,qn(g.priority,function(){zz(C)});return}}else if(A===31){if(A=o(C),A!==null){g.blockedOn=A,qn(g.priority,function(){zz(C)});return}}else if(A===3&&C.stateNode.current.memoizedState.isDehydrated){g.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}g.blockedOn=null}function AO(g){if(g.blockedOn!==null)return!1;for(var A=g.targetContainers;0<A.length;){var C=aP(g.nativeEvent);if(C===null){C=g.nativeEvent;var D=new C.constructor(C.type,C);Lc=D,C.target.dispatchEvent(D),Lc=null}else return A=_n(C),A!==null&&Qz(A),g.blockedOn=C,!1;A.shift()}return!0}function Xz(g,A,C){AO(g)&&C.delete(A)}function Qwe(){lP=!1,_h!==null&&AO(_h)&&(_h=null),Rh!==null&&AO(Rh)&&(Rh=null),jh!==null&&AO(jh)&&(jh=null),Fx.forEach(Xz),$x.forEach(Xz)}function SO(g,A){g.blockedOn===A&&(g.blockedOn=null,lP||(lP=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Qwe)))}var wO=null;function Wz(g){wO!==g&&(wO=g,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){wO===g&&(wO=null);for(var A=0;A<g.length;A+=3){var C=g[A],D=g[A+1],V=g[A+2];if(typeof D!="function"){if(oP(D||C)===null)continue;break}var G=_n(C);G!==null&&(g.splice(A,3),A-=3,aT(G,{pending:!0,data:V,method:C.method,action:D},D,V))}}))}function Rm(g){function A(Ee){return SO(Ee,g)}_h!==null&&SO(_h,g),Rh!==null&&SO(Rh,g),jh!==null&&SO(jh,g),Fx.forEach(A),$x.forEach(A);for(var C=0;C<Lh.length;C++){var D=Lh[C];D.blockedOn===g&&(D.blockedOn=null)}for(;0<Lh.length&&(C=Lh[0],C.blockedOn===null);)Uz(C),C.blockedOn===null&&Lh.shift();if(C=(g.ownerDocument||g).$$reactFormReplay,C!=null)for(D=0;D<C.length;D+=3){var V=C[D],G=C[D+1],ae=V[Ht]||null;if(typeof G=="function")ae||Wz(C);else if(ae){var de=null;if(G&&G.hasAttribute("formAction")){if(V=G,ae=G[Ht]||null)de=ae.formAction;else if(oP(V)!==null)continue}else de=ae.action;typeof de=="function"?C[D+1]=de:(C.splice(D,3),D-=3),Wz(C)}}}function qz(){function g(G){G.canIntercept&&G.info==="react-transition"&&G.intercept({handler:function(){return new Promise(function(ae){return V=ae})},focusReset:"manual",scroll:"manual"})}function A(){V!==null&&(V(),V=null),D||setTimeout(C,20)}function C(){if(!D&&!navigation.transition){var G=navigation.currentEntry;G&&G.url!=null&&navigation.navigate(G.url,{state:G.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,V=null;return navigation.addEventListener("navigate",g),navigation.addEventListener("navigatesuccess",A),navigation.addEventListener("navigateerror",A),setTimeout(C,100),function(){D=!0,navigation.removeEventListener("navigate",g),navigation.removeEventListener("navigatesuccess",A),navigation.removeEventListener("navigateerror",A),V!==null&&(V(),V=null)}}}function cP(g){this._internalRoot=g}OO.prototype.render=cP.prototype.render=function(g){var A=this._internalRoot;if(A===null)throw Error(r(409));var C=A.current,D=Eo();Vz(C,D,g,A,null,null)},OO.prototype.unmount=cP.prototype.unmount=function(){var g=this._internalRoot;if(g!==null){this._internalRoot=null;var A=g.containerInfo;Vz(g.current,2,null,g,null,null),iO(),A[dn]=null}};function OO(g){this._internalRoot=g}OO.prototype.unstable_scheduleHydration=function(g){if(g){var A=et();g={blockedOn:null,target:g,priority:A};for(var C=0;C<Lh.length&&A!==0&&A<Lh[C].priority;C++);Lh.splice(C,0,g),C===0&&Uz(g)}};var Yz=e.version;if(Yz!=="19.2.6")throw Error(r(527,Yz,"19.2.6"));J.findDOMNode=function(g){var A=g._reactInternals;if(A===void 0)throw typeof g.render=="function"?Error(r(188)):(g=Object.keys(g).join(","),Error(r(268,g)));return g=c(A),g=g!==null?u(g):null,g=g===null?null:g.stateNode,g};var zwe={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var CO=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!CO.isDisabled&&CO.supportsFiber)try{Jt=CO.inject(zwe),Je=CO}catch{}}return Hx.createRoot=function(g,A){if(!i(g))throw Error(r(299));var C=!1,D="",V=iQ,G=sQ,ae=aQ;return A!=null&&(A.unstable_strictMode===!0&&(C=!0),A.identifierPrefix!==void 0&&(D=A.identifierPrefix),A.onUncaughtError!==void 0&&(V=A.onUncaughtError),A.onCaughtError!==void 0&&(G=A.onCaughtError),A.onRecoverableError!==void 0&&(ae=A.onRecoverableError)),A=$z(g,1,!1,null,null,C,D,null,V,G,ae,qz),g[dn]=A.current,zT(g),new cP(A)},Hx.hydrateRoot=function(g,A,C){if(!i(g))throw Error(r(299));var D=!1,V="",G=iQ,ae=sQ,de=aQ,Ee=null;return C!=null&&(C.unstable_strictMode===!0&&(D=!0),C.identifierPrefix!==void 0&&(V=C.identifierPrefix),C.onUncaughtError!==void 0&&(G=C.onUncaughtError),C.onCaughtError!==void 0&&(ae=C.onCaughtError),C.onRecoverableError!==void 0&&(de=C.onRecoverableError),C.formState!==void 0&&(Ee=C.formState)),A=$z(g,1,!0,A,C??null,D,V,Ee,G,ae,de,qz),A.context=Bz(null),C=A.current,D=Eo(),D=En(D),V=Sh(D),V.callback=null,wh(C,V,D),C=D,A.current.lanes=C,Mn(A,C),Qc(A),g[dn]=A.current,zT(g),new OO(A)},Hx.version="19.2.6",Hx}var oZ;function tOe(){if(oZ)return hP.exports;oZ=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),hP.exports=eOe(),hP.exports}var nOe=tOe();function Af(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function qA(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function B7(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}const Bre="hyperframes-studio:anonymousId",Vre="hf-studio-anon-id";let pp=null;function rOe(){try{const t=typeof window>"u"?void 0:window.__HF_CLI_DISTINCT_ID;return typeof t=="string"&&t.length>0?t:null}catch{return null}}function gP(t,e){for(const n of[Bre,Vre])try{t.setItem(n,e)}catch{}}function V7(){if(pp)return pp;const t=qA(),e=rOe();if(e)return pp=e,t&&gP(t,e),e;if(t){let r=null;try{r=t.getItem(Bre)??t.getItem(Vre)}catch{}if(r)return pp=r,gP(t,r),r}else return pp=Af(),pp;const n=Af();return pp=n,gP(t,n),n}const iOe="hyperframes-studio:telemetryDisabled",Hre="hyperframes-studio:telemetryNoticeShown";function Qre(){return V7()}function zre(t){var e;try{return((e=qA())==null?void 0:e.getItem(t))==="1"}catch{return!1}}function sOe(){return zre(iOe)}function aOe(){return zre(Hre)}function oOe(){var t;try{(t=qA())==null||t.setItem(Hre,"1")}catch{}}const Zre="hyperframes-studio:sessionStartFired";function lOe(){var t;return((t=B7())==null?void 0:t.getItem(Zre))==="1"}function cOe(){var t;try{(t=B7())==null||t.setItem(Zre,"1")}catch{}}const uOe="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",fOe="hf-studio-telemetry-opt-out";function hOe(){try{return localStorage.getItem(fOe)==="1"}catch{return!1}}function dOe(){return typeof navigator<"u"&&navigator.doNotTrack==="1"}function pOe(){return uOe.startsWith("phc_")}function mOe(){try{return!1}catch{return!1}}function gOe(){try{return!1}catch{return!1}}function YA(){try{return yOe()}catch{return!1}}function yOe(){return pOe()&&!mOe()&&!gOe()&&!sOe()&&!hOe()&&!dOe()}let jm;function xOe(){if(jm!==void 0)return jm;if(typeof window>"u")return jm=null,jm;const t=window.__HF_CLI_AGENT_RUNTIME;return jm=typeof t=="string"&&t.length>0?t:null,jm}function Gre(){return xOe()??"none"}const bOe={user_agent:"",language:"",screen_width:0,screen_height:0,device_pixel_ratio:0,timezone_offset_minutes:0,is_mobile:!1,studio_version:"dev",agent_runtime:"none"};let Lm=null;function vOe(){if(Lm)return Lm;if(typeof navigator>"u"||typeof window>"u")return Lm=bOe,Lm;const t=navigator.userAgent,e=window.screen;return Lm={user_agent:t,language:navigator.language,screen_width:e.width,screen_height:e.height,device_pixel_ratio:window.devicePixelRatio,timezone_offset_minutes:new Date().getTimezoneOffset(),is_mobile:/Android|iPhone|iPad/i.test(t),studio_version:"0.8.17",agent_runtime:Gre()},Lm}function AOe(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=e+((e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24))>>>0;return e>>>0}function SOe(t,e){return AOe(`${t}:${e}`)%100}function wOe(t){var i;if(t.override===!0)return{enabled:!0,reason:"forced_on"};if(t.override===!1)return{enabled:!1,reason:"forced_off"};const e=Math.max(0,Math.min(100,Math.trunc(t.percentage)));if(e<=0)return{enabled:!1,reason:"out_of_cohort"};if(e>=100)return{enabled:!0,reason:"in_cohort"};if(t.exclude)return{enabled:!1,reason:"excluded"};const n=(i=t.unitId)==null?void 0:i.trim();if(!n)return{enabled:!1,reason:"no_unit_id"};const r=SOe(t.feature,n);return r<e?{enabled:!0,reason:"in_cohort",bucket:r}:{enabled:!1,reason:"out_of_cohort",bucket:r}}function lZ(t){const e=t==null?void 0:t.trim().toLowerCase();if(!(e===void 0||e==="")){if(e==="1"||e==="true"||e==="on"||e==="yes")return!0;if(e==="0"||e==="false"||e==="off"||e==="no")return!1}}const OOe="$feature/canary-";function COe(t){return`${OOe}${t}`}function kOe(t){return`canary_reason_${t.replace(/[^A-Za-z0-9]+/g,"_")}`}function EOe(t){const e={};for(const n of t)e[COe(n.name)]=n.enabled?"true":"false",n.reason!==void 0&&(e[kOe(n.name)]=n.reason);return e}const Ure=[{name:"calibration-10",percentage:10,description:"Inert. Validates rollout accuracy and cumulative-exposure drift at 10%.",owner:"vance",sunsetAfter:"2026-09-15"},{name:"calibration-50",percentage:50,description:"Inert. Second calibration point, and an independence check against calibration-10.",owner:"vance",sunsetAfter:"2026-09-15"}];function TOe(t){return Ure.find(e=>e.name===t)}function POe(t){return`hf_canary_${t.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`}function MOe(t){var e;try{if(typeof window>"u")return;const n=(e=window.__HF_CLI_CANARY_DECISIONS)==null?void 0:e[t];return typeof(n==null?void 0:n.enabled)!="boolean"?void 0:{enabled:n.enabled,forced:n.forced===!0}}catch{return}}function NOe(){try{const t=typeof window>"u"?void 0:window.__HF_CLI_BUCKET_SEED;if(typeof t=="string"&&t.length>0)return t}catch{}return V7()}const DOe="hyperframes-studio:canary:";function IOe(t){if(typeof window>"u")return;const e=POe(t),n=`${DOe}${t}`,r=B7();let i=null;try{i=new URLSearchParams(window.location.search).get(e)}catch{i=null}if(i!==null){if(i.trim().toLowerCase()==="reset"){r==null||r.removeItem(n);return}try{r==null||r.setItem(n,i)}catch{}return lZ(i)}return lZ((r==null?void 0:r.getItem(n))??void 0)}function cZ(){return typeof navigator>"u"?!1:navigator.webdriver===!0}const uZ=new Map,fZ=t=>({enabled:t,reason:t?"forced_on":"forced_off"}),_Oe=t=>({enabled:t,reason:t?"in_cohort":"out_of_cohort"});function ROe(t){const e=TOe(t);if(!e)return{enabled:!1,reason:"out_of_cohort"};const n=MOe(e.name);if(n!=null&&n.forced)return fZ(n.enabled);const r=IOe(e.name);if(r===void 0){if(!YA())return{enabled:!1,reason:"telemetry_opt_out"};if(cZ())return{enabled:!1,reason:"excluded"};if(n!==void 0)return _Oe(n.enabled)}return r!==void 0?fZ(r):wOe({feature:e.name,unitId:NOe(),percentage:e.percentage,exclude:cZ()})}function jOe(t){const e=uZ.get(t);if(e)return e;const n=ROe(t);return uZ.set(t,n),n}function Xre(){return EOe(Ure.map(t=>{const{enabled:e,reason:n}=jOe(t.name);return{name:t.name,enabled:e,reason:n}}))}const LOe=14,FOe=["action","tab","panel","status","mode","reason","format","via"],d4=[],$Oe=Date.now();function BOe(t){for(const e of FOe){const n=t[e];if(typeof n=="string"&&n.length>0&&n.length<=24)return`:${n}`;if(typeof n=="number"||typeof n=="boolean")return`:${String(n)}`}return""}function VOe(t,e){const n=t.replace(/^studio[:_]/,"");d4.push({at:Date.now()-$Oe,label:`${n}${BOe(e)}`}),d4.length>LOe&&d4.shift()}function HOe(){return d4.map(t=>`${(t.at/1e3).toFixed(1)} ${t.label}`).join(" > ")}const QOe="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",zOe="https://us.i.posthog.com",ZOe=1e3;let p4=[],yP=null;function GOe(){return YA()}function Ns(t,e={}){if(!GOe())return;VOe(t,e);const n=vOe();p4.push({event:t,properties:{...e,...n,...Xre()},timestamp:new Date().toISOString()}),yP===null&&(yP=setTimeout(()=>{yP=null,AI()},ZOe)),XOe()}function AI(){if(p4.length===0)return;const t=Qre(),e=p4.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:t,timestamp:n.timestamp}));p4=[],UOe(`${zOe}/batch/`,JSON.stringify({api_key:QOe,batch:e}))}function UOe(t,e){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}).catch(()=>{});return}catch{}try{navigator.sendBeacon(t,new Blob([e],{type:"application/json"}))}catch{}}function XOe(){aOe()||(oOe(),console.info("%c[HyperFrames]%c Anonymous studio usage analytics enabled. Disable: localStorage.setItem('hyperframes-studio:telemetryDisabled','1') (then reload).","color:#7c3aed;font-weight:bold","color:inherit"))}typeof window<"u"&&(window.addEventListener("pagehide",()=>AI(),{capture:!0}),window.addEventListener("visibilitychange",()=>{typeof document<"u"&&document.visibilityState==="hidden"&&AI()}));function WOe(t){Ns("studio_session_start",{has_project:t.has_project})}function qOe(t){Ns("studio_render_start",{fps:t.fps,quality:t.quality,format:t.format,resolution:t.resolution,composition:t.composition})}function YOe(t){Ns("studio_timeline_performance",t)}function KOe(){var t,e;try{const n=navigator,i=[`ua=${((t=n.userAgentData)==null?void 0:t.platform)??navigator.platform??"unknown"}`,`screen=${screen.width}x${screen.height}@${devicePixelRatio}x`,`lang=${navigator.language}`];return n.deviceMemory&&i.push(`mem=${n.deviceMemory}GB`),(e=n.connection)!=null&&e.effectiveType&&i.push(`net=${n.connection.effectiveType}`),navigator.hardwareConcurrency&&i.push(`cpu=${navigator.hardwareConcurrency}cores`),i.join(" ")}catch{return""}}function JOe(t){Ns("studio_razor_split",{mode:t.mode,count:t.count})}function Fm(t){Ns("studio_expanded_clip_edit",{action:t.action})}function hZ(t){Ns("studio_keyframe_lane_expand",{expanded:t.expanded})}function H7(t){Ns("studio_segment_ease_edit",{action:t.action,ease:t.ease})}function e8e(t){Ns("studio_feedback_shown",{reason:t.reason,render_id:t.render_id,source:"studio"})}function t8e(t){Ns("studio_feedback_dismissed",{reason:t.reason,render_id:t.render_id,via:t.via,had_rating:t.had_rating,source:"studio"})}function n8e(t){Ns("studio_feedback_interview_click",{reason:t.reason,source:"studio"})}function r8e(t){Ns("studio_feedback",{...t.rating===void 0?{}:{rating:t.rating,rating_scale:10},...t.comment?{comment:t.comment}:{},...t.context,reason:t.reason,render_id:t.render_id,question:t.question,answer_kind:t.answer_kind,doctor_summary:KOe(),breadcrumbs:HOe(),source:"studio"})}function kO(t){Ns("studio_block_param_commit",{tone:t.tone,block_name:t.blockName,param_key:t.key})}async function i8e(t){try{const e=await t.json();if(typeof e=="object"&&e!==null){const{error:n,hint:r}=e;if(typeof n=="string"&&n)return typeof r=="string"&&r?`${n}. ${r}`:n}}catch{}return`Server error (${t.status}). Check the terminal for details.`}function s8e(t){const e=(t==null?void 0:t.title)??"FFmpeg not found",n=(t==null?void 0:t.command)??(t==null?void 0:t.hint);return n?`${e}. Install it with: ${n}`:`${e}. Install FFmpeg to export.`}let Qx=null;const EO=t=>typeof t=="string"&&t?t:void 0;function a8e(t){if(typeof t!="object"||t===null)return null;const{ok:e,title:n,detail:r,hint:i,command:s}=t;return typeof e!="boolean"?null:{ok:e,title:EO(n),detail:EO(r),hint:EO(i),command:EO(s)}}async function o8e(){try{const t=await fetch("/api/environment/ffmpeg");return t.ok?a8e(await t.json()):null}catch{return null}}function l8e(){const[t,e]=x.useState(Qx),[n,r]=x.useState(Qx===null),i=x.useRef(!0);x.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const s=x.useCallback(async()=>{r(!0);const o=await o8e();Qx=o,i.current&&(e(o),r(!1))},[]);x.useEffect(()=>{Qx===null&&s()},[s]);const a=x.useCallback(()=>{Qx=null,s()},[s]);return{status:t,checking:n,recheck:a}}function dZ(t){return t!=="render_complete"}const pZ=[{id:"remove",prompt:"What would you cut from Studio?",placeholder:"The part you never use",presets:[{label:"Layers panel",hint:"The layer tree on the right"},{label:"Variables panel",hint:"Composition variables on the right"},{label:"Blocks browser",hint:"The block library in the sidebar"},{label:"Storyboard mode",hint:"The storyboard view next to Preview"},{label:"Caption editing",hint:"Editing caption words and presets in Studio"},{label:"Render history",hint:"The list of past exports"},{label:"Nothing",hint:"It all earns its place"}]},{id:"workaround",prompt:"What did you have to do outside Studio?",placeholder:"The step you finished somewhere else",presets:[{label:"Fix the exported file",hint:"Remuxing or re-encoding the output by hand"},{label:"Convert source media",hint:"Re-encoding footage before it would import cleanly"},{label:"Match loudness",hint:"Normalising levels across the finished audio"},{label:"Make images or graphics",hint:"Creating visual assets in another tool"},{label:"Record footage",hint:"Capturing screen or camera video"},{label:"Nothing, it was all here",hint:"No outside tools needed"}]},{id:"fix",prompt:"What should we fix first?",placeholder:"The thing that slowed you down",presets:[{label:"Audio mixing",hint:"Levels, ducking or the balance in the exported mix"},{label:"Export encoding",hint:"The render fails, or the finished file is wrong"},{label:"Export matches preview",hint:"The exported video differs from the preview"},{label:"Media and fonts",hint:"Adding video, images or fonts to a project"},{label:"Render speed",hint:"Exports take too long to finish"},{label:"Re-rendering everything",hint:"A small change means rendering the whole thing"},{label:"Checks and warnings",hint:"Lint flags things that are fine, or misses real ones"}]}],c8e={id:"detractor",prompt:"What went wrong?",placeholder:"The thing that made that a low score",presets:[{label:"Export failed",hint:"The render did not finish"},{label:"Output looked wrong",hint:"It rendered, but not the way I built it"},{label:"Crashed or froze",hint:"The editor stopped responding"},{label:"Lost my edits",hint:"Changes did not save, or came back changed"},{label:"Too slow",hint:"Waiting on renders, or the editor itself lagging"},{label:"Could not figure it out",hint:"Could not find or understand something"}]},u8e=6;function f8e(t){return t<=u8e?c8e:pZ[Math.floor(Math.random()*pZ.length)]}const c6={dismissedAt:"hyperframes-studio:feedbackDismissedAt",answeredAt:"hyperframes-studio:feedbackAnsweredAt"},Wre="hyperframes-studio:feedbackAskedThisSession",qre=864e5,h8e=30*qre,d8e=7*qre;let R2=null;function p8e(){try{return!1}catch{return!1}}function mZ(t){try{return parseInt(window.localStorage.getItem(t)||"0",10)||0}catch{return 0}}function Yre(t,e){try{window.localStorage.setItem(t,String(e))}catch{}}function m8e(){try{return window.sessionStorage.getItem(Wre)==="1"}catch{return!0}}function g8e(){try{window.sessionStorage.setItem(Wre,"1")}catch{}}function y8e(t){return!(p8e()||!YA()||m8e()||t-mZ(c6.answeredAt)<h8e||t-mZ(c6.dismissedAt)<d8e)}function Kre(t){R2&&y8e(Date.now())&&(g8e(),R2(t))}function x8e(t){return R2=t,()=>{R2===t&&(R2=null)}}function b8e(){Yre(c6.answeredAt,Date.now())}function v8e(){Yre(c6.dismissedAt,Date.now())}function Jre(t){return`hf-studio-hidden-renders:${t}`}function gZ(t){try{const e=window.localStorage.getItem(Jre(t)),n=e?JSON.parse(e):[];return new Set(Array.isArray(n)?n.filter(r=>typeof r=="string"):[])}catch{return new Set}}function A8e(t,e){try{window.localStorage.setItem(Jre(t),JSON.stringify([...e].slice(-200)))}catch{}}function S8e(t){const[e,n]=x.useState([]),[r,i]=x.useState(null),[s,a]=x.useState(null),{status:o,checking:l,recheck:c}=l8e(),u=o!==null&&!o.ok,f=x.useRef(null),h=x.useRef(null),m=x.useRef(new Map),y=x.useRef(new Set),d=x.useCallback((I,_)=>{m.current.set(I.id,_),n(j=>[...j,I])},[]),v=x.useCallback(I=>{var _;I&&h.current!==I||((_=f.current)==null||_.close(),f.current=null,h.current=null)},[]),b=x.useCallback(async()=>{if(t)try{const I=await fetch(`/api/projects/${t}/renders`);if(!I.ok){i(`Couldn't load render history (server error ${I.status}).`);return}const _=await I.json();if(i(null),Array.isArray(_.renders)){const j=gZ(t);n(L=>{const B=new Set(L.map(Q=>Q.id)),$=_.renders.filter(Q=>!B.has(Q.id)&&!j.has(Q.id)).map(Q=>({id:Q.id,status:Q.status==="failed"?"failed":"complete",progress:100,filename:Q.filename,createdAt:Q.createdAt,durationMs:Q.durationMs}));return[...L,...$]})}}catch{i("Couldn't load render history. Is the studio server running?")}},[t]);x.useEffect(()=>{b()},[b]);const w=x.useCallback(async(I={})=>{if(!t)return;if(u){d({id:Af(),status:"failed",progress:0,error:s8e(o),filename:"Export blocked",createdAt:Date.now()},{});return}const _=I.fps??30,j=I.quality??"standard",L=I.format??"mp4",B=I.resolution,$=I.composition;qOe({fps:_,quality:j,format:L,resolution:B,composition:$});const Q=Date.now(),Y={render_format:L,render_quality:j,render_fps:_,render_resolution:B??"auto",render_composition:$??"index.html",render_has_variables:!!(I.variables&&Object.keys(I.variables).length>0)},W={fps:_,quality:j,format:L};YA()?W.telemetryDistinctId=Qre():W.telemetryOptOut=!0,B&&B!=="auto"&&(W.resolution=B),$&&(W.composition=$),I.variables&&Object.keys(I.variables).length>0&&(W.variables=I.variables);let J;try{J=await fetch(`/api/projects/${t}/render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})}catch(U){const Z=U instanceof Error?U.message:String(U),K={id:Af(),status:"failed",progress:0,error:`Could not reach render server: ${Z}. Use \`hyperframes render\` from the CLI instead.`,filename:"Export failed",createdAt:Q};d(K,Y);return}if(!J.ok){const U={id:Af(),status:"failed",progress:0,error:await i8e(J),filename:"Export failed",createdAt:Q};d(U,Y);return}const{jobId:ne}=await J.json(),ie={mp4:".mp4",webm:".webm",mov:".mov"}[L]??".mp4",q={id:ne,status:"rendering",progress:0,filename:`${ne}${ie}`,createdAt:Q};d(q,Y),h.current=ne;const F=new EventSource(`/api/render/${ne}/progress`);return f.current=F,F.addEventListener("progress",U=>{try{const Z=JSON.parse(U.data),K=Z.status==="complete"||Z.status==="failed"||Z.status==="cancelled";n(ee=>ee.map(re=>re.id===ne?{...re,progress:Z.progress??re.progress,stage:Z.stage??Z.message??re.stage,status:K?Z.status:re.status,durationMs:Z.status==="complete"?Date.now()-Q:void 0,error:Z.error??re.error}:re)),K&&v(ne)}catch{}}),F.onerror=()=>{F.close(),n(U=>U.map(Z=>Z.id===ne&&Z.status==="rendering"?{...Z,status:"failed",error:"Connection lost. Is the render server running?"}:Z)),h.current=null},ne},[t,v,d,o,u]),O=x.useCallback(async I=>{a(null),v(I),n(_=>_.map(j=>j.id===I&&j.status==="rendering"?{...j,status:"cancelled"}:j));try{const _=await fetch(`/api/render/${I}/cancel`,{method:"POST"});if(!_.ok&&_.status!==404){a("Couldn't cancel on the server — the render may still be running.");return}if(_.ok){const j=await _.json().catch(()=>null);j!=null&&j.status&&j.status!=="cancelled"&&b()}}catch{a("Couldn't reach the server to cancel — the render may still be running.")}},[v,b]),k=x.useCallback(async I=>{a(null),v(I);try{if(!(await fetch(`/api/render/${I}`,{method:"DELETE"})).ok){a("Couldn't delete the render — it's still on disk.");return}}catch{a("Couldn't reach the server to delete the render.");return}n(_=>_.filter(j=>j.id!==I))},[v]),E=x.useCallback(()=>{n(I=>{const _=I.filter(j=>j.status!=="rendering");if(t&&_.length>0){const j=gZ(t);for(const L of _)j.add(L.id);A8e(t,j)}return I.filter(j=>j.status==="rendering")})},[t]),M=x.useCallback(()=>a(null),[]);x.useEffect(()=>{for(const I of e){if(I.status==="rendering"||I.status==="cancelled")continue;const _=m.current.get(I.id);!_||y.current.has(I.id)||(y.current.add(I.id),Kre({reason:I.status==="complete"?"render_complete":"render_failed",renderId:I.id,detail:I.error,context:{..._,render_progress:I.progress,render_duration_ms:I.durationMs??Date.now()-I.createdAt,render_stage:I.stage,render_error:I.error,renders_this_session:m.current.size}}))}},[e]),x.useEffect(()=>()=>{var I;(I=f.current)==null||I.close(),f.current=null},[t]);const N=e.some(I=>I.status==="rendering");return x.useMemo(()=>({jobs:e,isRendering:N,loadError:r,actionError:s,dismissActionError:M,reloadRenders:b,deleteRender:k,cancelRender:O,clearCompleted:E,startRender:w,ffmpeg:o,ffmpegMissing:u,ffmpegChecking:l,recheckFfmpeg:c}),[e,N,r,s,M,b,k,O,E,w,o,u,l,c])}const w8e="modulepreload",O8e=function(t){return"/"+t},yZ={},ly=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=a(n.map(c=>{if(c=O8e(c),c in yZ)return;yZ[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":w8e,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((m,y)=>{h.addEventListener("load",m),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};function C8e(t){if(typeof t!="object"||t===null)return!0;const e=t;return e.isLoaded===!0||typeof e.totalFrames=="number"&&e.totalFrames>0}function wr(t){x.useEffect(t,[])}const xZ=t=>{let e;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(m=>m(e,h))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,o);return o},k8e=(t=>t?xZ(t):xZ),E8e=t=>t;function T8e(t,e=E8e){const n=_b.useSyncExternalStore(t.subscribe,_b.useCallback(()=>e(t.getState()),[t,e]),_b.useCallback(()=>e(t.getInitialState()),[t,e]));return _b.useDebugValue(n),n}const bZ=t=>{const e=k8e(t),n=r=>T8e(e,r);return Object.assign(n,e),n},rE=(t=>t?bZ(t):bZ),Nv=rE(t=>({values:null,setValues:e=>t({values:e&&Object.keys(e).length>0?e:null})}));function eie(t){const e=Nv.getState().values;e?t.searchParams.set("variables",JSON.stringify(e)):t.searchParams.delete("variables")}const tie={primary:["bg-white text-neutral-950 font-medium","shadow-btn-primary","enabled:hover:bg-neutral-200","enabled:active:scale-[0.97]"].join(" "),secondary:["bg-transparent text-neutral-300 font-medium","border border-border","enabled:hover:bg-surface-hover enabled:hover:text-white enabled:hover:border-border-strong","enabled:active:scale-[0.98]"].join(" "),danger:["bg-accent-red text-white font-medium","enabled:hover:bg-red-600","enabled:active:scale-[0.97]"].join(" "),ghost:["bg-transparent text-neutral-400","enabled:hover:bg-surface-hover enabled:hover:text-white","enabled:active:scale-[0.98]"].join(" ")},P8e={sm:"h-7 px-2.5 text-xs gap-1.5 rounded-button",md:"h-8 px-3 text-sm gap-1.5 rounded-button",lg:"h-9 px-4 text-base gap-2 rounded-button"},Qo=x.forwardRef(({variant:t="secondary",size:e="md",loading:n,icon:r,children:i,className:s="",disabled:a,...o},l)=>p.jsxs("button",{ref:l,disabled:a||n,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:cursor-not-allowed","select-none cursor-pointer","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-studio-accent",tie[t],P8e[e],s].join(" "),...o,children:[n?p.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):r?p.jsx("span",{className:"flex-shrink-0",children:r}):null,i&&p.jsx("span",{children:i})]}));Qo.displayName="Button";const M8e={sm:"min-w-7 min-h-7 rounded-button",md:"min-w-8 min-h-8 rounded-button",lg:"min-w-9 min-h-9 rounded-button"},N8e=x.forwardRef(({icon:t,size:e="md",variant:n="ghost",className:r="",...i},s)=>p.jsx("button",{ref:s,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:cursor-not-allowed","select-none cursor-pointer","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-studio-accent",tie[n],M8e[e],r].join(" "),...i,children:t}));N8e.displayName="IconButton";function vZ({title:t,detail:e,mono:n,size:r=64,progress:i}){const s=typeof i=="number"&&Number.isFinite(i)?Math.min(1,Math.max(0,i)):void 0,a=Math.round(r*1.16);return p.jsxs("div",{className:"hf-loader",role:"status",draggable:!1,children:[p.jsx("div",{className:"hf-loader-mark-frame",style:{width:a,height:a},draggable:!1,children:p.jsxs("svg",{className:"hf-loader-mark",width:r,height:r,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[p.jsx("g",{className:"hf-loader-mark__mark",transform:"translate(50 50)",children:p.jsx("g",{className:"hf-loader-mark__core",transform:"scale(1)",opacity:".92",children:p.jsxs("g",{transform:"translate(-50 -50)",children:[p.jsx("path",{d:"M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z",fill:"url(#hf-loader-grad-left)"}),p.jsx("path",{d:"M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",fill:"url(#hf-loader-grad-right)"})]})})}),p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"hf-loader-grad-left",x1:"48.5676",y1:"25",x2:"44.7804",y2:"71.9384",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#06E3FA"}),p.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),p.jsxs("linearGradient",{id:"hf-loader-grad-right",x1:"54.8282",y1:"73.8392",x2:"72.0989",y2:"32.8932",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#06E3FA"}),p.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]})]})}),p.jsx("div",{className:"hf-loader-title",children:t}),e&&p.jsx("div",{className:"hf-loader-detail",children:e}),s!==void 0&&p.jsx("div",{className:"hf-loader-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s*100),children:p.jsx("div",{className:"hf-loader-progress__fill",style:{transform:`scaleX(${s})`}})}),n&&p.jsx("div",{className:"hf-loader-mono",children:n})]})}var Fl=$re();function m4(t,e,n){return Math.max(e,Math.min(n,t))}function D8e(t,e,n,r){const i=e/2,s=i+r;return m4(t,s,Math.max(s,n-i-r))}function Q7(t,e,n,r){const i=(r==null?void 0:r.offset)??8,s=(r==null?void 0:r.margin)??12,a=Math.max(s,e.width-n.width-s),o=t.left+t.width/2-n.width/2,l=m4(o,s,a),c=t.bottom+i,u=t.top-n.height-i,f=c+n.height<=e.height-s,h=u>=s;return f||!h?{left:l,top:m4(c,s,Math.max(s,e.height-n.height-s)),placement:"bottom"}:{left:l,top:m4(u,s,Math.max(s,e.height-n.height-s)),placement:"top"}}const AZ=28,xP=8;function br({label:t,children:e,delay:n=400,side:r="top"}){const[i,s]=x.useState(!1),[a,o]=x.useState({x:0,y:0}),[l,c]=x.useState(r),u=x.useRef(null),f=x.useRef(null),h=x.useRef(null),[m,y]=x.useState(0),d=x.useId(),v=x.useCallback(()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{const O=f.current;if(!O)return;const E=(O.firstElementChild??O).getBoundingClientRect();if(E.width===0&&E.height===0)return;let M=r;r==="top"&&E.top-AZ-6<xP?M="bottom":r==="bottom"&&E.bottom+AZ+6>window.innerHeight-xP&&(M="top"),c(M),o({x:E.left+E.width/2,y:M==="top"?E.top-6:E.bottom+6}),s(!0)},n)},[n,r]),b=x.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),s(!1)},[]);x.useLayoutEffect(()=>{var O;y(i?((O=h.current)==null?void 0:O.offsetWidth)??0:0)},[i,t]),x.useEffect(()=>{if(!i)return;const O=k=>{k.key==="Escape"&&b()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[i,b]);const w=D8e(a.x,m,window.innerWidth,xP);return p.jsxs(p.Fragment,{children:[p.jsx("span",{ref:f,onPointerEnter:v,onPointerLeave:b,onFocus:v,onBlur:b,"aria-describedby":i?d:void 0,className:"contents",children:e}),i&&Fl.createPortal(p.jsx("div",{className:"fixed z-[200] pointer-events-none",style:{left:w,top:a.y,transform:l==="top"?"translate(-50%, -100%)":"translate(-50%, 0)"},children:p.jsx("div",{ref:h,role:"tooltip",id:d,className:"px-2 py-1 rounded-md bg-neutral-800 border border-neutral-700/50 text-[10px] font-medium text-neutral-200 whitespace-nowrap shadow-lg",children:t})}),document.body)]})}const I8e=3,_8e=3;function SI(t){return typeof t=="object"&&t!==null}function R8e(t){if(!(t instanceof CustomEvent))return null;const e=t.detail;if(!SI(e))return null;const n=e.state;return SI(n)?n.loading===!0&&n.ready!==!0:null}const j8e=400,SZ="The composition preview did not become ready.";function L8e(t){return!(t instanceof CustomEvent)||!SI(t.detail)?SZ:typeof t.detail.message=="string"&&t.detail.message.trim()?t.detail.message:SZ}function F8e(t){const e=t.shadowRoot;if(!e)return;const n=e.querySelector(".hfp-container"),r=e.querySelector(".hfp-iframe");n==null||n.style.setProperty("pointer-events","auto"),r==null||r.style.setProperty("pointer-events","auto")}function $8e(t){const e=t.tagName.toLowerCase();return e==="video"||e==="audio"}function wZ(t,e){try{const n=t.contentWindow,r=t.contentDocument;if(!n||!r)return e;for(const s of r.querySelectorAll("video, audio"))if($8e(s)&&!s.error&&s.networkState!==_8e&&s.readyState<I8e)return!0;const i=n.__hfLottie;if(i!=null&&i.length){for(const s of i)if(!C8e(s))return!0}return!1}catch{return e}}const wI=x.forwardRef(({projectId:t,directUrl:e,onLoad:n,onCompositionLoadingChange:r,portrait:i,style:s,suppressLoadingOverlay:a},o)=>{const l=x.useRef(null),c=x.useRef(0),u=x.useRef(null),f=x.useRef(null),h=x.useRef(null),m=x.useRef(0),[y,d]=x.useState(!1),[v,b]=x.useState(!1),[w,O]=x.useState(!1),[k,E]=x.useState(!1),[M,N]=x.useState(!1),[I,_]=x.useState(!0),[j,L]=x.useState(!0),[B,$]=x.useState(null);x.useEffect(()=>{if(!I){L(!0);return}const J=setTimeout(()=>L(!1),j8e);return()=>clearTimeout(J)},[I]),wr(()=>{const J=l.current;if(!J)return;let ne=!1,le;return ly(()=>import("./hyperframes-player-DejBDgXB.js"),[]).then(()=>{if(ne)return;const ie=document.createElement("hyperframes-player"),q=new URL(e||`/api/projects/${t}/preview`,window.location.origin);eie(q);const F=q.pathname+q.search,U=()=>{m.current+=1;const se=new URL(F,window.location.origin);se.searchParams.set("_hfStudioRetry",String(m.current)),$(null),_(!0),ie.setAttribute("src",se.pathname+se.search)};h.current=U;const Z=ie.iframeElement,K=se=>se.stopImmediatePropagation(),ee=se=>{const ue=R8e(se);ue!==null&&N(ue)},re=()=>{$(null),_(!1)},z=se=>{$(L8e(se)),_(!1)},H=()=>{if(c.current++,$(null),N(!1),_(!0),c.current>1){J.classList.remove("preview-revealing"),J.offsetWidth,J.classList.add("preview-revealing");const be=()=>J.classList.remove("preview-revealing");J.addEventListener("animationend",be,{once:!0})}n(),u.current&&clearInterval(u.current);let ue=c.current>1?!1:wZ(Z,!1);if(ue){d(!0);let be=0;u.current=setInterval(()=>{be+=1,ue=wZ(Z,ue),(!ue||be>100)&&(ue&&be>100&&console.debug("[studio] asset readiness poll hit the 10s cap — continuing with unloaded assets"),u.current&&clearInterval(u.current),u.current=null,d(!1))},100)}else d(!1)};if(Z.addEventListener("load",H),ie.addEventListener("click",K,{capture:!0}),ie.addEventListener("shadertransitionstate",ee),ie.addEventListener("ready",re),ie.addEventListener("error",z),typeof o=="function"?o(Z):o&&(o.current=Z),ie.setAttribute("shader-capture-scale","1"),ie.setAttribute("shader-loading","player"),ie.setAttribute("width",String(i?1080:1920)),ie.setAttribute("height",String(i?1920:1080)),ie.style.width="100%",ie.style.height="100%",ie.style.display="block",ie.style.background="transparent",ie.setAttribute("src",F),J.appendChild(ie),ie.shadowRoot){const se=document.createElement("style");se.textContent=".hfp-container{overflow:visible}.hfp-iframe{box-shadow:0 0 0 1px rgba(255,255,255,0.08),0 4px 32px rgba(0,0,0,.7)}",ie.shadowRoot.appendChild(se)}F8e(ie),le=()=>{if(Z.removeEventListener("load",H),ie.removeEventListener("click",K,{capture:!0}),ie.removeEventListener("shadertransitionstate",ee),ie.removeEventListener("ready",re),ie.removeEventListener("error",z),u.current&&clearInterval(u.current),u.current=null,ie.remove(),h.current===U&&(h.current=null),typeof o!="function"){if(o){const se=o;se.current===Z&&(se.current=null)}}}}),()=>{ne=!0,le==null||le()}}),x.useEffect(()=>{if(!y){E(!1);return}const J=setTimeout(()=>E(!0),3e3);return()=>clearTimeout(J)},[y]),x.useEffect(()=>{if(f.current&&(clearTimeout(f.current),f.current=null),y){b(!0),O(!1);return}return O(!0),f.current=setTimeout(()=>{b(!1),O(!1),f.current=null},240),()=>{f.current&&(clearTimeout(f.current),f.current=null)}},[y]);const Q=()=>{u.current&&(clearInterval(u.current),u.current=null),d(!1)},Y=!a&&!j&&I,W=v&&!M&&!Y&&!B;return x.useEffect(()=>{r==null||r(Y||W)},[r,Y,W]),p.jsxs("div",{className:"relative w-full h-full max-w-full max-h-full overflow-hidden flex items-center justify-center",style:s,children:[p.jsx("div",{ref:l,className:"w-full h-full"}),Y&&p.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-30 select-none","data-hyperframes-ignore":"","data-testid":"composition-loading-overlay",draggable:!1,onDragStart:J=>J.preventDefault(),onMouseDown:J=>J.preventDefault(),onPointerDown:J=>J.preventDefault(),children:p.jsx(vZ,{title:"Loading composition",detail:"Preparing the Studio preview.",size:56})}),W&&p.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-20 select-none","data-hyperframes-ignore":"",draggable:!1,style:{opacity:w?0:1,pointerEvents:w?"none":"auto",transition:"opacity 180ms ease-in"},onDragStart:J=>J.preventDefault(),onMouseDown:J=>J.preventDefault(),children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx(vZ,{title:"Preparing preview assets",detail:"Waiting for media and motion assets before playback starts.",size:56}),k&&p.jsx("button",{type:"button",onClick:Q,className:"px-3 py-1.5 text-[11px] rounded-md border border-neutral-700 text-neutral-300 hover:border-neutral-500 hover:bg-neutral-800 transition-colors",children:"Continue anyway"})]})}),B&&p.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/90 px-6 text-center","data-hyperframes-ignore":"","data-testid":"composition-preview-error",children:p.jsxs("div",{className:"max-w-sm",children:[p.jsx("p",{className:"text-sm font-semibold text-white",children:"Preview failed to load"}),p.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:B}),p.jsx("button",{type:"button",className:"mt-4 rounded-md bg-white px-3 py-1.5 text-xs font-semibold text-black transition-colors hover:bg-neutral-200",onClick:()=>{var J;return(J=h.current)==null?void 0:J.call(h)},children:"Retry preview"})]})})]})});wI.displayName="Player";function nf(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nie(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
49
|
+
`).replace(pwe,"")}function bz(g,A){return A=xz(A),xz(g)===A}function Dr(g,A,C,D,V,G){switch(C){case"children":typeof D=="string"?A==="body"||A==="textarea"&&D===""||en(g,D):(typeof D=="number"||typeof D=="bigint")&&A!=="body"&&en(g,""+D);break;case"className":cn(g,"class",D);break;case"tabIndex":cn(g,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":cn(g,C,D);break;case"style":or(g,D,G);break;case"data":if(A!=="object"){cn(g,"data",D);break}case"src":case"href":if(D===""&&(A!=="a"||C!=="href")){g.removeAttribute(C);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){g.removeAttribute(C);break}D=Br(""+D),g.setAttribute(C,D);break;case"action":case"formAction":if(typeof D=="function"){g.setAttribute(C,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof G=="function"&&(C==="formAction"?(A!=="input"&&Dr(g,A,"name",V.name,V,null),Dr(g,A,"formEncType",V.formEncType,V,null),Dr(g,A,"formMethod",V.formMethod,V,null),Dr(g,A,"formTarget",V.formTarget,V,null)):(Dr(g,A,"encType",V.encType,V,null),Dr(g,A,"method",V.method,V,null),Dr(g,A,"target",V.target,V,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){g.removeAttribute(C);break}D=Br(""+D),g.setAttribute(C,D);break;case"onClick":D!=null&&(g.onclick=vs);break;case"onScroll":D!=null&&Hn("scroll",g);break;case"onScrollEnd":D!=null&&Hn("scrollend",g);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(C=D.__html,C!=null){if(V.children!=null)throw Error(r(60));g.innerHTML=C}}break;case"multiple":g.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":g.muted=D&&typeof D!="function"&&typeof D!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(D==null||typeof D=="function"||typeof D=="boolean"||typeof D=="symbol"){g.removeAttribute("xlink:href");break}C=Br(""+D),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",C);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":D!=null&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,""+D):g.removeAttribute(C);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":D&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,""):g.removeAttribute(C);break;case"capture":case"download":D===!0?g.setAttribute(C,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?g.setAttribute(C,D):g.removeAttribute(C);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?g.setAttribute(C,D):g.removeAttribute(C);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?g.removeAttribute(C):g.setAttribute(C,D);break;case"popover":Hn("beforetoggle",g),Hn("toggle",g),ni(g,"popover",D);break;case"xlinkActuate":Cn(g,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Cn(g,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Cn(g,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Cn(g,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Cn(g,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Cn(g,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Cn(g,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":ni(g,"is",D);break;case"innerText":case"textContent":break;default:(!(2<C.length)||C[0]!=="o"&&C[0]!=="O"||C[1]!=="n"&&C[1]!=="N")&&(C=ds.get(C)||C,ni(g,C,D))}}function GT(g,A,C,D,V,G){switch(C){case"style":or(g,D,G);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(C=D.__html,C!=null){if(V.children!=null)throw Error(r(60));g.innerHTML=C}}break;case"children":typeof D=="string"?en(g,D):(typeof D=="number"||typeof D=="bigint")&&en(g,""+D);break;case"onScroll":D!=null&&Hn("scroll",g);break;case"onScrollEnd":D!=null&&Hn("scrollend",g);break;case"onClick":D!=null&&(g.onclick=vs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dt.hasOwnProperty(C))e:{if(C[0]==="o"&&C[1]==="n"&&(V=C.endsWith("Capture"),A=C.slice(2,V?C.length-7:void 0),G=g[Ht]||null,G=G!=null?G[C]:null,typeof G=="function"&&g.removeEventListener(A,G,V),typeof D=="function")){typeof G!="function"&&G!==null&&(C in g?g[C]=null:g.hasAttribute(C)&&g.removeAttribute(C)),g.addEventListener(A,D,V);break e}C in g?g[C]=D:D===!0?g.setAttribute(C,""):ni(g,C,D)}}}function $s(g,A,C){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Hn("error",g),Hn("load",g);var D=!1,V=!1,G;for(G in C)if(C.hasOwnProperty(G)){var ae=C[G];if(ae!=null)switch(G){case"src":D=!0;break;case"srcSet":V=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,A));default:Dr(g,A,G,ae,C,null)}}V&&Dr(g,A,"srcSet",C.srcSet,C,null),D&&Dr(g,A,"src",C.src,C,null);return;case"input":Hn("invalid",g);var de=G=ae=V=null,Ee=null,Le=null;for(D in C)if(C.hasOwnProperty(D)){var Ge=C[D];if(Ge!=null)switch(D){case"name":V=Ge;break;case"type":ae=Ge;break;case"checked":Ee=Ge;break;case"defaultChecked":Le=Ge;break;case"value":G=Ge;break;case"defaultValue":de=Ge;break;case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(r(137,A));break;default:Dr(g,A,D,Ge,C,null)}}ft(g,G,de,Ee,Le,ae,V,!1);return;case"select":Hn("invalid",g),D=ae=G=null;for(V in C)if(C.hasOwnProperty(V)&&(de=C[V],de!=null))switch(V){case"value":G=de;break;case"defaultValue":ae=de;break;case"multiple":D=de;default:Dr(g,A,V,de,C,null)}A=G,C=ae,g.multiple=!!D,A!=null?_e(g,!!D,A,!1):C!=null&&_e(g,!!D,C,!0);return;case"textarea":Hn("invalid",g),G=V=D=null;for(ae in C)if(C.hasOwnProperty(ae)&&(de=C[ae],de!=null))switch(ae){case"value":D=de;break;case"defaultValue":V=de;break;case"children":G=de;break;case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(91));break;default:Dr(g,A,ae,de,C,null)}bt(g,D,V,G);return;case"option":for(Ee in C)if(C.hasOwnProperty(Ee)&&(D=C[Ee],D!=null))switch(Ee){case"selected":g.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Dr(g,A,Ee,D,C,null)}return;case"dialog":Hn("beforetoggle",g),Hn("toggle",g),Hn("cancel",g),Hn("close",g);break;case"iframe":case"object":Hn("load",g);break;case"video":case"audio":for(D=0;D<Dx.length;D++)Hn(Dx[D],g);break;case"image":Hn("error",g),Hn("load",g);break;case"details":Hn("toggle",g);break;case"embed":case"source":case"link":Hn("error",g),Hn("load",g);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Le in C)if(C.hasOwnProperty(Le)&&(D=C[Le],D!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,A));default:Dr(g,A,Le,D,C,null)}return;default:if(bi(A)){for(Ge in C)C.hasOwnProperty(Ge)&&(D=C[Ge],D!==void 0&>(g,A,Ge,D,C,void 0));return}}for(de in C)C.hasOwnProperty(de)&&(D=C[de],D!=null&&Dr(g,A,de,D,C,null))}function mwe(g,A,C,D){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var V=null,G=null,ae=null,de=null,Ee=null,Le=null,Ge=null;for(He in C){var Xe=C[He];if(C.hasOwnProperty(He)&&Xe!=null)switch(He){case"checked":break;case"value":break;case"defaultValue":Ee=Xe;default:D.hasOwnProperty(He)||Dr(g,A,He,null,D,Xe)}}for(var Fe in D){var He=D[Fe];if(Xe=C[Fe],D.hasOwnProperty(Fe)&&(He!=null||Xe!=null))switch(Fe){case"type":G=He;break;case"name":V=He;break;case"checked":Le=He;break;case"defaultChecked":Ge=He;break;case"value":ae=He;break;case"defaultValue":de=He;break;case"children":case"dangerouslySetInnerHTML":if(He!=null)throw Error(r(137,A));break;default:He!==Xe&&Dr(g,A,Fe,He,D,Xe)}}Sa(g,ae,de,Ee,Le,Ge,G,V);return;case"select":He=ae=de=Fe=null;for(G in C)if(Ee=C[G],C.hasOwnProperty(G)&&Ee!=null)switch(G){case"value":break;case"multiple":He=Ee;default:D.hasOwnProperty(G)||Dr(g,A,G,null,D,Ee)}for(V in D)if(G=D[V],Ee=C[V],D.hasOwnProperty(V)&&(G!=null||Ee!=null))switch(V){case"value":Fe=G;break;case"defaultValue":de=G;break;case"multiple":ae=G;default:G!==Ee&&Dr(g,A,V,G,D,Ee)}A=de,C=ae,D=He,Fe!=null?_e(g,!!C,Fe,!1):!!D!=!!C&&(A!=null?_e(g,!!C,A,!0):_e(g,!!C,C?[]:"",!1));return;case"textarea":He=Fe=null;for(de in C)if(V=C[de],C.hasOwnProperty(de)&&V!=null&&!D.hasOwnProperty(de))switch(de){case"value":break;case"children":break;default:Dr(g,A,de,null,D,V)}for(ae in D)if(V=D[ae],G=C[ae],D.hasOwnProperty(ae)&&(V!=null||G!=null))switch(ae){case"value":Fe=V;break;case"defaultValue":He=V;break;case"children":break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:V!==G&&Dr(g,A,ae,V,D,G)}ot(g,Fe,He);return;case"option":for(var jt in C)if(Fe=C[jt],C.hasOwnProperty(jt)&&Fe!=null&&!D.hasOwnProperty(jt))switch(jt){case"selected":g.selected=!1;break;default:Dr(g,A,jt,null,D,Fe)}for(Ee in D)if(Fe=D[Ee],He=C[Ee],D.hasOwnProperty(Ee)&&Fe!==He&&(Fe!=null||He!=null))switch(Ee){case"selected":g.selected=Fe&&typeof Fe!="function"&&typeof Fe!="symbol";break;default:Dr(g,A,Ee,Fe,D,He)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var sn in C)Fe=C[sn],C.hasOwnProperty(sn)&&Fe!=null&&!D.hasOwnProperty(sn)&&Dr(g,A,sn,null,D,Fe);for(Le in D)if(Fe=D[Le],He=C[Le],D.hasOwnProperty(Le)&&Fe!==He&&(Fe!=null||He!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(r(137,A));break;default:Dr(g,A,Le,Fe,D,He)}return;default:if(bi(A)){for(var Ir in C)Fe=C[Ir],C.hasOwnProperty(Ir)&&Fe!==void 0&&!D.hasOwnProperty(Ir)&>(g,A,Ir,void 0,D,Fe);for(Ge in D)Fe=D[Ge],He=C[Ge],!D.hasOwnProperty(Ge)||Fe===He||Fe===void 0&&He===void 0||GT(g,A,Ge,Fe,D,He);return}}for(var Ie in C)Fe=C[Ie],C.hasOwnProperty(Ie)&&Fe!=null&&!D.hasOwnProperty(Ie)&&Dr(g,A,Ie,null,D,Fe);for(Xe in D)Fe=D[Xe],He=C[Xe],!D.hasOwnProperty(Xe)||Fe===He||Fe==null&&He==null||Dr(g,A,Xe,Fe,D,He)}function vz(g){switch(g){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gwe(){if(typeof performance.getEntriesByType=="function"){for(var g=0,A=0,C=performance.getEntriesByType("resource"),D=0;D<C.length;D++){var V=C[D],G=V.transferSize,ae=V.initiatorType,de=V.duration;if(G&&de&&vz(ae)){for(ae=0,de=V.responseEnd,D+=1;D<C.length;D++){var Ee=C[D],Le=Ee.startTime;if(Le>de)break;var Ge=Ee.transferSize,Xe=Ee.initiatorType;Ge&&vz(Xe)&&(Ee=Ee.responseEnd,ae+=Ge*(Ee<de?1:(de-Le)/(Ee-Le)))}if(--D,A+=8*(G+ae)/(V.duration/1e3),g++,10<g)break}}if(0<g)return A/g/1e6}return navigator.connection&&(g=navigator.connection.downlink,typeof g=="number")?g:5}var UT=null,XT=null;function hO(g){return g.nodeType===9?g:g.ownerDocument}function Az(g){switch(g){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sz(g,A){if(g===0)switch(A){case"svg":return 1;case"math":return 2;default:return 0}return g===1&&A==="foreignObject"?0:g}function WT(g,A){return g==="textarea"||g==="noscript"||typeof A.children=="string"||typeof A.children=="number"||typeof A.children=="bigint"||typeof A.dangerouslySetInnerHTML=="object"&&A.dangerouslySetInnerHTML!==null&&A.dangerouslySetInnerHTML.__html!=null}var qT=null;function ywe(){var g=window.event;return g&&g.type==="popstate"?g===qT?!1:(qT=g,!0):(qT=null,!1)}var wz=typeof setTimeout=="function"?setTimeout:void 0,xwe=typeof clearTimeout=="function"?clearTimeout:void 0,Oz=typeof Promise=="function"?Promise:void 0,bwe=typeof queueMicrotask=="function"?queueMicrotask:typeof Oz<"u"?function(g){return Oz.resolve(null).then(g).catch(vwe)}:wz;function vwe(g){setTimeout(function(){throw g})}function Ih(g){return g==="head"}function Cz(g,A){var C=A,D=0;do{var V=C.nextSibling;if(g.removeChild(C),V&&V.nodeType===8)if(C=V.data,C==="/$"||C==="/&"){if(D===0){g.removeChild(V),Rm(A);return}D--}else if(C==="$"||C==="$?"||C==="$~"||C==="$!"||C==="&")D++;else if(C==="html")_x(g.ownerDocument.documentElement);else if(C==="head"){C=g.ownerDocument.head,_x(C);for(var G=C.firstChild;G;){var ae=G.nextSibling,de=G.nodeName;G[gt]||de==="SCRIPT"||de==="STYLE"||de==="LINK"&&G.rel.toLowerCase()==="stylesheet"||C.removeChild(G),G=ae}}else C==="body"&&_x(g.ownerDocument.body);C=V}while(C);Rm(A)}function kz(g,A){var C=g;g=0;do{var D=C.nextSibling;if(C.nodeType===1?A?(C._stashedDisplay=C.style.display,C.style.display="none"):(C.style.display=C._stashedDisplay||"",C.getAttribute("style")===""&&C.removeAttribute("style")):C.nodeType===3&&(A?(C._stashedText=C.nodeValue,C.nodeValue=""):C.nodeValue=C._stashedText||""),D&&D.nodeType===8)if(C=D.data,C==="/$"){if(g===0)break;g--}else C!=="$"&&C!=="$?"&&C!=="$~"&&C!=="$!"||g++;C=D}while(C)}function YT(g){var A=g.firstChild;for(A&&A.nodeType===10&&(A=A.nextSibling);A;){var C=A;switch(A=A.nextSibling,C.nodeName){case"HTML":case"HEAD":case"BODY":YT(C),nr(C);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(C.rel.toLowerCase()==="stylesheet")continue}g.removeChild(C)}}function Awe(g,A,C,D){for(;g.nodeType===1;){var V=C;if(g.nodeName.toLowerCase()!==A.toLowerCase()){if(!D&&(g.nodeName!=="INPUT"||g.type!=="hidden"))break}else if(D){if(!g[gt])switch(A){case"meta":if(!g.hasAttribute("itemprop"))break;return g;case"link":if(G=g.getAttribute("rel"),G==="stylesheet"&&g.hasAttribute("data-precedence"))break;if(G!==V.rel||g.getAttribute("href")!==(V.href==null||V.href===""?null:V.href)||g.getAttribute("crossorigin")!==(V.crossOrigin==null?null:V.crossOrigin)||g.getAttribute("title")!==(V.title==null?null:V.title))break;return g;case"style":if(g.hasAttribute("data-precedence"))break;return g;case"script":if(G=g.getAttribute("src"),(G!==(V.src==null?null:V.src)||g.getAttribute("type")!==(V.type==null?null:V.type)||g.getAttribute("crossorigin")!==(V.crossOrigin==null?null:V.crossOrigin))&&G&&g.hasAttribute("async")&&!g.hasAttribute("itemprop"))break;return g;default:return g}}else if(A==="input"&&g.type==="hidden"){var G=V.name==null?null:""+V.name;if(V.type==="hidden"&&g.getAttribute("name")===G)return g}else return g;if(g=pl(g.nextSibling),g===null)break}return null}function Swe(g,A,C){if(A==="")return null;for(;g.nodeType!==3;)if((g.nodeType!==1||g.nodeName!=="INPUT"||g.type!=="hidden")&&!C||(g=pl(g.nextSibling),g===null))return null;return g}function Ez(g,A){for(;g.nodeType!==8;)if((g.nodeType!==1||g.nodeName!=="INPUT"||g.type!=="hidden")&&!A||(g=pl(g.nextSibling),g===null))return null;return g}function KT(g){return g.data==="$?"||g.data==="$~"}function JT(g){return g.data==="$!"||g.data==="$?"&&g.ownerDocument.readyState!=="loading"}function wwe(g,A){var C=g.ownerDocument;if(g.data==="$~")g._reactRetry=A;else if(g.data!=="$?"||C.readyState!=="loading")A();else{var D=function(){A(),C.removeEventListener("DOMContentLoaded",D)};C.addEventListener("DOMContentLoaded",D),g._reactRetry=D}}function pl(g){for(;g!=null;g=g.nextSibling){var A=g.nodeType;if(A===1||A===3)break;if(A===8){if(A=g.data,A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"||A==="F!"||A==="F")break;if(A==="/$"||A==="/&")return null}}return g}var eP=null;function Tz(g){g=g.nextSibling;for(var A=0;g;){if(g.nodeType===8){var C=g.data;if(C==="/$"||C==="/&"){if(A===0)return pl(g.nextSibling);A--}else C!=="$"&&C!=="$!"&&C!=="$?"&&C!=="$~"&&C!=="&"||A++}g=g.nextSibling}return null}function Pz(g){g=g.previousSibling;for(var A=0;g;){if(g.nodeType===8){var C=g.data;if(C==="$"||C==="$!"||C==="$?"||C==="$~"||C==="&"){if(A===0)return g;A--}else C!=="/$"&&C!=="/&"||A++}g=g.previousSibling}return null}function Mz(g,A,C){switch(A=hO(C),g){case"html":if(g=A.documentElement,!g)throw Error(r(452));return g;case"head":if(g=A.head,!g)throw Error(r(453));return g;case"body":if(g=A.body,!g)throw Error(r(454));return g;default:throw Error(r(451))}}function _x(g){for(var A=g.attributes;A.length;)g.removeAttributeNode(A[0]);nr(g)}var ml=new Map,Nz=new Set;function dO(g){return typeof g.getRootNode=="function"?g.getRootNode():g.nodeType===9?g:g.ownerDocument}var Ku=J.d;J.d={f:Owe,r:Cwe,D:kwe,C:Ewe,L:Twe,m:Pwe,X:Nwe,S:Mwe,M:Dwe};function Owe(){var g=Ku.f(),A=iO();return g||A}function Cwe(g){var A=_n(g);A!==null&&A.tag===5&&A.type==="form"?XH(A):Ku.r(g)}var Dm=typeof document>"u"?null:document;function Dz(g,A,C){var D=Dm;if(D&&typeof A=="string"&&A){var V=xi(A);V='link[rel="'+g+'"][href="'+V+'"]',typeof C=="string"&&(V+='[crossorigin="'+C+'"]'),Nz.has(V)||(Nz.add(V),g={rel:g,crossOrigin:C,href:A},D.querySelector(V)===null&&(A=D.createElement("link"),$s(A,"link",g),Ct(A),D.head.appendChild(A)))}}function kwe(g){Ku.D(g),Dz("dns-prefetch",g,null)}function Ewe(g,A){Ku.C(g,A),Dz("preconnect",g,A)}function Twe(g,A,C){Ku.L(g,A,C);var D=Dm;if(D&&g&&A){var V='link[rel="preload"][as="'+xi(A)+'"]';A==="image"&&C&&C.imageSrcSet?(V+='[imagesrcset="'+xi(C.imageSrcSet)+'"]',typeof C.imageSizes=="string"&&(V+='[imagesizes="'+xi(C.imageSizes)+'"]')):V+='[href="'+xi(g)+'"]';var G=V;switch(A){case"style":G=Im(g);break;case"script":G=_m(g)}ml.has(G)||(g=f({rel:"preload",href:A==="image"&&C&&C.imageSrcSet?void 0:g,as:A},C),ml.set(G,g),D.querySelector(V)!==null||A==="style"&&D.querySelector(Rx(G))||A==="script"&&D.querySelector(jx(G))||(A=D.createElement("link"),$s(A,"link",g),Ct(A),D.head.appendChild(A)))}}function Pwe(g,A){Ku.m(g,A);var C=Dm;if(C&&g){var D=A&&typeof A.as=="string"?A.as:"script",V='link[rel="modulepreload"][as="'+xi(D)+'"][href="'+xi(g)+'"]',G=V;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":G=_m(g)}if(!ml.has(G)&&(g=f({rel:"modulepreload",href:g},A),ml.set(G,g),C.querySelector(V)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(C.querySelector(jx(G)))return}D=C.createElement("link"),$s(D,"link",g),Ct(D),C.head.appendChild(D)}}}function Mwe(g,A,C){Ku.S(g,A,C);var D=Dm;if(D&&g){var V=Ut(D).hoistableStyles,G=Im(g);A=A||"default";var ae=V.get(G);if(!ae){var de={loading:0,preload:null};if(ae=D.querySelector(Rx(G)))de.loading=5;else{g=f({rel:"stylesheet",href:g,"data-precedence":A},C),(C=ml.get(G))&&tP(g,C);var Ee=ae=D.createElement("link");Ct(Ee),$s(Ee,"link",g),Ee._p=new Promise(function(Le,Ge){Ee.onload=Le,Ee.onerror=Ge}),Ee.addEventListener("load",function(){de.loading|=1}),Ee.addEventListener("error",function(){de.loading|=2}),de.loading|=4,pO(ae,A,D)}ae={type:"stylesheet",instance:ae,count:1,state:de},V.set(G,ae)}}}function Nwe(g,A){Ku.X(g,A);var C=Dm;if(C&&g){var D=Ut(C).hoistableScripts,V=_m(g),G=D.get(V);G||(G=C.querySelector(jx(V)),G||(g=f({src:g,async:!0},A),(A=ml.get(V))&&nP(g,A),G=C.createElement("script"),Ct(G),$s(G,"link",g),C.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},D.set(V,G))}}function Dwe(g,A){Ku.M(g,A);var C=Dm;if(C&&g){var D=Ut(C).hoistableScripts,V=_m(g),G=D.get(V);G||(G=C.querySelector(jx(V)),G||(g=f({src:g,async:!0,type:"module"},A),(A=ml.get(V))&&nP(g,A),G=C.createElement("script"),Ct(G),$s(G,"link",g),C.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},D.set(V,G))}}function Iz(g,A,C,D){var V=(V=ee.current)?dO(V):null;if(!V)throw Error(r(446));switch(g){case"meta":case"title":return null;case"style":return typeof C.precedence=="string"&&typeof C.href=="string"?(A=Im(C.href),C=Ut(V).hoistableStyles,D=C.get(A),D||(D={type:"style",instance:null,count:0,state:null},C.set(A,D)),D):{type:"void",instance:null,count:0,state:null};case"link":if(C.rel==="stylesheet"&&typeof C.href=="string"&&typeof C.precedence=="string"){g=Im(C.href);var G=Ut(V).hoistableStyles,ae=G.get(g);if(ae||(V=V.ownerDocument||V,ae={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},G.set(g,ae),(G=V.querySelector(Rx(g)))&&!G._p&&(ae.instance=G,ae.state.loading=5),ml.has(g)||(C={rel:"preload",as:"style",href:C.href,crossOrigin:C.crossOrigin,integrity:C.integrity,media:C.media,hrefLang:C.hrefLang,referrerPolicy:C.referrerPolicy},ml.set(g,C),G||Iwe(V,g,C,ae.state))),A&&D===null)throw Error(r(528,""));return ae}if(A&&D!==null)throw Error(r(529,""));return null;case"script":return A=C.async,C=C.src,typeof C=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=_m(C),C=Ut(V).hoistableScripts,D=C.get(A),D||(D={type:"script",instance:null,count:0,state:null},C.set(A,D)),D):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,g))}}function Im(g){return'href="'+xi(g)+'"'}function Rx(g){return'link[rel="stylesheet"]['+g+"]"}function _z(g){return f({},g,{"data-precedence":g.precedence,precedence:null})}function Iwe(g,A,C,D){g.querySelector('link[rel="preload"][as="style"]['+A+"]")?D.loading=1:(A=g.createElement("link"),D.preload=A,A.addEventListener("load",function(){return D.loading|=1}),A.addEventListener("error",function(){return D.loading|=2}),$s(A,"link",C),Ct(A),g.head.appendChild(A))}function _m(g){return'[src="'+xi(g)+'"]'}function jx(g){return"script[async]"+g}function Rz(g,A,C){if(A.count++,A.instance===null)switch(A.type){case"style":var D=g.querySelector('style[data-href~="'+xi(C.href)+'"]');if(D)return A.instance=D,Ct(D),D;var V=f({},C,{"data-href":C.href,"data-precedence":C.precedence,href:null,precedence:null});return D=(g.ownerDocument||g).createElement("style"),Ct(D),$s(D,"style",V),pO(D,C.precedence,g),A.instance=D;case"stylesheet":V=Im(C.href);var G=g.querySelector(Rx(V));if(G)return A.state.loading|=4,A.instance=G,Ct(G),G;D=_z(C),(V=ml.get(V))&&tP(D,V),G=(g.ownerDocument||g).createElement("link"),Ct(G);var ae=G;return ae._p=new Promise(function(de,Ee){ae.onload=de,ae.onerror=Ee}),$s(G,"link",D),A.state.loading|=4,pO(G,C.precedence,g),A.instance=G;case"script":return G=_m(C.src),(V=g.querySelector(jx(G)))?(A.instance=V,Ct(V),V):(D=C,(V=ml.get(G))&&(D=f({},C),nP(D,V)),g=g.ownerDocument||g,V=g.createElement("script"),Ct(V),$s(V,"link",D),g.head.appendChild(V),A.instance=V);case"void":return null;default:throw Error(r(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(D=A.instance,A.state.loading|=4,pO(D,C.precedence,g));return A.instance}function pO(g,A,C){for(var D=C.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),V=D.length?D[D.length-1]:null,G=V,ae=0;ae<D.length;ae++){var de=D[ae];if(de.dataset.precedence===A)G=de;else if(G!==V)break}G?G.parentNode.insertBefore(g,G.nextSibling):(A=C.nodeType===9?C.head:C,A.insertBefore(g,A.firstChild))}function tP(g,A){g.crossOrigin==null&&(g.crossOrigin=A.crossOrigin),g.referrerPolicy==null&&(g.referrerPolicy=A.referrerPolicy),g.title==null&&(g.title=A.title)}function nP(g,A){g.crossOrigin==null&&(g.crossOrigin=A.crossOrigin),g.referrerPolicy==null&&(g.referrerPolicy=A.referrerPolicy),g.integrity==null&&(g.integrity=A.integrity)}var mO=null;function jz(g,A,C){if(mO===null){var D=new Map,V=mO=new Map;V.set(C,D)}else V=mO,D=V.get(C),D||(D=new Map,V.set(C,D));if(D.has(g))return D;for(D.set(g,null),C=C.getElementsByTagName(g),V=0;V<C.length;V++){var G=C[V];if(!(G[gt]||G[hn]||g==="link"&&G.getAttribute("rel")==="stylesheet")&&G.namespaceURI!=="http://www.w3.org/2000/svg"){var ae=G.getAttribute(A)||"";ae=g+ae;var de=D.get(ae);de?de.push(G):D.set(ae,[G])}}return D}function Lz(g,A,C){g=g.ownerDocument||g,g.head.insertBefore(C,A==="title"?g.querySelector("head > title"):null)}function _we(g,A,C){if(C===1||A.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;switch(A.rel){case"stylesheet":return g=A.disabled,typeof A.precedence=="string"&&g==null;default:return!0}case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function Fz(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function Rwe(g,A,C,D){if(C.type==="stylesheet"&&(typeof D.media!="string"||matchMedia(D.media).matches!==!1)&&(C.state.loading&4)===0){if(C.instance===null){var V=Im(D.href),G=A.querySelector(Rx(V));if(G){A=G._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(g.count++,g=gO.bind(g),A.then(g,g)),C.state.loading|=4,C.instance=G,Ct(G);return}G=A.ownerDocument||A,D=_z(D),(V=ml.get(V))&&tP(D,V),G=G.createElement("link"),Ct(G);var ae=G;ae._p=new Promise(function(de,Ee){ae.onload=de,ae.onerror=Ee}),$s(G,"link",D),C.instance=G}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(C,A),(A=C.state.preload)&&(C.state.loading&3)===0&&(g.count++,C=gO.bind(g),A.addEventListener("load",C),A.addEventListener("error",C))}}var rP=0;function jwe(g,A){return g.stylesheets&&g.count===0&&xO(g,g.stylesheets),0<g.count||0<g.imgCount?function(C){var D=setTimeout(function(){if(g.stylesheets&&xO(g,g.stylesheets),g.unsuspend){var G=g.unsuspend;g.unsuspend=null,G()}},6e4+A);0<g.imgBytes&&rP===0&&(rP=62500*gwe());var V=setTimeout(function(){if(g.waitingForImages=!1,g.count===0&&(g.stylesheets&&xO(g,g.stylesheets),g.unsuspend)){var G=g.unsuspend;g.unsuspend=null,G()}},(g.imgBytes>rP?50:800)+A);return g.unsuspend=C,function(){g.unsuspend=null,clearTimeout(D),clearTimeout(V)}}:null}function gO(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xO(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var yO=null;function xO(g,A){g.stylesheets=null,g.unsuspend!==null&&(g.count++,yO=new Map,A.forEach(Lwe,g),yO=null,gO.call(g))}function Lwe(g,A){if(!(A.state.loading&4)){var C=yO.get(g);if(C)var D=C.get(null);else{C=new Map,yO.set(g,C);for(var V=g.querySelectorAll("link[data-precedence],style[data-precedence]"),G=0;G<V.length;G++){var ae=V[G];(ae.nodeName==="LINK"||ae.getAttribute("media")!=="not all")&&(C.set(ae.dataset.precedence,ae),D=ae)}D&&C.set(null,D)}V=A.instance,ae=V.getAttribute("data-precedence"),G=C.get(ae)||D,G===D&&C.set(null,V),C.set(ae,V),this.count++,D=gO.bind(this),V.addEventListener("load",D),V.addEventListener("error",D),G?G.parentNode.insertBefore(V,G.nextSibling):(g=g.nodeType===9?g.head:g,g.insertBefore(V,g.firstChild)),A.state.loading|=4}}var Lx={$$typeof:O,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Fwe(g,A,C,D,V,G,ae,de,Ee){this.tag=1,this.containerInfo=g,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=D,this.onUncaughtError=V,this.onCaughtError=G,this.onRecoverableError=ae,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ee,this.incompleteTransitions=new Map}function $z(g,A,C,D,V,G,ae,de,Ee,Le,Ge,Xe){return g=new Fwe(g,A,C,ae,Ee,Le,Ge,Xe,de),A=1,G===!0&&(A|=24),G=So(3,null,null,A),g.current=G,G.stateNode=g,A=j5(),A.refCount++,g.pooledCache=A,A.refCount++,G.memoizedState={element:D,isDehydrated:C,cache:A},B5(G),g}function Bz(g){return g?(g=fm,g):fm}function Vz(g,A,C,D,V,G){V=Bz(V),D.context===null?D.context=V:D.pendingContext=V,D=Sh(A),D.payload={element:C},G=G===void 0?null:G,G!==null&&(D.callback=G),C=wh(g,D,A),C!==null&&(Ua(C,g,A),mx(C,g,A))}function Hz(g,A){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var C=g.retryLane;g.retryLane=C!==0&&C<A?C:A}}function iP(g,A){Hz(g,A),(g=g.alternate)&&Hz(g,A)}function Qz(g){if(g.tag===13||g.tag===31){var A=tp(g,67108864);A!==null&&Ua(A,g,67108864),iP(g,67108864)}}function zz(g){if(g.tag===13||g.tag===31){var A=Eo();A=En(A);var C=tp(g,A);C!==null&&Ua(C,g,A),iP(g,A)}}var bO=!0;function $we(g,A,C,D){var V=W.T;W.T=null;var G=J.p;try{J.p=2,sP(g,A,C,D)}finally{J.p=G,W.T=V}}function Bwe(g,A,C,D){var V=W.T;W.T=null;var G=J.p;try{J.p=8,sP(g,A,C,D)}finally{J.p=G,W.T=V}}function sP(g,A,C,D){if(bO){var V=aP(D);if(V===null)ZT(g,A,D,vO,C),Gz(g,D);else if(Hwe(V,g,A,C,D))D.stopPropagation();else if(Gz(g,D),A&4&&-1<Vwe.indexOf(g)){for(;V!==null;){var G=_n(V);if(G!==null)switch(G.tag){case 3:if(G=G.stateNode,G.current.memoizedState.isDehydrated){var ae=De(G.pendingLanes);if(ae!==0){var de=G;for(de.pendingLanes|=2,de.entangledLanes|=2;ae;){var Ee=1<<31-At(ae);de.entanglements[1]|=Ee,ae&=~Ee}Qc(G),(mr&6)===0&&(nO=Ze()+500,Nx(0))}}break;case 31:case 13:de=tp(G,2),de!==null&&Ua(de,G,2),iO(),iP(G,2)}if(G=aP(D),G===null&&ZT(g,A,D,vO,C),G===V)break;V=G}V!==null&&D.stopPropagation()}else ZT(g,A,D,null,C)}}function aP(g){return g=Iu(g),oP(g)}var vO=null;function oP(g){if(vO=null,g=On(g),g!==null){var A=s(g);if(A===null)g=null;else{var C=A.tag;if(C===13){if(g=a(A),g!==null)return g;g=null}else if(C===31){if(g=o(A),g!==null)return g;g=null}else if(C===3){if(A.stateNode.current.memoizedState.isDehydrated)return A.tag===3?A.stateNode.containerInfo:null;g=null}else A!==g&&(g=null)}}return vO=g,null}function Zz(g){switch(g){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(qe()){case pt:return 2;case it:return 8;case vt:case Ot:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var lP=!1,_h=null,Rh=null,jh=null,Fx=new Map,$x=new Map,Lh=[],Vwe="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".split(" ");function Gz(g,A){switch(g){case"focusin":case"focusout":_h=null;break;case"dragenter":case"dragleave":Rh=null;break;case"mouseover":case"mouseout":jh=null;break;case"pointerover":case"pointerout":Fx.delete(A.pointerId);break;case"gotpointercapture":case"lostpointercapture":$x.delete(A.pointerId)}}function Bx(g,A,C,D,V,G){return g===null||g.nativeEvent!==G?(g={blockedOn:A,domEventName:C,eventSystemFlags:D,nativeEvent:G,targetContainers:[V]},A!==null&&(A=_n(A),A!==null&&Qz(A)),g):(g.eventSystemFlags|=D,A=g.targetContainers,V!==null&&A.indexOf(V)===-1&&A.push(V),g)}function Hwe(g,A,C,D,V){switch(A){case"focusin":return _h=Bx(_h,g,A,C,D,V),!0;case"dragenter":return Rh=Bx(Rh,g,A,C,D,V),!0;case"mouseover":return jh=Bx(jh,g,A,C,D,V),!0;case"pointerover":var G=V.pointerId;return Fx.set(G,Bx(Fx.get(G)||null,g,A,C,D,V)),!0;case"gotpointercapture":return G=V.pointerId,$x.set(G,Bx($x.get(G)||null,g,A,C,D,V)),!0}return!1}function Uz(g){var A=On(g.target);if(A!==null){var C=s(A);if(C!==null){if(A=C.tag,A===13){if(A=a(C),A!==null){g.blockedOn=A,qn(g.priority,function(){zz(C)});return}}else if(A===31){if(A=o(C),A!==null){g.blockedOn=A,qn(g.priority,function(){zz(C)});return}}else if(A===3&&C.stateNode.current.memoizedState.isDehydrated){g.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}g.blockedOn=null}function AO(g){if(g.blockedOn!==null)return!1;for(var A=g.targetContainers;0<A.length;){var C=aP(g.nativeEvent);if(C===null){C=g.nativeEvent;var D=new C.constructor(C.type,C);Lc=D,C.target.dispatchEvent(D),Lc=null}else return A=_n(C),A!==null&&Qz(A),g.blockedOn=C,!1;A.shift()}return!0}function Xz(g,A,C){AO(g)&&C.delete(A)}function Qwe(){lP=!1,_h!==null&&AO(_h)&&(_h=null),Rh!==null&&AO(Rh)&&(Rh=null),jh!==null&&AO(jh)&&(jh=null),Fx.forEach(Xz),$x.forEach(Xz)}function SO(g,A){g.blockedOn===A&&(g.blockedOn=null,lP||(lP=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Qwe)))}var wO=null;function Wz(g){wO!==g&&(wO=g,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){wO===g&&(wO=null);for(var A=0;A<g.length;A+=3){var C=g[A],D=g[A+1],V=g[A+2];if(typeof D!="function"){if(oP(D||C)===null)continue;break}var G=_n(C);G!==null&&(g.splice(A,3),A-=3,aT(G,{pending:!0,data:V,method:C.method,action:D},D,V))}}))}function Rm(g){function A(Ee){return SO(Ee,g)}_h!==null&&SO(_h,g),Rh!==null&&SO(Rh,g),jh!==null&&SO(jh,g),Fx.forEach(A),$x.forEach(A);for(var C=0;C<Lh.length;C++){var D=Lh[C];D.blockedOn===g&&(D.blockedOn=null)}for(;0<Lh.length&&(C=Lh[0],C.blockedOn===null);)Uz(C),C.blockedOn===null&&Lh.shift();if(C=(g.ownerDocument||g).$$reactFormReplay,C!=null)for(D=0;D<C.length;D+=3){var V=C[D],G=C[D+1],ae=V[Ht]||null;if(typeof G=="function")ae||Wz(C);else if(ae){var de=null;if(G&&G.hasAttribute("formAction")){if(V=G,ae=G[Ht]||null)de=ae.formAction;else if(oP(V)!==null)continue}else de=ae.action;typeof de=="function"?C[D+1]=de:(C.splice(D,3),D-=3),Wz(C)}}}function qz(){function g(G){G.canIntercept&&G.info==="react-transition"&&G.intercept({handler:function(){return new Promise(function(ae){return V=ae})},focusReset:"manual",scroll:"manual"})}function A(){V!==null&&(V(),V=null),D||setTimeout(C,20)}function C(){if(!D&&!navigation.transition){var G=navigation.currentEntry;G&&G.url!=null&&navigation.navigate(G.url,{state:G.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,V=null;return navigation.addEventListener("navigate",g),navigation.addEventListener("navigatesuccess",A),navigation.addEventListener("navigateerror",A),setTimeout(C,100),function(){D=!0,navigation.removeEventListener("navigate",g),navigation.removeEventListener("navigatesuccess",A),navigation.removeEventListener("navigateerror",A),V!==null&&(V(),V=null)}}}function cP(g){this._internalRoot=g}OO.prototype.render=cP.prototype.render=function(g){var A=this._internalRoot;if(A===null)throw Error(r(409));var C=A.current,D=Eo();Vz(C,D,g,A,null,null)},OO.prototype.unmount=cP.prototype.unmount=function(){var g=this._internalRoot;if(g!==null){this._internalRoot=null;var A=g.containerInfo;Vz(g.current,2,null,g,null,null),iO(),A[dn]=null}};function OO(g){this._internalRoot=g}OO.prototype.unstable_scheduleHydration=function(g){if(g){var A=et();g={blockedOn:null,target:g,priority:A};for(var C=0;C<Lh.length&&A!==0&&A<Lh[C].priority;C++);Lh.splice(C,0,g),C===0&&Uz(g)}};var Yz=e.version;if(Yz!=="19.2.6")throw Error(r(527,Yz,"19.2.6"));J.findDOMNode=function(g){var A=g._reactInternals;if(A===void 0)throw typeof g.render=="function"?Error(r(188)):(g=Object.keys(g).join(","),Error(r(268,g)));return g=c(A),g=g!==null?u(g):null,g=g===null?null:g.stateNode,g};var zwe={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var CO=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!CO.isDisabled&&CO.supportsFiber)try{Jt=CO.inject(zwe),Je=CO}catch{}}return Hx.createRoot=function(g,A){if(!i(g))throw Error(r(299));var C=!1,D="",V=iQ,G=sQ,ae=aQ;return A!=null&&(A.unstable_strictMode===!0&&(C=!0),A.identifierPrefix!==void 0&&(D=A.identifierPrefix),A.onUncaughtError!==void 0&&(V=A.onUncaughtError),A.onCaughtError!==void 0&&(G=A.onCaughtError),A.onRecoverableError!==void 0&&(ae=A.onRecoverableError)),A=$z(g,1,!1,null,null,C,D,null,V,G,ae,qz),g[dn]=A.current,zT(g),new cP(A)},Hx.hydrateRoot=function(g,A,C){if(!i(g))throw Error(r(299));var D=!1,V="",G=iQ,ae=sQ,de=aQ,Ee=null;return C!=null&&(C.unstable_strictMode===!0&&(D=!0),C.identifierPrefix!==void 0&&(V=C.identifierPrefix),C.onUncaughtError!==void 0&&(G=C.onUncaughtError),C.onCaughtError!==void 0&&(ae=C.onCaughtError),C.onRecoverableError!==void 0&&(de=C.onRecoverableError),C.formState!==void 0&&(Ee=C.formState)),A=$z(g,1,!0,A,C??null,D,V,Ee,G,ae,de,qz),A.context=Bz(null),C=A.current,D=Eo(),D=En(D),V=Sh(D),V.callback=null,wh(C,V,D),C=D,A.current.lanes=C,Mn(A,C),Qc(A),g[dn]=A.current,zT(g),new OO(A)},Hx.version="19.2.6",Hx}var oZ;function tOe(){if(oZ)return hP.exports;oZ=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),hP.exports=eOe(),hP.exports}var nOe=tOe();function Af(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function qA(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function B7(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}const Bre="hyperframes-studio:anonymousId",Vre="hf-studio-anon-id";let pp=null;function rOe(){try{const t=typeof window>"u"?void 0:window.__HF_CLI_DISTINCT_ID;return typeof t=="string"&&t.length>0?t:null}catch{return null}}function gP(t,e){for(const n of[Bre,Vre])try{t.setItem(n,e)}catch{}}function V7(){if(pp)return pp;const t=qA(),e=rOe();if(e)return pp=e,t&&gP(t,e),e;if(t){let r=null;try{r=t.getItem(Bre)??t.getItem(Vre)}catch{}if(r)return pp=r,gP(t,r),r}else return pp=Af(),pp;const n=Af();return pp=n,gP(t,n),n}const iOe="hyperframes-studio:telemetryDisabled",Hre="hyperframes-studio:telemetryNoticeShown";function Qre(){return V7()}function zre(t){var e;try{return((e=qA())==null?void 0:e.getItem(t))==="1"}catch{return!1}}function sOe(){return zre(iOe)}function aOe(){return zre(Hre)}function oOe(){var t;try{(t=qA())==null||t.setItem(Hre,"1")}catch{}}const Zre="hyperframes-studio:sessionStartFired";function lOe(){var t;return((t=B7())==null?void 0:t.getItem(Zre))==="1"}function cOe(){var t;try{(t=B7())==null||t.setItem(Zre,"1")}catch{}}const uOe="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",fOe="hf-studio-telemetry-opt-out";function hOe(){try{return localStorage.getItem(fOe)==="1"}catch{return!1}}function dOe(){return typeof navigator<"u"&&navigator.doNotTrack==="1"}function pOe(){return uOe.startsWith("phc_")}function mOe(){try{return!1}catch{return!1}}function gOe(){try{return!1}catch{return!1}}function YA(){try{return yOe()}catch{return!1}}function yOe(){return pOe()&&!mOe()&&!gOe()&&!sOe()&&!hOe()&&!dOe()}let jm;function xOe(){if(jm!==void 0)return jm;if(typeof window>"u")return jm=null,jm;const t=window.__HF_CLI_AGENT_RUNTIME;return jm=typeof t=="string"&&t.length>0?t:null,jm}function Gre(){return xOe()??"none"}const bOe={user_agent:"",language:"",screen_width:0,screen_height:0,device_pixel_ratio:0,timezone_offset_minutes:0,is_mobile:!1,studio_version:"dev",agent_runtime:"none"};let Lm=null;function vOe(){if(Lm)return Lm;if(typeof navigator>"u"||typeof window>"u")return Lm=bOe,Lm;const t=navigator.userAgent,e=window.screen;return Lm={user_agent:t,language:navigator.language,screen_width:e.width,screen_height:e.height,device_pixel_ratio:window.devicePixelRatio,timezone_offset_minutes:new Date().getTimezoneOffset(),is_mobile:/Android|iPhone|iPad/i.test(t),studio_version:"0.8.18",agent_runtime:Gre()},Lm}function AOe(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=e+((e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24))>>>0;return e>>>0}function SOe(t,e){return AOe(`${t}:${e}`)%100}function wOe(t){var i;if(t.override===!0)return{enabled:!0,reason:"forced_on"};if(t.override===!1)return{enabled:!1,reason:"forced_off"};const e=Math.max(0,Math.min(100,Math.trunc(t.percentage)));if(e<=0)return{enabled:!1,reason:"out_of_cohort"};if(e>=100)return{enabled:!0,reason:"in_cohort"};if(t.exclude)return{enabled:!1,reason:"excluded"};const n=(i=t.unitId)==null?void 0:i.trim();if(!n)return{enabled:!1,reason:"no_unit_id"};const r=SOe(t.feature,n);return r<e?{enabled:!0,reason:"in_cohort",bucket:r}:{enabled:!1,reason:"out_of_cohort",bucket:r}}function lZ(t){const e=t==null?void 0:t.trim().toLowerCase();if(!(e===void 0||e==="")){if(e==="1"||e==="true"||e==="on"||e==="yes")return!0;if(e==="0"||e==="false"||e==="off"||e==="no")return!1}}const OOe="$feature/canary-";function COe(t){return`${OOe}${t}`}function kOe(t){return`canary_reason_${t.replace(/[^A-Za-z0-9]+/g,"_")}`}function EOe(t){const e={};for(const n of t)e[COe(n.name)]=n.enabled?"true":"false",n.reason!==void 0&&(e[kOe(n.name)]=n.reason);return e}const Ure=[{name:"calibration-10",percentage:10,description:"Inert. Validates rollout accuracy and cumulative-exposure drift at 10%.",owner:"vance",sunsetAfter:"2026-09-15"},{name:"calibration-50",percentage:50,description:"Inert. Second calibration point, and an independence check against calibration-10.",owner:"vance",sunsetAfter:"2026-09-15"}];function TOe(t){return Ure.find(e=>e.name===t)}function POe(t){return`hf_canary_${t.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`}function MOe(t){var e;try{if(typeof window>"u")return;const n=(e=window.__HF_CLI_CANARY_DECISIONS)==null?void 0:e[t];return typeof(n==null?void 0:n.enabled)!="boolean"?void 0:{enabled:n.enabled,forced:n.forced===!0}}catch{return}}function NOe(){try{const t=typeof window>"u"?void 0:window.__HF_CLI_BUCKET_SEED;if(typeof t=="string"&&t.length>0)return t}catch{}return V7()}const DOe="hyperframes-studio:canary:";function IOe(t){if(typeof window>"u")return;const e=POe(t),n=`${DOe}${t}`,r=B7();let i=null;try{i=new URLSearchParams(window.location.search).get(e)}catch{i=null}if(i!==null){if(i.trim().toLowerCase()==="reset"){r==null||r.removeItem(n);return}try{r==null||r.setItem(n,i)}catch{}return lZ(i)}return lZ((r==null?void 0:r.getItem(n))??void 0)}function cZ(){return typeof navigator>"u"?!1:navigator.webdriver===!0}const uZ=new Map,fZ=t=>({enabled:t,reason:t?"forced_on":"forced_off"}),_Oe=t=>({enabled:t,reason:t?"in_cohort":"out_of_cohort"});function ROe(t){const e=TOe(t);if(!e)return{enabled:!1,reason:"out_of_cohort"};const n=MOe(e.name);if(n!=null&&n.forced)return fZ(n.enabled);const r=IOe(e.name);if(r===void 0){if(!YA())return{enabled:!1,reason:"telemetry_opt_out"};if(cZ())return{enabled:!1,reason:"excluded"};if(n!==void 0)return _Oe(n.enabled)}return r!==void 0?fZ(r):wOe({feature:e.name,unitId:NOe(),percentage:e.percentage,exclude:cZ()})}function jOe(t){const e=uZ.get(t);if(e)return e;const n=ROe(t);return uZ.set(t,n),n}function Xre(){return EOe(Ure.map(t=>{const{enabled:e,reason:n}=jOe(t.name);return{name:t.name,enabled:e,reason:n}}))}const LOe=14,FOe=["action","tab","panel","status","mode","reason","format","via"],d4=[],$Oe=Date.now();function BOe(t){for(const e of FOe){const n=t[e];if(typeof n=="string"&&n.length>0&&n.length<=24)return`:${n}`;if(typeof n=="number"||typeof n=="boolean")return`:${String(n)}`}return""}function VOe(t,e){const n=t.replace(/^studio[:_]/,"");d4.push({at:Date.now()-$Oe,label:`${n}${BOe(e)}`}),d4.length>LOe&&d4.shift()}function HOe(){return d4.map(t=>`${(t.at/1e3).toFixed(1)} ${t.label}`).join(" > ")}const QOe="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",zOe="https://us.i.posthog.com",ZOe=1e3;let p4=[],yP=null;function GOe(){return YA()}function Ns(t,e={}){if(!GOe())return;VOe(t,e);const n=vOe();p4.push({event:t,properties:{...e,...n,...Xre()},timestamp:new Date().toISOString()}),yP===null&&(yP=setTimeout(()=>{yP=null,AI()},ZOe)),XOe()}function AI(){if(p4.length===0)return;const t=Qre(),e=p4.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:t,timestamp:n.timestamp}));p4=[],UOe(`${zOe}/batch/`,JSON.stringify({api_key:QOe,batch:e}))}function UOe(t,e){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}).catch(()=>{});return}catch{}try{navigator.sendBeacon(t,new Blob([e],{type:"application/json"}))}catch{}}function XOe(){aOe()||(oOe(),console.info("%c[HyperFrames]%c Anonymous studio usage analytics enabled. Disable: localStorage.setItem('hyperframes-studio:telemetryDisabled','1') (then reload).","color:#7c3aed;font-weight:bold","color:inherit"))}typeof window<"u"&&(window.addEventListener("pagehide",()=>AI(),{capture:!0}),window.addEventListener("visibilitychange",()=>{typeof document<"u"&&document.visibilityState==="hidden"&&AI()}));function WOe(t){Ns("studio_session_start",{has_project:t.has_project})}function qOe(t){Ns("studio_render_start",{fps:t.fps,quality:t.quality,format:t.format,resolution:t.resolution,composition:t.composition})}function YOe(t){Ns("studio_timeline_performance",t)}function KOe(){var t,e;try{const n=navigator,i=[`ua=${((t=n.userAgentData)==null?void 0:t.platform)??navigator.platform??"unknown"}`,`screen=${screen.width}x${screen.height}@${devicePixelRatio}x`,`lang=${navigator.language}`];return n.deviceMemory&&i.push(`mem=${n.deviceMemory}GB`),(e=n.connection)!=null&&e.effectiveType&&i.push(`net=${n.connection.effectiveType}`),navigator.hardwareConcurrency&&i.push(`cpu=${navigator.hardwareConcurrency}cores`),i.join(" ")}catch{return""}}function JOe(t){Ns("studio_razor_split",{mode:t.mode,count:t.count})}function Fm(t){Ns("studio_expanded_clip_edit",{action:t.action})}function hZ(t){Ns("studio_keyframe_lane_expand",{expanded:t.expanded})}function H7(t){Ns("studio_segment_ease_edit",{action:t.action,ease:t.ease})}function e8e(t){Ns("studio_feedback_shown",{reason:t.reason,render_id:t.render_id,source:"studio"})}function t8e(t){Ns("studio_feedback_dismissed",{reason:t.reason,render_id:t.render_id,via:t.via,had_rating:t.had_rating,source:"studio"})}function n8e(t){Ns("studio_feedback_interview_click",{reason:t.reason,source:"studio"})}function r8e(t){Ns("studio_feedback",{...t.rating===void 0?{}:{rating:t.rating,rating_scale:10},...t.comment?{comment:t.comment}:{},...t.context,reason:t.reason,render_id:t.render_id,question:t.question,answer_kind:t.answer_kind,doctor_summary:KOe(),breadcrumbs:HOe(),source:"studio"})}function kO(t){Ns("studio_block_param_commit",{tone:t.tone,block_name:t.blockName,param_key:t.key})}async function i8e(t){try{const e=await t.json();if(typeof e=="object"&&e!==null){const{error:n,hint:r}=e;if(typeof n=="string"&&n)return typeof r=="string"&&r?`${n}. ${r}`:n}}catch{}return`Server error (${t.status}). Check the terminal for details.`}function s8e(t){const e=(t==null?void 0:t.title)??"FFmpeg not found",n=(t==null?void 0:t.command)??(t==null?void 0:t.hint);return n?`${e}. Install it with: ${n}`:`${e}. Install FFmpeg to export.`}let Qx=null;const EO=t=>typeof t=="string"&&t?t:void 0;function a8e(t){if(typeof t!="object"||t===null)return null;const{ok:e,title:n,detail:r,hint:i,command:s}=t;return typeof e!="boolean"?null:{ok:e,title:EO(n),detail:EO(r),hint:EO(i),command:EO(s)}}async function o8e(){try{const t=await fetch("/api/environment/ffmpeg");return t.ok?a8e(await t.json()):null}catch{return null}}function l8e(){const[t,e]=x.useState(Qx),[n,r]=x.useState(Qx===null),i=x.useRef(!0);x.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const s=x.useCallback(async()=>{r(!0);const o=await o8e();Qx=o,i.current&&(e(o),r(!1))},[]);x.useEffect(()=>{Qx===null&&s()},[s]);const a=x.useCallback(()=>{Qx=null,s()},[s]);return{status:t,checking:n,recheck:a}}function dZ(t){return t!=="render_complete"}const pZ=[{id:"remove",prompt:"What would you cut from Studio?",placeholder:"The part you never use",presets:[{label:"Layers panel",hint:"The layer tree on the right"},{label:"Variables panel",hint:"Composition variables on the right"},{label:"Blocks browser",hint:"The block library in the sidebar"},{label:"Storyboard mode",hint:"The storyboard view next to Preview"},{label:"Caption editing",hint:"Editing caption words and presets in Studio"},{label:"Render history",hint:"The list of past exports"},{label:"Nothing",hint:"It all earns its place"}]},{id:"workaround",prompt:"What did you have to do outside Studio?",placeholder:"The step you finished somewhere else",presets:[{label:"Fix the exported file",hint:"Remuxing or re-encoding the output by hand"},{label:"Convert source media",hint:"Re-encoding footage before it would import cleanly"},{label:"Match loudness",hint:"Normalising levels across the finished audio"},{label:"Make images or graphics",hint:"Creating visual assets in another tool"},{label:"Record footage",hint:"Capturing screen or camera video"},{label:"Nothing, it was all here",hint:"No outside tools needed"}]},{id:"fix",prompt:"What should we fix first?",placeholder:"The thing that slowed you down",presets:[{label:"Audio mixing",hint:"Levels, ducking or the balance in the exported mix"},{label:"Export encoding",hint:"The render fails, or the finished file is wrong"},{label:"Export matches preview",hint:"The exported video differs from the preview"},{label:"Media and fonts",hint:"Adding video, images or fonts to a project"},{label:"Render speed",hint:"Exports take too long to finish"},{label:"Re-rendering everything",hint:"A small change means rendering the whole thing"},{label:"Checks and warnings",hint:"Lint flags things that are fine, or misses real ones"}]}],c8e={id:"detractor",prompt:"What went wrong?",placeholder:"The thing that made that a low score",presets:[{label:"Export failed",hint:"The render did not finish"},{label:"Output looked wrong",hint:"It rendered, but not the way I built it"},{label:"Crashed or froze",hint:"The editor stopped responding"},{label:"Lost my edits",hint:"Changes did not save, or came back changed"},{label:"Too slow",hint:"Waiting on renders, or the editor itself lagging"},{label:"Could not figure it out",hint:"Could not find or understand something"}]},u8e=6;function f8e(t){return t<=u8e?c8e:pZ[Math.floor(Math.random()*pZ.length)]}const c6={dismissedAt:"hyperframes-studio:feedbackDismissedAt",answeredAt:"hyperframes-studio:feedbackAnsweredAt"},Wre="hyperframes-studio:feedbackAskedThisSession",qre=864e5,h8e=30*qre,d8e=7*qre;let R2=null;function p8e(){try{return!1}catch{return!1}}function mZ(t){try{return parseInt(window.localStorage.getItem(t)||"0",10)||0}catch{return 0}}function Yre(t,e){try{window.localStorage.setItem(t,String(e))}catch{}}function m8e(){try{return window.sessionStorage.getItem(Wre)==="1"}catch{return!0}}function g8e(){try{window.sessionStorage.setItem(Wre,"1")}catch{}}function y8e(t){return!(p8e()||!YA()||m8e()||t-mZ(c6.answeredAt)<h8e||t-mZ(c6.dismissedAt)<d8e)}function Kre(t){R2&&y8e(Date.now())&&(g8e(),R2(t))}function x8e(t){return R2=t,()=>{R2===t&&(R2=null)}}function b8e(){Yre(c6.answeredAt,Date.now())}function v8e(){Yre(c6.dismissedAt,Date.now())}function Jre(t){return`hf-studio-hidden-renders:${t}`}function gZ(t){try{const e=window.localStorage.getItem(Jre(t)),n=e?JSON.parse(e):[];return new Set(Array.isArray(n)?n.filter(r=>typeof r=="string"):[])}catch{return new Set}}function A8e(t,e){try{window.localStorage.setItem(Jre(t),JSON.stringify([...e].slice(-200)))}catch{}}function S8e(t){const[e,n]=x.useState([]),[r,i]=x.useState(null),[s,a]=x.useState(null),{status:o,checking:l,recheck:c}=l8e(),u=o!==null&&!o.ok,f=x.useRef(null),h=x.useRef(null),m=x.useRef(new Map),y=x.useRef(new Set),d=x.useCallback((I,_)=>{m.current.set(I.id,_),n(j=>[...j,I])},[]),v=x.useCallback(I=>{var _;I&&h.current!==I||((_=f.current)==null||_.close(),f.current=null,h.current=null)},[]),b=x.useCallback(async()=>{if(t)try{const I=await fetch(`/api/projects/${t}/renders`);if(!I.ok){i(`Couldn't load render history (server error ${I.status}).`);return}const _=await I.json();if(i(null),Array.isArray(_.renders)){const j=gZ(t);n(L=>{const B=new Set(L.map(Q=>Q.id)),$=_.renders.filter(Q=>!B.has(Q.id)&&!j.has(Q.id)).map(Q=>({id:Q.id,status:Q.status==="failed"?"failed":"complete",progress:100,filename:Q.filename,createdAt:Q.createdAt,durationMs:Q.durationMs}));return[...L,...$]})}}catch{i("Couldn't load render history. Is the studio server running?")}},[t]);x.useEffect(()=>{b()},[b]);const w=x.useCallback(async(I={})=>{if(!t)return;if(u){d({id:Af(),status:"failed",progress:0,error:s8e(o),filename:"Export blocked",createdAt:Date.now()},{});return}const _=I.fps??30,j=I.quality??"standard",L=I.format??"mp4",B=I.resolution,$=I.composition;qOe({fps:_,quality:j,format:L,resolution:B,composition:$});const Q=Date.now(),Y={render_format:L,render_quality:j,render_fps:_,render_resolution:B??"auto",render_composition:$??"index.html",render_has_variables:!!(I.variables&&Object.keys(I.variables).length>0)},W={fps:_,quality:j,format:L};YA()?W.telemetryDistinctId=Qre():W.telemetryOptOut=!0,B&&B!=="auto"&&(W.resolution=B),$&&(W.composition=$),I.variables&&Object.keys(I.variables).length>0&&(W.variables=I.variables);let J;try{J=await fetch(`/api/projects/${t}/render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})}catch(U){const Z=U instanceof Error?U.message:String(U),K={id:Af(),status:"failed",progress:0,error:`Could not reach render server: ${Z}. Use \`hyperframes render\` from the CLI instead.`,filename:"Export failed",createdAt:Q};d(K,Y);return}if(!J.ok){const U={id:Af(),status:"failed",progress:0,error:await i8e(J),filename:"Export failed",createdAt:Q};d(U,Y);return}const{jobId:ne}=await J.json(),ie={mp4:".mp4",webm:".webm",mov:".mov"}[L]??".mp4",q={id:ne,status:"rendering",progress:0,filename:`${ne}${ie}`,createdAt:Q};d(q,Y),h.current=ne;const F=new EventSource(`/api/render/${ne}/progress`);return f.current=F,F.addEventListener("progress",U=>{try{const Z=JSON.parse(U.data),K=Z.status==="complete"||Z.status==="failed"||Z.status==="cancelled";n(ee=>ee.map(re=>re.id===ne?{...re,progress:Z.progress??re.progress,stage:Z.stage??Z.message??re.stage,status:K?Z.status:re.status,durationMs:Z.status==="complete"?Date.now()-Q:void 0,error:Z.error??re.error}:re)),K&&v(ne)}catch{}}),F.onerror=()=>{F.close(),n(U=>U.map(Z=>Z.id===ne&&Z.status==="rendering"?{...Z,status:"failed",error:"Connection lost. Is the render server running?"}:Z)),h.current=null},ne},[t,v,d,o,u]),O=x.useCallback(async I=>{a(null),v(I),n(_=>_.map(j=>j.id===I&&j.status==="rendering"?{...j,status:"cancelled"}:j));try{const _=await fetch(`/api/render/${I}/cancel`,{method:"POST"});if(!_.ok&&_.status!==404){a("Couldn't cancel on the server — the render may still be running.");return}if(_.ok){const j=await _.json().catch(()=>null);j!=null&&j.status&&j.status!=="cancelled"&&b()}}catch{a("Couldn't reach the server to cancel — the render may still be running.")}},[v,b]),k=x.useCallback(async I=>{a(null),v(I);try{if(!(await fetch(`/api/render/${I}`,{method:"DELETE"})).ok){a("Couldn't delete the render — it's still on disk.");return}}catch{a("Couldn't reach the server to delete the render.");return}n(_=>_.filter(j=>j.id!==I))},[v]),E=x.useCallback(()=>{n(I=>{const _=I.filter(j=>j.status!=="rendering");if(t&&_.length>0){const j=gZ(t);for(const L of _)j.add(L.id);A8e(t,j)}return I.filter(j=>j.status==="rendering")})},[t]),M=x.useCallback(()=>a(null),[]);x.useEffect(()=>{for(const I of e){if(I.status==="rendering"||I.status==="cancelled")continue;const _=m.current.get(I.id);!_||y.current.has(I.id)||(y.current.add(I.id),Kre({reason:I.status==="complete"?"render_complete":"render_failed",renderId:I.id,detail:I.error,context:{..._,render_progress:I.progress,render_duration_ms:I.durationMs??Date.now()-I.createdAt,render_stage:I.stage,render_error:I.error,renders_this_session:m.current.size}}))}},[e]),x.useEffect(()=>()=>{var I;(I=f.current)==null||I.close(),f.current=null},[t]);const N=e.some(I=>I.status==="rendering");return x.useMemo(()=>({jobs:e,isRendering:N,loadError:r,actionError:s,dismissActionError:M,reloadRenders:b,deleteRender:k,cancelRender:O,clearCompleted:E,startRender:w,ffmpeg:o,ffmpegMissing:u,ffmpegChecking:l,recheckFfmpeg:c}),[e,N,r,s,M,b,k,O,E,w,o,u,l,c])}const w8e="modulepreload",O8e=function(t){return"/"+t},yZ={},ly=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=a(n.map(c=>{if(c=O8e(c),c in yZ)return;yZ[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":w8e,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((m,y)=>{h.addEventListener("load",m),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};function C8e(t){if(typeof t!="object"||t===null)return!0;const e=t;return e.isLoaded===!0||typeof e.totalFrames=="number"&&e.totalFrames>0}function wr(t){x.useEffect(t,[])}const xZ=t=>{let e;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(m=>m(e,h))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,o);return o},k8e=(t=>t?xZ(t):xZ),E8e=t=>t;function T8e(t,e=E8e){const n=_b.useSyncExternalStore(t.subscribe,_b.useCallback(()=>e(t.getState()),[t,e]),_b.useCallback(()=>e(t.getInitialState()),[t,e]));return _b.useDebugValue(n),n}const bZ=t=>{const e=k8e(t),n=r=>T8e(e,r);return Object.assign(n,e),n},rE=(t=>t?bZ(t):bZ),Nv=rE(t=>({values:null,setValues:e=>t({values:e&&Object.keys(e).length>0?e:null})}));function eie(t){const e=Nv.getState().values;e?t.searchParams.set("variables",JSON.stringify(e)):t.searchParams.delete("variables")}const tie={primary:["bg-white text-neutral-950 font-medium","shadow-btn-primary","enabled:hover:bg-neutral-200","enabled:active:scale-[0.97]"].join(" "),secondary:["bg-transparent text-neutral-300 font-medium","border border-border","enabled:hover:bg-surface-hover enabled:hover:text-white enabled:hover:border-border-strong","enabled:active:scale-[0.98]"].join(" "),danger:["bg-accent-red text-white font-medium","enabled:hover:bg-red-600","enabled:active:scale-[0.97]"].join(" "),ghost:["bg-transparent text-neutral-400","enabled:hover:bg-surface-hover enabled:hover:text-white","enabled:active:scale-[0.98]"].join(" ")},P8e={sm:"h-7 px-2.5 text-xs gap-1.5 rounded-button",md:"h-8 px-3 text-sm gap-1.5 rounded-button",lg:"h-9 px-4 text-base gap-2 rounded-button"},Qo=x.forwardRef(({variant:t="secondary",size:e="md",loading:n,icon:r,children:i,className:s="",disabled:a,...o},l)=>p.jsxs("button",{ref:l,disabled:a||n,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:cursor-not-allowed","select-none cursor-pointer","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-studio-accent",tie[t],P8e[e],s].join(" "),...o,children:[n?p.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):r?p.jsx("span",{className:"flex-shrink-0",children:r}):null,i&&p.jsx("span",{children:i})]}));Qo.displayName="Button";const M8e={sm:"min-w-7 min-h-7 rounded-button",md:"min-w-8 min-h-8 rounded-button",lg:"min-w-9 min-h-9 rounded-button"},N8e=x.forwardRef(({icon:t,size:e="md",variant:n="ghost",className:r="",...i},s)=>p.jsx("button",{ref:s,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:cursor-not-allowed","select-none cursor-pointer","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-studio-accent",tie[n],M8e[e],r].join(" "),...i,children:t}));N8e.displayName="IconButton";function vZ({title:t,detail:e,mono:n,size:r=64,progress:i}){const s=typeof i=="number"&&Number.isFinite(i)?Math.min(1,Math.max(0,i)):void 0,a=Math.round(r*1.16);return p.jsxs("div",{className:"hf-loader",role:"status",draggable:!1,children:[p.jsx("div",{className:"hf-loader-mark-frame",style:{width:a,height:a},draggable:!1,children:p.jsxs("svg",{className:"hf-loader-mark",width:r,height:r,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[p.jsx("g",{className:"hf-loader-mark__mark",transform:"translate(50 50)",children:p.jsx("g",{className:"hf-loader-mark__core",transform:"scale(1)",opacity:".92",children:p.jsxs("g",{transform:"translate(-50 -50)",children:[p.jsx("path",{d:"M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z",fill:"url(#hf-loader-grad-left)"}),p.jsx("path",{d:"M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",fill:"url(#hf-loader-grad-right)"})]})})}),p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"hf-loader-grad-left",x1:"48.5676",y1:"25",x2:"44.7804",y2:"71.9384",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#06E3FA"}),p.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),p.jsxs("linearGradient",{id:"hf-loader-grad-right",x1:"54.8282",y1:"73.8392",x2:"72.0989",y2:"32.8932",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#06E3FA"}),p.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]})]})}),p.jsx("div",{className:"hf-loader-title",children:t}),e&&p.jsx("div",{className:"hf-loader-detail",children:e}),s!==void 0&&p.jsx("div",{className:"hf-loader-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s*100),children:p.jsx("div",{className:"hf-loader-progress__fill",style:{transform:`scaleX(${s})`}})}),n&&p.jsx("div",{className:"hf-loader-mono",children:n})]})}var Fl=$re();function m4(t,e,n){return Math.max(e,Math.min(n,t))}function D8e(t,e,n,r){const i=e/2,s=i+r;return m4(t,s,Math.max(s,n-i-r))}function Q7(t,e,n,r){const i=(r==null?void 0:r.offset)??8,s=(r==null?void 0:r.margin)??12,a=Math.max(s,e.width-n.width-s),o=t.left+t.width/2-n.width/2,l=m4(o,s,a),c=t.bottom+i,u=t.top-n.height-i,f=c+n.height<=e.height-s,h=u>=s;return f||!h?{left:l,top:m4(c,s,Math.max(s,e.height-n.height-s)),placement:"bottom"}:{left:l,top:m4(u,s,Math.max(s,e.height-n.height-s)),placement:"top"}}const AZ=28,xP=8;function br({label:t,children:e,delay:n=400,side:r="top"}){const[i,s]=x.useState(!1),[a,o]=x.useState({x:0,y:0}),[l,c]=x.useState(r),u=x.useRef(null),f=x.useRef(null),h=x.useRef(null),[m,y]=x.useState(0),d=x.useId(),v=x.useCallback(()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{const O=f.current;if(!O)return;const E=(O.firstElementChild??O).getBoundingClientRect();if(E.width===0&&E.height===0)return;let M=r;r==="top"&&E.top-AZ-6<xP?M="bottom":r==="bottom"&&E.bottom+AZ+6>window.innerHeight-xP&&(M="top"),c(M),o({x:E.left+E.width/2,y:M==="top"?E.top-6:E.bottom+6}),s(!0)},n)},[n,r]),b=x.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),s(!1)},[]);x.useLayoutEffect(()=>{var O;y(i?((O=h.current)==null?void 0:O.offsetWidth)??0:0)},[i,t]),x.useEffect(()=>{if(!i)return;const O=k=>{k.key==="Escape"&&b()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[i,b]);const w=D8e(a.x,m,window.innerWidth,xP);return p.jsxs(p.Fragment,{children:[p.jsx("span",{ref:f,onPointerEnter:v,onPointerLeave:b,onFocus:v,onBlur:b,"aria-describedby":i?d:void 0,className:"contents",children:e}),i&&Fl.createPortal(p.jsx("div",{className:"fixed z-[200] pointer-events-none",style:{left:w,top:a.y,transform:l==="top"?"translate(-50%, -100%)":"translate(-50%, 0)"},children:p.jsx("div",{ref:h,role:"tooltip",id:d,className:"px-2 py-1 rounded-md bg-neutral-800 border border-neutral-700/50 text-[10px] font-medium text-neutral-200 whitespace-nowrap shadow-lg",children:t})}),document.body)]})}const I8e=3,_8e=3;function SI(t){return typeof t=="object"&&t!==null}function R8e(t){if(!(t instanceof CustomEvent))return null;const e=t.detail;if(!SI(e))return null;const n=e.state;return SI(n)?n.loading===!0&&n.ready!==!0:null}const j8e=400,SZ="The composition preview did not become ready.";function L8e(t){return!(t instanceof CustomEvent)||!SI(t.detail)?SZ:typeof t.detail.message=="string"&&t.detail.message.trim()?t.detail.message:SZ}function F8e(t){const e=t.shadowRoot;if(!e)return;const n=e.querySelector(".hfp-container"),r=e.querySelector(".hfp-iframe");n==null||n.style.setProperty("pointer-events","auto"),r==null||r.style.setProperty("pointer-events","auto")}function $8e(t){const e=t.tagName.toLowerCase();return e==="video"||e==="audio"}function wZ(t,e){try{const n=t.contentWindow,r=t.contentDocument;if(!n||!r)return e;for(const s of r.querySelectorAll("video, audio"))if($8e(s)&&!s.error&&s.networkState!==_8e&&s.readyState<I8e)return!0;const i=n.__hfLottie;if(i!=null&&i.length){for(const s of i)if(!C8e(s))return!0}return!1}catch{return e}}const wI=x.forwardRef(({projectId:t,directUrl:e,onLoad:n,onCompositionLoadingChange:r,portrait:i,style:s,suppressLoadingOverlay:a},o)=>{const l=x.useRef(null),c=x.useRef(0),u=x.useRef(null),f=x.useRef(null),h=x.useRef(null),m=x.useRef(0),[y,d]=x.useState(!1),[v,b]=x.useState(!1),[w,O]=x.useState(!1),[k,E]=x.useState(!1),[M,N]=x.useState(!1),[I,_]=x.useState(!0),[j,L]=x.useState(!0),[B,$]=x.useState(null);x.useEffect(()=>{if(!I){L(!0);return}const J=setTimeout(()=>L(!1),j8e);return()=>clearTimeout(J)},[I]),wr(()=>{const J=l.current;if(!J)return;let ne=!1,le;return ly(()=>import("./hyperframes-player-DzRNJZAz.js"),[]).then(()=>{if(ne)return;const ie=document.createElement("hyperframes-player"),q=new URL(e||`/api/projects/${t}/preview`,window.location.origin);eie(q);const F=q.pathname+q.search,U=()=>{m.current+=1;const se=new URL(F,window.location.origin);se.searchParams.set("_hfStudioRetry",String(m.current)),$(null),_(!0),ie.setAttribute("src",se.pathname+se.search)};h.current=U;const Z=ie.iframeElement,K=se=>se.stopImmediatePropagation(),ee=se=>{const ue=R8e(se);ue!==null&&N(ue)},re=()=>{$(null),_(!1)},z=se=>{$(L8e(se)),_(!1)},H=()=>{if(c.current++,$(null),N(!1),_(!0),c.current>1){J.classList.remove("preview-revealing"),J.offsetWidth,J.classList.add("preview-revealing");const be=()=>J.classList.remove("preview-revealing");J.addEventListener("animationend",be,{once:!0})}n(),u.current&&clearInterval(u.current);let ue=c.current>1?!1:wZ(Z,!1);if(ue){d(!0);let be=0;u.current=setInterval(()=>{be+=1,ue=wZ(Z,ue),(!ue||be>100)&&(ue&&be>100&&console.debug("[studio] asset readiness poll hit the 10s cap — continuing with unloaded assets"),u.current&&clearInterval(u.current),u.current=null,d(!1))},100)}else d(!1)};if(Z.addEventListener("load",H),ie.addEventListener("click",K,{capture:!0}),ie.addEventListener("shadertransitionstate",ee),ie.addEventListener("ready",re),ie.addEventListener("error",z),typeof o=="function"?o(Z):o&&(o.current=Z),ie.setAttribute("shader-capture-scale","1"),ie.setAttribute("shader-loading","player"),ie.setAttribute("width",String(i?1080:1920)),ie.setAttribute("height",String(i?1920:1080)),ie.style.width="100%",ie.style.height="100%",ie.style.display="block",ie.style.background="transparent",ie.setAttribute("src",F),J.appendChild(ie),ie.shadowRoot){const se=document.createElement("style");se.textContent=".hfp-container{overflow:visible}.hfp-iframe{box-shadow:0 0 0 1px rgba(255,255,255,0.08),0 4px 32px rgba(0,0,0,.7)}",ie.shadowRoot.appendChild(se)}F8e(ie),le=()=>{if(Z.removeEventListener("load",H),ie.removeEventListener("click",K,{capture:!0}),ie.removeEventListener("shadertransitionstate",ee),ie.removeEventListener("ready",re),ie.removeEventListener("error",z),u.current&&clearInterval(u.current),u.current=null,ie.remove(),h.current===U&&(h.current=null),typeof o!="function"){if(o){const se=o;se.current===Z&&(se.current=null)}}}}),()=>{ne=!0,le==null||le()}}),x.useEffect(()=>{if(!y){E(!1);return}const J=setTimeout(()=>E(!0),3e3);return()=>clearTimeout(J)},[y]),x.useEffect(()=>{if(f.current&&(clearTimeout(f.current),f.current=null),y){b(!0),O(!1);return}return O(!0),f.current=setTimeout(()=>{b(!1),O(!1),f.current=null},240),()=>{f.current&&(clearTimeout(f.current),f.current=null)}},[y]);const Q=()=>{u.current&&(clearInterval(u.current),u.current=null),d(!1)},Y=!a&&!j&&I,W=v&&!M&&!Y&&!B;return x.useEffect(()=>{r==null||r(Y||W)},[r,Y,W]),p.jsxs("div",{className:"relative w-full h-full max-w-full max-h-full overflow-hidden flex items-center justify-center",style:s,children:[p.jsx("div",{ref:l,className:"w-full h-full"}),Y&&p.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-30 select-none","data-hyperframes-ignore":"","data-testid":"composition-loading-overlay",draggable:!1,onDragStart:J=>J.preventDefault(),onMouseDown:J=>J.preventDefault(),onPointerDown:J=>J.preventDefault(),children:p.jsx(vZ,{title:"Loading composition",detail:"Preparing the Studio preview.",size:56})}),W&&p.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-20 select-none","data-hyperframes-ignore":"",draggable:!1,style:{opacity:w?0:1,pointerEvents:w?"none":"auto",transition:"opacity 180ms ease-in"},onDragStart:J=>J.preventDefault(),onMouseDown:J=>J.preventDefault(),children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx(vZ,{title:"Preparing preview assets",detail:"Waiting for media and motion assets before playback starts.",size:56}),k&&p.jsx("button",{type:"button",onClick:Q,className:"px-3 py-1.5 text-[11px] rounded-md border border-neutral-700 text-neutral-300 hover:border-neutral-500 hover:bg-neutral-800 transition-colors",children:"Continue anyway"})]})}),B&&p.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/90 px-6 text-center","data-hyperframes-ignore":"","data-testid":"composition-preview-error",children:p.jsxs("div",{className:"max-w-sm",children:[p.jsx("p",{className:"text-sm font-semibold text-white",children:"Preview failed to load"}),p.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:B}),p.jsx("button",{type:"button",className:"mt-4 rounded-md bg-white px-3 py-1.5 text-xs font-semibold text-black transition-colors hover:bg-neutral-200",onClick:()=>{var J;return(J=h.current)==null?void 0:J.call(h)},children:"Retry preview"})]})})]})});wI.displayName="Player";function nf(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nie(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
50
50
|
* GSAP 3.15.0
|
|
51
51
|
* https://gsap.com
|
|
52
52
|
*
|
|
@@ -67,7 +67,7 @@ Error generating stack: `+D.message+`
|
|
|
67
67
|
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
68
68
|
* Subject to the terms at https://gsap.com/standard-license
|
|
69
69
|
* @author: Jack Doyle, jack@greensock.com
|
|
70
|
-
*/var s6e=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,a6e=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,o6e=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,l6e=/(^[#\.][a-z]|[a-y][a-z])/i,c6e=Math.PI/180,PO=Math.sin,MO=Math.cos,hc=Math.abs,cf=Math.sqrt,NO=Math.atan2,HZ=1e8,QZ=function(e){return typeof e=="string"},Kie=function(e){return typeof e=="number"},zZ=1e5,ns=function(e){return Math.round(e*zZ)/zZ||0},ZZ=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},u6e=function(e,n,r){var i=e.length,s=~~(r*i);if(e[s]>n){for(;--s&&e[s]>n;);s<0&&(s=0)}else for(;e[++s]<n&&s<i;);return s<i?s:i-1};function f6e(t){t=QZ(t)&&l6e.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=mf(t)):t?QZ(t)?mf(t):Kie(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function Lb(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var h6e=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),s=i.length,a;for(n=","+n+",";--s>-1;)a=i[s].nodeName.toLowerCase(),n.indexOf(","+a+",")<0&&r.setAttributeNS(null,a,i[s].nodeValue);return r},d6e={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},p6e=function(e,n){for(var r=n?n.split(","):[],i={},s=r.length;--s>-1;)i[r[s]]=+e.getAttribute(r[s])||0;return i};function Jie(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,s,a,o,l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_;return n==="path"||!t.getBBox?t:(c=h6e(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),_=p6e(t,d6e[n]),n==="rect"?(o=_.rx,l=_.ry||o,s=_.x,a=_.y,m=_.width-o*2,y=_.height-l*2,o||l?(d=s+o*(1-r),v=s+o,b=v+m,w=b+o*r,O=b+o,k=a+l*(1-r),E=a+l,M=E+y,N=M+l*r,I=M+l,i="M"+O+","+E+" V"+M+" C"+[O,N,w,I,b,I,b-(b-v)/3,I,v+(b-v)/3,I,v,I,d,I,s,N,s,M,s,M-(M-E)/3,s,E+(M-E)/3,s,E,s,k,d,a,v,a,v+(b-v)/3,a,b-(b-v)/3,a,b,a,w,a,O,k,O,E].join(",")+"z"):i="M"+(s+m)+","+a+" v"+y+" h"+-m+" v"+-y+" h"+m+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(o=l=_.r,f=o*r):(o=_.rx,l=_.ry,f=l*r),s=_.cx,a=_.cy,u=o*r,i="M"+(s+o)+","+a+" C"+[s+o,a+f,s+u,a+l,s,a+l,s-u,a+l,s-o,a+f,s-o,a,s-o,a-f,s-u,a-l,s,a-l,s+u,a-l,s+o,a-f,s+o,a].join(",")+"z"):n==="line"?i="M"+_.x1+","+_.y1+" L"+_.x2+","+_.y2:(n==="polyline"||n==="polygon")&&(h=(t.getAttribute("points")+"").match(a6e)||[],s=h.shift(),a=h.shift(),i="M"+s+","+a+" L"+h.join(","),n==="polygon"&&(i+=","+s+","+a+"z")),c.setAttribute("d",$p(c._gsRawPath=mf(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function ese(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,s=t.length,a=t[e],o=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:HZ)||HZ,h=c[l+n*r-1],m=e?c[l-1]:0,y,d,v,b,w,O,k,E,M,N,I,_,j,L,B,$,Q;for(c.length=u.length=0,d=e+2;d<s;d+=6){if(v=t[d+4]-a,b=t[d+2]-a,w=t[d]-a,E=t[d+5]-o,M=t[d+3]-o,N=t[d+1]-o,O=k=I=_=0,hc(v)<.01&&hc(E)<.01&&hc(w)+hc(N)<.01)t.length>8&&(t.splice(d,6),d-=6,s-=6);else for(y=1;y<=r;y++)L=i*y,j=1-L,O=k-(k=(L*L*v+3*j*(L*b+j*w))*L),I=_-(_=(L*L*E+3*j*(L*M+j*N))*L),$=cf(I*I+O*O),$<f&&(f=$),m+=$,c[l++]=m;a+=v,o+=E}if(h)for(h-=m;l<c.length;l++)c[l]+=h;if(c.length&&f){if(t.totalLength=Q=c[c.length-1]||0,t.minLength=f,Q/f<9999)for($=B=0,y=0;y<Q;y+=f)u[$++]=c[B]<y?++B:B}else t.totalLength=c[0]=0;return e?m-c[e/2-1]:m}function tse(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=12,n+=ese(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function m6e(t,e,n,r,i,s,a,o,l){if(!(t===o&&e===l)){n=hc(n),r=hc(r);var c=i%360*c6e,u=MO(c),f=PO(c),h=Math.PI,m=h*2,y=(t-o)/2,d=(e-l)/2,v=u*y+f*d,b=-f*y+u*d,w=v*v,O=b*b,k=w/(n*n)+O/(r*r);k>1&&(n=cf(k)*n,r=cf(k)*r);var E=n*n,M=r*r,N=(E*M-E*O-M*w)/(E*O+M*w);N<0&&(N=0);var I=(s===a?-1:1)*cf(N),_=I*(n*b/r),j=I*-(r*v/n),L=(t+o)/2,B=(e+l)/2,$=L+(u*_-f*j),Q=B+(f*_+u*j),Y=(v-_)/n,W=(b-j)/r,J=(-v-_)/n,ne=(-b-j)/r,le=Y*Y+W*W,ie=(W<0?-1:1)*Math.acos(Y/cf(le)),q=(Y*ne-W*J<0?-1:1)*Math.acos((Y*J+W*ne)/cf(le*(J*J+ne*ne)));isNaN(q)&&(q=h),!a&&q>0?q-=m:a&&q<0&&(q+=m),ie%=m,q%=m;var F=Math.ceil(hc(q)/(m/4)),U=[],Z=q/F,K=4/3*PO(Z/2)/(1+MO(Z/2)),ee=u*n,re=f*n,z=f*-r,H=u*r,se;for(se=0;se<F;se++)i=ie+se*Z,v=MO(i),b=PO(i),Y=MO(i+=Z),W=PO(i),U.push(v-K*b,b+K*v,Y+K*W,W-K*Y,Y,W);for(se=0;se<U.length;se+=2)v=U[se],b=U[se+1],U[se]=v*ee+b*z+$,U[se+1]=v*re+b*H+Q;return U[se-2]=o,U[se-1]=l,U}}function mf(t){var e=(t+"").replace(o6e,function(_){var j=+_;return j<1e-4&&j>-1e-4?0:j}).match(s6e)||[],n=[],r=0,i=0,s=2/3,a=e.length,o=0,l="ERROR: malformed path: "+t,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I=function(j,L,B,$){w=(B-j)/3,O=($-L)/3,d.push(j+w,L+O,B-w,$-O,B,$)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<a;c++)if(E=m,isNaN(e[c])?(m=e[c].toUpperCase(),y=m!==e[c]):c--,f=+e[c+1],h=+e[c+2],y&&(f+=r,h+=i),c||(v=f,b=h),m==="M")d&&(d.length<8?n.length-=1:o+=d.length,ZZ(d)),r=v=f,i=b=h,d=[f,h],n.push(d),c+=2,m="L";else if(m==="C")d||(d=[0,0]),y||(r=i=0),d.push(f,h,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(m==="S")w=r,O=i,(E==="C"||E==="S")&&(w+=r-d[d.length-4],O+=i-d[d.length-3]),y||(r=i=0),d.push(w,O,f,h,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(m==="Q")w=r+(f-r)*s,O=i+(h-i)*s,y||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,d.push(w,O,r+(f-r)*s,i+(h-i)*s,r,i),c+=4;else if(m==="T")w=r-d[d.length-4],O=i-d[d.length-3],d.push(r+w,i+O,f+(r+w*1.5-f)*s,h+(i+O*1.5-h)*s,r=f,i=h),c+=2;else if(m==="H")I(r,i,r=f,i),c+=1;else if(m==="V")I(r,i,r,i=f+(y?i-r:0)),c+=1;else if(m==="L"||m==="Z")m==="Z"&&(f=v,h=b,d.closed=!0),(m==="L"||hc(r-f)>.5||hc(i-h)>.5)&&(I(r,i,f,h),m==="L"&&(c+=2)),r=f,i=h;else if(m==="A"){if(M=e[c+4],N=e[c+5],w=e[c+6],O=e[c+7],u=7,M.length>1&&(M.length<3?(O=w,w=N,u--):(O=N,w=M.substr(2),u-=2),N=M.charAt(1),M=M.charAt(0)),k=m6e(r,i,+e[c+1],+e[c+2],+e[c+3],+M,+N,(y?r:0)+w*1,(y?i:0)+O*1),c+=u,k)for(u=0;u<k.length;u++)d.push(k[u]);r=d[d.length-2],i=d[d.length-1]}else console.log(l);return c=d.length,c<6?(n.pop(),c=0):ZZ(d),n.totalPoints=o+c,n}function g6e(t,e){t.samples||ese(t);for(var n=t.samples,r=t.lookup,i=t.resolution,s=t.totalLength,a=t.slice(0,2),o=[],l=t.length-4,c=6,u=.2,f=0,h=0,m,y,d,v,b,w,O,k,E,M,N,I,_,j;c<l;c+=6)Math.abs(NO(t[c+1]-t[c-1],t[c]-t[c-2])-NO(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&o.push(c);if(o.push(t.length-2),l=o.length,a.nonSmooth=I=[1],e>l)for(e-=l,b=0;b<l;b++){for(_=o[b],j=Math.round(_/6*i),E=n[j-1]-f,y=Math.round(n[j-1]/s*e)-h,h+=y,w=1/(y+1),O=1;O<=y;O++)M=f+E*O*w,c=r.length?r[M<s?~~(M/t.minLength):r.length-1]||0:u6e(n,M,M/s),d=c?n[c-1]:0,v=n[c],v<M&&(d=v,v=n[++c]),m=1/i*((M-d)/(v-d)+c%i)||0,k=1-m,c=~~(c/i)*6,N=t[c],a.push(ns((m*m*(t[c+6]-N)+3*k*(m*(t[c+4]-N)+k*(t[c+2]-N)))*m+N),ns((m*m*(t[c+7]-(N=t[c+1]))+3*k*(m*(t[c+5]-N)+k*(t[c+3]-N)))*m+N));I[a.length]=1,a.push(t[_],t[_+1]),f+=E}return c=t.length-2,t.closed&&Math.abs(NO(t[c+1]-t[c-1],t[c]-t[c-2])-NO(t[3]-t[1],t[2]-t[0]))<=u&&(I[0]=I[I.length-1]=0),a}function y6e(t,e){hc(t[0]-t[2])<1e-4&&hc(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],s=+t[2],a=+t[3],o=[r,i,r,i],l=s-r,c=a-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,h,m,y,d,v,b,w,O,k,E,M,N,I,_,j;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(s,a),s=r,a=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,y=2;y<n;y+=2)if(h=r,m=i,r=s,i=a,s=+t[y+2],a=+t[y+3],!(r===s&&i===a)){if(d=l,v=c,l=s-r,c=a-i,u[y]){o.push(r-(r-h)/4,i-(i-m)/4,r,i,r+(s-r)/4,i+(a-i)/4);continue}b=cf(d*d+v*v),w=cf(l*l+c*c),O=cf(Math.pow(l/w+d/b,2)+Math.pow(c/w+v/b,2)),k=(b+w)*e*.25/O,E=r-(r-h)*(b?k/b:0),M=r+(s-r)*(w?k/w:0),N=r-(E+((M-E)*(b*3/(b+w)+.5)/4||0)),I=i-(i-m)*(b?k/b:0),_=i+(a-i)*(w?k/w:0),j=i-(I+((_-I)*(b*3/(b+w)+.5)/4||0)),o.push(ns(E+N),ns(I+j),ns(r),ns(i),ns(M+N),ns(_+j))}return r!==s||i!==a||o.length<4?o.push(ns(s),ns(a),ns(s),ns(a)):o.length-=2,o.length===2?o.push(r,i,r,i,r,i):f&&(o.splice(0,6),o.length-=6),o.closed=f,o}function $p(t){Kie(t[0])&&(t=[t]);var e="",n=t.length,r,i,s,a;for(i=0;i<n;i++){for(a=t[i],e+="M"+ns(a[0])+","+ns(a[1])+" C",r=a.length,s=2;s<r;s++)e+=ns(a[s++])+","+ns(a[s++])+" "+ns(a[s++])+","+ns(a[s++])+" "+ns(a[s++])+","+ns(a[s])+" ";a.closed&&(e+="z")}return e}function y6(){return y6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},y6.apply(this,arguments)}var wl,lj,Fb,nse,$b,rse,ise=function(){return wl||typeof window<"u"&&(wl=window.gsap)&&wl.registerPlugin&&wl},EP=function(e){return typeof e=="function"},x6=Math.atan2,GZ=Math.cos,UZ=Math.sin,l0=Math.sqrt,oE=Math.PI,XZ=oE*2,x6e=oE*.3,b6e=oE*.7,cj=1e20,Vv=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,v6e=/(^[#.][a-z]|[a-y][a-z])/i,A6e=/[achlmqstvz]/i,Jh=function(e){return console&&console.warn(e)},zc=function(e){return Math.round(e*1e5)/1e5||0},WZ=function(e){var n=e.length,r=0,i=0,s;for(s=0;s<n;s++)r+=e[s++],i+=e[s];return[r/(n/2),i/(n/2)]},Z1=function(e){var n=e.length,r=e[0],i=r,s=e[1],a=s,o,l,c;for(c=6;c<n;c+=6)o=e[c],l=e[c+1],o>r?r=o:o<i&&(i=o),l>s?s=l:l<a&&(a=l);return e.centerX=(r+i)/2,e.centerY=(s+a)/2,e.size=(r-i)*(s-a)},$2=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],s=i,a=e[0][1],o=a,l=1/n,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I;--r>-1;)for(m=e[r],c=m.length,h=6;h<c;h+=6)for(b=m[h],w=m[h+1],O=m[h+2]-b,M=m[h+3]-w,k=m[h+4]-b,N=m[h+5]-w,E=m[h+6]-b,I=m[h+7]-w,y=n;--y>-1;)d=l*y,v=1-d,u=(d*d*E+3*v*(d*k+v*O))*d+b,f=(d*d*I+3*v*(d*N+v*M))*d+w,u>i?i=u:u<s&&(s=u),f>a?a=f:f<o&&(o=f);return e.centerX=(i+s)/2,e.centerY=(a+o)/2,e.left=s,e.width=i-s,e.top=o,e.height=a-o,e.size=(i-s)*(a-o)},sse=function(e,n){return n.length-e.length},qZ=function(e,n){var r=e.size||Z1(e),i=n.size||Z1(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},YZ=function(e,n){var r=e.slice(0),i=e.length,s=i-2,a,o;for(n=n|0,a=0;a<i;a++)o=(a+n)%s,e[a++]=r[o],e[a]=r[o+1]},TP=function(e,n,r,i,s){var a=e.length,o=0,l=a-2,c,u,f,h;for(r*=6,u=0;u<a;u+=6)c=(u+r)%l,h=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-s),o+=l0(f*f+h*h);return o},S6e=function(e,n,r){var i=e.length,s=WZ(e),a=WZ(n),o=a[0]-s[0],l=a[1]-s[1],c=TP(e,n,0,o,l),u=0,f,h,m;for(m=6;m<i;m+=6)h=TP(e,n,m/6,o,l),h<c&&(c=h,u=m);if(r)for(f=e.slice(0),Lb(f),m=6;m<i;m+=6)h=TP(f,n,m/6,o,l),h<c&&(c=h,u=-m);return u/6},w6e=function(e,n,r){for(var i=e.length,s=cj,a=0,o=0,l,c,u,f,h,m;--i>-1;)for(l=e[i],m=l.length,h=0;h<m;h+=6)c=l[h]-n,u=l[h+1]-r,f=l0(c*c+u*u),f<s&&(s=f,a=l[h],o=l[h+1]);return[a,o]},O6e=function(e,n,r,i,s,a){var o=n.length,l=0,c=Math.min(e.size||Z1(e),n[r].size||Z1(n[r]))*i,u=cj,f=e.centerX+s,h=e.centerY+a,m,y,d,v,b;for(y=r;y<o&&(m=n[y].size||Z1(n[y]),!(m<c));y++)d=n[y].centerX-f,v=n[y].centerY-h,b=l0(d*d+v*v),b<u&&(l=y,u=b);return b=n[l],n.splice(l,1),b},C6e=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],s=e[n+1],a=e[n+2],o=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],h,m,y,d,v,b,w,O,k;r-- >0;)h=1-1/(r+2),m=i+(a-i)*h,y=a+(l-a)*h,d=s+(o-s)*h,v=o+(c-o)*h,b=m+(y-m)*h,w=d+(v-d)*h,O=l+(u-l)*h,k=c+(f-c)*h,y+=(O-y)*h,v+=(k-v)*h,e.splice(n+2,4,a=zc(m),o=zc(d),l=zc(b),c=zc(w),u=zc(b+(y-b)*h),f=zc(w+(v-w)*h),zc(y),zc(v),zc(O),zc(k))},k6e=function(e){for(var n=e.length,r=-cj,i;n--;)e[n]>r&&(r=e[n],i=n);return i},b4=function(e,n){for(var r=[],i=[],s=e.length-2,a=0;a<s;a+=6)r.push(Math.pow(e[a]-e[a+6],2)+Math.pow(e[a+1]-e[a+7],2));for(;n--;)a=k6e(r),i[a]=s=(i[a]||0)+1,r[a]*=s/(s+1);for(a=r.length;a--;)i[a]&&C6e(e,a*6,i[a])},FI=function(e,n){return n||tse(e),Math.max(4,Math.round(e.totalLength/4))},KZ=function(e){return e.slice(0).sort(sse)},ase=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},PP=function(e,n){n=n||{};var r=n,i=r.redraw,s=r.points,a=r.maxSegments,o=a===void 0?999:a,l=0,c=e,u=Array.isArray(s)?s:0,f,h,m,y,d;if(i=i!==!1,i)tse(e);else for(e.totalPoints=0,h=e.length;h--;)e.totalPoints+=e[h].length;for(u?(c=KZ(e),u=KZ(u),d=u[0].totalLength/Math.round(u[0].length/6)):((!s||s==="auto")&&(s=FI(e,i),i||(s-=Math.round(e.totalPoints/6))),s=Math.max(i?10:4,Math.min(999,s))),h=0;h<c.length;h++){if(m=c[h],f=Math.max(i?10:4,u?Math.round(u[h]?u[h].length/6:c[h].totalLength/d||0):Math.round((l/s+(i?m.totalLength/e.totalLength:m.length/e.totalPoints))*s)-l),!(h>=o||u&&(!u[h]||ase(u[h]))))if(i){var v;y=y6e(g6e(m,f),n.curviness),m.length=0,(v=m).push.apply(v,y)}else b4(m,f);l+=f}return e},$I=function(e,n,r,i,s){var a=n.length-e.length,o=a>0?n:e,l=a>0?e:n,c=0,u=i==="complexity"?sse:qZ,f=i==="position"?0:typeof i=="number"?i:.8,h=l.length,m=typeof r=="object"&&r.push?r.slice(0):[r],y=m[0]==="reverse"||m[0]<0,d=r==="log",v,b,w,O,k,E,M;if(l[0]){if(o.length>1&&(e.sort(u),n.sort(u),o.size||$2(o),l.size||$2(l),E=o.centerX-l.centerX,M=o.centerY-l.centerY,u===qZ))for(h=0;h<l.length;h++)o.splice(h,0,O6e(l[h],o,h,f,E,M));if(a)for(a<0&&(a=-a),o[0].length>l[0].length&&b4(l[0],(o[0].length-l[0].length)/6|0),h=l.length;c<a;)O=o[h].size||Z1(o[h]),w=w6e(l,o[h].centerX,o[h].centerY),O=w[0],k=w[1],l[h++]=[O,k,O,k,O,k,O,k],l.totalPoints+=8,c++;for(h=0;h<e.length;h++)v=n[h],b=e[h],a=v.length-b.length,a<0?b4(v,-a/6|0):a>0&&b4(b,a/6|0),y&&s!==!1&&!b.reversed&&Lb(b),r=m[h]||m[h]===0?m[h]:"auto",r&&(b.closed||Math.abs(b[0]-b[b.length-2])<.5&&Math.abs(b[1]-b[b.length-1])<.5?r==="auto"||r==="log"?(m[h]=r=S6e(b,v,!h||s===!1),r<0&&(y=!0,Lb(b),r=-r),YZ(b,r*6)):r!=="reverse"&&(h&&r<0&&Lb(b),YZ(b,(r<0?-r:r)*6)):!y&&(r==="auto"&&Math.abs(v[0]-b[0])+Math.abs(v[1]-b[1])+Math.abs(v[v.length-2]-b[b.length-2])+Math.abs(v[v.length-1]-b[b.length-1])>Math.abs(v[0]-b[b.length-2])+Math.abs(v[1]-b[b.length-1])+Math.abs(v[v.length-2]-b[0])+Math.abs(v[v.length-1]-b[1])||r%2)?(Lb(b),m[h]=-1,y=!0):r==="auto"?m[h]=0:r==="reverse"&&(m[h]=-1),b.closed!==v.closed&&(b.closed=v.closed=!1));return d&&Jh("shapeIndex:["+m.join(",")+"]"),e.shapeIndex=m,m}},JZ=function(e,n,r,i,s){var a=mf(e[0]),o=mf(e[1]);$I(a,o,n||n===0?n:"auto",r,s)&&(e[0]=$p(a),e[1]=$p(o),(i==="log"||i===!0)&&Jh('precompile:["'+e[0]+'","'+e[1]+'"]'))},E6e=function(e,n){if(!n)return e;var r=e.match(Vv)||[],i=r.length,s="",a,o,l;for(n==="reverse"?(o=i-1,a=-2):(o=((parseInt(n,10)||0)*2+1+i*100)%i,a=2),l=0;l<i;l+=2)s+=r[o-1]+","+r[o]+" ",o=(o+a)%i;return s},eG=function(e,n){var r=0,i=parseFloat(e[0]),s=parseFloat(e[1]),a=i+","+s+" ",o=.999999,l,c,u,f,h,m,y;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,m=parseFloat(e[c+2]),y=parseFloat(e[c+3]),r>o)for(h=1/(Math.floor(r)+1),f=1;r>o;)a+=(i+(m-i)*h*f).toFixed(2)+","+(s+(y-s)*h*f).toFixed(2)+" ",r--,f++;a+=m+","+y+" ",i=m,s=y}return a},BI=function(e){var n=e[0].match(Vv)||[],r=e[1].match(Vv)||[],i=r.length-n.length;i>0?e[0]=eG(n,i):e[1]=eG(r,-i)},T6e=function(e){return isNaN(e)?BI:function(n){BI(n),n[1]=E6e(n[1],parseInt(e,10))}},P6e=function(e,n,r){var i=typeof e=="string",s,a;return(!i||v6e.test(e)||(e.match(Vv)||[]).length<3)&&(s=lj(e)[0],s?(a=(s.nodeName+"").toUpperCase(),n&&a!=="PATH"&&(s=Jie(s,!1),a="PATH"),e=s.getAttribute(a==="PATH"?"d":"points")||"",s===r&&(e=s.getAttributeNS(null,"data-original")||e)):(Jh("WARNING: invalid morph to: "+e),e=!1)),e},tG=function(e){for(var n=e.length,r,i,s,a,o,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],s=r[l+1]-r[l+3],a=r[l+6]-r[l+4],o=r[l+7]-r[l+5],u[l+2]=x6(s,i),u[l+3]=l0(i*i+s*s),u[l+4]=x6(o,a),u[l+5]=l0(a*a+o*o);return e},nG=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},ose=function(e){return e!==e%oE?e+(e<0?XZ:-XZ):e},rG="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",M6e=function(e,n,r,i){var s=this._origin,a=this._eOrigin,o=e[r]-s.x,l=e[r+1]-s.y,c=l0(o*o+l*l),u=x6(l,o),f,h;return o=n[r]-a.x,l=n[r+1]-a.y,f=x6(l,o)-u,h=ose(f),!i&&Fb&&Math.abs(h+Fb.ca)<x6e&&(i=Fb),this._anchorPT=Fb={_next:this._anchorPT,t:e,sa:u,ca:i&&h*i.ca<0&&Math.abs(h)>b6e?f:h,sl:c,cl:l0(o*o+l*l)-c,i:r}},iG=function(e){wl=ise(),$b=$b||wl&&wl.plugins.morphSVG,wl&&$b?(lj=wl.utils.toArray,rse=wl.core.reverting||function(){},$b.prototype._tweenRotation=M6e,nse=1):e&&Jh("Please gsap.registerPlugin(MorphSVGPlugin)")},v1={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){wl=e,$b=n,iG()},init:function(e,n,r,i,s){if(nse||iG(1),!n)return Jh("invalid shape"),!1;EP(n)&&(n=n.call(r,i,e,s));var a,o,l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){a={};for(o in n)a[o]=EP(n[o])&&o!=="render"?n[o].call(r,i,e,s):n[o];n=a}var j=e.nodeType?window.getComputedStyle(e):{},L=j.fill+"",B=!(L==="none"||(L.match(Vv)||[])[3]==="0"||j.fillRule==="evenodd"),$=n.smooth,Q=(n.origin||"50 50").split(",");if($===!0||$==="auto"?$={}:typeof $=="number"&&($={points:$}),a=(e.nodeName+"").toUpperCase(),u=a==="POLYLINE"||a==="POLYGON",a!=="PATH"&&!u&&!n.prop)return Jh("Cannot morph a <"+a+"> element. "+rG),!1;if(o=a==="PATH"?"d":"points",!n.prop&&!EP(e.setAttribute))return!1;if(c=P6e(n.shape||n.d||n.points||"",o==="d",e),u&&A6e.test(c))return Jh("A <"+a+"> cannot accept path data. "+rG),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",h=n.map||v1.defaultMap,this._prop=n.prop,this._render=n.render||v1.defaultRender,this._apply="updateTarget"in n?n.updateTarget:v1.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,M=typeof n.precompile=="object",d=this._original=this._prop?e[this._prop]:e.getAttribute(o),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",d),o==="d"||this._prop){if(d=mf(M?n.precompile[0]:d),v=mf(M?n.precompile[1]:c),$){for(w=d.length;--w;)ase(d[w])&&d.splice(w,1);PP(d,y6({},$,{points:+$.points||Math.max(FI(d),FI(v)),maxSegments:v.length})),PP(v,$.redraw===!1?$:y6({},$,{points:d}))}if(!M&&!$I(d,v,f,h,B))return!1;for((n.precompile==="log"||n.precompile===!0)&&Jh('precompile:["'+$p(d)+'","'+$p(v)+'"]'),I=(n.type||v1.defaultType)!=="linear",_=n.curveMode||I,tG(d),tG(v),I&&(d.size||$2(d),v.size||$2(v),N=nG(Q[0]),this._origin=d.origin={x:d.left+N.x*d.width,y:d.top+N.y*d.height},Q[1]&&(N=nG(Q[1])),this._eOrigin={x:v.left+N.x*v.width,y:v.top+N.y*v.height}),this._rawPath=e._gsRawPath=d,w=d.length;--w>-1;){for(k=d[w],E=v[w],m=k.cpData,y=E.cpData,O=k.length,Fb=0,b=0;b<O;b+=6)(E[b]!==k[b]||E[b+1]!==k[b+1])&&(I?l=this._tweenRotation(k,E,b):(l=this.add(k,b,k[b],E[b],0,0,0,0,0,1),l=this.add(k,b+1,k[b+1],E[b+1],0,0,0,0,0,1)||l));for(b=0;b<O;b+=2)_&&(m[b]!==y[b]||m[b+1]!==y[b+1])&&m[b+1]&&y[b+1]?this._controlPT={_next:this._controlPT,i:b,j:w,ai:b%6>3?b+2:b-2,sa:m[b],ca:ose(y[b]-m[b]),sl:m[b+1],cl:y[b+1]-m[b+1]}:(E[b]!==k[b]&&(l=this.add(k,b,k[b],E[b],0,0,0,0,0,1)),E[b+1]!==k[b+1]&&(l=this.add(k,b+1,k[b+1],E[b+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(o)+"",c+"",i,s,0,T6e(f),o);I&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=$&&$.persist!==!1?$p(v):c,l.endProp=o)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,s=n._anchorPT,a=n._rnd,o=n._target,l=n._pt,c,u,f,h,m,y,d,v,b;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?o[n._prop]=l.end:o.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;s;)m=s.sa+e*s.ca,h=s.sl+e*s.cl,s.t[s.i]=n._origin.x+GZ(m)*h,s.t[s.i+1]=n._origin.y+UZ(m)*h,s=s._next;for(;i;)f=r[i.j],y=i.i,m=i.sa+e*i.ca,v=UZ(m),b=GZ(m),h=i.sl+e*i.cl,f[y]=f[i.ai]-b*h,f[y+1]=f[i.ai+1]-v*h,i=i._next;if(!e&&rse()&&(r=mf(n._original)),o._gsRawPath=r,n._apply){for(c="",u=" ",d=0;d<r.length;d++){for(f=r[d],h=f.length,c+="M"+(f[0]*a|0)/a+u+(f[1]*a|0)/a+" C",y=2;y<h;y++)c+=(f[y]*a|0)/a+u;f.closed&&(c+="z")}n._prop?o[n._prop]=c:o.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,o)},kill:function(e){this._pt=this._rawPath=0},getRawPath:f6e,stringToRawPath:mf,rawPathToString:$p,smoothRawPath:PP,normalizeStrings:function(e,n,r){var i=r.shapeIndex,s=r.map,a=[e,n];return JZ(a,i,s),a},pathFilter:JZ,pointsFilter:BI,getTotalSize:$2,equalizeSegmentQuantity:$I,convertToPath:function(e,n){return lj(e).map(function(r){return Jie(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};ise()&&wl.registerPlugin(v1);const Bd=30;function as(t){if(!Number.isFinite(t)||t<0)return"00:00";const e=Math.floor(t/60),n=Math.floor(t%60);return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}function Hv(t,e=Bd){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:Math.round(t*e)}function uj(t,e=Bd){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:t/e}function N6e(t,e,n=Bd){const r=Hv(t,n),i=Math.max(0,r+e);return uj(i,n)}function sG(t,e,n=Bd){const r=Hv(t,n),i=Hv(e,n);return`${r}f / ${i}f`}function D6e(){try{return!1}catch{return!1}}function I6e(t){!D6e()||typeof window>"u"||(window.__playerStore=t)}function lse(t){return Number.isFinite(t)&&t>0}function aG(t,e){const n=Math.max(0,Number.isFinite(e)?e:0),r=Math.max(0,Number.isFinite(t)?t:0);return n>0?Math.min(r,n):r}function v4(t){if(!t)return 0;try{const e=Number(t.getDuration());return lse(e)?e:0}catch{return 0}}function _6e(t){return{now:()=>t.performance.now(),requestAnimationFrame:e=>t.requestAnimationFrame(e),cancelAnimationFrame:e=>t.cancelAnimationFrame(e)}}function R6e(t,e,n,r=()=>1){var m;const i=Math.max(0,Number.isFinite(e)?e:0);let s=aG(Number(((m=t.getTime)==null?void 0:m.call(t))??0),i),a=!1,o=0,l=s,c=n.now();const u=y=>{var d;if(s=aG(y,i),typeof t.renderSeek=="function"){t.renderSeek(s);return}(d=t.seek)==null||d.call(t,s)},f=()=>{o&&(n.cancelAnimationFrame(o),o=0)},h=y=>{if(!a)return;const d=Math.max(.1,Number(r())||1),v=(y-c)/1e3*d;if(u(l+v),s>=i){a=!1,o=0;return}o=n.requestAnimationFrame(h)};return{play:()=>{a||i<=0||(s>=i&&u(0),a=!0,l=s,c=n.now(),f(),o=n.requestAnimationFrame(h))},pause:()=>{a=!1,f()},seek:(y,d)=>{if(u(y),d!=null&&d.keepPlaying){a&&(l=s,c=n.now());return}a=!1,f()},getTime:()=>s,getDuration:()=>i,isPlaying:()=>a}}function DO(t,e){var n;(n=t.current)==null||n.adapter.pause(),t.current=null,e.current=!1}function j6e(t){const{cache:e,warned:n,bestAdapter:r,effectiveDuration:i,docDuration:s}=t,a=e.current;if((a==null?void 0:a.player)===r&&a.duration===i)return a.adapter;a==null||a.adapter.pause(),n.current||(n.current=!0,console.warn(`[useTimelinePlayer] Selected adapter duration (${v4(r)}s) does not cover the document duration (${s}s); falling back to seek-driven playback, which never starts media elements or WebAudio. Audio will not play in preview — extend the GSAP timeline to cover the declared data-duration.`));const o=R6e(r,i,t.clock,t.getPlaybackRate);return e.current={player:r,duration:i,adapter:o},o}function oG(t){return{play:()=>t.play(),pause:()=>t.pause(),seek:(e,n)=>{const r=!(n!=null&&n.keepPlaying);r&&t.pause(),t.seek(e),r&&t.pause()},getTime:()=>t.time(),getDuration:()=>t.duration(),isPlaying:()=>t.isActive()}}function cse(t,e,n,r,i){if(!(!n||n.startsWith("#")||n.startsWith("[data-composition-id=")))try{const s=r??"index.html",o=Array.from(t.querySelectorAll(n)).filter(l=>(i(l)??"index.html")===s).indexOf(e);return o>=0?o:void 0}catch{return}}const Xs="data-fx-chain",use=Xs.slice(5),c0=1,Zx=(t="frequency",e="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:t,label:e,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),MP=(t=.707,e="Bandwidth — higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:t,scale:"log",automatable:!0,hint:e}),IO=(t=-40,e=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:t,max:e,step:.1,default:n,automatable:!0}),lG={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},JA=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[IO(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[Zx("frequency","Frequency",1e3),IO(-40,40,0),MP(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Zx("frequency","Frequency",200,20,2e3),IO(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Zx("frequency","Frequency",4e3,500,2e4),IO(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies — the usual fix for rumble on a voice.",params:[Zx("frequency","Cutoff",300,20,2e4),MP(.707),lG],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies — darkens or muffles a track.",params:[Zx("frequency","Cutoff",8e3,100,2e4),MP(.707),lG],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling — nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times — a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],lE=new Map(JA.map(t=>[t.id,t]));function eS(t){return lE.get(t)}JA.map(t=>t.id);function jf(t){const e=lE.get(t);if(!e)return{};const n={};for(const r of e.params)n[r.key]=r.default;return n}function Vd(t,e){const n=lE.get(t);if(!n)return{};const r={};for(const i of n.params){const s=e==null?void 0:e[i.key];if(i.kind==="enum"){const o=i.options.some(l=>l.value===s);r[i.key]=o?s:i.default;continue}const a=typeof s=="number"?s:typeof s=="string"&&s.trim()!==""?Number(s):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}class A1 extends Error{constructor(e){super(e),this.name="AudioFxChainError"}}function cE(t){let e;try{e=JSON.parse(t)}catch(i){throw new A1(`Chain file is not valid JSON: ${i.message}`)}if(typeof e!="object"||e===null)throw new A1("Chain file must be a JSON object.");const n=e;if(n.version!==c0)throw new A1(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new A1("Chain file is missing a `nodes` array.");const r=n.nodes.map(F6e);return{version:c0,nodes:r}}function L6e(t){return t.nodes.filter(e=>e.enabled!==!1)}function mu(t){return JSON.stringify({version:c0,nodes:t.nodes.map($6e)})}function cy(t){const e=new Set(t.nodes.map(n=>n.id).filter(Boolean));for(let n=1;;n+=1){const r=`n${n}`;if(!e.has(r))return r}}function F6e(t,e){if(typeof t!="object"||t===null)throw new A1(`Node ${e} is not an object.`);const n=t;if(typeof n.type!="string"||!lE.has(n.type))throw new A1(`Node ${e} has unknown effect type: ${String(n.type)}`);return hse({type:n.type,id:ed(n.id),fromCarve:b6(n.fromCarve),fromPreset:ed(n.fromPreset),label:ed(n.label),fromEq:ed(n.fromEq),fromLeveller:b6(n.fromLeveller),presetAmount:fse(n.presetAmount),enabled:n.enabled!==!1,params:Vd(n.type,n.params??void 0)})}function $6e(t){return hse({type:t.type,id:ed(t.id),fromCarve:b6(t.fromCarve),fromPreset:ed(t.fromPreset),label:ed(t.label),fromEq:ed(t.fromEq),fromLeveller:b6(t.fromLeveller),presetAmount:t.presetAmount===1?void 0:fse(t.presetAmount),enabled:t.enabled===!1?!1:void 0,params:Vd(t.type,t.params)})}function ed(t){return typeof t=="string"&&t?t:void 0}function b6(t){return t===!0?!0:void 0}function fse(t){if(!(typeof t!="number"||!Number.isFinite(t)))return Math.min(1,Math.max(0,t))}function hse(t){for(const e of Object.keys(t))t[e]===void 0&&delete t[e];return t}const VI="data-hf-render-id",B6e="data-hf-group-render-id",fj=12,dse=10**(fj/20),hd=-100,vg=100,pse=-60;function hj(t){return Number.isFinite(t)?Math.max(0,Math.min(dse,t)):1}function mse(t){return hj(t).toFixed(6).replace(/\.?0+$/,"")}function HI(t){const e=Math.max(hd,Math.min(vg,t));return e===hd?0:10**((e<0?e/Math.abs(hd)*Math.abs(pse):e/vg*fj)/20)}function gse(t){const e=hj(t);if(e===0)return hd;const n=20*Math.log10(e),r=n<0?n/Math.abs(pse)*Math.abs(hd):n/fj*vg;return Math.max(hd,Math.min(vg,r))}function QI(t){const e=hj(t);if(e===0)return"-∞ dB";const n=20*Math.log10(e),r=Math.abs(n)<.05?0:n;return(r>0?"+":"")+r.toFixed(1)+" dB"}const io="data-automation",yse=io.slice(5),uE=1,xse=512;class yp extends Error{constructor(e){super(e),this.name="AudioAutomationError"}}const B2="volume";function uy(t){if(t===B2)return{kind:"volume"};const e=t.split(".");if(e.length===3&&e[0]==="fx"&&e[1]===bse){const i=e[2];return i?{kind:"preset",presetId:i}:null}if(e.length!==3||e[0]!=="fx")return null;const[,n,r]=e;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}function Od(t,e){return`fx.${t}.${e}`}const bse="preset";function NP(t){return`fx.${bse}.${t}`}const V6e={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},vse={min:0,max:dse,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function u0(t,e){const n=uy(t);if(!n)return null;if(n.kind==="volume")return vse;if(n.kind==="preset")return(e==null?void 0:e.nodes.some(o=>o.fromPreset===n.presetId))?{...V6e,label:`${n.presetId} · Amount`}:null;const r=e==null?void 0:e.nodes.find(a=>a.id===n.nodeId);if(!r)return null;const i=eS(r.type),s=i==null?void 0:i.params.find(a=>a.key===n.param);return!s||s.kind!=="number"?null:{min:s.min,max:s.max,step:s.step,unit:s.unit,label:`${(i==null?void 0:i.label)??r.type} · ${s.label}`,scale:s.scale==="log"&&s.min>0?"log":"linear",default:s.default}}function Qv(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)?e:null}return null}function H6e(t){const e=Qv(t);return e===null||e===0?0:Math.min(1,Math.max(-1,e))}function dj(t,e){const n=Qv(t),r=Qv(e);if(n===null||r===null)return null;const i=o=>Math.min(.999,Math.max(.001,o)),s=i(n),a=i(r);return Math.abs(s-a)<1e-6?null:{x:s,y:a}}function Q6e(t,e){const n=dj(t,e);return n?{viaX:n.x,viaY:n.y}:null}function z6e(t){const e=H6e(t==null?void 0:t.curve),n=dj(t==null?void 0:t.viaX,t==null?void 0:t.viaY);return{...e?{curve:e}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Z6e(t,e){const n=Qv(t==null?void 0:t.t),r=Qv(t==null?void 0:t.v);if(n===null||r===null)return null;const i=e?Math.min(e.max,Math.max(e.min,r)):r;return{t:Math.max(0,n),v:i,...z6e(t)}}function Ase(t,e){const n=t.map(i=>Z6e(i,e)).filter(i=>i!==null).sort((i,s)=>i.t-s.t),r=[];for(const i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,xse)}function G6e(t){const e=[];for(const n of t.lanes){if(!uy(n.target))continue;const r=n.target===B2?vse:null,i=Ase(n.points??[],r);i.length>0&&e.push({target:n.target,points:i})}return{version:uE,lanes:e}}function Sse(t,e){const n=[];for(const r of t.lanes){const i=u0(r.target,e);if(!i)continue;const s=Ase(r.points,i);s.length>0&&n.push({target:r.target,points:s})}return{version:uE,lanes:n}}function wse(t){let e;try{e=JSON.parse(t)}catch(i){throw new yp(`Automation is not valid JSON: ${i.message}`)}if(typeof e!="object"||e===null)throw new yp("Automation must be a JSON object.");const n=e;if(n.version!==uE)throw new yp(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new yp("Automation is missing a `lanes` array.");const r=n.lanes.map((i,s)=>{if(typeof i!="object"||i===null)throw new yp(`Lane ${s} is not an object.`);const a=i;if(typeof a.target!="string"||!uy(a.target))throw new yp(`Lane ${s} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new yp(`Lane ${s} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return G6e({lanes:r})}function Ose(t){return JSON.stringify({version:uE,lanes:t.lanes.map(e=>({target:e.target,points:e.points.map(n=>({t:n.t,v:n.v,...n.curve?{curve:n.curve}:{},...n.viaX!==void 0&&n.viaY!==void 0?{viaX:n.viaX,viaY:n.viaY}:{}}))}))})}function U6e(t,e){return e?Math.pow(t,Math.pow(2,2*e)):t}function X6e(t,e){const n=t-.5,r=e-.5,i=.999,s=1e6,a=n>0?n/(i-t):n<0?-n/(t-(1-i)):0,o=r>0?r/(i-e):r<0?-r/(e-(1-i)):0,l=Math.min(s,Math.max(1,a,o));return{cx:t+n/l,cy:e+r/l,w:l}}function W6e(t,e,n){const{cx:r,cy:i,w:s}=X6e(e,n),a=2-2*s,o=t*a-1+2*s*r,l=-t*a-2*s*r,c=q6e(o,l,t),u=1-c,f=u*u+2*s*c*u+c*c;return f>0?(2*s*i*c*u+c*c)/f:t}function q6e(t,e,n){if(Math.abs(t)<1e-12)return Math.abs(e)<1e-12?n:-n/e;const r=Math.sqrt(Math.max(0,e*e-4*t*n)),i=(-e+r)/(2*t),s=(-e-r)/(2*t),a=o=>o>=-1e-9&&o<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(s)?Math.min(1,Math.max(0,s)):n}function Y6e(t,e){const n=dj(e.viaX,e.viaY);return n?W6e(Math.min(1,Math.max(0,t)),n.x,n.y):U6e(t,e.curve)}function K6e(t,e,n,r){return r==="log"&&t>0&&e>0?Math.exp(Math.log(t)+(Math.log(e)-Math.log(t))*n):t+(e-t)*n}function Lf(t,e,n="linear"){const r=t.points;if(r.length===0)return 0;const i=r[0];if(e<=i.t)return i.v;const s=r[r.length-1];if(e>=s.t)return s.v;let a=0,o=r.length-1;for(;o-a>1;){const f=a+o>>1;r[f].t<=e?a=f:o=f}const l=r[a],c=r[o],u=c.t-l.t;return u<=0?c.v:K6e(l.v,c.v,Y6e((e-l.t)/u,l),n)}const ga="hf-audio-group",Zo="data-audio-group";function J6e(t){const e=t==null?void 0:t.getAttribute("data-volume"),n=e?parseFloat(e):1;return Number.isFinite(n)?n:1}function eCe(t,e,n){const r=n==null?void 0:n.getAttribute(Xs),i=n==null?void 0:n.getAttribute(io);return{id:t,label:(n==null?void 0:n.getAttribute("data-label"))||t,memberIds:e,...r?{fxChain:r}:{},...i?{automation:i}:{},volume:J6e(n),hidden:(n==null?void 0:n.hasAttribute("data-hidden"))??!1}}function tCe(t,e){var i,s;const n=Array.from(((i=t==null?void 0:t.querySelectorAll)==null?void 0:i.call(t,`${ga}[${VI}]`))??[]).find(a=>a.getAttribute(VI)===e);if(n)return n;const r=(t==null?void 0:t.getElementById(e))??null;return r&&((s=r.tagName)==null?void 0:s.toLowerCase())===ga?r:null}function Hd(t){const e=new Map;for(const i of t.querySelectorAll(`audio[${Zo}]`)){const s=i.getAttribute(B6e)??i.getAttribute(Zo);if(!s||!i.id)continue;const a=e.get(s);a?a.push(i.id):e.set(s,[i.id])}const n=new Map;for(const i of t.querySelectorAll(ga)){const s=i.getAttribute(VI)??i.id;s&&n.set(s,i)}const r=[];for(const[i,s]of e)r.push(eCe(i,s,n.get(i)));return r}function Cse(t,e){const n=new Map(Hd(t).map(a=>[a.id,a])),r=new Set,i=[],s=a=>{r.has(a)||(r.add(a),i.push(a))};for(const a of e){const o=n.get(a);o?o.memberIds.forEach(s):t.getElementById(a)&&!tCe(t,a)&&s(a)}return i}const Ff="data-hf-reveal-prior-z",f0="data-hf-reveal-prior-pos";function pj(t){const e=t.getAttribute(Ff);if(e==null)return null;const n=Number.parseInt(e,10);return Number.isFinite(n)?n:null}function fE(t){var a,o;const e=pj(t);if(e!=null)return e;const n=t,r=l=>{if(l==null||l===""||l==="auto")return null;const c=Number.parseInt(l,10);return Number.isFinite(c)?c:null},i=r((a=n.style)==null?void 0:a.zIndex);if(i!=null)return i;const s=(o=t.ownerDocument)==null?void 0:o.defaultView;if(s!=null&&s.getComputedStyle){const l=r(s.getComputedStyle(n).zIndex);if(l!=null)return l}return 0}function kse(t){if(!t)return 0;const e=Number.parseFloat(t.getAttribute("data-duration")??"")||Number.parseFloat(t.getAttribute("data-hf-authored-duration")??"");return lse(e)?e:0}function Ese(t){return Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1}function hE(t){return t.tagName.toLowerCase()===ga?!0:!!t.closest(["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-hf-color-grading-canvas]"].join(","))}function mj(t){if(!t)return 0;const e=t.querySelector("[data-composition-id]");let n=0;for(const r of Array.from(t.querySelectorAll("[data-start]"))){if(r===e||hE(r))continue;const i=Number.parseFloat(r.getAttribute("data-start")??""),s=kse(r);!Number.isFinite(i)||i<0||s<=0||(n=Math.max(n,i+s))}return n}function Tse(t){if(!t)return 0;const e=kse(t.querySelector("[data-composition-id]"));return e>0?e:mj(t)}function gj(t){return t?mj(new DOMParser().parseFromString(t,"text/html")):0}function zI(t){var n;const e=((n=t.ownerDocument.defaultView)==null?void 0:n.HTMLElement)??globalThis.HTMLElement;return typeof e<"u"&&t instanceof e}function Pse(t){const e=t.ownerDocument.defaultView??window,n=e.HTMLMediaElement??globalThis.HTMLMediaElement,r=e.HTMLImageElement??globalThis.HTMLImageElement;if(t instanceof n||t instanceof r)return t;const i=t.querySelector("video, audio, img");return i instanceof n||i instanceof r?i:null}function nCe(t,e){const n=e.getAttribute("data-playback-start"),r=e.getAttribute("data-media-start"),i=n??r;if(i!=null){const a=parseFloat(i);Number.isFinite(a)&&(t.playbackStart=a)}n!=null?t.playbackStartAttr="playback-start":r!=null&&(t.playbackStartAttr="media-start");const s=Number.parseFloat(e.getAttribute("data-playback-rate")??"");Number.isFinite(s)&&s>0&&(t.playbackRate=Ese(s))}function Mse(t,e){nCe(t,e);const n=Pse(e);if(!n)return;t.tag=n.tagName.toLowerCase();const r=n.getAttribute("src");r&&(t.src=r);const s=(n.ownerDocument.defaultView??window).HTMLMediaElement??globalThis.HTMLMediaElement;if(typeof s>"u"||!(n instanceof s))return;const a=e.getAttribute("data-source-duration")??n.getAttribute("data-source-duration"),o=a?parseFloat(a):n.duration;Number.isFinite(o)&&o>0&&(t.sourceDuration=o);const l=n.defaultPlaybackRate;t.playbackRate==null&&Number.isFinite(l)&&l>0&&(t.playbackRate=Ese(l))}function tS(t){var i,s,a;const e=(i=t.label)==null?void 0:i.trim();if(e)return e;const n=(s=t.id)==null?void 0:s.trim();if(n)return n;const r=(a=t.tag)==null?void 0:a.trim().toLowerCase();return r?`${r} clip`:"Timeline clip"}const rCe=new Set(["base","link","meta","noscript","script","style","template"]);function cG(t){return t.trim().replace(/[_-]+/g," ").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function iCe(t){const e=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label");if(e!=null&&e.trim())return e.trim();if(t.id.trim())return cG(t.id);const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];return r?cG(r):tS({tag:t.tagName})}function h0(t){if(zI(t)&&t.id)return`#${CSS.escape(t.id)}`;const e=t.getAttribute("data-composition-id");if(e)return`[data-composition-id="${CSS.escape(e)}"]`;if(zI(t)){const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];if(r)return`.${CSS.escape(r)}`}}function d0(t){var n;const e=(n=t.parentElement)==null?void 0:n.closest("[data-composition-id]");return(e==null?void 0:e.getAttribute("data-composition-file"))??(e==null?void 0:e.getAttribute("data-composition-src"))??void 0}function zv(t,e,n){return cse(t,e,n,d0(e),d0)}function Zv(t){const e=t.sourceFile??"index.html";return t.domId?`${e}#${t.domId}`:t.selector?`${e}:${t.selector}:${t.selectorIndex??0}`:`${e}:${t.id}:${t.fallbackIndex}`}function v6(t){const e=t.lastIndexOf("#");return e<0?{sourceFile:null,domId:t}:{sourceFile:t.slice(0,e),domId:t.slice(e+1)}}function Gv(t){var r;const e=((r=t.preferredId)==null?void 0:r.trim())||Zv({id:t.label,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile}),n=Zv({id:e,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile});return{id:e,key:n}}function zn(t){return t.key??t.id}function A6(t){return t.domId||null}function G1(t){if(!(!t.domId&&!t.selector))return Zv({id:"",fallbackIndex:0,...t})}function sCe(t){const e=t.querySelector("[data-composition-id]");return Array.from(t.querySelectorAll("[data-start]")).filter(n=>n!==e&&!hE(n))}function aCe(t,e){return Math.abs(t-e)<.001}const oCe=[["data-start",t=>t.start],["data-duration",t=>t.duration],["data-track-index",t=>t.track]];function lCe(t,e){var r;const n=(r=e.tagName)==null?void 0:r.toLowerCase();return n&&t.tagName.toLowerCase()!==n?!1:oCe.every(([i,s])=>{const a=Number.parseFloat(t.getAttribute(i)??"");return!Number.isFinite(a)||aCe(a,s(e))})}function cCe(t,e){return t.getElementById(e)??t.querySelector(`[data-composition-id="${CSS.escape(e)}"]`)??t.querySelector(`.${CSS.escape(e)}`)??null}function uCe(t,e,n,r=new Set){const i=e.id?cCe(t,e.id):null;if(i&&!r.has(i))return i;const s=sCe(t).filter(o=>!r.has(o)),a=s.find(o=>lCe(o,e));return a||(s[n]??null)}function fCe(t,e){if(!zI(e)||hE(e)||e.parentElement!==t)return!1;const n=e.tagName.toLowerCase();return rCe.has(n)||e.hasAttribute("data-start")||e.hasAttribute("data-track-index")?!1:!!h0(e)}function hCe(t,e,n){return n?e&&t.has(e)?new Set(t):new Set:e?new Set([e]):new Set}function dCe(t,e){return!t||e===null?!1:t.elementKey===v6(e).domId}const Nse="hf-studio-ui-preferences";function uG(t){return typeof t=="object"&&t!==null}function Dse(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function Ise(t){if(!t)return{};try{const e=t.getItem(Nse);if(!e)return{};const n=JSON.parse(e);if(!uG(n))return{};const r={};if(typeof n.leftCollapsed=="boolean"&&(r.leftCollapsed=n.leftCollapsed),typeof n.leftWidth=="number"&&Number.isFinite(n.leftWidth)&&(r.leftWidth=n.leftWidth),typeof n.rightWidth=="number"&&Number.isFinite(n.rightWidth)&&(r.rightWidth=n.rightWidth),typeof n.timelineVisible=="boolean"&&(r.timelineVisible=n.timelineVisible),typeof n.timelineHeight=="number"&&Number.isFinite(n.timelineHeight)&&(r.timelineHeight=n.timelineHeight),typeof n.playbackRate=="number"&&Number.isFinite(n.playbackRate)&&(r.playbackRate=n.playbackRate),typeof n.audioMuted=="boolean"&&(r.audioMuted=n.audioMuted),typeof n.audioVolume=="number"&&Number.isFinite(n.audioVolume)&&n.audioVolume>=0&&n.audioVolume<=1&&(r.audioVolume=n.audioVolume),n.thumbnailMode==="adaptive"||n.thumbnailMode==="hidden"?r.thumbnailMode=n.thumbnailMode:typeof n.thumbnailsEnabled=="boolean"&&(r.thumbnailMode=n.thumbnailsEnabled?"adaptive":"hidden"),uG(n.previewZoom)){const{zoomPercent:i,panX:s,panY:a}=n.previewZoom;typeof i=="number"&&Number.isFinite(i)&&typeof s=="number"&&Number.isFinite(s)&&typeof a=="number"&&Number.isFinite(a)&&(r.previewZoom={zoomPercent:i,panX:s,panY:a})}return Array.isArray(n.recentBlocks)&&(r.recentBlocks=n.recentBlocks.filter(i=>typeof i=="string")),typeof n.snapEnabled=="boolean"&&(r.snapEnabled=n.snapEnabled),typeof n.gridVisible=="boolean"&&(r.gridVisible=n.gridVisible),typeof n.gridSpacing=="number"&&Number.isFinite(n.gridSpacing)&&(r.gridSpacing=n.gridSpacing),typeof n.snapToGrid=="boolean"&&(r.snapToGrid=n.snapToGrid),typeof n.timelineSnapEnabled=="boolean"&&(r.timelineSnapEnabled=n.timelineSnapEnabled),(n.timeDisplayMode==="time"||n.timeDisplayMode==="frame")&&(r.timeDisplayMode=n.timeDisplayMode),(n.timelineZoomMode==="fit"||n.timelineZoomMode==="manual")&&(r.timelineZoomMode=n.timelineZoomMode),typeof n.timelineManualZoomPercent=="number"&&Number.isFinite(n.timelineManualZoomPercent)&&(r.timelineManualZoomPercent=n.timelineManualZoomPercent),typeof n.agentToolsEnabled=="boolean"&&(r.agentToolsEnabled=n.agentToolsEnabled),r}catch{return{}}}function to(t=Dse()){return Ise(t)}function Ol(t,e=Dse()){if(e)try{const n={...Ise(e),...t};e.setItem(Nse,JSON.stringify(n))}catch{}}const _se=10,pCe=48,mCe=.5,gCe=2,yCe=.014;function yj(t){if(!Number.isFinite(t)||t<=0)return 100;const e=Bd*pCe;return Math.max(100,Math.round(e/t*100))}function L0(t,e){if(!Number.isFinite(t))return 100;const n=yj(e);return Math.max(_se,Math.min(n,Math.round(t)))}function dE(t,e,n){return t==="fit"?100:L0(e,n)}function xCe(t,e){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?100:L0(t/e*100,e)}function bCe(t,e,n){if(!Number.isFinite(t)||t<=0)return 100;const r=dE(e,n,t);return e==="fit"?t:t*(r/100)}function fG(t,e,n,r){const i=dE(e,n,r),s=t==="in"?i*gCe:i*mCe;return L0(s,r)}function vCe(t,e,n,r){const i=dE(e,n,r);return!Number.isFinite(t)||t===0?i:L0(i*Math.exp(-t*yCe),r)}const S6=Math.log(_se);function ACe(t,e){const n=L0(t,e),r=Math.log(yj(e));return(Math.log(n)-S6)/(r-S6)*100}function SCe(t,e){const n=Math.max(0,Math.min(100,t)),r=Math.log(yj(e)),i=S6+n/100*(r-S6);return L0(Math.exp(i),e)}function ZI(t,e){return t.projectId===e.timelineProjectId&&t.sessionEpoch===e.timelineSessionEpoch}function Rse(t,e){return t.projectId===e.timelineProjectId&&t.sessionEpoch===e.timelineSessionEpoch&&t.elementId===e.selectedElementId}function wCe(t,e){return{selectedKeyframes:new Set,toggleSelectedKeyframe:n=>t(r=>{const i=new Set(r.selectedKeyframes);return i.has(n)?i.delete(n):i.add(n),{selectedKeyframes:i}}),clearSelectedKeyframes:()=>t({selectedKeyframes:new Set}),expandedClipIds:new Set,toggleClipExpanded:n=>t(r=>{const i=new Set(r.expandedClipIds);return i.has(n)?i.delete(n):i.add(n),{expandedClipIds:i}}),setClipExpanded:(n,r)=>t(i=>{if(i.expandedClipIds.has(n)===r)return i;const s=new Set(i.expandedClipIds);return r?s.add(n):s.delete(n),{expandedClipIds:s}}),expandClips:n=>t(r=>{if(n.every(s=>r.expandedClipIds.has(s)))return r;const i=new Set(r.expandedClipIds);for(const s of n)i.add(s);return{expandedClipIds:i}}),collapsedGroupIds:new Set,toggleGroupExpanded:n=>t(r=>{const i=new Set(r.collapsedGroupIds);return i.has(n)?i.delete(n):i.add(n),{collapsedGroupIds:i}}),expandedLaneOwnerIds:new Set,toggleLaneOwnerExpanded:n=>t(r=>{const i=new Set(r.expandedLaneOwnerIds);return i.has(n)?i.delete(n):i.add(n),{expandedLaneOwnerIds:i}}),focusedEaseSegment:null,focusedEaseRequestNonce:0,setFocusedEaseSegment:n=>t(r=>{const i=r.focusedEaseRequestNonce+1,{timelineProjectId:s,timelineSessionEpoch:a}=e();return{focusedEaseRequestNonce:i,focusedEaseSegment:{...n,projectId:s,sessionEpoch:a,nonce:i}}}),clearFocusedEaseSegment:n=>t(r=>{var i;return((i=r.focusedEaseSegment)==null?void 0:i.nonce)===n?{focusedEaseSegment:null}:r}),revealedAudioFxTarget:null,revealedAudioFxNonce:0,setRevealedAudioFxTarget:n=>t(r=>{const i=r.revealedAudioFxNonce+1,{timelineProjectId:s,timelineSessionEpoch:a}=e();return{revealedAudioFxNonce:i,revealedAudioFxTarget:{...n,projectId:s,sessionEpoch:a,nonce:i}}}),clearRevealedAudioFxTarget:n=>t(r=>{var i;return((i=r.revealedAudioFxTarget)==null?void 0:i.nonce)===n?{revealedAudioFxTarget:null}:r}),keyframeCache:new Map,setKeyframeCache:(n,r)=>t(i=>{if(r?i.keyframeCache.get(n)===r:!i.keyframeCache.has(n))return i;const s=new Map(i.keyframeCache);return r?s.set(n,r):s.delete(n),{keyframeCache:s}}),gsapAnimations:new Map,setGsapAnimations:(n,r)=>t(i=>{if(r?i.gsapAnimations.get(n)===r:!i.gsapAnimations.has(n))return i;const s=new Map(i.gsapAnimations);return r?s.set(n,r):s.delete(n),{gsapAnimations:s}})}}function OCe(t){return{automationSelection:null,setAutomationSelection:e=>t({automationSelection:{...e,t0:Math.min(e.t0,e.t1),t1:Math.max(e.t0,e.t1),v0:Math.min(e.v0,e.v1),v1:Math.max(e.v0,e.v1)}}),clearAutomationSelection:()=>t({automationSelection:null})}}function CCe(t){return{motionPathArmed:!1,setMotionPathArmed:e=>t({motionPathArmed:e}),motionPathCreateAvailable:!1,setMotionPathCreateAvailable:e=>t({motionPathCreateAvailable:e}),autoKeyframeEnabled:!0,setAutoKeyframeEnabled:e=>t({autoKeyframeEnabled:e})}}function kCe(t,e,n,r){return{id:t,projectId:e,sessionEpoch:n,nonce:r}}const jse="follow-preference";function ECe(t,e=jse){return t??(e==="legacy-default"?"hidden":"adaptive")}function TCe(t,e=jse){return e==="force-hidden"?"hidden":t}function PCe(t){return{thumbnailMode:ECe(to().thumbnailMode),setThumbnailMode:e=>{Ol({thumbnailMode:e}),t({thumbnailMode:e})}}}const DP=new Set,ya={notify:t=>DP.forEach(e=>e(t)),subscribe:t=>(DP.add(t),()=>DP.delete(t))};function IP(t,e){const n=new Set(t);return n.size===0?{selectedElementIds:n,selectedElementId:null}:e&&n.has(e)?{selectedElementIds:n,selectedElementId:e}:{selectedElementIds:n,selectedElementId:n.values().next().value??null}}function GI(){return{isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,beatDragging:!1,elements:[],selectedElementId:null,zEditVersion:0,inPoint:null,outPoint:null,activeTool:"select",activeKeyframePct:null,motionPathArmed:!1,motionPathCreateAvailable:!1,selectedKeyframes:new Set,automationSelection:null,expandedClipIds:new Set,collapsedGroupIds:new Set,expandedLaneOwnerIds:new Set,focusedEaseSegment:null,revealedAudioFxTarget:null,selectedElementIds:new Set,requestedSeekTime:null,lintFindingsByElement:new Map,timelineFocus:null,keyframeCache:new Map,gsapAnimations:new Map,beatAnalysis:null,beatEdits:null,beatUndo:[],beatRedo:[],beatPersist:null,clipManifest:null,clipParentMap:new Map,domClipChildren:[]}}const fe=rE((t,e)=>({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,timelineSessionEpoch:0,timelineProjectId:null,beatDragging:!1,elements:[],selectedElementId:null,playbackRate:to().playbackRate??1,audioMuted:to().audioMuted??!1,audioVolume:to().audioVolume??1,loopEnabled:!1,zoomMode:"fit",manualZoomPercent:100,zEditVersion:0,timelinePps:100,timelineFitPps:100,inPoint:null,outPoint:null,activeTool:"select",setActiveTool:n=>t({activeTool:n}),...wCe(t,()=>({timelineProjectId:e().timelineProjectId,timelineSessionEpoch:e().timelineSessionEpoch})),...PCe(t),...OCe(t),...CCe(t),activeKeyframePct:null,setActiveKeyframePct:n=>t({activeKeyframePct:n}),selectedElementIds:new Set,setSelection:(n,r)=>t(IP(n,r)),addSelectedElementId:n=>t(r=>{const i=new Set(r.selectedElementIds);return i.add(n),IP(i,r.selectedElementId)}),toggleSelectedElementId:n=>t(r=>{const i=new Set(r.selectedElementIds);return i.has(n)?i.delete(n):i.add(n),IP(i,r.selectedElementId)}),clearSelection:()=>t({selectedElementId:null,selectedElementIds:new Set}),requestedSeekTime:null,requestSeek:n=>t({requestedSeekTime:n}),clearSeekRequest:()=>t({requestedSeekTime:null}),playbackRequest:null,requestPlayback:(n,r=null)=>t(i=>{var s;return{playbackRequest:{playing:n,returnTo:r,nonce:(((s=i.playbackRequest)==null?void 0:s.nonce)??0)+1}}}),clearPlaybackRequest:()=>t({playbackRequest:null}),clipRevealRequest:null,requestClipReveal:n=>t(r=>{var i;return{clipRevealRequest:{elementId:n,nonce:(((i=r.clipRevealRequest)==null?void 0:i.nonce)??0)+1}}}),clearClipRevealRequest:()=>t({clipRevealRequest:null}),timelineFocus:null,timelineFocusNonce:0,requestTimelineFocus:n=>t(r=>{const i=r.timelineFocusNonce+1;return{timelineFocusNonce:i,timelineFocus:kCe(n,r.timelineProjectId,r.timelineSessionEpoch,i)}}),clearTimelineFocus:n=>t(r=>{var i;return((i=r.timelineFocus)==null?void 0:i.nonce)===n?{timelineFocus:null}:r}),lintFindingsByElement:new Map,setLintFindingsByElement:n=>t({lintFindingsByElement:n}),beatAnalysis:null,setBeatAnalysis:n=>t({beatAnalysis:n}),beatEdits:null,setBeatEdits:n=>t({beatEdits:n}),beatUndo:[],beatRedo:[],beatPersist:null,setBeatPersist:n=>t({beatPersist:n}),commitBeatEdits:(n,r)=>{var i,s;t(a=>({beatEdits:n,beatUndo:[...a.beatUndo,{restore:a.beatEdits,at:Date.now(),label:r}],beatRedo:[]})),(s=(i=e()).beatPersist)==null||s.call(i)},undoBeatEdits:()=>{var i,s;const n=e(),r=n.beatUndo[n.beatUndo.length-1];return r?(t({beatEdits:r.restore,beatUndo:n.beatUndo.slice(0,-1),beatRedo:[...n.beatRedo,{restore:n.beatEdits,at:r.at,label:r.label}]}),(s=(i=e()).beatPersist)==null||s.call(i),r.label):null},resetBeatHistory:()=>t({beatUndo:[],beatRedo:[]}),redoBeatEdits:()=>{var i,s;const n=e(),r=n.beatRedo[n.beatRedo.length-1];return r?(t({beatEdits:r.restore,beatRedo:n.beatRedo.slice(0,-1),beatUndo:[...n.beatUndo,{restore:n.beatEdits,at:r.at,label:r.label}]}),(s=(i=e()).beatPersist)==null||s.call(i),r.label):null},clipManifest:null,setClipManifest:n=>t({clipManifest:n}),clipParentMap:new Map,setClipParentMap:n=>t({clipParentMap:n}),domClipChildren:[],setDomClipChildren:n=>t({domClipChildren:n}),setIsPlaying:n=>{e().isPlaying!==n&&t({isPlaying:n})},setPlaybackRate:n=>{Ol({playbackRate:n}),t({playbackRate:n})},setAudioMuted:n=>{Ol({audioMuted:n}),t({audioMuted:n})},setAudioVolume:n=>{const r=Number.isFinite(n)?Math.max(0,Math.min(1,n)):1;Ol({audioVolume:r}),t({audioVolume:r})},setLoopEnabled:n=>t({loopEnabled:n}),setZoomMode:n=>t({zoomMode:n}),clearSelectedElementIds:()=>t({selectedElementIds:new Set}),setSelectedElementIds:n=>t({selectedElementIds:new Set(n)}),timelineSnapEnabled:to().timelineSnapEnabled??!0,setTimelineSnapEnabled:n=>{Ol({timelineSnapEnabled:n}),t({timelineSnapEnabled:n})},timeDisplayMode:to().timeDisplayMode??"time",setTimeDisplayMode:n=>{Ol({timeDisplayMode:n}),t({timeDisplayMode:n})},pinTimelineZoom:(n,r)=>t(i=>{if(i.zoomMode==="manual")return{};const s=xCe(n,r);return Ol({timelineZoomMode:"manual",timelineManualZoomPercent:s}),{zoomMode:"manual",manualZoomPercent:s}}),setTimelineScale:(n,r)=>{const i=e();i.timelinePps===n&&i.timelineFitPps===r||t({timelinePps:n,timelineFitPps:r})},setInPoint:n=>t(r=>{const i=n!==null&&Number.isFinite(n)?n:null;return{inPoint:i,outPoint:i!==null&&r.outPoint!==null&&i>=r.outPoint?null:r.outPoint,loopEnabled:i!==null?!0:r.loopEnabled}}),setOutPoint:n=>t(r=>{const i=n!==null&&Number.isFinite(n)?n:null;return{outPoint:i,inPoint:i!==null&&r.inPoint!==null&&i<=r.inPoint?null:r.inPoint,loopEnabled:i!==null?!0:r.loopEnabled}}),setManualZoomPercent:n=>t(r=>({manualZoomPercent:L0(n,r.timelineFitPps)})),bumpZEditVersion:()=>t(n=>({zEditVersion:n.zEditVersion+1})),setCurrentTime:n=>t({currentTime:Number.isFinite(n)?n:0}),setDuration:n=>t({duration:Number.isFinite(n)?n:0}),setTimelineReady:n=>t({timelineReady:n}),setBeatDragging:n=>t({beatDragging:n}),setElements:n=>t({elements:n}),setSelectedElementId:(n,r)=>t(i=>{const s=hCe(i.selectedElementIds,n,r==null?void 0:r.preserveSet),a=dCe(i.revealedAudioFxTarget,n);return n!==i.selectedElementId?{selectedElementId:n,selectedElementIds:s,activeKeyframePct:null,motionPathArmed:!1,focusedEaseSegment:null,...a?{}:{revealedAudioFxTarget:null}}:{selectedElementId:n,selectedElementIds:s}}),setSelectionAnchor:n=>t(r=>n!=null&&r.selectedElementIds.size>1&&r.selectedElementIds.has(n)?{selectedElementId:n,focusedEaseSegment:n===r.selectedElementId?r.focusedEaseSegment:null}:{selectedElementId:n,selectedElementIds:n?new Set([n]):new Set,focusedEaseSegment:n===r.selectedElementId?r.focusedEaseSegment:null}),updateElement:(n,r)=>t(i=>({elements:i.elements.map(s=>(s.key??s.id)===n?{...s,...r}:s)})),beginTimelineSession:n=>t(r=>r.timelineProjectId===n?r:{...GI(),timelineSessionEpoch:r.timelineSessionEpoch+1,timelineProjectId:n}),reset:()=>t(GI())}));I6e(fe);const Lse="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",Fse="https://us.i.posthog.com",MCe=3e4,NCe=5e3;let Uv=[],V2=null;function DCe(){return V7()}function ICe(){return YA()}function _Ce(){var t,e;return{studio_version:"0.8.17",agent_runtime:Gre(),screen_width:(t=window.screen)==null?void 0:t.width,screen_height:(e=window.screen)==null?void 0:e.height,viewport_width:window.innerWidth,viewport_height:window.innerHeight,user_agent:navigator.userAgent,url_hash:location.hash.replace(/#project\//,"").split("?")[0]}}function Pt(t,e={}){ICe()&&(Uv.push({event:`studio:${t}`,properties:{..._Ce(),...Xre(),...e},timestamp:new Date().toISOString()}),V2||(V2=setInterval(RCe,MCe)))}function $se(){const t=Uv.map(e=>({event:e.event,properties:{...e.properties,$ip:null},distinct_id:DCe(),timestamp:e.timestamp}));return Uv=[],t}async function RCe(){if(Uv.length===0)return;const t=$se(),e=new AbortController,n=setTimeout(()=>e.abort(),NCe);try{await fetch(`${Fse}/batch/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:Lse,batch:t}),signal:e.signal})}catch{}finally{clearTimeout(n)}}function Bse(){if(V2&&(clearInterval(V2),V2=null),Uv.length===0)return;const t=$se(),e=JSON.stringify({api_key:Lse,batch:t});try{navigator.sendBeacon(`${Fse}/batch/`,e)}catch{}}typeof window<"u"&&window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Bse()});function F0(t){const e=x.useRef(null),n=x.useCallback(r=>{var i;if(r instanceof KeyboardEvent){r.key==="Escape"&&t();return}(i=e.current)!=null&&i.contains(r.target)||t()},[t]);return x.useEffect(()=>(document.addEventListener("pointerdown",n,!0),document.addEventListener("mousedown",n,!0),document.addEventListener("keydown",n),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("mousedown",n,!0),document.removeEventListener("keydown",n)}),[n]),e}const jCe=[{title:"Playback",hints:[{key:"Space",label:"Play / Pause"},{key:"J",label:"Play backward"},{key:"K",label:"Stop"},{key:"L",label:"Play forward"},{key:"M",label:"Toggle mute"},{key:"⇧L",label:"Toggle loop"},{key:"←/→",label:"Step 1 frame"},{key:"⇧←/⇧→",label:"Step 10 frames"},{key:"F",label:"Toggle fullscreen"}]},{title:"Keyframes (when an element is selected)",hints:[{key:"K",label:"Add keyframe at playhead"},{key:"Del",label:"Delete selected keyframe"},{key:"H",label:"Toggle hold / bezier"},{key:"U",label:"Expand / collapse properties"},{key:"R",label:"Record gesture"}]},{title:"Editing",hints:[{key:"⌘Z",label:"Undo"},{key:"⌘⇧Z",label:"Redo"},{key:"⌘C",label:"Copy element"},{key:"⌘V",label:"Paste element"},{key:"⌘X",label:"Cut element"},{key:"S",label:"Split clip at playhead"},{key:"⇧Click",label:"Razor tool: split all tracks"},{key:"⌘G",label:"Group elements"},{key:"⌘⇧G",label:"Ungroup"},{key:"Del",label:"Delete selected element (no keyframe selected)"}]},{title:"Gesture recording modifiers",hints:[{key:"Drag",label:"Record x / y position"},{key:"Scroll",label:"Record z depth"},{key:"⇧ Drag",label:"Record rotationX / rotationY"},{key:"⌥ Drag",label:"Record rotation"},{key:"⌘ Drag↕",label:"Record opacity"},{key:"⌘ Scroll",label:"Record scale"}]},{title:"Canvas",hints:[{key:"Drag",label:"Move element / add keyframe"},{key:"⌥ Drag",label:"Move entire animation path"},{key:"⇧ Drag",label:"Uniform resize"}]},{title:"Crop",hints:[{key:"Drag edge",label:"Crop a side"},{key:"Drag center",label:"Reposition the crop"}]},{title:"Panels",hints:[{key:"⌘1",label:"Compositions tab"},{key:"⌘2",label:"Assets tab"}]},{title:"Work area",hints:[{key:"I",label:"Set in-point"},{key:"⇧I",label:"Clear in-point"},{key:"O",label:"Set out-point"},{key:"⇧O",label:"Clear out-point"},{key:"A",label:"Jump to in-point"},{key:"E",label:"Jump to out-point"}]}],LCe=x.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,setInPoint:s,setOutPoint:a,onSeek:o}){const[l,c]=x.useState(!1),[u,f]=x.useState(""),h=x.useId(),m=x.useCallback(()=>c(!1),[]),y=F0(m),d=x.useRef(null),v=x.useRef(null);x.useEffect(()=>{var E;if(!l)return;const k=v.current;return(E=d.current)==null||E.focus(),()=>{k==null||k.focus()}},[l]);const b=x.useCallback(()=>{if(e)return;const k=Number.parseInt(u,10);!Number.isFinite(k)||n<=0||o(Math.min(n,uj(Math.max(0,k))))},[e,n,u,o]),w=x.useCallback(k=>{k.preventDefault(),b()},[b]),O=x.useCallback(k=>{k.key==="Enter"&&(k.preventDefault(),b())},[b]);return p.jsxs("div",{ref:y,className:"relative flex-shrink-0",children:[p.jsx(br,{label:"Shortcuts and tools",children:p.jsx("button",{ref:v,type:"button",onClick:()=>c(k=>!k),className:`flex h-7 w-7 items-center justify-center rounded-md transition-colors ${l?"text-neutral-200":"text-neutral-600 hover:text-neutral-300"}`,"aria-label":"Shortcuts and tools","aria-expanded":l,"aria-controls":h,children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),p.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"})]})})}),l&&p.jsxs("div",{id:h,ref:d,tabIndex:-1,role:"dialog","aria-label":"Keyboard shortcuts and tools",className:"absolute bottom-full right-0 mb-2 z-50 rounded-lg shadow-xl min-w-[220px] overflow-y-auto outline-none",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)",maxHeight:"min(280px, calc(100vh - 80px))"},children:[p.jsxs("div",{className:"px-3 pt-3 pb-2.5",children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Jump to frame"}),p.jsxs("form",{onSubmit:w,className:"flex items-center gap-1.5",children:[p.jsx("input",{value:u,onChange:k=>f(k.target.value),disabled:e,inputMode:"numeric",pattern:"[0-9]*","aria-label":"Jump to frame",placeholder:"frame number",className:"h-6 flex-1 rounded border border-neutral-700 bg-neutral-900 px-2 text-[10px] font-mono tabular-nums text-neutral-200 outline-none transition-colors placeholder:text-neutral-600 focus:border-studio-accent/60",onKeyDown:O,onBlur:b}),p.jsx(br,{label:"Jump to frame",children:p.jsx("button",{type:"submit",disabled:e,className:"h-6 px-2 rounded border border-neutral-700 text-[10px] text-neutral-300 transition-colors hover:border-neutral-500 hover:bg-neutral-800 disabled:opacity-40",children:"Go"})})]})]}),p.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),p.jsxs("div",{className:"px-3 pt-2.5 pb-2",children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Work area"}),p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"I"}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:"In-point"})]}),p.jsx("div",{className:"flex items-center gap-1.5",children:r!==null?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:as(r)}),p.jsx(br,{label:"Clear in-point",children:p.jsx("button",{type:"button",onClick:()=>s(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear in-point",children:p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):p.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"O"}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:"Out-point"})]}),p.jsx("div",{className:"flex items-center gap-1.5",children:i!==null?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:as(i)}),p.jsx(br,{label:"Clear out-point",children:p.jsx("button",{type:"button",onClick:()=>a(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear out-point",children:p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):p.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]})]})]}),p.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),p.jsx("div",{className:"px-3 pt-2.5 pb-3 flex flex-col gap-3",children:jCe.map(k=>p.jsxs("div",{children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:k.title}),p.jsx("div",{className:"flex flex-col gap-1",children:k.hints.map(E=>p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[36px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:E.key}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:E.label})]},E.key))})]},k.title))})]})]})}),FCe=[.25,.5,1,1.5,2],$Ce=x.memo(function({playbackRate:e,setPlaybackRate:n,disabled:r}){const[i,s]=x.useState(!1),a=x.useCallback(()=>s(!1),[]),o=F0(a);return p.jsxs("div",{ref:o,className:"relative flex-shrink-0",children:[p.jsx(br,{label:"Playback speed",children:p.jsx("button",{type:"button",onClick:()=>s(l=>!l),disabled:r,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Playback speed",className:"h-7 w-8 rounded-md font-mono text-[10px] tabular-nums text-neutral-500 transition-colors hover:text-neutral-200 disabled:opacity-30",children:e===1?"1x":`${e}x`})}),i&&p.jsx("div",{role:"menu","aria-label":"Playback speed options",className:"absolute bottom-full right-0 mb-1.5 rounded-lg shadow-xl z-50 min-w-[56px] overflow-hidden",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)"},children:FCe.map(l=>{const c=l===e;return p.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":c,onClick:()=>{Pt("playback",{action:"speed_change",rate:l}),n(l),s(!1)},className:`block w-full px-3 py-1.5 text-[11px] text-left font-mono tabular-nums transition-colors outline-none focus-visible:bg-white/[0.04] ${c?"text-neutral-50 bg-white/[0.06]":"text-neutral-500 hover:bg-white/[0.04]"}`,children:[l,"x"]},l)})})]})});function BCe({muted:t,volume:e}){const n=t||e===0;return p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M11 5 6 9H3v6h3l5 4V5Z"}),n?p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"m19 9-6 6"}),p.jsx("path",{d:"m13 9 6 6"})]}):p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),e>=.5?p.jsx("path",{d:"M18.5 5.5a9 9 0 0 1 0 13"}):null]})]})}const VCe=x.memo(function({audioMuted:e,audioVolume:n,disabled:r,setAudioMuted:i,setAudioVolume:s}){const a=Math.round(n*100),o=e||n===0,l=o?"Unmute audio":"Mute audio";return p.jsxs("div",{className:"group flex flex-shrink-0 items-center",children:[p.jsx("div",{className:"w-0 overflow-hidden opacity-0 transition-[width,opacity] duration-150 ease-out group-hover:w-14 group-hover:opacity-100 group-focus-within:w-14 group-focus-within:opacity-100",children:p.jsxs("div",{className:"relative mx-1 flex h-6 w-12 items-center",children:[p.jsx("div",{className:"absolute inset-x-0 h-0.5 overflow-hidden rounded-full bg-neutral-700",children:p.jsx("div",{className:"h-full rounded-full bg-neutral-300",style:{width:`${a}%`}})}),p.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:a,disabled:r,"aria-label":"Preview volume","aria-valuetext":`${a}%`,title:`Preview volume: ${a}%`,onChange:c=>{const u=Number(c.currentTarget.value)/100;s(u),e&&u>0&&i(!1)},className:"hf-preview-volume-range absolute inset-0 w-full disabled:pointer-events-none"})]})}),p.jsx(br,{label:l,children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"mute_toggle",muted:!o}),o&&n===0&&s(1),i(!o)},disabled:r,"aria-label":l,"aria-pressed":o,className:`flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-30 ${o?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,children:p.jsx(BCe,{muted:e,volume:n})})})]})});Bv.registerPlugin(v1);const hG="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",dG="M56 28H67V71H56Z M73 28H84V71H73Z";function HCe({playing:t}){const e=x.useRef(null),n=x.useRef(!0);return x.useEffect(()=>{var o;const r=e.current;if(!r)return;const i=t?dG:hG,s=typeof window<"u"&&((o=window.matchMedia)==null?void 0:o.call(window,"(prefers-reduced-motion: reduce)").matches);if(n.current||s){n.current=!1,Bv.set(r,{morphSVG:i});return}const a=Bv.to(r,{duration:.28,ease:"power2.inOut",morphSVG:i});return()=>{a.kill()}},[t]),p.jsx("span",{className:"relative inline-flex h-3 w-3 items-center justify-center","aria-hidden":"true",children:p.jsx("svg",{width:"12",height:"12",viewBox:"46 21 54 56",fill:"#FAFAFA",children:p.jsx("path",{ref:e,d:t?dG:hG})})})}const QCe=x.memo(function({loopEnabled:e,disabled:n,setLoopEnabled:r}){return p.jsx(br,{label:"Loop playback",children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"loop_toggle",enabled:!e}),r(!e)},disabled:n,className:`flex h-7 w-7 items-center justify-center rounded-md transition-colors disabled:opacity-30 ${e?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,"aria-label":e?"Disable loop playback":"Enable loop playback","aria-pressed":e,children:p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M17 2l4 4-4 4"}),p.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),p.jsx("path",{d:"M7 22l-4-4 4-4"}),p.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})})})}),zCe=x.memo(function({isFullscreen:e,onToggleFullscreen:n}){return p.jsx(br,{label:e?"Exit fullscreen (F)":"Enter fullscreen (F)",children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"fullscreen_toggle",active:!e}),n()},className:`flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md transition-colors ${e?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,"aria-label":e?"Exit fullscreen":"Enter fullscreen",children:p.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e?p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),p.jsx("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),p.jsx("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),p.jsx("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]}):p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),p.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),p.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),p.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})})})}),ZCe=x.memo(function({onTogglePlay:e,onSeek:n,disabled:r=!1,isFullscreen:i=!1,onToggleFullscreen:s}){const a=fe(B=>B.isPlaying),o=fe(B=>B.duration),l=fe(B=>B.timelineReady),c=fe(B=>B.playbackRate),u=fe(B=>B.audioMuted),f=fe(B=>B.audioVolume),h=fe(B=>B.loopEnabled),m=fe.getState().setPlaybackRate,y=fe.getState().setAudioMuted,d=fe.getState().setAudioVolume,v=fe.getState().setLoopEnabled,b=fe(B=>B.inPoint),w=fe(B=>B.outPoint),O=fe.getState().setInPoint,k=fe.getState().setOutPoint,E=fe(B=>B.timeDisplayMode),M=fe.getState().setTimeDisplayMode,N=x.useRef(null),I=x.useRef(0),_=x.useRef(E);_.current=E;const j=x.useRef(o);j.current=o;const L=r||!l;return x.useEffect(()=>{if(!N.current)return;const B=I.current;N.current.textContent=E==="frame"?sG(B,o):as(B)},[o,E]),wr(()=>{const B=Q=>{if(I.current=Q,!N.current)return;const Y=j.current;N.current.textContent=_.current==="frame"?sG(Q,Y):as(Q)},$=ya.subscribe(B);return B(fe.getState().currentTime),$}),p.jsx("div",{children:p.jsxs("div",{className:"grid h-10 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center px-3","aria-disabled":r||void 0,style:{paddingBottom:"env(safe-area-inset-bottom)"},children:[p.jsx(br,{label:E==="time"?"Switch to frame display":"Switch to time display",children:p.jsxs("button",{type:"button",onClick:()=>M(E==="time"?"frame":"time"),disabled:r,className:"min-w-0 justify-self-start whitespace-nowrap font-mono text-[11px] tabular-nums text-neutral-400 transition-colors hover:text-neutral-200 disabled:pointer-events-none",children:[p.jsx("span",{ref:N,children:as(0)}),E==="time"?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"mx-0.5 text-neutral-700",children:"/"}),p.jsx("span",{className:"text-neutral-600",children:as(o)})]}):null]})}),p.jsx(br,{label:a?"Pause":"Play",children:p.jsx("button",{type:"button","aria-label":a?"Pause":"Play",onClick:()=>{Pt("playback",{action:a?"pause":"play"}),e()},disabled:L,className:"flex h-8 w-8 items-center justify-center justify-self-center rounded-md text-neutral-100 transition-colors hover:text-white disabled:pointer-events-none disabled:opacity-30",children:p.jsx(HCe,{playing:a})})}),p.jsxs("div",{className:"flex min-w-0 items-center justify-self-end",children:[p.jsx(VCe,{audioMuted:u,audioVolume:f,disabled:L,setAudioMuted:y,setAudioVolume:d}),p.jsx($Ce,{playbackRate:c,setPlaybackRate:m,disabled:r}),p.jsx(QCe,{loopEnabled:h,disabled:r,setLoopEnabled:v}),s&&p.jsx(zCe,{isFullscreen:i,onToggleFullscreen:s}),p.jsx(LCe,{disabled:r,duration:o,inPoint:b,outPoint:w,setInPoint:O,setOutPoint:k,onSeek:n})]})]})})}),GCe=new Set(["audio","music","sfx","sound","narration"]),UCe=/\.(aac|flac|m4a|mp3|ogg|opus|wav)(?:[?#].*)?$/i,XCe=/\b(music|bgm|soundtrack|background[-_]?music)\b/i;function Xv(t){return t?t.tagName.toLowerCase()===ga?!0:Ko({tag:t.tagName,src:t.getAttribute("src")??void 0}):!1}function Ko(t){if(!t)return!1;const e=t.tag.trim().toLowerCase();return GCe.has(e)?!0:!!(t.src&&UCe.test(t.src))}function fy(t){if(!t||!Ko(t))return!1;if(t.timelineRole==="music")return!0;if(t.timelineRole&&t.timelineRole!=="music")return!1;const e=t.domId??t.id??"";return XCe.test(e)}function WCe(t){const e=t.find(fy);if(e)return{element:e,isFallback:!1};let n=null;for(const r of t)Ko(r)&&(r.timelineRole&&r.timelineRole!=="music"||(!n||r.duration>n.duration)&&(n=r));return n?{element:n,isFallback:!0}:null}function Vse(t){return!t.some(e=>Xv(e.element))}let _O=null;const pG=()=>ly(()=>import("./index-uu4Zd3BU.js").then(t=>t.i),[]);function qCe(t=pG){const e=t===pG;if(e&&_O)return _O;const n=t().then(r=>(r.default??r)||null).catch(()=>(e&&(_O=null),null));return e&&(_O=n),n}const _P=1024,mG=512,YCe=.05;function Hse(t,e,n){const r=Math.floor(e*YCe),i=Math.floor(n*e),s=Math.max(0,i-r),a=Math.min(t.length,i+r);let o=0;for(let l=s;l<a;l++){const c=t[l]??0;o+=c*c}return Math.sqrt(o/Math.max(a-s,1))}function Qse(t,e){return!t.channelData||t.peak<=0?.5:Math.min(1,Hse(t.channelData,t.sampleRate,e)/t.peak)}async function KCe(t){const e=t.getChannelData(0),n=t.sampleRate,r=[];for(let a=0;a<e.length-_P;a+=mG){let o=0;for(let l=0;l<_P;l++){const c=e[a+l];o+=c*c}r.push(o/_P)}const i=[],s=20;for(let a=s;a<r.length-s;a++){let o=0;for(let u=a-s;u<a+s;u++)o+=r[u];o/=s*2;const l=o*1.5,c=r[a];if(c>l&&c>(r[a-1]??0)&&c>(r[a+1]??0)){const u=a*mG/n;(i.length===0||u-i[i.length-1]>.1)&&i.push(Math.round(u*1e3)/1e3)}}return i}function JCe(t){if(t.length<4)return null;const e=[];for(let s=1;s<t.length;s++)e.push(t[s]-t[s-1]);const n=[...e].sort((s,a)=>s-a),r=Math.floor(n.length/2),i=n.length%2===0?(n[r-1]+n[r])/2:n[r];return i<=0?null:Math.round(60/i*10)/10}function RP(t){let e=t;for(;e>120;)e/=2;for(;e<60;)e*=2;return e}function eke(t,e){const n=[t/2,t,t*2];let r=t,i=Number.POSITIVE_INFINITY;for(const s of n){if(s<=0)continue;const a=Math.abs(s-e);a<i&&(i=a,r=s)}return r}function tke(t,e,n){if(t.length===0||e<=0||n<=0)return t;const r=60/e;if(r<.125)return t;const i=r*.25;let s=0,a=-1;for(const l of t.slice(0,10)){const c=(l%r+r)%r;let u=0;for(const f of t){const h=(f%r+r)%r;Math.min(Math.abs(h-c),r-Math.abs(h-c))<i&&u++}u>a&&(a=u,s=c)}const o=[];for(let l=s;l<=n+.001;l+=r)o.push(Math.round(l*1e3)/1e3);return o}function nke(t,e,n){if(t.length===0)return{times:t,strengths:[],peak:1e-6};const r=t.map(l=>Hse(e,n,l)),i=Math.max(...r,1e-6),s=i*.12,a=[],o=[];for(let l=0;l<t.length;l++)r[l]>=s&&(a.push(t[l]),o.push(Math.min(1,r[l]/i)));return{times:a,strengths:o,peak:i}}async function rke(t){const e=t.getChannelData(0),n=t.sampleRate,r=t.duration,i=await KCe(t),s=JCe(i);let a=null;try{const h=await qCe();h&&(a=h(t))}catch{}let o=s,l="uncertain",c=null;if(s!==null&&a!==null){const h=Math.abs(RP(s)-RP(a))/RP(a);h<.05?(o=eke(a,s),l="high",c=o):h<.1?(o=Math.round((s+a)/2),l="low",c=o):(o=s,l="uncertain")}else s!==null?(o=s,l="low",c=s):a!==null&&(o=a,l="low",c=a);const u=c!==null?tke(i,c,r):i,f=nke(u,e,n);return{beatTimes:f.times,beatStrengths:f.strengths,bpm:o,bpmConfidence:l,channelData:e,sampleRate:n,peak:f.peak}}async function ike(t){const e=new AudioContext;try{const r=await(await fetch(t)).arrayBuffer(),i=await e.decodeAudioData(r);return rke(i)}finally{await e.close()}}function zse(t){if(!t||/^(blob:|data:)/i.test(t))return null;let e=null;const n="/preview/",r=t.indexOf(n);if(r!==-1){let i=t.slice(r+n.length);const s=i.search(/[?#]/);s!==-1&&(i=i.slice(0,s)),i.startsWith("comp/")&&(i=i.slice(5)),e=i?decodeURIComponent(i):null}if(!e)try{e=decodeURIComponent(new URL(t,"http://_").pathname)}catch{e=t}return e?(e=e.replace(/^\/+/,""),e||null):null}function gG(t){const e=zse(t);return e?`beats/${e}.json`:null}function ske(t,e,n){const r=t.map((s,a)=>({time:Math.round(s*1e3)/1e3,strength:Math.round((e[a]??.5)*1e3)/1e3}));return`${JSON.stringify({version:1,audio:n,beats:r},null,2)}
|
|
70
|
+
*/var s6e=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,a6e=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,o6e=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,l6e=/(^[#\.][a-z]|[a-y][a-z])/i,c6e=Math.PI/180,PO=Math.sin,MO=Math.cos,hc=Math.abs,cf=Math.sqrt,NO=Math.atan2,HZ=1e8,QZ=function(e){return typeof e=="string"},Kie=function(e){return typeof e=="number"},zZ=1e5,ns=function(e){return Math.round(e*zZ)/zZ||0},ZZ=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},u6e=function(e,n,r){var i=e.length,s=~~(r*i);if(e[s]>n){for(;--s&&e[s]>n;);s<0&&(s=0)}else for(;e[++s]<n&&s<i;);return s<i?s:i-1};function f6e(t){t=QZ(t)&&l6e.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=mf(t)):t?QZ(t)?mf(t):Kie(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function Lb(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var h6e=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),s=i.length,a;for(n=","+n+",";--s>-1;)a=i[s].nodeName.toLowerCase(),n.indexOf(","+a+",")<0&&r.setAttributeNS(null,a,i[s].nodeValue);return r},d6e={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},p6e=function(e,n){for(var r=n?n.split(","):[],i={},s=r.length;--s>-1;)i[r[s]]=+e.getAttribute(r[s])||0;return i};function Jie(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,s,a,o,l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_;return n==="path"||!t.getBBox?t:(c=h6e(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),_=p6e(t,d6e[n]),n==="rect"?(o=_.rx,l=_.ry||o,s=_.x,a=_.y,m=_.width-o*2,y=_.height-l*2,o||l?(d=s+o*(1-r),v=s+o,b=v+m,w=b+o*r,O=b+o,k=a+l*(1-r),E=a+l,M=E+y,N=M+l*r,I=M+l,i="M"+O+","+E+" V"+M+" C"+[O,N,w,I,b,I,b-(b-v)/3,I,v+(b-v)/3,I,v,I,d,I,s,N,s,M,s,M-(M-E)/3,s,E+(M-E)/3,s,E,s,k,d,a,v,a,v+(b-v)/3,a,b-(b-v)/3,a,b,a,w,a,O,k,O,E].join(",")+"z"):i="M"+(s+m)+","+a+" v"+y+" h"+-m+" v"+-y+" h"+m+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(o=l=_.r,f=o*r):(o=_.rx,l=_.ry,f=l*r),s=_.cx,a=_.cy,u=o*r,i="M"+(s+o)+","+a+" C"+[s+o,a+f,s+u,a+l,s,a+l,s-u,a+l,s-o,a+f,s-o,a,s-o,a-f,s-u,a-l,s,a-l,s+u,a-l,s+o,a-f,s+o,a].join(",")+"z"):n==="line"?i="M"+_.x1+","+_.y1+" L"+_.x2+","+_.y2:(n==="polyline"||n==="polygon")&&(h=(t.getAttribute("points")+"").match(a6e)||[],s=h.shift(),a=h.shift(),i="M"+s+","+a+" L"+h.join(","),n==="polygon"&&(i+=","+s+","+a+"z")),c.setAttribute("d",$p(c._gsRawPath=mf(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function ese(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,s=t.length,a=t[e],o=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:HZ)||HZ,h=c[l+n*r-1],m=e?c[l-1]:0,y,d,v,b,w,O,k,E,M,N,I,_,j,L,B,$,Q;for(c.length=u.length=0,d=e+2;d<s;d+=6){if(v=t[d+4]-a,b=t[d+2]-a,w=t[d]-a,E=t[d+5]-o,M=t[d+3]-o,N=t[d+1]-o,O=k=I=_=0,hc(v)<.01&&hc(E)<.01&&hc(w)+hc(N)<.01)t.length>8&&(t.splice(d,6),d-=6,s-=6);else for(y=1;y<=r;y++)L=i*y,j=1-L,O=k-(k=(L*L*v+3*j*(L*b+j*w))*L),I=_-(_=(L*L*E+3*j*(L*M+j*N))*L),$=cf(I*I+O*O),$<f&&(f=$),m+=$,c[l++]=m;a+=v,o+=E}if(h)for(h-=m;l<c.length;l++)c[l]+=h;if(c.length&&f){if(t.totalLength=Q=c[c.length-1]||0,t.minLength=f,Q/f<9999)for($=B=0,y=0;y<Q;y+=f)u[$++]=c[B]<y?++B:B}else t.totalLength=c[0]=0;return e?m-c[e/2-1]:m}function tse(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=12,n+=ese(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function m6e(t,e,n,r,i,s,a,o,l){if(!(t===o&&e===l)){n=hc(n),r=hc(r);var c=i%360*c6e,u=MO(c),f=PO(c),h=Math.PI,m=h*2,y=(t-o)/2,d=(e-l)/2,v=u*y+f*d,b=-f*y+u*d,w=v*v,O=b*b,k=w/(n*n)+O/(r*r);k>1&&(n=cf(k)*n,r=cf(k)*r);var E=n*n,M=r*r,N=(E*M-E*O-M*w)/(E*O+M*w);N<0&&(N=0);var I=(s===a?-1:1)*cf(N),_=I*(n*b/r),j=I*-(r*v/n),L=(t+o)/2,B=(e+l)/2,$=L+(u*_-f*j),Q=B+(f*_+u*j),Y=(v-_)/n,W=(b-j)/r,J=(-v-_)/n,ne=(-b-j)/r,le=Y*Y+W*W,ie=(W<0?-1:1)*Math.acos(Y/cf(le)),q=(Y*ne-W*J<0?-1:1)*Math.acos((Y*J+W*ne)/cf(le*(J*J+ne*ne)));isNaN(q)&&(q=h),!a&&q>0?q-=m:a&&q<0&&(q+=m),ie%=m,q%=m;var F=Math.ceil(hc(q)/(m/4)),U=[],Z=q/F,K=4/3*PO(Z/2)/(1+MO(Z/2)),ee=u*n,re=f*n,z=f*-r,H=u*r,se;for(se=0;se<F;se++)i=ie+se*Z,v=MO(i),b=PO(i),Y=MO(i+=Z),W=PO(i),U.push(v-K*b,b+K*v,Y+K*W,W-K*Y,Y,W);for(se=0;se<U.length;se+=2)v=U[se],b=U[se+1],U[se]=v*ee+b*z+$,U[se+1]=v*re+b*H+Q;return U[se-2]=o,U[se-1]=l,U}}function mf(t){var e=(t+"").replace(o6e,function(_){var j=+_;return j<1e-4&&j>-1e-4?0:j}).match(s6e)||[],n=[],r=0,i=0,s=2/3,a=e.length,o=0,l="ERROR: malformed path: "+t,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I=function(j,L,B,$){w=(B-j)/3,O=($-L)/3,d.push(j+w,L+O,B-w,$-O,B,$)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<a;c++)if(E=m,isNaN(e[c])?(m=e[c].toUpperCase(),y=m!==e[c]):c--,f=+e[c+1],h=+e[c+2],y&&(f+=r,h+=i),c||(v=f,b=h),m==="M")d&&(d.length<8?n.length-=1:o+=d.length,ZZ(d)),r=v=f,i=b=h,d=[f,h],n.push(d),c+=2,m="L";else if(m==="C")d||(d=[0,0]),y||(r=i=0),d.push(f,h,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(m==="S")w=r,O=i,(E==="C"||E==="S")&&(w+=r-d[d.length-4],O+=i-d[d.length-3]),y||(r=i=0),d.push(w,O,f,h,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(m==="Q")w=r+(f-r)*s,O=i+(h-i)*s,y||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,d.push(w,O,r+(f-r)*s,i+(h-i)*s,r,i),c+=4;else if(m==="T")w=r-d[d.length-4],O=i-d[d.length-3],d.push(r+w,i+O,f+(r+w*1.5-f)*s,h+(i+O*1.5-h)*s,r=f,i=h),c+=2;else if(m==="H")I(r,i,r=f,i),c+=1;else if(m==="V")I(r,i,r,i=f+(y?i-r:0)),c+=1;else if(m==="L"||m==="Z")m==="Z"&&(f=v,h=b,d.closed=!0),(m==="L"||hc(r-f)>.5||hc(i-h)>.5)&&(I(r,i,f,h),m==="L"&&(c+=2)),r=f,i=h;else if(m==="A"){if(M=e[c+4],N=e[c+5],w=e[c+6],O=e[c+7],u=7,M.length>1&&(M.length<3?(O=w,w=N,u--):(O=N,w=M.substr(2),u-=2),N=M.charAt(1),M=M.charAt(0)),k=m6e(r,i,+e[c+1],+e[c+2],+e[c+3],+M,+N,(y?r:0)+w*1,(y?i:0)+O*1),c+=u,k)for(u=0;u<k.length;u++)d.push(k[u]);r=d[d.length-2],i=d[d.length-1]}else console.log(l);return c=d.length,c<6?(n.pop(),c=0):ZZ(d),n.totalPoints=o+c,n}function g6e(t,e){t.samples||ese(t);for(var n=t.samples,r=t.lookup,i=t.resolution,s=t.totalLength,a=t.slice(0,2),o=[],l=t.length-4,c=6,u=.2,f=0,h=0,m,y,d,v,b,w,O,k,E,M,N,I,_,j;c<l;c+=6)Math.abs(NO(t[c+1]-t[c-1],t[c]-t[c-2])-NO(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&o.push(c);if(o.push(t.length-2),l=o.length,a.nonSmooth=I=[1],e>l)for(e-=l,b=0;b<l;b++){for(_=o[b],j=Math.round(_/6*i),E=n[j-1]-f,y=Math.round(n[j-1]/s*e)-h,h+=y,w=1/(y+1),O=1;O<=y;O++)M=f+E*O*w,c=r.length?r[M<s?~~(M/t.minLength):r.length-1]||0:u6e(n,M,M/s),d=c?n[c-1]:0,v=n[c],v<M&&(d=v,v=n[++c]),m=1/i*((M-d)/(v-d)+c%i)||0,k=1-m,c=~~(c/i)*6,N=t[c],a.push(ns((m*m*(t[c+6]-N)+3*k*(m*(t[c+4]-N)+k*(t[c+2]-N)))*m+N),ns((m*m*(t[c+7]-(N=t[c+1]))+3*k*(m*(t[c+5]-N)+k*(t[c+3]-N)))*m+N));I[a.length]=1,a.push(t[_],t[_+1]),f+=E}return c=t.length-2,t.closed&&Math.abs(NO(t[c+1]-t[c-1],t[c]-t[c-2])-NO(t[3]-t[1],t[2]-t[0]))<=u&&(I[0]=I[I.length-1]=0),a}function y6e(t,e){hc(t[0]-t[2])<1e-4&&hc(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],s=+t[2],a=+t[3],o=[r,i,r,i],l=s-r,c=a-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,h,m,y,d,v,b,w,O,k,E,M,N,I,_,j;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(s,a),s=r,a=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,y=2;y<n;y+=2)if(h=r,m=i,r=s,i=a,s=+t[y+2],a=+t[y+3],!(r===s&&i===a)){if(d=l,v=c,l=s-r,c=a-i,u[y]){o.push(r-(r-h)/4,i-(i-m)/4,r,i,r+(s-r)/4,i+(a-i)/4);continue}b=cf(d*d+v*v),w=cf(l*l+c*c),O=cf(Math.pow(l/w+d/b,2)+Math.pow(c/w+v/b,2)),k=(b+w)*e*.25/O,E=r-(r-h)*(b?k/b:0),M=r+(s-r)*(w?k/w:0),N=r-(E+((M-E)*(b*3/(b+w)+.5)/4||0)),I=i-(i-m)*(b?k/b:0),_=i+(a-i)*(w?k/w:0),j=i-(I+((_-I)*(b*3/(b+w)+.5)/4||0)),o.push(ns(E+N),ns(I+j),ns(r),ns(i),ns(M+N),ns(_+j))}return r!==s||i!==a||o.length<4?o.push(ns(s),ns(a),ns(s),ns(a)):o.length-=2,o.length===2?o.push(r,i,r,i,r,i):f&&(o.splice(0,6),o.length-=6),o.closed=f,o}function $p(t){Kie(t[0])&&(t=[t]);var e="",n=t.length,r,i,s,a;for(i=0;i<n;i++){for(a=t[i],e+="M"+ns(a[0])+","+ns(a[1])+" C",r=a.length,s=2;s<r;s++)e+=ns(a[s++])+","+ns(a[s++])+" "+ns(a[s++])+","+ns(a[s++])+" "+ns(a[s++])+","+ns(a[s])+" ";a.closed&&(e+="z")}return e}function y6(){return y6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},y6.apply(this,arguments)}var wl,lj,Fb,nse,$b,rse,ise=function(){return wl||typeof window<"u"&&(wl=window.gsap)&&wl.registerPlugin&&wl},EP=function(e){return typeof e=="function"},x6=Math.atan2,GZ=Math.cos,UZ=Math.sin,l0=Math.sqrt,oE=Math.PI,XZ=oE*2,x6e=oE*.3,b6e=oE*.7,cj=1e20,Vv=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,v6e=/(^[#.][a-z]|[a-y][a-z])/i,A6e=/[achlmqstvz]/i,Jh=function(e){return console&&console.warn(e)},zc=function(e){return Math.round(e*1e5)/1e5||0},WZ=function(e){var n=e.length,r=0,i=0,s;for(s=0;s<n;s++)r+=e[s++],i+=e[s];return[r/(n/2),i/(n/2)]},Z1=function(e){var n=e.length,r=e[0],i=r,s=e[1],a=s,o,l,c;for(c=6;c<n;c+=6)o=e[c],l=e[c+1],o>r?r=o:o<i&&(i=o),l>s?s=l:l<a&&(a=l);return e.centerX=(r+i)/2,e.centerY=(s+a)/2,e.size=(r-i)*(s-a)},$2=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],s=i,a=e[0][1],o=a,l=1/n,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I;--r>-1;)for(m=e[r],c=m.length,h=6;h<c;h+=6)for(b=m[h],w=m[h+1],O=m[h+2]-b,M=m[h+3]-w,k=m[h+4]-b,N=m[h+5]-w,E=m[h+6]-b,I=m[h+7]-w,y=n;--y>-1;)d=l*y,v=1-d,u=(d*d*E+3*v*(d*k+v*O))*d+b,f=(d*d*I+3*v*(d*N+v*M))*d+w,u>i?i=u:u<s&&(s=u),f>a?a=f:f<o&&(o=f);return e.centerX=(i+s)/2,e.centerY=(a+o)/2,e.left=s,e.width=i-s,e.top=o,e.height=a-o,e.size=(i-s)*(a-o)},sse=function(e,n){return n.length-e.length},qZ=function(e,n){var r=e.size||Z1(e),i=n.size||Z1(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},YZ=function(e,n){var r=e.slice(0),i=e.length,s=i-2,a,o;for(n=n|0,a=0;a<i;a++)o=(a+n)%s,e[a++]=r[o],e[a]=r[o+1]},TP=function(e,n,r,i,s){var a=e.length,o=0,l=a-2,c,u,f,h;for(r*=6,u=0;u<a;u+=6)c=(u+r)%l,h=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-s),o+=l0(f*f+h*h);return o},S6e=function(e,n,r){var i=e.length,s=WZ(e),a=WZ(n),o=a[0]-s[0],l=a[1]-s[1],c=TP(e,n,0,o,l),u=0,f,h,m;for(m=6;m<i;m+=6)h=TP(e,n,m/6,o,l),h<c&&(c=h,u=m);if(r)for(f=e.slice(0),Lb(f),m=6;m<i;m+=6)h=TP(f,n,m/6,o,l),h<c&&(c=h,u=-m);return u/6},w6e=function(e,n,r){for(var i=e.length,s=cj,a=0,o=0,l,c,u,f,h,m;--i>-1;)for(l=e[i],m=l.length,h=0;h<m;h+=6)c=l[h]-n,u=l[h+1]-r,f=l0(c*c+u*u),f<s&&(s=f,a=l[h],o=l[h+1]);return[a,o]},O6e=function(e,n,r,i,s,a){var o=n.length,l=0,c=Math.min(e.size||Z1(e),n[r].size||Z1(n[r]))*i,u=cj,f=e.centerX+s,h=e.centerY+a,m,y,d,v,b;for(y=r;y<o&&(m=n[y].size||Z1(n[y]),!(m<c));y++)d=n[y].centerX-f,v=n[y].centerY-h,b=l0(d*d+v*v),b<u&&(l=y,u=b);return b=n[l],n.splice(l,1),b},C6e=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],s=e[n+1],a=e[n+2],o=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],h,m,y,d,v,b,w,O,k;r-- >0;)h=1-1/(r+2),m=i+(a-i)*h,y=a+(l-a)*h,d=s+(o-s)*h,v=o+(c-o)*h,b=m+(y-m)*h,w=d+(v-d)*h,O=l+(u-l)*h,k=c+(f-c)*h,y+=(O-y)*h,v+=(k-v)*h,e.splice(n+2,4,a=zc(m),o=zc(d),l=zc(b),c=zc(w),u=zc(b+(y-b)*h),f=zc(w+(v-w)*h),zc(y),zc(v),zc(O),zc(k))},k6e=function(e){for(var n=e.length,r=-cj,i;n--;)e[n]>r&&(r=e[n],i=n);return i},b4=function(e,n){for(var r=[],i=[],s=e.length-2,a=0;a<s;a+=6)r.push(Math.pow(e[a]-e[a+6],2)+Math.pow(e[a+1]-e[a+7],2));for(;n--;)a=k6e(r),i[a]=s=(i[a]||0)+1,r[a]*=s/(s+1);for(a=r.length;a--;)i[a]&&C6e(e,a*6,i[a])},FI=function(e,n){return n||tse(e),Math.max(4,Math.round(e.totalLength/4))},KZ=function(e){return e.slice(0).sort(sse)},ase=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},PP=function(e,n){n=n||{};var r=n,i=r.redraw,s=r.points,a=r.maxSegments,o=a===void 0?999:a,l=0,c=e,u=Array.isArray(s)?s:0,f,h,m,y,d;if(i=i!==!1,i)tse(e);else for(e.totalPoints=0,h=e.length;h--;)e.totalPoints+=e[h].length;for(u?(c=KZ(e),u=KZ(u),d=u[0].totalLength/Math.round(u[0].length/6)):((!s||s==="auto")&&(s=FI(e,i),i||(s-=Math.round(e.totalPoints/6))),s=Math.max(i?10:4,Math.min(999,s))),h=0;h<c.length;h++){if(m=c[h],f=Math.max(i?10:4,u?Math.round(u[h]?u[h].length/6:c[h].totalLength/d||0):Math.round((l/s+(i?m.totalLength/e.totalLength:m.length/e.totalPoints))*s)-l),!(h>=o||u&&(!u[h]||ase(u[h]))))if(i){var v;y=y6e(g6e(m,f),n.curviness),m.length=0,(v=m).push.apply(v,y)}else b4(m,f);l+=f}return e},$I=function(e,n,r,i,s){var a=n.length-e.length,o=a>0?n:e,l=a>0?e:n,c=0,u=i==="complexity"?sse:qZ,f=i==="position"?0:typeof i=="number"?i:.8,h=l.length,m=typeof r=="object"&&r.push?r.slice(0):[r],y=m[0]==="reverse"||m[0]<0,d=r==="log",v,b,w,O,k,E,M;if(l[0]){if(o.length>1&&(e.sort(u),n.sort(u),o.size||$2(o),l.size||$2(l),E=o.centerX-l.centerX,M=o.centerY-l.centerY,u===qZ))for(h=0;h<l.length;h++)o.splice(h,0,O6e(l[h],o,h,f,E,M));if(a)for(a<0&&(a=-a),o[0].length>l[0].length&&b4(l[0],(o[0].length-l[0].length)/6|0),h=l.length;c<a;)O=o[h].size||Z1(o[h]),w=w6e(l,o[h].centerX,o[h].centerY),O=w[0],k=w[1],l[h++]=[O,k,O,k,O,k,O,k],l.totalPoints+=8,c++;for(h=0;h<e.length;h++)v=n[h],b=e[h],a=v.length-b.length,a<0?b4(v,-a/6|0):a>0&&b4(b,a/6|0),y&&s!==!1&&!b.reversed&&Lb(b),r=m[h]||m[h]===0?m[h]:"auto",r&&(b.closed||Math.abs(b[0]-b[b.length-2])<.5&&Math.abs(b[1]-b[b.length-1])<.5?r==="auto"||r==="log"?(m[h]=r=S6e(b,v,!h||s===!1),r<0&&(y=!0,Lb(b),r=-r),YZ(b,r*6)):r!=="reverse"&&(h&&r<0&&Lb(b),YZ(b,(r<0?-r:r)*6)):!y&&(r==="auto"&&Math.abs(v[0]-b[0])+Math.abs(v[1]-b[1])+Math.abs(v[v.length-2]-b[b.length-2])+Math.abs(v[v.length-1]-b[b.length-1])>Math.abs(v[0]-b[b.length-2])+Math.abs(v[1]-b[b.length-1])+Math.abs(v[v.length-2]-b[0])+Math.abs(v[v.length-1]-b[1])||r%2)?(Lb(b),m[h]=-1,y=!0):r==="auto"?m[h]=0:r==="reverse"&&(m[h]=-1),b.closed!==v.closed&&(b.closed=v.closed=!1));return d&&Jh("shapeIndex:["+m.join(",")+"]"),e.shapeIndex=m,m}},JZ=function(e,n,r,i,s){var a=mf(e[0]),o=mf(e[1]);$I(a,o,n||n===0?n:"auto",r,s)&&(e[0]=$p(a),e[1]=$p(o),(i==="log"||i===!0)&&Jh('precompile:["'+e[0]+'","'+e[1]+'"]'))},E6e=function(e,n){if(!n)return e;var r=e.match(Vv)||[],i=r.length,s="",a,o,l;for(n==="reverse"?(o=i-1,a=-2):(o=((parseInt(n,10)||0)*2+1+i*100)%i,a=2),l=0;l<i;l+=2)s+=r[o-1]+","+r[o]+" ",o=(o+a)%i;return s},eG=function(e,n){var r=0,i=parseFloat(e[0]),s=parseFloat(e[1]),a=i+","+s+" ",o=.999999,l,c,u,f,h,m,y;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,m=parseFloat(e[c+2]),y=parseFloat(e[c+3]),r>o)for(h=1/(Math.floor(r)+1),f=1;r>o;)a+=(i+(m-i)*h*f).toFixed(2)+","+(s+(y-s)*h*f).toFixed(2)+" ",r--,f++;a+=m+","+y+" ",i=m,s=y}return a},BI=function(e){var n=e[0].match(Vv)||[],r=e[1].match(Vv)||[],i=r.length-n.length;i>0?e[0]=eG(n,i):e[1]=eG(r,-i)},T6e=function(e){return isNaN(e)?BI:function(n){BI(n),n[1]=E6e(n[1],parseInt(e,10))}},P6e=function(e,n,r){var i=typeof e=="string",s,a;return(!i||v6e.test(e)||(e.match(Vv)||[]).length<3)&&(s=lj(e)[0],s?(a=(s.nodeName+"").toUpperCase(),n&&a!=="PATH"&&(s=Jie(s,!1),a="PATH"),e=s.getAttribute(a==="PATH"?"d":"points")||"",s===r&&(e=s.getAttributeNS(null,"data-original")||e)):(Jh("WARNING: invalid morph to: "+e),e=!1)),e},tG=function(e){for(var n=e.length,r,i,s,a,o,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],s=r[l+1]-r[l+3],a=r[l+6]-r[l+4],o=r[l+7]-r[l+5],u[l+2]=x6(s,i),u[l+3]=l0(i*i+s*s),u[l+4]=x6(o,a),u[l+5]=l0(a*a+o*o);return e},nG=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},ose=function(e){return e!==e%oE?e+(e<0?XZ:-XZ):e},rG="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",M6e=function(e,n,r,i){var s=this._origin,a=this._eOrigin,o=e[r]-s.x,l=e[r+1]-s.y,c=l0(o*o+l*l),u=x6(l,o),f,h;return o=n[r]-a.x,l=n[r+1]-a.y,f=x6(l,o)-u,h=ose(f),!i&&Fb&&Math.abs(h+Fb.ca)<x6e&&(i=Fb),this._anchorPT=Fb={_next:this._anchorPT,t:e,sa:u,ca:i&&h*i.ca<0&&Math.abs(h)>b6e?f:h,sl:c,cl:l0(o*o+l*l)-c,i:r}},iG=function(e){wl=ise(),$b=$b||wl&&wl.plugins.morphSVG,wl&&$b?(lj=wl.utils.toArray,rse=wl.core.reverting||function(){},$b.prototype._tweenRotation=M6e,nse=1):e&&Jh("Please gsap.registerPlugin(MorphSVGPlugin)")},v1={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){wl=e,$b=n,iG()},init:function(e,n,r,i,s){if(nse||iG(1),!n)return Jh("invalid shape"),!1;EP(n)&&(n=n.call(r,i,e,s));var a,o,l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){a={};for(o in n)a[o]=EP(n[o])&&o!=="render"?n[o].call(r,i,e,s):n[o];n=a}var j=e.nodeType?window.getComputedStyle(e):{},L=j.fill+"",B=!(L==="none"||(L.match(Vv)||[])[3]==="0"||j.fillRule==="evenodd"),$=n.smooth,Q=(n.origin||"50 50").split(",");if($===!0||$==="auto"?$={}:typeof $=="number"&&($={points:$}),a=(e.nodeName+"").toUpperCase(),u=a==="POLYLINE"||a==="POLYGON",a!=="PATH"&&!u&&!n.prop)return Jh("Cannot morph a <"+a+"> element. "+rG),!1;if(o=a==="PATH"?"d":"points",!n.prop&&!EP(e.setAttribute))return!1;if(c=P6e(n.shape||n.d||n.points||"",o==="d",e),u&&A6e.test(c))return Jh("A <"+a+"> cannot accept path data. "+rG),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",h=n.map||v1.defaultMap,this._prop=n.prop,this._render=n.render||v1.defaultRender,this._apply="updateTarget"in n?n.updateTarget:v1.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,M=typeof n.precompile=="object",d=this._original=this._prop?e[this._prop]:e.getAttribute(o),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",d),o==="d"||this._prop){if(d=mf(M?n.precompile[0]:d),v=mf(M?n.precompile[1]:c),$){for(w=d.length;--w;)ase(d[w])&&d.splice(w,1);PP(d,y6({},$,{points:+$.points||Math.max(FI(d),FI(v)),maxSegments:v.length})),PP(v,$.redraw===!1?$:y6({},$,{points:d}))}if(!M&&!$I(d,v,f,h,B))return!1;for((n.precompile==="log"||n.precompile===!0)&&Jh('precompile:["'+$p(d)+'","'+$p(v)+'"]'),I=(n.type||v1.defaultType)!=="linear",_=n.curveMode||I,tG(d),tG(v),I&&(d.size||$2(d),v.size||$2(v),N=nG(Q[0]),this._origin=d.origin={x:d.left+N.x*d.width,y:d.top+N.y*d.height},Q[1]&&(N=nG(Q[1])),this._eOrigin={x:v.left+N.x*v.width,y:v.top+N.y*v.height}),this._rawPath=e._gsRawPath=d,w=d.length;--w>-1;){for(k=d[w],E=v[w],m=k.cpData,y=E.cpData,O=k.length,Fb=0,b=0;b<O;b+=6)(E[b]!==k[b]||E[b+1]!==k[b+1])&&(I?l=this._tweenRotation(k,E,b):(l=this.add(k,b,k[b],E[b],0,0,0,0,0,1),l=this.add(k,b+1,k[b+1],E[b+1],0,0,0,0,0,1)||l));for(b=0;b<O;b+=2)_&&(m[b]!==y[b]||m[b+1]!==y[b+1])&&m[b+1]&&y[b+1]?this._controlPT={_next:this._controlPT,i:b,j:w,ai:b%6>3?b+2:b-2,sa:m[b],ca:ose(y[b]-m[b]),sl:m[b+1],cl:y[b+1]-m[b+1]}:(E[b]!==k[b]&&(l=this.add(k,b,k[b],E[b],0,0,0,0,0,1)),E[b+1]!==k[b+1]&&(l=this.add(k,b+1,k[b+1],E[b+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(o)+"",c+"",i,s,0,T6e(f),o);I&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=$&&$.persist!==!1?$p(v):c,l.endProp=o)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,s=n._anchorPT,a=n._rnd,o=n._target,l=n._pt,c,u,f,h,m,y,d,v,b;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?o[n._prop]=l.end:o.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;s;)m=s.sa+e*s.ca,h=s.sl+e*s.cl,s.t[s.i]=n._origin.x+GZ(m)*h,s.t[s.i+1]=n._origin.y+UZ(m)*h,s=s._next;for(;i;)f=r[i.j],y=i.i,m=i.sa+e*i.ca,v=UZ(m),b=GZ(m),h=i.sl+e*i.cl,f[y]=f[i.ai]-b*h,f[y+1]=f[i.ai+1]-v*h,i=i._next;if(!e&&rse()&&(r=mf(n._original)),o._gsRawPath=r,n._apply){for(c="",u=" ",d=0;d<r.length;d++){for(f=r[d],h=f.length,c+="M"+(f[0]*a|0)/a+u+(f[1]*a|0)/a+" C",y=2;y<h;y++)c+=(f[y]*a|0)/a+u;f.closed&&(c+="z")}n._prop?o[n._prop]=c:o.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,o)},kill:function(e){this._pt=this._rawPath=0},getRawPath:f6e,stringToRawPath:mf,rawPathToString:$p,smoothRawPath:PP,normalizeStrings:function(e,n,r){var i=r.shapeIndex,s=r.map,a=[e,n];return JZ(a,i,s),a},pathFilter:JZ,pointsFilter:BI,getTotalSize:$2,equalizeSegmentQuantity:$I,convertToPath:function(e,n){return lj(e).map(function(r){return Jie(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};ise()&&wl.registerPlugin(v1);const Bd=30;function as(t){if(!Number.isFinite(t)||t<0)return"00:00";const e=Math.floor(t/60),n=Math.floor(t%60);return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}function Hv(t,e=Bd){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:Math.round(t*e)}function uj(t,e=Bd){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:t/e}function N6e(t,e,n=Bd){const r=Hv(t,n),i=Math.max(0,r+e);return uj(i,n)}function sG(t,e,n=Bd){const r=Hv(t,n),i=Hv(e,n);return`${r}f / ${i}f`}function D6e(){try{return!1}catch{return!1}}function I6e(t){!D6e()||typeof window>"u"||(window.__playerStore=t)}function lse(t){return Number.isFinite(t)&&t>0}function aG(t,e){const n=Math.max(0,Number.isFinite(e)?e:0),r=Math.max(0,Number.isFinite(t)?t:0);return n>0?Math.min(r,n):r}function v4(t){if(!t)return 0;try{const e=Number(t.getDuration());return lse(e)?e:0}catch{return 0}}function _6e(t){return{now:()=>t.performance.now(),requestAnimationFrame:e=>t.requestAnimationFrame(e),cancelAnimationFrame:e=>t.cancelAnimationFrame(e)}}function R6e(t,e,n,r=()=>1){var m;const i=Math.max(0,Number.isFinite(e)?e:0);let s=aG(Number(((m=t.getTime)==null?void 0:m.call(t))??0),i),a=!1,o=0,l=s,c=n.now();const u=y=>{var d;if(s=aG(y,i),typeof t.renderSeek=="function"){t.renderSeek(s);return}(d=t.seek)==null||d.call(t,s)},f=()=>{o&&(n.cancelAnimationFrame(o),o=0)},h=y=>{if(!a)return;const d=Math.max(.1,Number(r())||1),v=(y-c)/1e3*d;if(u(l+v),s>=i){a=!1,o=0;return}o=n.requestAnimationFrame(h)};return{play:()=>{a||i<=0||(s>=i&&u(0),a=!0,l=s,c=n.now(),f(),o=n.requestAnimationFrame(h))},pause:()=>{a=!1,f()},seek:(y,d)=>{if(u(y),d!=null&&d.keepPlaying){a&&(l=s,c=n.now());return}a=!1,f()},getTime:()=>s,getDuration:()=>i,isPlaying:()=>a}}function DO(t,e){var n;(n=t.current)==null||n.adapter.pause(),t.current=null,e.current=!1}function j6e(t){const{cache:e,warned:n,bestAdapter:r,effectiveDuration:i,docDuration:s}=t,a=e.current;if((a==null?void 0:a.player)===r&&a.duration===i)return a.adapter;a==null||a.adapter.pause(),n.current||(n.current=!0,console.warn(`[useTimelinePlayer] Selected adapter duration (${v4(r)}s) does not cover the document duration (${s}s); falling back to seek-driven playback, which never starts media elements or WebAudio. Audio will not play in preview — extend the GSAP timeline to cover the declared data-duration.`));const o=R6e(r,i,t.clock,t.getPlaybackRate);return e.current={player:r,duration:i,adapter:o},o}function oG(t){return{play:()=>t.play(),pause:()=>t.pause(),seek:(e,n)=>{const r=!(n!=null&&n.keepPlaying);r&&t.pause(),t.seek(e),r&&t.pause()},getTime:()=>t.time(),getDuration:()=>t.duration(),isPlaying:()=>t.isActive()}}function cse(t,e,n,r,i){if(!(!n||n.startsWith("#")||n.startsWith("[data-composition-id=")))try{const s=r??"index.html",o=Array.from(t.querySelectorAll(n)).filter(l=>(i(l)??"index.html")===s).indexOf(e);return o>=0?o:void 0}catch{return}}const Xs="data-fx-chain",use=Xs.slice(5),c0=1,Zx=(t="frequency",e="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:t,label:e,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),MP=(t=.707,e="Bandwidth — higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:t,scale:"log",automatable:!0,hint:e}),IO=(t=-40,e=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:t,max:e,step:.1,default:n,automatable:!0}),lG={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},JA=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[IO(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[Zx("frequency","Frequency",1e3),IO(-40,40,0),MP(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Zx("frequency","Frequency",200,20,2e3),IO(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Zx("frequency","Frequency",4e3,500,2e4),IO(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies — the usual fix for rumble on a voice.",params:[Zx("frequency","Cutoff",300,20,2e4),MP(.707),lG],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies — darkens or muffles a track.",params:[Zx("frequency","Cutoff",8e3,100,2e4),MP(.707),lG],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling — nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times — a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],lE=new Map(JA.map(t=>[t.id,t]));function eS(t){return lE.get(t)}JA.map(t=>t.id);function jf(t){const e=lE.get(t);if(!e)return{};const n={};for(const r of e.params)n[r.key]=r.default;return n}function Vd(t,e){const n=lE.get(t);if(!n)return{};const r={};for(const i of n.params){const s=e==null?void 0:e[i.key];if(i.kind==="enum"){const o=i.options.some(l=>l.value===s);r[i.key]=o?s:i.default;continue}const a=typeof s=="number"?s:typeof s=="string"&&s.trim()!==""?Number(s):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}class A1 extends Error{constructor(e){super(e),this.name="AudioFxChainError"}}function cE(t){let e;try{e=JSON.parse(t)}catch(i){throw new A1(`Chain file is not valid JSON: ${i.message}`)}if(typeof e!="object"||e===null)throw new A1("Chain file must be a JSON object.");const n=e;if(n.version!==c0)throw new A1(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new A1("Chain file is missing a `nodes` array.");const r=n.nodes.map(F6e);return{version:c0,nodes:r}}function L6e(t){return t.nodes.filter(e=>e.enabled!==!1)}function mu(t){return JSON.stringify({version:c0,nodes:t.nodes.map($6e)})}function cy(t){const e=new Set(t.nodes.map(n=>n.id).filter(Boolean));for(let n=1;;n+=1){const r=`n${n}`;if(!e.has(r))return r}}function F6e(t,e){if(typeof t!="object"||t===null)throw new A1(`Node ${e} is not an object.`);const n=t;if(typeof n.type!="string"||!lE.has(n.type))throw new A1(`Node ${e} has unknown effect type: ${String(n.type)}`);return hse({type:n.type,id:ed(n.id),fromCarve:b6(n.fromCarve),fromPreset:ed(n.fromPreset),label:ed(n.label),fromEq:ed(n.fromEq),fromLeveller:b6(n.fromLeveller),presetAmount:fse(n.presetAmount),enabled:n.enabled!==!1,params:Vd(n.type,n.params??void 0)})}function $6e(t){return hse({type:t.type,id:ed(t.id),fromCarve:b6(t.fromCarve),fromPreset:ed(t.fromPreset),label:ed(t.label),fromEq:ed(t.fromEq),fromLeveller:b6(t.fromLeveller),presetAmount:t.presetAmount===1?void 0:fse(t.presetAmount),enabled:t.enabled===!1?!1:void 0,params:Vd(t.type,t.params)})}function ed(t){return typeof t=="string"&&t?t:void 0}function b6(t){return t===!0?!0:void 0}function fse(t){if(!(typeof t!="number"||!Number.isFinite(t)))return Math.min(1,Math.max(0,t))}function hse(t){for(const e of Object.keys(t))t[e]===void 0&&delete t[e];return t}const VI="data-hf-render-id",B6e="data-hf-group-render-id",fj=12,dse=10**(fj/20),hd=-100,vg=100,pse=-60;function hj(t){return Number.isFinite(t)?Math.max(0,Math.min(dse,t)):1}function mse(t){return hj(t).toFixed(6).replace(/\.?0+$/,"")}function HI(t){const e=Math.max(hd,Math.min(vg,t));return e===hd?0:10**((e<0?e/Math.abs(hd)*Math.abs(pse):e/vg*fj)/20)}function gse(t){const e=hj(t);if(e===0)return hd;const n=20*Math.log10(e),r=n<0?n/Math.abs(pse)*Math.abs(hd):n/fj*vg;return Math.max(hd,Math.min(vg,r))}function QI(t){const e=hj(t);if(e===0)return"-∞ dB";const n=20*Math.log10(e),r=Math.abs(n)<.05?0:n;return(r>0?"+":"")+r.toFixed(1)+" dB"}const io="data-automation",yse=io.slice(5),uE=1,xse=512;class yp extends Error{constructor(e){super(e),this.name="AudioAutomationError"}}const B2="volume";function uy(t){if(t===B2)return{kind:"volume"};const e=t.split(".");if(e.length===3&&e[0]==="fx"&&e[1]===bse){const i=e[2];return i?{kind:"preset",presetId:i}:null}if(e.length!==3||e[0]!=="fx")return null;const[,n,r]=e;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}function Od(t,e){return`fx.${t}.${e}`}const bse="preset";function NP(t){return`fx.${bse}.${t}`}const V6e={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},vse={min:0,max:dse,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function u0(t,e){const n=uy(t);if(!n)return null;if(n.kind==="volume")return vse;if(n.kind==="preset")return(e==null?void 0:e.nodes.some(o=>o.fromPreset===n.presetId))?{...V6e,label:`${n.presetId} · Amount`}:null;const r=e==null?void 0:e.nodes.find(a=>a.id===n.nodeId);if(!r)return null;const i=eS(r.type),s=i==null?void 0:i.params.find(a=>a.key===n.param);return!s||s.kind!=="number"?null:{min:s.min,max:s.max,step:s.step,unit:s.unit,label:`${(i==null?void 0:i.label)??r.type} · ${s.label}`,scale:s.scale==="log"&&s.min>0?"log":"linear",default:s.default}}function Qv(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)?e:null}return null}function H6e(t){const e=Qv(t);return e===null||e===0?0:Math.min(1,Math.max(-1,e))}function dj(t,e){const n=Qv(t),r=Qv(e);if(n===null||r===null)return null;const i=o=>Math.min(.999,Math.max(.001,o)),s=i(n),a=i(r);return Math.abs(s-a)<1e-6?null:{x:s,y:a}}function Q6e(t,e){const n=dj(t,e);return n?{viaX:n.x,viaY:n.y}:null}function z6e(t){const e=H6e(t==null?void 0:t.curve),n=dj(t==null?void 0:t.viaX,t==null?void 0:t.viaY);return{...e?{curve:e}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Z6e(t,e){const n=Qv(t==null?void 0:t.t),r=Qv(t==null?void 0:t.v);if(n===null||r===null)return null;const i=e?Math.min(e.max,Math.max(e.min,r)):r;return{t:Math.max(0,n),v:i,...z6e(t)}}function Ase(t,e){const n=t.map(i=>Z6e(i,e)).filter(i=>i!==null).sort((i,s)=>i.t-s.t),r=[];for(const i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,xse)}function G6e(t){const e=[];for(const n of t.lanes){if(!uy(n.target))continue;const r=n.target===B2?vse:null,i=Ase(n.points??[],r);i.length>0&&e.push({target:n.target,points:i})}return{version:uE,lanes:e}}function Sse(t,e){const n=[];for(const r of t.lanes){const i=u0(r.target,e);if(!i)continue;const s=Ase(r.points,i);s.length>0&&n.push({target:r.target,points:s})}return{version:uE,lanes:n}}function wse(t){let e;try{e=JSON.parse(t)}catch(i){throw new yp(`Automation is not valid JSON: ${i.message}`)}if(typeof e!="object"||e===null)throw new yp("Automation must be a JSON object.");const n=e;if(n.version!==uE)throw new yp(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new yp("Automation is missing a `lanes` array.");const r=n.lanes.map((i,s)=>{if(typeof i!="object"||i===null)throw new yp(`Lane ${s} is not an object.`);const a=i;if(typeof a.target!="string"||!uy(a.target))throw new yp(`Lane ${s} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new yp(`Lane ${s} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return G6e({lanes:r})}function Ose(t){return JSON.stringify({version:uE,lanes:t.lanes.map(e=>({target:e.target,points:e.points.map(n=>({t:n.t,v:n.v,...n.curve?{curve:n.curve}:{},...n.viaX!==void 0&&n.viaY!==void 0?{viaX:n.viaX,viaY:n.viaY}:{}}))}))})}function U6e(t,e){return e?Math.pow(t,Math.pow(2,2*e)):t}function X6e(t,e){const n=t-.5,r=e-.5,i=.999,s=1e6,a=n>0?n/(i-t):n<0?-n/(t-(1-i)):0,o=r>0?r/(i-e):r<0?-r/(e-(1-i)):0,l=Math.min(s,Math.max(1,a,o));return{cx:t+n/l,cy:e+r/l,w:l}}function W6e(t,e,n){const{cx:r,cy:i,w:s}=X6e(e,n),a=2-2*s,o=t*a-1+2*s*r,l=-t*a-2*s*r,c=q6e(o,l,t),u=1-c,f=u*u+2*s*c*u+c*c;return f>0?(2*s*i*c*u+c*c)/f:t}function q6e(t,e,n){if(Math.abs(t)<1e-12)return Math.abs(e)<1e-12?n:-n/e;const r=Math.sqrt(Math.max(0,e*e-4*t*n)),i=(-e+r)/(2*t),s=(-e-r)/(2*t),a=o=>o>=-1e-9&&o<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(s)?Math.min(1,Math.max(0,s)):n}function Y6e(t,e){const n=dj(e.viaX,e.viaY);return n?W6e(Math.min(1,Math.max(0,t)),n.x,n.y):U6e(t,e.curve)}function K6e(t,e,n,r){return r==="log"&&t>0&&e>0?Math.exp(Math.log(t)+(Math.log(e)-Math.log(t))*n):t+(e-t)*n}function Lf(t,e,n="linear"){const r=t.points;if(r.length===0)return 0;const i=r[0];if(e<=i.t)return i.v;const s=r[r.length-1];if(e>=s.t)return s.v;let a=0,o=r.length-1;for(;o-a>1;){const f=a+o>>1;r[f].t<=e?a=f:o=f}const l=r[a],c=r[o],u=c.t-l.t;return u<=0?c.v:K6e(l.v,c.v,Y6e((e-l.t)/u,l),n)}const ga="hf-audio-group",Zo="data-audio-group";function J6e(t){const e=t==null?void 0:t.getAttribute("data-volume"),n=e?parseFloat(e):1;return Number.isFinite(n)?n:1}function eCe(t,e,n){const r=n==null?void 0:n.getAttribute(Xs),i=n==null?void 0:n.getAttribute(io);return{id:t,label:(n==null?void 0:n.getAttribute("data-label"))||t,memberIds:e,...r?{fxChain:r}:{},...i?{automation:i}:{},volume:J6e(n),hidden:(n==null?void 0:n.hasAttribute("data-hidden"))??!1}}function tCe(t,e){var i,s;const n=Array.from(((i=t==null?void 0:t.querySelectorAll)==null?void 0:i.call(t,`${ga}[${VI}]`))??[]).find(a=>a.getAttribute(VI)===e);if(n)return n;const r=(t==null?void 0:t.getElementById(e))??null;return r&&((s=r.tagName)==null?void 0:s.toLowerCase())===ga?r:null}function Hd(t){const e=new Map;for(const i of t.querySelectorAll(`audio[${Zo}]`)){const s=i.getAttribute(B6e)??i.getAttribute(Zo);if(!s||!i.id)continue;const a=e.get(s);a?a.push(i.id):e.set(s,[i.id])}const n=new Map;for(const i of t.querySelectorAll(ga)){const s=i.getAttribute(VI)??i.id;s&&n.set(s,i)}const r=[];for(const[i,s]of e)r.push(eCe(i,s,n.get(i)));return r}function Cse(t,e){const n=new Map(Hd(t).map(a=>[a.id,a])),r=new Set,i=[],s=a=>{r.has(a)||(r.add(a),i.push(a))};for(const a of e){const o=n.get(a);o?o.memberIds.forEach(s):t.getElementById(a)&&!tCe(t,a)&&s(a)}return i}const Ff="data-hf-reveal-prior-z",f0="data-hf-reveal-prior-pos";function pj(t){const e=t.getAttribute(Ff);if(e==null)return null;const n=Number.parseInt(e,10);return Number.isFinite(n)?n:null}function fE(t){var a,o;const e=pj(t);if(e!=null)return e;const n=t,r=l=>{if(l==null||l===""||l==="auto")return null;const c=Number.parseInt(l,10);return Number.isFinite(c)?c:null},i=r((a=n.style)==null?void 0:a.zIndex);if(i!=null)return i;const s=(o=t.ownerDocument)==null?void 0:o.defaultView;if(s!=null&&s.getComputedStyle){const l=r(s.getComputedStyle(n).zIndex);if(l!=null)return l}return 0}function kse(t){if(!t)return 0;const e=Number.parseFloat(t.getAttribute("data-duration")??"")||Number.parseFloat(t.getAttribute("data-hf-authored-duration")??"");return lse(e)?e:0}function Ese(t){return Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1}function hE(t){return t.tagName.toLowerCase()===ga?!0:!!t.closest(["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-hf-color-grading-canvas]"].join(","))}function mj(t){if(!t)return 0;const e=t.querySelector("[data-composition-id]");let n=0;for(const r of Array.from(t.querySelectorAll("[data-start]"))){if(r===e||hE(r))continue;const i=Number.parseFloat(r.getAttribute("data-start")??""),s=kse(r);!Number.isFinite(i)||i<0||s<=0||(n=Math.max(n,i+s))}return n}function Tse(t){if(!t)return 0;const e=kse(t.querySelector("[data-composition-id]"));return e>0?e:mj(t)}function gj(t){return t?mj(new DOMParser().parseFromString(t,"text/html")):0}function zI(t){var n;const e=((n=t.ownerDocument.defaultView)==null?void 0:n.HTMLElement)??globalThis.HTMLElement;return typeof e<"u"&&t instanceof e}function Pse(t){const e=t.ownerDocument.defaultView??window,n=e.HTMLMediaElement??globalThis.HTMLMediaElement,r=e.HTMLImageElement??globalThis.HTMLImageElement;if(t instanceof n||t instanceof r)return t;const i=t.querySelector("video, audio, img");return i instanceof n||i instanceof r?i:null}function nCe(t,e){const n=e.getAttribute("data-playback-start"),r=e.getAttribute("data-media-start"),i=n??r;if(i!=null){const a=parseFloat(i);Number.isFinite(a)&&(t.playbackStart=a)}n!=null?t.playbackStartAttr="playback-start":r!=null&&(t.playbackStartAttr="media-start");const s=Number.parseFloat(e.getAttribute("data-playback-rate")??"");Number.isFinite(s)&&s>0&&(t.playbackRate=Ese(s))}function Mse(t,e){nCe(t,e);const n=Pse(e);if(!n)return;t.tag=n.tagName.toLowerCase();const r=n.getAttribute("src");r&&(t.src=r);const s=(n.ownerDocument.defaultView??window).HTMLMediaElement??globalThis.HTMLMediaElement;if(typeof s>"u"||!(n instanceof s))return;const a=e.getAttribute("data-source-duration")??n.getAttribute("data-source-duration"),o=a?parseFloat(a):n.duration;Number.isFinite(o)&&o>0&&(t.sourceDuration=o);const l=n.defaultPlaybackRate;t.playbackRate==null&&Number.isFinite(l)&&l>0&&(t.playbackRate=Ese(l))}function tS(t){var i,s,a;const e=(i=t.label)==null?void 0:i.trim();if(e)return e;const n=(s=t.id)==null?void 0:s.trim();if(n)return n;const r=(a=t.tag)==null?void 0:a.trim().toLowerCase();return r?`${r} clip`:"Timeline clip"}const rCe=new Set(["base","link","meta","noscript","script","style","template"]);function cG(t){return t.trim().replace(/[_-]+/g," ").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function iCe(t){const e=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label");if(e!=null&&e.trim())return e.trim();if(t.id.trim())return cG(t.id);const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];return r?cG(r):tS({tag:t.tagName})}function h0(t){if(zI(t)&&t.id)return`#${CSS.escape(t.id)}`;const e=t.getAttribute("data-composition-id");if(e)return`[data-composition-id="${CSS.escape(e)}"]`;if(zI(t)){const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];if(r)return`.${CSS.escape(r)}`}}function d0(t){var n;const e=(n=t.parentElement)==null?void 0:n.closest("[data-composition-id]");return(e==null?void 0:e.getAttribute("data-composition-file"))??(e==null?void 0:e.getAttribute("data-composition-src"))??void 0}function zv(t,e,n){return cse(t,e,n,d0(e),d0)}function Zv(t){const e=t.sourceFile??"index.html";return t.domId?`${e}#${t.domId}`:t.selector?`${e}:${t.selector}:${t.selectorIndex??0}`:`${e}:${t.id}:${t.fallbackIndex}`}function v6(t){const e=t.lastIndexOf("#");return e<0?{sourceFile:null,domId:t}:{sourceFile:t.slice(0,e),domId:t.slice(e+1)}}function Gv(t){var r;const e=((r=t.preferredId)==null?void 0:r.trim())||Zv({id:t.label,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile}),n=Zv({id:e,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile});return{id:e,key:n}}function zn(t){return t.key??t.id}function A6(t){return t.domId||null}function G1(t){if(!(!t.domId&&!t.selector))return Zv({id:"",fallbackIndex:0,...t})}function sCe(t){const e=t.querySelector("[data-composition-id]");return Array.from(t.querySelectorAll("[data-start]")).filter(n=>n!==e&&!hE(n))}function aCe(t,e){return Math.abs(t-e)<.001}const oCe=[["data-start",t=>t.start],["data-duration",t=>t.duration],["data-track-index",t=>t.track]];function lCe(t,e){var r;const n=(r=e.tagName)==null?void 0:r.toLowerCase();return n&&t.tagName.toLowerCase()!==n?!1:oCe.every(([i,s])=>{const a=Number.parseFloat(t.getAttribute(i)??"");return!Number.isFinite(a)||aCe(a,s(e))})}function cCe(t,e){return t.getElementById(e)??t.querySelector(`[data-composition-id="${CSS.escape(e)}"]`)??t.querySelector(`.${CSS.escape(e)}`)??null}function uCe(t,e,n,r=new Set){const i=e.id?cCe(t,e.id):null;if(i&&!r.has(i))return i;const s=sCe(t).filter(o=>!r.has(o)),a=s.find(o=>lCe(o,e));return a||(s[n]??null)}function fCe(t,e){if(!zI(e)||hE(e)||e.parentElement!==t)return!1;const n=e.tagName.toLowerCase();return rCe.has(n)||e.hasAttribute("data-start")||e.hasAttribute("data-track-index")?!1:!!h0(e)}function hCe(t,e,n){return n?e&&t.has(e)?new Set(t):new Set:e?new Set([e]):new Set}function dCe(t,e){return!t||e===null?!1:t.elementKey===v6(e).domId}const Nse="hf-studio-ui-preferences";function uG(t){return typeof t=="object"&&t!==null}function Dse(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function Ise(t){if(!t)return{};try{const e=t.getItem(Nse);if(!e)return{};const n=JSON.parse(e);if(!uG(n))return{};const r={};if(typeof n.leftCollapsed=="boolean"&&(r.leftCollapsed=n.leftCollapsed),typeof n.leftWidth=="number"&&Number.isFinite(n.leftWidth)&&(r.leftWidth=n.leftWidth),typeof n.rightWidth=="number"&&Number.isFinite(n.rightWidth)&&(r.rightWidth=n.rightWidth),typeof n.timelineVisible=="boolean"&&(r.timelineVisible=n.timelineVisible),typeof n.timelineHeight=="number"&&Number.isFinite(n.timelineHeight)&&(r.timelineHeight=n.timelineHeight),typeof n.playbackRate=="number"&&Number.isFinite(n.playbackRate)&&(r.playbackRate=n.playbackRate),typeof n.audioMuted=="boolean"&&(r.audioMuted=n.audioMuted),typeof n.audioVolume=="number"&&Number.isFinite(n.audioVolume)&&n.audioVolume>=0&&n.audioVolume<=1&&(r.audioVolume=n.audioVolume),n.thumbnailMode==="adaptive"||n.thumbnailMode==="hidden"?r.thumbnailMode=n.thumbnailMode:typeof n.thumbnailsEnabled=="boolean"&&(r.thumbnailMode=n.thumbnailsEnabled?"adaptive":"hidden"),uG(n.previewZoom)){const{zoomPercent:i,panX:s,panY:a}=n.previewZoom;typeof i=="number"&&Number.isFinite(i)&&typeof s=="number"&&Number.isFinite(s)&&typeof a=="number"&&Number.isFinite(a)&&(r.previewZoom={zoomPercent:i,panX:s,panY:a})}return Array.isArray(n.recentBlocks)&&(r.recentBlocks=n.recentBlocks.filter(i=>typeof i=="string")),typeof n.snapEnabled=="boolean"&&(r.snapEnabled=n.snapEnabled),typeof n.gridVisible=="boolean"&&(r.gridVisible=n.gridVisible),typeof n.gridSpacing=="number"&&Number.isFinite(n.gridSpacing)&&(r.gridSpacing=n.gridSpacing),typeof n.snapToGrid=="boolean"&&(r.snapToGrid=n.snapToGrid),typeof n.timelineSnapEnabled=="boolean"&&(r.timelineSnapEnabled=n.timelineSnapEnabled),(n.timeDisplayMode==="time"||n.timeDisplayMode==="frame")&&(r.timeDisplayMode=n.timeDisplayMode),(n.timelineZoomMode==="fit"||n.timelineZoomMode==="manual")&&(r.timelineZoomMode=n.timelineZoomMode),typeof n.timelineManualZoomPercent=="number"&&Number.isFinite(n.timelineManualZoomPercent)&&(r.timelineManualZoomPercent=n.timelineManualZoomPercent),typeof n.agentToolsEnabled=="boolean"&&(r.agentToolsEnabled=n.agentToolsEnabled),r}catch{return{}}}function to(t=Dse()){return Ise(t)}function Ol(t,e=Dse()){if(e)try{const n={...Ise(e),...t};e.setItem(Nse,JSON.stringify(n))}catch{}}const _se=10,pCe=48,mCe=.5,gCe=2,yCe=.014;function yj(t){if(!Number.isFinite(t)||t<=0)return 100;const e=Bd*pCe;return Math.max(100,Math.round(e/t*100))}function L0(t,e){if(!Number.isFinite(t))return 100;const n=yj(e);return Math.max(_se,Math.min(n,Math.round(t)))}function dE(t,e,n){return t==="fit"?100:L0(e,n)}function xCe(t,e){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?100:L0(t/e*100,e)}function bCe(t,e,n){if(!Number.isFinite(t)||t<=0)return 100;const r=dE(e,n,t);return e==="fit"?t:t*(r/100)}function fG(t,e,n,r){const i=dE(e,n,r),s=t==="in"?i*gCe:i*mCe;return L0(s,r)}function vCe(t,e,n,r){const i=dE(e,n,r);return!Number.isFinite(t)||t===0?i:L0(i*Math.exp(-t*yCe),r)}const S6=Math.log(_se);function ACe(t,e){const n=L0(t,e),r=Math.log(yj(e));return(Math.log(n)-S6)/(r-S6)*100}function SCe(t,e){const n=Math.max(0,Math.min(100,t)),r=Math.log(yj(e)),i=S6+n/100*(r-S6);return L0(Math.exp(i),e)}function ZI(t,e){return t.projectId===e.timelineProjectId&&t.sessionEpoch===e.timelineSessionEpoch}function Rse(t,e){return t.projectId===e.timelineProjectId&&t.sessionEpoch===e.timelineSessionEpoch&&t.elementId===e.selectedElementId}function wCe(t,e){return{selectedKeyframes:new Set,toggleSelectedKeyframe:n=>t(r=>{const i=new Set(r.selectedKeyframes);return i.has(n)?i.delete(n):i.add(n),{selectedKeyframes:i}}),clearSelectedKeyframes:()=>t({selectedKeyframes:new Set}),expandedClipIds:new Set,toggleClipExpanded:n=>t(r=>{const i=new Set(r.expandedClipIds);return i.has(n)?i.delete(n):i.add(n),{expandedClipIds:i}}),setClipExpanded:(n,r)=>t(i=>{if(i.expandedClipIds.has(n)===r)return i;const s=new Set(i.expandedClipIds);return r?s.add(n):s.delete(n),{expandedClipIds:s}}),expandClips:n=>t(r=>{if(n.every(s=>r.expandedClipIds.has(s)))return r;const i=new Set(r.expandedClipIds);for(const s of n)i.add(s);return{expandedClipIds:i}}),collapsedGroupIds:new Set,toggleGroupExpanded:n=>t(r=>{const i=new Set(r.collapsedGroupIds);return i.has(n)?i.delete(n):i.add(n),{collapsedGroupIds:i}}),expandedLaneOwnerIds:new Set,toggleLaneOwnerExpanded:n=>t(r=>{const i=new Set(r.expandedLaneOwnerIds);return i.has(n)?i.delete(n):i.add(n),{expandedLaneOwnerIds:i}}),focusedEaseSegment:null,focusedEaseRequestNonce:0,setFocusedEaseSegment:n=>t(r=>{const i=r.focusedEaseRequestNonce+1,{timelineProjectId:s,timelineSessionEpoch:a}=e();return{focusedEaseRequestNonce:i,focusedEaseSegment:{...n,projectId:s,sessionEpoch:a,nonce:i}}}),clearFocusedEaseSegment:n=>t(r=>{var i;return((i=r.focusedEaseSegment)==null?void 0:i.nonce)===n?{focusedEaseSegment:null}:r}),revealedAudioFxTarget:null,revealedAudioFxNonce:0,setRevealedAudioFxTarget:n=>t(r=>{const i=r.revealedAudioFxNonce+1,{timelineProjectId:s,timelineSessionEpoch:a}=e();return{revealedAudioFxNonce:i,revealedAudioFxTarget:{...n,projectId:s,sessionEpoch:a,nonce:i}}}),clearRevealedAudioFxTarget:n=>t(r=>{var i;return((i=r.revealedAudioFxTarget)==null?void 0:i.nonce)===n?{revealedAudioFxTarget:null}:r}),keyframeCache:new Map,setKeyframeCache:(n,r)=>t(i=>{if(r?i.keyframeCache.get(n)===r:!i.keyframeCache.has(n))return i;const s=new Map(i.keyframeCache);return r?s.set(n,r):s.delete(n),{keyframeCache:s}}),gsapAnimations:new Map,setGsapAnimations:(n,r)=>t(i=>{if(r?i.gsapAnimations.get(n)===r:!i.gsapAnimations.has(n))return i;const s=new Map(i.gsapAnimations);return r?s.set(n,r):s.delete(n),{gsapAnimations:s}})}}function OCe(t){return{automationSelection:null,setAutomationSelection:e=>t({automationSelection:{...e,t0:Math.min(e.t0,e.t1),t1:Math.max(e.t0,e.t1),v0:Math.min(e.v0,e.v1),v1:Math.max(e.v0,e.v1)}}),clearAutomationSelection:()=>t({automationSelection:null})}}function CCe(t){return{motionPathArmed:!1,setMotionPathArmed:e=>t({motionPathArmed:e}),motionPathCreateAvailable:!1,setMotionPathCreateAvailable:e=>t({motionPathCreateAvailable:e}),autoKeyframeEnabled:!0,setAutoKeyframeEnabled:e=>t({autoKeyframeEnabled:e})}}function kCe(t,e,n,r){return{id:t,projectId:e,sessionEpoch:n,nonce:r}}const jse="follow-preference";function ECe(t,e=jse){return t??(e==="legacy-default"?"hidden":"adaptive")}function TCe(t,e=jse){return e==="force-hidden"?"hidden":t}function PCe(t){return{thumbnailMode:ECe(to().thumbnailMode),setThumbnailMode:e=>{Ol({thumbnailMode:e}),t({thumbnailMode:e})}}}const DP=new Set,ya={notify:t=>DP.forEach(e=>e(t)),subscribe:t=>(DP.add(t),()=>DP.delete(t))};function IP(t,e){const n=new Set(t);return n.size===0?{selectedElementIds:n,selectedElementId:null}:e&&n.has(e)?{selectedElementIds:n,selectedElementId:e}:{selectedElementIds:n,selectedElementId:n.values().next().value??null}}function GI(){return{isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,beatDragging:!1,elements:[],selectedElementId:null,zEditVersion:0,inPoint:null,outPoint:null,activeTool:"select",activeKeyframePct:null,motionPathArmed:!1,motionPathCreateAvailable:!1,selectedKeyframes:new Set,automationSelection:null,expandedClipIds:new Set,collapsedGroupIds:new Set,expandedLaneOwnerIds:new Set,focusedEaseSegment:null,revealedAudioFxTarget:null,selectedElementIds:new Set,requestedSeekTime:null,lintFindingsByElement:new Map,timelineFocus:null,keyframeCache:new Map,gsapAnimations:new Map,beatAnalysis:null,beatEdits:null,beatUndo:[],beatRedo:[],beatPersist:null,clipManifest:null,clipParentMap:new Map,domClipChildren:[]}}const fe=rE((t,e)=>({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,timelineSessionEpoch:0,timelineProjectId:null,beatDragging:!1,elements:[],selectedElementId:null,playbackRate:to().playbackRate??1,audioMuted:to().audioMuted??!1,audioVolume:to().audioVolume??1,loopEnabled:!1,zoomMode:"fit",manualZoomPercent:100,zEditVersion:0,timelinePps:100,timelineFitPps:100,inPoint:null,outPoint:null,activeTool:"select",setActiveTool:n=>t({activeTool:n}),...wCe(t,()=>({timelineProjectId:e().timelineProjectId,timelineSessionEpoch:e().timelineSessionEpoch})),...PCe(t),...OCe(t),...CCe(t),activeKeyframePct:null,setActiveKeyframePct:n=>t({activeKeyframePct:n}),selectedElementIds:new Set,setSelection:(n,r)=>t(IP(n,r)),addSelectedElementId:n=>t(r=>{const i=new Set(r.selectedElementIds);return i.add(n),IP(i,r.selectedElementId)}),toggleSelectedElementId:n=>t(r=>{const i=new Set(r.selectedElementIds);return i.has(n)?i.delete(n):i.add(n),IP(i,r.selectedElementId)}),clearSelection:()=>t({selectedElementId:null,selectedElementIds:new Set}),requestedSeekTime:null,requestSeek:n=>t({requestedSeekTime:n}),clearSeekRequest:()=>t({requestedSeekTime:null}),playbackRequest:null,requestPlayback:(n,r=null)=>t(i=>{var s;return{playbackRequest:{playing:n,returnTo:r,nonce:(((s=i.playbackRequest)==null?void 0:s.nonce)??0)+1}}}),clearPlaybackRequest:()=>t({playbackRequest:null}),clipRevealRequest:null,requestClipReveal:n=>t(r=>{var i;return{clipRevealRequest:{elementId:n,nonce:(((i=r.clipRevealRequest)==null?void 0:i.nonce)??0)+1}}}),clearClipRevealRequest:()=>t({clipRevealRequest:null}),timelineFocus:null,timelineFocusNonce:0,requestTimelineFocus:n=>t(r=>{const i=r.timelineFocusNonce+1;return{timelineFocusNonce:i,timelineFocus:kCe(n,r.timelineProjectId,r.timelineSessionEpoch,i)}}),clearTimelineFocus:n=>t(r=>{var i;return((i=r.timelineFocus)==null?void 0:i.nonce)===n?{timelineFocus:null}:r}),lintFindingsByElement:new Map,setLintFindingsByElement:n=>t({lintFindingsByElement:n}),beatAnalysis:null,setBeatAnalysis:n=>t({beatAnalysis:n}),beatEdits:null,setBeatEdits:n=>t({beatEdits:n}),beatUndo:[],beatRedo:[],beatPersist:null,setBeatPersist:n=>t({beatPersist:n}),commitBeatEdits:(n,r)=>{var i,s;t(a=>({beatEdits:n,beatUndo:[...a.beatUndo,{restore:a.beatEdits,at:Date.now(),label:r}],beatRedo:[]})),(s=(i=e()).beatPersist)==null||s.call(i)},undoBeatEdits:()=>{var i,s;const n=e(),r=n.beatUndo[n.beatUndo.length-1];return r?(t({beatEdits:r.restore,beatUndo:n.beatUndo.slice(0,-1),beatRedo:[...n.beatRedo,{restore:n.beatEdits,at:r.at,label:r.label}]}),(s=(i=e()).beatPersist)==null||s.call(i),r.label):null},resetBeatHistory:()=>t({beatUndo:[],beatRedo:[]}),redoBeatEdits:()=>{var i,s;const n=e(),r=n.beatRedo[n.beatRedo.length-1];return r?(t({beatEdits:r.restore,beatRedo:n.beatRedo.slice(0,-1),beatUndo:[...n.beatUndo,{restore:n.beatEdits,at:r.at,label:r.label}]}),(s=(i=e()).beatPersist)==null||s.call(i),r.label):null},clipManifest:null,setClipManifest:n=>t({clipManifest:n}),clipParentMap:new Map,setClipParentMap:n=>t({clipParentMap:n}),domClipChildren:[],setDomClipChildren:n=>t({domClipChildren:n}),setIsPlaying:n=>{e().isPlaying!==n&&t({isPlaying:n})},setPlaybackRate:n=>{Ol({playbackRate:n}),t({playbackRate:n})},setAudioMuted:n=>{Ol({audioMuted:n}),t({audioMuted:n})},setAudioVolume:n=>{const r=Number.isFinite(n)?Math.max(0,Math.min(1,n)):1;Ol({audioVolume:r}),t({audioVolume:r})},setLoopEnabled:n=>t({loopEnabled:n}),setZoomMode:n=>t({zoomMode:n}),clearSelectedElementIds:()=>t({selectedElementIds:new Set}),setSelectedElementIds:n=>t({selectedElementIds:new Set(n)}),timelineSnapEnabled:to().timelineSnapEnabled??!0,setTimelineSnapEnabled:n=>{Ol({timelineSnapEnabled:n}),t({timelineSnapEnabled:n})},timeDisplayMode:to().timeDisplayMode??"time",setTimeDisplayMode:n=>{Ol({timeDisplayMode:n}),t({timeDisplayMode:n})},pinTimelineZoom:(n,r)=>t(i=>{if(i.zoomMode==="manual")return{};const s=xCe(n,r);return Ol({timelineZoomMode:"manual",timelineManualZoomPercent:s}),{zoomMode:"manual",manualZoomPercent:s}}),setTimelineScale:(n,r)=>{const i=e();i.timelinePps===n&&i.timelineFitPps===r||t({timelinePps:n,timelineFitPps:r})},setInPoint:n=>t(r=>{const i=n!==null&&Number.isFinite(n)?n:null;return{inPoint:i,outPoint:i!==null&&r.outPoint!==null&&i>=r.outPoint?null:r.outPoint,loopEnabled:i!==null?!0:r.loopEnabled}}),setOutPoint:n=>t(r=>{const i=n!==null&&Number.isFinite(n)?n:null;return{outPoint:i,inPoint:i!==null&&r.inPoint!==null&&i<=r.inPoint?null:r.inPoint,loopEnabled:i!==null?!0:r.loopEnabled}}),setManualZoomPercent:n=>t(r=>({manualZoomPercent:L0(n,r.timelineFitPps)})),bumpZEditVersion:()=>t(n=>({zEditVersion:n.zEditVersion+1})),setCurrentTime:n=>t({currentTime:Number.isFinite(n)?n:0}),setDuration:n=>t({duration:Number.isFinite(n)?n:0}),setTimelineReady:n=>t({timelineReady:n}),setBeatDragging:n=>t({beatDragging:n}),setElements:n=>t({elements:n}),setSelectedElementId:(n,r)=>t(i=>{const s=hCe(i.selectedElementIds,n,r==null?void 0:r.preserveSet),a=dCe(i.revealedAudioFxTarget,n);return n!==i.selectedElementId?{selectedElementId:n,selectedElementIds:s,activeKeyframePct:null,motionPathArmed:!1,focusedEaseSegment:null,...a?{}:{revealedAudioFxTarget:null}}:{selectedElementId:n,selectedElementIds:s}}),setSelectionAnchor:n=>t(r=>n!=null&&r.selectedElementIds.size>1&&r.selectedElementIds.has(n)?{selectedElementId:n,focusedEaseSegment:n===r.selectedElementId?r.focusedEaseSegment:null}:{selectedElementId:n,selectedElementIds:n?new Set([n]):new Set,focusedEaseSegment:n===r.selectedElementId?r.focusedEaseSegment:null}),updateElement:(n,r)=>t(i=>({elements:i.elements.map(s=>(s.key??s.id)===n?{...s,...r}:s)})),beginTimelineSession:n=>t(r=>r.timelineProjectId===n?r:{...GI(),timelineSessionEpoch:r.timelineSessionEpoch+1,timelineProjectId:n}),reset:()=>t(GI())}));I6e(fe);const Lse="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",Fse="https://us.i.posthog.com",MCe=3e4,NCe=5e3;let Uv=[],V2=null;function DCe(){return V7()}function ICe(){return YA()}function _Ce(){var t,e;return{studio_version:"0.8.18",agent_runtime:Gre(),screen_width:(t=window.screen)==null?void 0:t.width,screen_height:(e=window.screen)==null?void 0:e.height,viewport_width:window.innerWidth,viewport_height:window.innerHeight,user_agent:navigator.userAgent,url_hash:location.hash.replace(/#project\//,"").split("?")[0]}}function Pt(t,e={}){ICe()&&(Uv.push({event:`studio:${t}`,properties:{..._Ce(),...Xre(),...e},timestamp:new Date().toISOString()}),V2||(V2=setInterval(RCe,MCe)))}function $se(){const t=Uv.map(e=>({event:e.event,properties:{...e.properties,$ip:null},distinct_id:DCe(),timestamp:e.timestamp}));return Uv=[],t}async function RCe(){if(Uv.length===0)return;const t=$se(),e=new AbortController,n=setTimeout(()=>e.abort(),NCe);try{await fetch(`${Fse}/batch/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:Lse,batch:t}),signal:e.signal})}catch{}finally{clearTimeout(n)}}function Bse(){if(V2&&(clearInterval(V2),V2=null),Uv.length===0)return;const t=$se(),e=JSON.stringify({api_key:Lse,batch:t});try{navigator.sendBeacon(`${Fse}/batch/`,e)}catch{}}typeof window<"u"&&window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Bse()});function F0(t){const e=x.useRef(null),n=x.useCallback(r=>{var i;if(r instanceof KeyboardEvent){r.key==="Escape"&&t();return}(i=e.current)!=null&&i.contains(r.target)||t()},[t]);return x.useEffect(()=>(document.addEventListener("pointerdown",n,!0),document.addEventListener("mousedown",n,!0),document.addEventListener("keydown",n),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("mousedown",n,!0),document.removeEventListener("keydown",n)}),[n]),e}const jCe=[{title:"Playback",hints:[{key:"Space",label:"Play / Pause"},{key:"J",label:"Play backward"},{key:"K",label:"Stop"},{key:"L",label:"Play forward"},{key:"M",label:"Toggle mute"},{key:"⇧L",label:"Toggle loop"},{key:"←/→",label:"Step 1 frame"},{key:"⇧←/⇧→",label:"Step 10 frames"},{key:"F",label:"Toggle fullscreen"}]},{title:"Keyframes (when an element is selected)",hints:[{key:"K",label:"Add keyframe at playhead"},{key:"Del",label:"Delete selected keyframe"},{key:"H",label:"Toggle hold / bezier"},{key:"U",label:"Expand / collapse properties"},{key:"R",label:"Record gesture"}]},{title:"Editing",hints:[{key:"⌘Z",label:"Undo"},{key:"⌘⇧Z",label:"Redo"},{key:"⌘C",label:"Copy element"},{key:"⌘V",label:"Paste element"},{key:"⌘X",label:"Cut element"},{key:"S",label:"Split clip at playhead"},{key:"⇧Click",label:"Razor tool: split all tracks"},{key:"⌘G",label:"Group elements"},{key:"⌘⇧G",label:"Ungroup"},{key:"Del",label:"Delete selected element (no keyframe selected)"}]},{title:"Gesture recording modifiers",hints:[{key:"Drag",label:"Record x / y position"},{key:"Scroll",label:"Record z depth"},{key:"⇧ Drag",label:"Record rotationX / rotationY"},{key:"⌥ Drag",label:"Record rotation"},{key:"⌘ Drag↕",label:"Record opacity"},{key:"⌘ Scroll",label:"Record scale"}]},{title:"Canvas",hints:[{key:"Drag",label:"Move element / add keyframe"},{key:"⌥ Drag",label:"Move entire animation path"},{key:"⇧ Drag",label:"Uniform resize"}]},{title:"Crop",hints:[{key:"Drag edge",label:"Crop a side"},{key:"Drag center",label:"Reposition the crop"}]},{title:"Panels",hints:[{key:"⌘1",label:"Compositions tab"},{key:"⌘2",label:"Assets tab"}]},{title:"Work area",hints:[{key:"I",label:"Set in-point"},{key:"⇧I",label:"Clear in-point"},{key:"O",label:"Set out-point"},{key:"⇧O",label:"Clear out-point"},{key:"A",label:"Jump to in-point"},{key:"E",label:"Jump to out-point"}]}],LCe=x.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,setInPoint:s,setOutPoint:a,onSeek:o}){const[l,c]=x.useState(!1),[u,f]=x.useState(""),h=x.useId(),m=x.useCallback(()=>c(!1),[]),y=F0(m),d=x.useRef(null),v=x.useRef(null);x.useEffect(()=>{var E;if(!l)return;const k=v.current;return(E=d.current)==null||E.focus(),()=>{k==null||k.focus()}},[l]);const b=x.useCallback(()=>{if(e)return;const k=Number.parseInt(u,10);!Number.isFinite(k)||n<=0||o(Math.min(n,uj(Math.max(0,k))))},[e,n,u,o]),w=x.useCallback(k=>{k.preventDefault(),b()},[b]),O=x.useCallback(k=>{k.key==="Enter"&&(k.preventDefault(),b())},[b]);return p.jsxs("div",{ref:y,className:"relative flex-shrink-0",children:[p.jsx(br,{label:"Shortcuts and tools",children:p.jsx("button",{ref:v,type:"button",onClick:()=>c(k=>!k),className:`flex h-7 w-7 items-center justify-center rounded-md transition-colors ${l?"text-neutral-200":"text-neutral-600 hover:text-neutral-300"}`,"aria-label":"Shortcuts and tools","aria-expanded":l,"aria-controls":h,children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),p.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"})]})})}),l&&p.jsxs("div",{id:h,ref:d,tabIndex:-1,role:"dialog","aria-label":"Keyboard shortcuts and tools",className:"absolute bottom-full right-0 mb-2 z-50 rounded-lg shadow-xl min-w-[220px] overflow-y-auto outline-none",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)",maxHeight:"min(280px, calc(100vh - 80px))"},children:[p.jsxs("div",{className:"px-3 pt-3 pb-2.5",children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Jump to frame"}),p.jsxs("form",{onSubmit:w,className:"flex items-center gap-1.5",children:[p.jsx("input",{value:u,onChange:k=>f(k.target.value),disabled:e,inputMode:"numeric",pattern:"[0-9]*","aria-label":"Jump to frame",placeholder:"frame number",className:"h-6 flex-1 rounded border border-neutral-700 bg-neutral-900 px-2 text-[10px] font-mono tabular-nums text-neutral-200 outline-none transition-colors placeholder:text-neutral-600 focus:border-studio-accent/60",onKeyDown:O,onBlur:b}),p.jsx(br,{label:"Jump to frame",children:p.jsx("button",{type:"submit",disabled:e,className:"h-6 px-2 rounded border border-neutral-700 text-[10px] text-neutral-300 transition-colors hover:border-neutral-500 hover:bg-neutral-800 disabled:opacity-40",children:"Go"})})]})]}),p.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),p.jsxs("div",{className:"px-3 pt-2.5 pb-2",children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Work area"}),p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"I"}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:"In-point"})]}),p.jsx("div",{className:"flex items-center gap-1.5",children:r!==null?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:as(r)}),p.jsx(br,{label:"Clear in-point",children:p.jsx("button",{type:"button",onClick:()=>s(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear in-point",children:p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):p.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"O"}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:"Out-point"})]}),p.jsx("div",{className:"flex items-center gap-1.5",children:i!==null?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:as(i)}),p.jsx(br,{label:"Clear out-point",children:p.jsx("button",{type:"button",onClick:()=>a(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear out-point",children:p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):p.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]})]})]}),p.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),p.jsx("div",{className:"px-3 pt-2.5 pb-3 flex flex-col gap-3",children:jCe.map(k=>p.jsxs("div",{children:[p.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:k.title}),p.jsx("div",{className:"flex flex-col gap-1",children:k.hints.map(E=>p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[36px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:E.key}),p.jsx("span",{className:"text-[10px] text-neutral-400",children:E.label})]},E.key))})]},k.title))})]})]})}),FCe=[.25,.5,1,1.5,2],$Ce=x.memo(function({playbackRate:e,setPlaybackRate:n,disabled:r}){const[i,s]=x.useState(!1),a=x.useCallback(()=>s(!1),[]),o=F0(a);return p.jsxs("div",{ref:o,className:"relative flex-shrink-0",children:[p.jsx(br,{label:"Playback speed",children:p.jsx("button",{type:"button",onClick:()=>s(l=>!l),disabled:r,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Playback speed",className:"h-7 w-8 rounded-md font-mono text-[10px] tabular-nums text-neutral-500 transition-colors hover:text-neutral-200 disabled:opacity-30",children:e===1?"1x":`${e}x`})}),i&&p.jsx("div",{role:"menu","aria-label":"Playback speed options",className:"absolute bottom-full right-0 mb-1.5 rounded-lg shadow-xl z-50 min-w-[56px] overflow-hidden",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)"},children:FCe.map(l=>{const c=l===e;return p.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":c,onClick:()=>{Pt("playback",{action:"speed_change",rate:l}),n(l),s(!1)},className:`block w-full px-3 py-1.5 text-[11px] text-left font-mono tabular-nums transition-colors outline-none focus-visible:bg-white/[0.04] ${c?"text-neutral-50 bg-white/[0.06]":"text-neutral-500 hover:bg-white/[0.04]"}`,children:[l,"x"]},l)})})]})});function BCe({muted:t,volume:e}){const n=t||e===0;return p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M11 5 6 9H3v6h3l5 4V5Z"}),n?p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"m19 9-6 6"}),p.jsx("path",{d:"m13 9 6 6"})]}):p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),e>=.5?p.jsx("path",{d:"M18.5 5.5a9 9 0 0 1 0 13"}):null]})]})}const VCe=x.memo(function({audioMuted:e,audioVolume:n,disabled:r,setAudioMuted:i,setAudioVolume:s}){const a=Math.round(n*100),o=e||n===0,l=o?"Unmute audio":"Mute audio";return p.jsxs("div",{className:"group flex flex-shrink-0 items-center",children:[p.jsx("div",{className:"w-0 overflow-hidden opacity-0 transition-[width,opacity] duration-150 ease-out group-hover:w-14 group-hover:opacity-100 group-focus-within:w-14 group-focus-within:opacity-100",children:p.jsxs("div",{className:"relative mx-1 flex h-6 w-12 items-center",children:[p.jsx("div",{className:"absolute inset-x-0 h-0.5 overflow-hidden rounded-full bg-neutral-700",children:p.jsx("div",{className:"h-full rounded-full bg-neutral-300",style:{width:`${a}%`}})}),p.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:a,disabled:r,"aria-label":"Preview volume","aria-valuetext":`${a}%`,title:`Preview volume: ${a}%`,onChange:c=>{const u=Number(c.currentTarget.value)/100;s(u),e&&u>0&&i(!1)},className:"hf-preview-volume-range absolute inset-0 w-full disabled:pointer-events-none"})]})}),p.jsx(br,{label:l,children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"mute_toggle",muted:!o}),o&&n===0&&s(1),i(!o)},disabled:r,"aria-label":l,"aria-pressed":o,className:`flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-30 ${o?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,children:p.jsx(BCe,{muted:e,volume:n})})})]})});Bv.registerPlugin(v1);const hG="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",dG="M56 28H67V71H56Z M73 28H84V71H73Z";function HCe({playing:t}){const e=x.useRef(null),n=x.useRef(!0);return x.useEffect(()=>{var o;const r=e.current;if(!r)return;const i=t?dG:hG,s=typeof window<"u"&&((o=window.matchMedia)==null?void 0:o.call(window,"(prefers-reduced-motion: reduce)").matches);if(n.current||s){n.current=!1,Bv.set(r,{morphSVG:i});return}const a=Bv.to(r,{duration:.28,ease:"power2.inOut",morphSVG:i});return()=>{a.kill()}},[t]),p.jsx("span",{className:"relative inline-flex h-3 w-3 items-center justify-center","aria-hidden":"true",children:p.jsx("svg",{width:"12",height:"12",viewBox:"46 21 54 56",fill:"#FAFAFA",children:p.jsx("path",{ref:e,d:t?dG:hG})})})}const QCe=x.memo(function({loopEnabled:e,disabled:n,setLoopEnabled:r}){return p.jsx(br,{label:"Loop playback",children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"loop_toggle",enabled:!e}),r(!e)},disabled:n,className:`flex h-7 w-7 items-center justify-center rounded-md transition-colors disabled:opacity-30 ${e?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,"aria-label":e?"Disable loop playback":"Enable loop playback","aria-pressed":e,children:p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M17 2l4 4-4 4"}),p.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),p.jsx("path",{d:"M7 22l-4-4 4-4"}),p.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})})})}),zCe=x.memo(function({isFullscreen:e,onToggleFullscreen:n}){return p.jsx(br,{label:e?"Exit fullscreen (F)":"Enter fullscreen (F)",children:p.jsx("button",{type:"button",onClick:()=>{Pt("playback",{action:"fullscreen_toggle",active:!e}),n()},className:`flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md transition-colors ${e?"text-studio-accent":"text-neutral-500 hover:text-neutral-200"}`,"aria-label":e?"Exit fullscreen":"Enter fullscreen",children:p.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e?p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),p.jsx("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),p.jsx("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),p.jsx("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]}):p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),p.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),p.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),p.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})})})}),ZCe=x.memo(function({onTogglePlay:e,onSeek:n,disabled:r=!1,isFullscreen:i=!1,onToggleFullscreen:s}){const a=fe(B=>B.isPlaying),o=fe(B=>B.duration),l=fe(B=>B.timelineReady),c=fe(B=>B.playbackRate),u=fe(B=>B.audioMuted),f=fe(B=>B.audioVolume),h=fe(B=>B.loopEnabled),m=fe.getState().setPlaybackRate,y=fe.getState().setAudioMuted,d=fe.getState().setAudioVolume,v=fe.getState().setLoopEnabled,b=fe(B=>B.inPoint),w=fe(B=>B.outPoint),O=fe.getState().setInPoint,k=fe.getState().setOutPoint,E=fe(B=>B.timeDisplayMode),M=fe.getState().setTimeDisplayMode,N=x.useRef(null),I=x.useRef(0),_=x.useRef(E);_.current=E;const j=x.useRef(o);j.current=o;const L=r||!l;return x.useEffect(()=>{if(!N.current)return;const B=I.current;N.current.textContent=E==="frame"?sG(B,o):as(B)},[o,E]),wr(()=>{const B=Q=>{if(I.current=Q,!N.current)return;const Y=j.current;N.current.textContent=_.current==="frame"?sG(Q,Y):as(Q)},$=ya.subscribe(B);return B(fe.getState().currentTime),$}),p.jsx("div",{children:p.jsxs("div",{className:"grid h-10 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center px-3","aria-disabled":r||void 0,style:{paddingBottom:"env(safe-area-inset-bottom)"},children:[p.jsx(br,{label:E==="time"?"Switch to frame display":"Switch to time display",children:p.jsxs("button",{type:"button",onClick:()=>M(E==="time"?"frame":"time"),disabled:r,className:"min-w-0 justify-self-start whitespace-nowrap font-mono text-[11px] tabular-nums text-neutral-400 transition-colors hover:text-neutral-200 disabled:pointer-events-none",children:[p.jsx("span",{ref:N,children:as(0)}),E==="time"?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"mx-0.5 text-neutral-700",children:"/"}),p.jsx("span",{className:"text-neutral-600",children:as(o)})]}):null]})}),p.jsx(br,{label:a?"Pause":"Play",children:p.jsx("button",{type:"button","aria-label":a?"Pause":"Play",onClick:()=>{Pt("playback",{action:a?"pause":"play"}),e()},disabled:L,className:"flex h-8 w-8 items-center justify-center justify-self-center rounded-md text-neutral-100 transition-colors hover:text-white disabled:pointer-events-none disabled:opacity-30",children:p.jsx(HCe,{playing:a})})}),p.jsxs("div",{className:"flex min-w-0 items-center justify-self-end",children:[p.jsx(VCe,{audioMuted:u,audioVolume:f,disabled:L,setAudioMuted:y,setAudioVolume:d}),p.jsx($Ce,{playbackRate:c,setPlaybackRate:m,disabled:r}),p.jsx(QCe,{loopEnabled:h,disabled:r,setLoopEnabled:v}),s&&p.jsx(zCe,{isFullscreen:i,onToggleFullscreen:s}),p.jsx(LCe,{disabled:r,duration:o,inPoint:b,outPoint:w,setInPoint:O,setOutPoint:k,onSeek:n})]})]})})}),GCe=new Set(["audio","music","sfx","sound","narration"]),UCe=/\.(aac|flac|m4a|mp3|ogg|opus|wav)(?:[?#].*)?$/i,XCe=/\b(music|bgm|soundtrack|background[-_]?music)\b/i;function Xv(t){return t?t.tagName.toLowerCase()===ga?!0:Ko({tag:t.tagName,src:t.getAttribute("src")??void 0}):!1}function Ko(t){if(!t)return!1;const e=t.tag.trim().toLowerCase();return GCe.has(e)?!0:!!(t.src&&UCe.test(t.src))}function fy(t){if(!t||!Ko(t))return!1;if(t.timelineRole==="music")return!0;if(t.timelineRole&&t.timelineRole!=="music")return!1;const e=t.domId??t.id??"";return XCe.test(e)}function WCe(t){const e=t.find(fy);if(e)return{element:e,isFallback:!1};let n=null;for(const r of t)Ko(r)&&(r.timelineRole&&r.timelineRole!=="music"||(!n||r.duration>n.duration)&&(n=r));return n?{element:n,isFallback:!0}:null}function Vse(t){return!t.some(e=>Xv(e.element))}let _O=null;const pG=()=>ly(()=>import("./index-SGl0bb71.js").then(t=>t.i),[]);function qCe(t=pG){const e=t===pG;if(e&&_O)return _O;const n=t().then(r=>(r.default??r)||null).catch(()=>(e&&(_O=null),null));return e&&(_O=n),n}const _P=1024,mG=512,YCe=.05;function Hse(t,e,n){const r=Math.floor(e*YCe),i=Math.floor(n*e),s=Math.max(0,i-r),a=Math.min(t.length,i+r);let o=0;for(let l=s;l<a;l++){const c=t[l]??0;o+=c*c}return Math.sqrt(o/Math.max(a-s,1))}function Qse(t,e){return!t.channelData||t.peak<=0?.5:Math.min(1,Hse(t.channelData,t.sampleRate,e)/t.peak)}async function KCe(t){const e=t.getChannelData(0),n=t.sampleRate,r=[];for(let a=0;a<e.length-_P;a+=mG){let o=0;for(let l=0;l<_P;l++){const c=e[a+l];o+=c*c}r.push(o/_P)}const i=[],s=20;for(let a=s;a<r.length-s;a++){let o=0;for(let u=a-s;u<a+s;u++)o+=r[u];o/=s*2;const l=o*1.5,c=r[a];if(c>l&&c>(r[a-1]??0)&&c>(r[a+1]??0)){const u=a*mG/n;(i.length===0||u-i[i.length-1]>.1)&&i.push(Math.round(u*1e3)/1e3)}}return i}function JCe(t){if(t.length<4)return null;const e=[];for(let s=1;s<t.length;s++)e.push(t[s]-t[s-1]);const n=[...e].sort((s,a)=>s-a),r=Math.floor(n.length/2),i=n.length%2===0?(n[r-1]+n[r])/2:n[r];return i<=0?null:Math.round(60/i*10)/10}function RP(t){let e=t;for(;e>120;)e/=2;for(;e<60;)e*=2;return e}function eke(t,e){const n=[t/2,t,t*2];let r=t,i=Number.POSITIVE_INFINITY;for(const s of n){if(s<=0)continue;const a=Math.abs(s-e);a<i&&(i=a,r=s)}return r}function tke(t,e,n){if(t.length===0||e<=0||n<=0)return t;const r=60/e;if(r<.125)return t;const i=r*.25;let s=0,a=-1;for(const l of t.slice(0,10)){const c=(l%r+r)%r;let u=0;for(const f of t){const h=(f%r+r)%r;Math.min(Math.abs(h-c),r-Math.abs(h-c))<i&&u++}u>a&&(a=u,s=c)}const o=[];for(let l=s;l<=n+.001;l+=r)o.push(Math.round(l*1e3)/1e3);return o}function nke(t,e,n){if(t.length===0)return{times:t,strengths:[],peak:1e-6};const r=t.map(l=>Hse(e,n,l)),i=Math.max(...r,1e-6),s=i*.12,a=[],o=[];for(let l=0;l<t.length;l++)r[l]>=s&&(a.push(t[l]),o.push(Math.min(1,r[l]/i)));return{times:a,strengths:o,peak:i}}async function rke(t){const e=t.getChannelData(0),n=t.sampleRate,r=t.duration,i=await KCe(t),s=JCe(i);let a=null;try{const h=await qCe();h&&(a=h(t))}catch{}let o=s,l="uncertain",c=null;if(s!==null&&a!==null){const h=Math.abs(RP(s)-RP(a))/RP(a);h<.05?(o=eke(a,s),l="high",c=o):h<.1?(o=Math.round((s+a)/2),l="low",c=o):(o=s,l="uncertain")}else s!==null?(o=s,l="low",c=s):a!==null&&(o=a,l="low",c=a);const u=c!==null?tke(i,c,r):i,f=nke(u,e,n);return{beatTimes:f.times,beatStrengths:f.strengths,bpm:o,bpmConfidence:l,channelData:e,sampleRate:n,peak:f.peak}}async function ike(t){const e=new AudioContext;try{const r=await(await fetch(t)).arrayBuffer(),i=await e.decodeAudioData(r);return rke(i)}finally{await e.close()}}function zse(t){if(!t||/^(blob:|data:)/i.test(t))return null;let e=null;const n="/preview/",r=t.indexOf(n);if(r!==-1){let i=t.slice(r+n.length);const s=i.search(/[?#]/);s!==-1&&(i=i.slice(0,s)),i.startsWith("comp/")&&(i=i.slice(5)),e=i?decodeURIComponent(i):null}if(!e)try{e=decodeURIComponent(new URL(t,"http://_").pathname)}catch{e=t}return e?(e=e.replace(/^\/+/,""),e||null):null}function gG(t){const e=zse(t);return e?`beats/${e}.json`:null}function ske(t,e,n){const r=t.map((s,a)=>({time:Math.round(s*1e3)/1e3,strength:Math.round((e[a]??.5)*1e3)/1e3}));return`${JSON.stringify({version:1,audio:n,beats:r},null,2)}
|
|
71
71
|
`}function Zse(t){try{const e=JSON.parse(t);if(!e||e.version!==1||!Array.isArray(e.beats))return null;const n=[],r=[];for(const i of e.beats)if(i&&typeof i.time=="number"&&Number.isFinite(i.time)){n.push(i.time);const s=typeof i.strength=="number"&&Number.isFinite(i.strength)?i.strength:.5;r.push(Math.max(0,Math.min(1,s)))}return{times:n,strengths:r}}catch{return null}}const yG="__hfStudioContexts",xG=new Map;function ake(){const t=globalThis,e=t[yG];if(e)return e;const n=new Map;return t[yG]=n,n}function Dc(t,e){const n=ake();n.has(t)&&xG.get(t)!==e&&console.warn(`[hmrStableContext] "${t}" was registered twice with different defaults — two contexts are sharing one identity. Use module path + export name.`),xG.set(t,e);const r=n.get(t);if(r)return r;const i=x.createContext(e);return n.set(t,i),i}const xj=Dc("FileManagerContext",null);function $0(){const t=x.useContext(xj);if(!t)throw new Error("useFileManagerContext must be used within FileManagerProvider");return t}function Gse(){return x.useContext(xj)}function oke({value:{editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:s,editingPathRef:a,projectIdRef:o,saveRafRef:l,flushPendingSourceSave:c,discardPendingSourceSave:u,getPendingSourceCandidate:f,importedFontAssetsRef:h,readProjectFile:m,writeProjectFile:y,overwriteExternalConflict:d,readOptionalProjectFile:v,observeProjectFileVersion:b,updateEditingFileContent:w,revealSourceOffset:O,openSourceForSelection:k,handleFileSelect:E,handleContentChange:M,refreshFileTree:N,uploadProjectFiles:I,handleCreateFile:_,handleCreateFolder:j,handleDeleteFile:L,handleRenameFile:B,handleDuplicateFile:$,handleMoveFile:Q,handleImportFiles:Y,handleImportFonts:W,compositions:J,assets:ne,fontAssets:le},children:ie}){const q=x.useMemo(()=>({editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:s,editingPathRef:a,projectIdRef:o,saveRafRef:l,flushPendingSourceSave:c,discardPendingSourceSave:u,getPendingSourceCandidate:f,importedFontAssetsRef:h,readProjectFile:m,writeProjectFile:y,overwriteExternalConflict:d,readOptionalProjectFile:v,observeProjectFileVersion:b,updateEditingFileContent:w,revealSourceOffset:O,openSourceForSelection:k,handleFileSelect:E,handleContentChange:M,refreshFileTree:N,uploadProjectFiles:I,handleCreateFile:_,handleCreateFolder:j,handleDeleteFile:L,handleRenameFile:B,handleDuplicateFile:$,handleMoveFile:Q,handleImportFiles:Y,handleImportFonts:W,compositions:J,assets:ne,fontAssets:le}),[t,e,n,r,i,s,a,o,l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_,j,L,B,$,Q,Y,W,J,ne,le]);return p.jsx(xj,{value:q,children:ie})}const lke=.015;function oc(t,e){return Math.abs(t-e)<lke}function pE(t,e){return t&&e&&t.src===e?t:null}function bj(t,e,n,r){const i=pE(n,r),s=(i==null?void 0:i.removed)??[],a=[];for(let o=0;o<t.length;o++){const l=t[o];s.some(c=>oc(c,l))||a.push({time:l,strength:e[o]??.5})}if(i)for(const o of i.added)a.some(l=>oc(l.time,o.time))||a.push(o);return a.sort((o,l)=>o.time-l.time),{times:a.map(o=>o.time),strengths:a.map(o=>o.strength)}}function Use(t,e){const n=pE(t,e);return n?{...n,added:[...n.added],removed:[...n.removed]}:{src:e,added:[],removed:[]}}function Xse(t,e,n,r=[]){const i=pE(t,e);if(r.some(l=>oc(l,n.time))&&!((i==null?void 0:i.removed)??[]).some(l=>oc(l,n.time))||((i==null?void 0:i.added)??[]).some(l=>oc(l.time,n.time)))return t;const a=Use(t,e),o=a.removed.findIndex(l=>oc(l,n.time));return o>=0?(a.removed.splice(o,1),a):(a.added.push(n),a)}function Wse(t,e,n,r){const i=pE(t,e),s=((i==null?void 0:i.added)??[]).some(u=>oc(u.time,r)),a=n.find(u=>oc(u,r)),o=a!==void 0&&((i==null?void 0:i.removed)??[]).some(u=>oc(u,a));if(!s&&(a===void 0||o))return t;const l=Use(t,e),c=l.added.findIndex(u=>oc(u.time,r));return c>=0?(l.added.splice(c,1),l):(a!==void 0&&!l.removed.some(u=>oc(u,a))&&l.removed.push(a),l)}function cke(t,e,n,r,i){const s=Wse(t,e,n,r);return Xse(s,e,i,n)??s}const bG=new WeakMap;function p0(t){const e=bG.get(t);if(e)return e;const n=new Map,r=[],i=new Set;let s=null;for(const o of t)n.set(zn(o),o),o.src&&r.push(o),Ko(o)&&i.add(o.track),!s&&fy(o)&&(s=o);const a=Object.freeze({byKey:n,musicElement:s,mediaElements:Object.freeze(r),audioTracks:i});return bG.set(t,a),a}function qse(t,e,n){if(!t||!e)return null;const r=bj(t.beatTimes,t.beatStrengths,n,e.src??null),i=e.playbackStart??0,s=i+e.duration,a=e.start-i,o=[],l=[];return r.times.forEach((c,u)=>{c>=i&&c<=s&&(o.push(Math.round((c+a)*1e3)/1e3),l.push(r.strengths[u]??1))}),{...t,beatTimes:o,beatStrengths:l}}function mE(){const t=fe.getState(),e=t.elements.find(fy),n=t.beatAnalysis;return!e||!n||!e.src?null:{s:t,music:e,analysis:n,src:e.src}}function w6(t,e,n){return e+(n-t)}function vj(t){return t.duration>0?t.duration:t.sourceDuration&&t.sourceDuration>0?t.sourceDuration:Number.POSITIVE_INFINITY}function uke(t){const e=mE();return e?t>=e.music.start&&t<=e.music.start+vj(e.music):!1}function fke(t){const e=mE();if(!e)return;const n=e.music.playbackStart??0,r=w6(e.music.start,n,t);if(r<n||r>n+vj(e.music))return;const i=Qse(e.analysis,r),s=Xse(e.s.beatEdits,e.src,{time:r,strength:i},e.analysis.beatTimes);s!==e.s.beatEdits&&e.s.commitBeatEdits(s,"add beat")}function hke(t){const e=mE();if(!e)return;const n=w6(e.music.start,e.music.playbackStart??0,t),r=Wse(e.s.beatEdits,e.src,e.analysis.beatTimes,n);r!==e.s.beatEdits&&e.s.commitBeatEdits(r,"delete beat")}function dke(t,e){const n=mE();if(!n)return;const r=n.music.playbackStart??0,i=w6(n.music.start,r,t),s=w6(n.music.start,r,e),a=Math.max(r,Math.min(r+vj(n.music),s)),o=Qse(n.analysis,a),l=cke(n.s.beatEdits,n.src,n.analysis.beatTimes,i,{time:a,strength:o});l!==n.s.beatEdits&&n.s.commitBeatEdits(l,"move beat")}const S1=new Map,pke=4,mke=350;function gke(t,e){for(S1.set(t,e);S1.size>pke;){const n=S1.keys().next().value;if(n===void 0)break;S1.delete(n)}}async function yke(t,e,n){if(!t)return{...e,hasFile:!1};try{const r=await n.readOptionalProjectFile(t),i=r?Zse(r):null;if(i&&i.times.length>0)return{times:i.times,strengths:i.strengths,hasFile:!0}}catch{}return{...e,hasFile:!1}}async function xke(t,e){try{const n=await t.readOptionalProjectFile(e),r=n?Zse(n):null;return!!(r&&r.times.length>0)}catch{return!1}}async function bke(t,e,n){let r=S1.get(t);r||(r=ike(t),gke(t,r));try{const i=await r,s={times:i.beatTimes,strengths:i.beatStrengths},{times:a,strengths:o}=await yke(e,s,n);return{analysis:i,times:a,strengths:o}}catch{return null}}function vke(){const t=fe(r=>r.beatAnalysis),e=fe(r=>p0(r.elements).musicElement),n=fe(r=>r.beatEdits);return x.useMemo(()=>qse(t,e,n),[t,e,n])}function Ake(){const t=fe(f=>f.elements),e=fe(f=>f.setBeatAnalysis),n=fe(f=>f.setBeatEdits),r=fe(f=>f.setBeatPersist),i=fe(f=>f.resetBeatHistory),s=Gse(),a=s==null?void 0:s.readOptionalProjectFile,o=s==null?void 0:s.writeProjectFile,l=x.useRef(null);l.current=a&&o?{readOptionalProjectFile:a,writeProjectFile:o}:null;const{musicSrc:c,isFallbackTrack:u}=x.useMemo(()=>{const f=WCe(t);return{musicSrc:(f==null?void 0:f.element.src)??null,isFallbackTrack:(f==null?void 0:f.isFallback)??!1}},[t]);x.useEffect(()=>{if(!c){e(null),n(null),i();return}if(!l.current){e(null),n(null),i();return}let f=!1;const h=gG(c),m=l.current;return(async()=>{if(!h||!m)return;if(!u){const d=await xke(m,h);if(f)return;if(!d){e(null);return}}if(f)return;const y=await bke(c,h,m);if(!f){if(!y){e(null),S1.delete(c);return}n(null),i(),e({...y.analysis,beatTimes:y.times,beatStrengths:y.strengths})}})(),()=>{f=!0}},[c,u,e,n,i]),x.useEffect(()=>{const f=gG(c);if(!c||!f||!l.current){r(null);return}const h=l.current,m=zse(c)??"audio";let y=null,d=null;const v=()=>{if(d===null)return;const w=d;d=null,h.writeProjectFile(f,w).catch(()=>{})};return r(()=>{const w=fe.getState(),O=w.beatAnalysis;if(!O)return;const k=bj(O.beatTimes,O.beatStrengths,w.beatEdits,c);d=ske(k.times,k.strengths,m),y&&clearTimeout(y),y=setTimeout(()=>{y=null,v()},mke)}),()=>{y&&clearTimeout(y),v(),r(null)}},[c,r])}const jP="css:root",Yse=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Ske=new Set([...Yse,"contain","isolation","mask-border","mix-blend-mode","opacity"]),wke=new Set(["absolute","relative"]),Oke=new Set(["flex","inline-flex","grid","inline-grid"]),Cke=new Set(["layout","paint","strict","content"]),kke=new Set(["size","inline-size"]);function Eke(t){return t.position==="fixed"||t.position==="sticky"}function Tke(t,e){var r;if(e.zIndex==="auto"||e.zIndex==="")return!1;if(wke.has(e.position))return!0;const n=t.parentElement?(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t.parentElement).display:null;return n!=null&&Oke.has(n)}function Pke(t){const e=Number.parseFloat(t.opacity);if(Number.isFinite(e)&&e<1||t.getPropertyValue("isolation")==="isolate")return!0;const n=t.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:Yse.some(r=>{const i=t.getPropertyValue(r);return i!==""&&i!=="none"})}function Mke(t){return t.getPropertyValue("contain").split(/\s+/).some(n=>Cke.has(n))?!0:kke.has(t.getPropertyValue("container-type"))}function Nke(t){return t.getPropertyValue("will-change").split(",").map(e=>e.trim()).some(e=>Ske.has(e))}function Dke(t,e){return Eke(e)||Tke(t,e)||Pke(e)||Mke(e)?!0:Nke(e)}function Ike(t){const e=[];let n=t;for(;n!=null&&n.parentElement;)e.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${e.reverse().join(".")}`}function Aj(t){const e=t.ownerDocument.defaultView;if(!e)return jP;let n=t.parentElement;for(;n&&n!==t.ownerDocument.documentElement;){try{if(Dke(n,e.getComputedStyle(n)))return Ike(n)}catch{return jP}n=n.parentElement}return jP}const Nn=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"});Object.freeze([Nn.start,Nn.duration,Nn.trackIndex]);Object.freeze([Nn.derivedEnd]);Object.freeze([Nn.derivedEnd,Nn.legacyTrack]);class nS extends Error{constructor(n,r){super(r);Et(this,"code");this.name="ClipTimingWriteError",this.code=n}}function hy(t){if(t==null||t.trim()==="")return null;const e=Number(t);return Number.isFinite(e)?e:null}const Kse=/^[A-Za-z0-9_.:-]+$/;function Jse(t,e){const n=t.charCodeAt(e);return n>=48&&n<=57}function vG(t,e){let n=e;for(;n>=0&&Jse(t,n);)n--;return n}function _ke(t,e){let n=e;for(;n>=0&&(t[n]??"").trim()==="";)n--;return n}function Rke(t){const e=t.length-1;if(!Jse(t,e))return null;let n=vG(t,e);return t[n]==="."&&(n=vG(t,n-1)),n+1}function jke(t){const e=Rke(t);if(e==null)return null;const n=_ke(t,e-1),r=t[n];if(r!=="+"&&r!=="-")return null;const i=t.slice(0,n).trim();if(!Kse.test(i))return null;const s=Number(t.slice(e));return Number.isFinite(s)?{refId:i,operator:r,magnitude:s}:null}function eae(t){const e=(t??"").trim();if(!e)return null;const n=hy(e);if(n!=null)return{kind:"absolute",value:n};if(Kse.test(e))return{kind:"reference",refId:e,offset:0};const r=jke(e);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function Da(t,e,n,r){t.push({code:e,attribute:n,value:r})}function Lke(t,e,n,r){var s;if(e==null||e.trim()==="")return n.defaultStart===void 0?0:n.defaultStart;if(!t)return Da(r,"invalid-start",Nn.start,e),null;if(t.kind==="absolute")return Math.max(0,t.value);const i=(s=n.resolveReferenceEnd)==null?void 0:s.call(n,t.refId);return i==null||!Number.isFinite(i)?(Da(r,"unresolved-start-reference",Nn.start,e),null):Math.max(0,i+t.offset)}const Fke=1e-9;function $ke(t,e){return Math.abs(t-e)<=Fke}function Bke(t,e,n){const r=hy(t);if(r==null){Da(n,"deprecated-end",Nn.derivedEnd,t),Da(n,"invalid-end",Nn.derivedEnd,t);return}if(e==null){Da(n,"deprecated-end",Nn.derivedEnd,t);return}$ke(r,e)||(Da(n,"deprecated-end",Nn.derivedEnd,t),Da(n,"conflicting-end",Nn.derivedEnd,t))}function Vke(t,e,n){const r=hy(t);return r==null||r<0?(Da(n,"invalid-duration",Nn.duration,t),{duration:null,end:null,durationSource:"invalid"}):{duration:r,end:e==null?null:e+r,durationSource:"duration"}}function Hke(t,e,n){Da(n,"deprecated-end",Nn.derivedEnd,t);const r=hy(t);return r==null?(Da(n,"invalid-end",Nn.derivedEnd,t),{duration:null,end:null,durationSource:"invalid"}):e==null?{duration:null,end:r,durationSource:"legacy-end"}:r<e?(Da(n,"end-before-start",Nn.derivedEnd,t),{duration:null,end:null,durationSource:"invalid"}):{duration:r-e,end:r,durationSource:"legacy-end"}}function Qke(t,e,n){const r=t.getAttribute(Nn.duration),i=t.getAttribute(Nn.derivedEnd);if(r==null)return i==null?{duration:null,end:null,durationSource:"missing"}:Hke(i,e,n);const s=Vke(r,e,n);return i!=null&&Bke(i,s.end,n),s}function AG(t,e,n,r){const i=hy(t);return i==null||!Number.isInteger(i)?(Da(r,"invalid-track-index",e,t),{trackIndex:0,trackSource:"invalid"}):{trackIndex:i,trackSource:n}}function zke(t,e){const n=t.getAttribute(Nn.trackIndex),r=t.getAttribute(Nn.legacyTrack);if(n==null&&r==null)return{trackIndex:0,trackSource:"default"};if(n==null&&r!=null)return Da(e,"deprecated-layer",Nn.legacyTrack,r),AG(r,Nn.legacyTrack,"legacy-layer",e);const i=AG(n??"",Nn.trackIndex,"track-index",e);if(r==null)return i;Da(e,"deprecated-layer",Nn.legacyTrack,r);const s=hy(r);return s!=null&&s!==i.trackIndex&&Da(e,"conflicting-layer",Nn.legacyTrack,r),i}function Cd(t,e={}){const n=[],r=t.getAttribute(Nn.start),i=eae(r),s=Lke(i,r,e,n),a=Qke(t,s,n),o=zke(t,n);return{startExpression:i,start:s,...a,...o,diagnostics:n}}function tae(t){if(!Number.isFinite(t))throw new nS("invalid-start","start must be finite");return String(t)}function Zke(t){if(t.kind==="absolute")return tae(t.value);if(!t.refId||!Number.isFinite(t.offset))throw new nS("invalid-start","reference start must have an id and finite offset");return t.offset===0?t.refId:`${t.refId} ${t.offset<0?"-":"+"} ${Math.abs(t.offset)}`}function Gke(t){if(typeof t=="number")return tae(t);if(typeof t=="object"&&t!=null)return Zke(t);if(typeof t=="string"&&eae(t))return t.trim();throw new nS("invalid-start",`invalid start expression: ${t??""}`)}function Uke(t,e,n){if(e===null){t.removeAttribute(Nn.duration);return}if(e===void 0){t.getAttribute(Nn.duration)==null&&n.duration!=null&&t.setAttribute(Nn.duration,String(n.duration));return}if(!Number.isFinite(e)||e<0)throw new nS("invalid-duration","duration must be a finite, non-negative number");t.setAttribute(Nn.duration,String(e))}function Xke(t,e,n){if(e===null){t.removeAttribute(Nn.trackIndex);return}if(e===void 0){t.getAttribute(Nn.trackIndex)==null&&n.trackSource==="legacy-layer"&&t.setAttribute(Nn.trackIndex,String(n.trackIndex));return}if(!Number.isFinite(e)||!Number.isInteger(e))throw new nS("invalid-track-index","trackIndex must be a finite integer");t.setAttribute(Nn.trackIndex,String(e))}function Wke(t,e){const n=Cd(t);return e.start!==void 0&&t.setAttribute(Nn.start,Gke(e.start)),Uke(t,e.duration,n),Xke(t,e.trackIndex,n),e.duration===void 0&&t.getAttribute(Nn.duration)==null&&t.getAttribute(Nn.derivedEnd)!=null&&n.duration==null||t.removeAttribute(Nn.derivedEnd),t.removeAttribute(Nn.legacyTrack),Cd(t)}const UI=new WeakMap,XI=new WeakMap,SG=new WeakSet;function qke(t){if(SG.has(t)||typeof MutationObserver>"u"||!t.body)return;SG.add(t),new MutationObserver(n=>{n.some(i=>i.type!=="childList"||[...i.addedNodes,...i.removedNodes].some(s=>{var a;return s instanceof Element&&(s.tagName.toLowerCase()===ga||s.hasAttribute(Zo)||((a=s.querySelector)==null?void 0:a.call(s,`${ga},[${Zo}]`))!=null)}))&&XI.set(t,(XI.get(t)??0)+1)}).observe(t.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[Zo,Xs,io,"data-label","data-volume","data-hidden","id"]})}function gE(t){t&&UI.delete(t)}function yE(t,e){if(!t)return{label:e,volume:1,hidden:!1};qke(t);const n=XI.get(t)??0,r=UI.get(t);let i=r&&r.revision===n?r.entries:void 0;return i||(i=new Map(Hd(t).map(s=>[s.id,{label:s.label,volume:s.volume,hidden:s.hidden,...s.fxChain?{fxChain:s.fxChain}:{},...s.automation?{automation:s.automation}:{}}])),UI.set(t,{revision:n,entries:i})),i.get(e)??{label:e,volume:1,hidden:!1}}const nae=1,Yke=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data"];function Kke(t,e){let n=Math.abs(t),r=Math.abs(e);for(;r!==0;){const i=n%r;n=r,r=i}return n||1}function Jke(t){const e=Number.isFinite(t)&&t>0?t:30,n=Number.isInteger(e)?1:1e6,r=Math.round(e*n),i=Kke(r,n);return{numerator:r/i,denominator:n/i}}function eEe(t){if(typeof t!="object"||t===null)return null;const e=t;return!Number.isFinite(e.numerator)||!Number.isFinite(e.denominator)||(e.numerator??0)<=0||(e.denominator??0)<=0?null:Number(e.numerator)/Number(e.denominator)}function tEe(t){return{protocolVersion:nae,capabilities:Yke,fps:Jke(t)}}function nEe(t){return Array.isArray(t)&&t.every(e=>typeof e=="string")}function rEe(t,e=30){if(typeof t!="object"||t===null)return{status:"legacy",fps:e};const n=t;if(n.protocolVersion===void 0)return{status:"legacy",fps:e};if(n.protocolVersion!==nae)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};const r=eEe(n.fps);return r===null||!nEe(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}function iEe(t,e={},n=30){return{...e,source:"hf-parent",type:"control",action:t,...tEe(n)}}function WI(t,e,n={},r=30){t==null||t.postMessage(iEe(e,n,r),"*")}function Sj(t){return rEe(t,30)}function sEe(t){t.status==="unsupported"&&window.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:t.code,receivedVersion:t.receivedVersion}}))}function xE(t){const e=Sj(t);return e.status!=="unsupported"?e:(sEe(e),null)}function aEe(t){const e=Sj(t);return e.status==="supported"?e.fps:30}function oEe(t,e){t.documentElement&&(t.documentElement.style.overflow="hidden",t.documentElement.style.margin="0"),t.body&&(t.body.style.overflow="hidden",t.body.style.margin="0"),e.scrollTo({top:0,left:0,behavior:"auto"})}function lEe(t){const e=/data-composition-id=["']([^"']+)["']/gi,n=new Set,r=Array.from(t.querySelectorAll("style, script"));for(const a of r){const o=a.textContent||"";if(!o)continue;let l;for(;(l=e.exec(o))!==null;){const c=(l[1]||"").trim();c&&n.add(c)}}if(n.size===0)return;const i=new Set,s=Array.from(t.querySelectorAll("[data-composition-id]"));for(const a of s){const o=a.getAttribute("data-composition-id");o&&i.add(o)}for(const a of n){if(a==="root"||i.has(a))continue;const o=t.getElementById(`${a}-layer`)||t.getElementById(`${a}-comp`)||t.getElementById(a);o&&(o.getAttribute("data-composition-id")||o.setAttribute("data-composition-id",a))}}function rae(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function cEe(t){return t instanceof HTMLElement}function wj(t){const e=t.getRootNode();return typeof ShadowRoot<"u"&&e instanceof ShadowRoot&&cEe(e.host)?e.host:null}function Oj(t,e,n){WI(t.contentWindow,e,n)}function iae(t,e){if(t)try{const n=wj(t);if(n&&typeof n.muted=="boolean"){n.muted=e;return}Oj(t,"set-muted",{muted:e})}catch{}}function uEe(t,e){if(!t)return;const n=rae(e);try{const r=wj(t);if(r&&typeof r.volume=="number"){r.volume=n;return}Oj(t,"set-volume",{volume:n})}catch{}}function fEe(t,e,n){iae(t,e),uEe(t,n)}function hEe(t,e){if(!t)return;const n=Number.isFinite(e)&&e>0?e:1;try{const r=wj(t);if(r&&typeof r.playbackRate=="number"){r.playbackRate=n;return}Oj(t,"set-playback-rate",{playbackRate:n})}catch{}}const dEe=.25;let H2=null,U1=null,Q2=null,z2=null;function pEe(t,e){if(e){const n=t.getElementById(e);if(n instanceof HTMLAudioElement)return n}return t.querySelector("audio[data-timeline-role='music']")??t.querySelector("audio")}function mEe(t,e,n){H2&&H2!==t&&Wv(),Q2===null&&(Q2=t.muted),z2===null&&(z2=t.volume),H2=t;try{t.muted=!1,t.volume=dEe*rae(n),Math.abs(t.currentTime-e)>.04&&(t.currentTime=e),t.paused&&t.play().catch(()=>{})}catch{}U1&&clearTimeout(U1),U1=setTimeout(Wv,140)}function gEe(t,e,n,r=1){if(!t)return;if(e===null){Wv();return}let i=null;try{i=t.contentDocument}catch{return}if(!i)return;const s=pEe(i,n);s&&mEe(s,e,r)}function Wv(){U1&&(clearTimeout(U1),U1=null);const t=H2;if(H2=null,!!t){try{t.pause(),Q2!==null&&(t.muted=Q2),z2!==null&&(t.volume=z2)}catch{}Q2=null,z2=null}}function sae(t,e){var n,r,i;return((i=(r=(n=t.__timelines)==null?void 0:n[e])==null?void 0:r.duration)==null?void 0:i.call(r))??0}function yEe(t){const e=new Map;for(const n of t.querySelectorAll("[data-start]"))for(const r of[n.id,n.getAttribute("data-hf-id"),n.getAttribute("data-composition-id")])r&&e.set(r,n);return e}function xEe(t,e){const n=(r,i)=>{if(i.has(r))return null;const s=t.get(r);if(!s)return null;const a=new Set(i).add(r),o=Cd(s,{resolveReferenceEnd:u=>n(u,a)});if(o.end!=null)return o.end;const l=s.getAttribute("data-composition-id"),c=l?sae(e,l):0;return o.start==null||c<=0?null:o.start+c};return n}function bEe(t,e,n){if(!Number.isFinite(e)||e<=0)return null;const r=Number.isFinite(t)?t:0;if(!Number.isFinite(n)||n<=0)return{start:r,duration:e};if(r>=n)return null;const i=Math.min(e,Math.max(0,n-r));return i>0?{start:r,duration:i}:null}function vEe(t,e){return t||e}function A4(t){return t||void 0}function AEe(t,e,n){if(n)return{...t,compositionSrc:n};const r=e.querySelector("video[src]");return r?{...t,src:A4(r.getAttribute("src")),tag:"video"}:t}function SEe(t){const{doc:e,iframeWin:n,element:r,compositionId:i,rootDuration:s,fallbackIndex:a,resolveEnd:o}=t,l=Cd(r,{resolveReferenceEnd:w=>o(w,new Set([i]))}),c=bEe(l.start??0,l.duration??sae(n,i),s);if(!c)return null;const u=vEe(r.id,i),f=r.getAttribute("data-composition-src")??r.getAttribute("data-composition-file"),h=h0(r),m=d0(r),y=zv(e,r,h),d=tS({id:u,label:r.getAttribute("data-timeline-label")??r.getAttribute("data-label"),tag:r.tagName}),v=Gv({preferredId:u,label:d,fallbackIndex:a,domId:A4(r.id),selector:h,selectorIndex:y,sourceFile:m}),b={id:v.id,label:d,key:v.key,tag:r.tagName.toLowerCase(),start:c.start,duration:c.duration,track:l.trackIndex,domId:A4(r.id),hfId:A4(r.getAttribute("data-hf-id")),selector:h,selectorIndex:y,sourceFile:m,zIndex:fE(r)};return AEe(b,r,f)}function wEe(t,e,n,r){const i=new Set(n.map(h=>h.id)),s=t.querySelector("[data-composition-id]"),a=s==null?void 0:s.getAttribute("data-composition-id"),o=t.querySelectorAll("[data-composition-id][data-start]"),l=[],c=xEe(yEe(t),e);for(const h of o){const m=h,y=m.getAttribute("data-composition-id");if(!y||y===a||i.has(m.id)||i.has(y))continue;const d=SEe({doc:t,iframeWin:e,element:m,compositionId:y,rootDuration:r,fallbackIndex:l.length,resolveEnd:c});d&&l.push(d)}let u=!1;const f=n.map(h=>{if(h.compositionSrc)return h;const m=t.getElementById(h.id)??t.querySelector(`[data-composition-id="${CSS.escape(h.id)}"]`);if(!m)return h;const y=m.getAttribute("data-composition-src")||m.getAttribute("data-composition-file");return y?(u=!0,{...h,compositionSrc:y}):h});return{missing:l,updatedEls:f,patched:u}}function wG(t){return t.tagName||t.kind||"div"}function aae(t){const{clip:e,fallbackIndex:n,doc:r}=t;let i=t.hostEl??null;const s=tS({id:e.id,label:e.label,tag:wG(e)});let a,o,l,c,u;i&&(a=i.id||void 0,u=i.getAttribute("data-hf-id")||void 0,o=h0(i),l=r&&o?zv(r,i,o):void 0,c=d0(i));const f=Gv({preferredId:e.id,label:s,fallbackIndex:n,domId:a,selector:o,selectorIndex:l,sourceFile:c}),h={id:f.id,label:s,key:f.key,kind:e.kind,tag:wG(e),start:e.start,duration:e.duration,track:e.track,authoredTrack:e.track,stackingContextId:e.stackingContextId??null,domId:a,hfId:u,selector:o,selectorIndex:l,sourceFile:c,playbackStart:e.playbackStart,playbackRate:e.playbackRate};if(i){Mse(h,i),i.hasAttribute("data-hidden")&&(h.hidden=!0);const m=i.getAttribute("data-timeline-role");m&&(h.timelineRole=m);const y=i.getAttribute("data-audio-group");if(y){h.audioGroup=y;const b=yE(r??i.ownerDocument,y);h.audioGroupLabel=b.label,h.audioGroupVolume=b.volume,h.audioGroupHidden=b.hidden,b.fxChain&&(h.audioGroupFxChain=b.fxChain),b.automation&&(h.audioGroupAutomation=b.automation)}const d=i.getAttribute("data-fx-chain");d&&(h.fxChain=d);const v=i.getAttribute("data-automation");v&&(h.automation=v),h.zIndex=fE(i)}if(e.assetUrl&&(h.src=e.assetUrl),e.kind==="composition"&&e.compositionId){h.playbackStart??(h.playbackStart=0),h.playbackRate??(h.playbackRate=1);let m=e.compositionSrc;if(m||(i=(r==null?void 0:r.querySelector(`[data-composition-id="${CSS.escape(e.compositionId)}"]`))??i,m=(i==null?void 0:i.getAttribute("data-composition-src"))??(i==null?void 0:i.getAttribute("data-composition-file"))??null),m)h.compositionSrc=m;else if(i){const y=i.querySelector("video[src]");y&&(h.src=y.getAttribute("src")||void 0,h.tag="video")}if(i){h.domId=i.id||void 0,h.hfId=i.getAttribute("data-hf-id")||void 0,h.selector=h0(i),h.selectorIndex=r&&h.selector?zv(r,i,h.selector):void 0,h.sourceFile=d0(i);const y=Gv({preferredId:e.id,label:s,fallbackIndex:n,domId:h.domId,selector:h.selector,selectorIndex:h.selectorIndex,sourceFile:h.sourceFile});h.id=y.id,h.key=y.key}}return h}function oae(t,e,n=[]){if(!Number.isFinite(e)||e<=0)return[];const r=t.querySelector("[data-composition-id]");if(!r)return[];const i=new Set(n.map(zn)),s=n.reduce((o,l)=>Math.max(o,Number.isFinite(l.track)?l.track:0),-1),a=[];for(const o of Array.from(r.children)){if(!fCe(r,o))continue;const l=h0(o);if(!l)continue;const c=zv(t,o,l),u=d0(o),f=iCe(o),h=Gv({preferredId:o.id||null,label:f,fallbackIndex:n.length+a.length,domId:o.id||void 0,selector:l,selectorIndex:c,sourceFile:u});i.has(h.key)||i.has(h.id)||a.push({domId:o.id||void 0,hfId:o.getAttribute("data-hf-id")||void 0,zIndex:fE(o),duration:e,id:h.id,key:h.key,label:f,selector:l,selectorIndex:c,sourceFile:u,stackingContextId:Aj(o),start:0,tag:o.tagName.toLowerCase(),timingSource:"implicit",track:s+1+a.length})}return a}function lae(t,e){const n=t.querySelector("[data-composition-id]"),r=t.querySelectorAll("[data-start]"),i=[];let s=0;return r.forEach(a=>{if(a===n||hE(a))return;const o=a,l=Cd(o),c=l.start;if(c==null||Number.isFinite(e)&&e>0&&c>=e)return;const u=o.tagName.toLowerCase();let f=l.duration??0;if(f<=0&&(f=Math.max(0,e-c)),Number.isFinite(e)&&e>0&&(f=Math.min(f,Math.max(0,e-c))),!Number.isFinite(f)||f<=0)return;const h=l.trackSource==="default"?s++:l.trackIndex,m=o.getAttribute("data-composition-id"),y=h0(o),d=d0(o),v=zv(t,o,y),b=tS({id:o.id||m||null,label:o.getAttribute("data-timeline-label")??o.getAttribute("data-label"),tag:u}),w=Gv({preferredId:o.id||m||null,label:b,fallbackIndex:i.length,domId:o.id||void 0,selector:y,selectorIndex:v,sourceFile:d}),O={id:w.id,label:b,key:w.key,kind:m&&m!==(n==null?void 0:n.getAttribute("data-composition-id"))?"composition":u==="video"||u==="audio"?u:u==="img"?"image":"element",tag:u,start:c,duration:f,track:h,domId:o.id||void 0,hfId:o.getAttribute("data-hf-id")||void 0,selector:y,selectorIndex:v,sourceFile:d,stackingContextId:Aj(o),timingSource:"authored",zIndex:fE(o)},k=Pse(o);if(Mse(O,o),k){k.tagName==="IMG"&&(O.tag="img");const j=o.getAttribute("data-volume")??k.getAttribute("data-volume");j&&(O.volume=parseFloat(j));const L=k.src||void 0;L&&(O.src=L)}const E=o.getAttribute("data-fx-chain");E&&(O.fxChain=E);const M=o.getAttribute("data-automation");M&&(O.automation=M),o.hasAttribute("data-timeline-locked")&&(O.timelineLocked=!0),o.hasAttribute("data-hidden")&&(O.hidden=!0);const N=o.getAttribute("data-timeline-role");N&&(O.timelineRole=N);const I=o.getAttribute("data-audio-group");if(I){O.audioGroup=I;const j=yE(t,I);O.audioGroupLabel=j.label,O.audioGroupVolume=j.volume,O.audioGroupHidden=j.hidden,j.fxChain&&(O.audioGroupFxChain=j.fxChain),j.automation&&(O.audioGroupAutomation=j.automation)}const _=o.getAttribute("data-composition-src")||o.getAttribute("data-composition-file");if(_)O.compositionSrc=_;else if(m&&m!==(n==null?void 0:n.getAttribute("data-composition-id"))){const j=o.querySelector("video[src]");j&&(O.src=j.getAttribute("src")||void 0,O.tag="video")}O.kind==="composition"&&(O.playbackStart??(O.playbackStart=0),O.playbackRate??(O.playbackRate=1)),i.push(O)}),[...i,...oae(t,e,i)]}function OEe(t,e,n,r){const i=Number.isFinite(n)?n:0,s=Number.isFinite(r)?r:0;if(t.length===0||e.length>=t.length||s>i)return e;const a=new Set(e.map(zn)),o=t.filter(l=>!a.has(zn(l))&&l.compositionSrc!=null);return o.length===0?e:[...e,...o]}function CEe(t){const e=t.match(/\/preview\/comp\/(.+?)(?:\?|$)/);return e?decodeURIComponent(e[1]):void 0}function kEe(t){if(!Number.isFinite(t.rootDuration)||t.rootDuration<=0)return null;const e=CEe(t.iframeSrc);return{id:t.compositionId,label:tS({id:t.compositionId,tag:t.tagName}),key:Zv({id:t.compositionId,fallbackIndex:0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:e}),tag:t.tagName.toLowerCase()||"div",start:0,duration:t.rootDuration,track:0,compositionSrc:e,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:e}}function EEe(t,e){let n=e.get(t);if(!n)return null;const r=new Set;for(r.add(t);e.has(n);){if(r.has(n))return n;r.add(n);const i=e.get(n);if(!i)return n;n=i}return n}function cae(t,e,n){if(!t)return null;const r=v6(t).domId;if(n.has(r))return r;if(n.has(t))return t;const i=e.find(s=>s.label===t||s.label===r);return i!=null&&i.id&&n.has(i.id)?i.id:null}function TEe(t,e){return Number.isFinite(e)&&e>=t.start&&e<t.start+t.duration}function PEe(t,e){return Number.isFinite(e)&&e>=t.start&&e<=t.start+t.duration}function MEe(t,e,n){let r=0,i=e.get(t);const s=new Set;for(s.add(t);i;){if(s.has(i))return r;s.add(i),n.has(i)&&(r+=1),i=e.get(i)}return r}function NEe(t,e,n){const r=new Set(n.values()),i=c=>{const u=new Set;for(const f of e)f.id&&r.has(f.id)&&c(f,t)&&u.add(f.id);return u},s=i(TEe),a=s.size>0?s:i(PEe);let o=null,l=-1;for(const c of a){const u=MEe(c,n,a);u<=l||(o=c,l=u)}return o}function DEe({selectedElementId:t,currentTime:e,manifest:n,parentMap:r}){const i=cae(t,n,r);return i||NEe(e,n,r)}function Z2(t,e){return e.size===0?t:t.filter(n=>!e.has(n.domId??n.id))}function IEe(t,e,n){const r=t.start+t.duration;if(t.start>=n||r<=e)return null;const i=Math.max(t.start,e),s=Math.min(r,n)-i;return s>0?{start:i,duration:s}:null}function _Ee(t,e){const n=t!=null&&t.audioGroup?t:e!=null&&e.audioGroup?e:null;return n?{audioGroup:n.audioGroup,audioGroupLabel:n.audioGroupLabel,audioGroupVolume:n.audioGroupVolume,audioGroupHidden:n.audioGroupHidden,audioGroupFxChain:n.audioGroupFxChain,audioGroupAutomation:n.audioGroupAutomation}:{}}function REe(t){return t?{hidden:t.hidden,timelineLocked:t.timelineLocked,timelineRole:t.timelineRole,fxChain:t.fxChain,automation:t.automation}:{}}function jEe(t,e,n,r,i,s){const a=[];for(const o of t){const l=IEe(o,e.start,e.end);if(!l)continue;const c=aae({clip:o,fallbackIndex:a.length}),u=o.id??void 0,f=o.id?`#${o.id}`:void 0,h=Zv({id:c.id,fallbackIndex:a.length,domId:u,selector:f,selectorIndex:c.selectorIndex,sourceFile:n.sourceFile});a.push({...c,...REe(i.find(m=>m.key===h)),..._Ee(i.find(m=>m.key===h),u?s.get(u):void 0),key:h,start:l.start,duration:l.duration,track:e.track+.5*(a.length+1)/(t.length+1),authoredTrack:c.authoredTrack,stackingContextId:c.stackingContextId,expandedParentStart:n.start,expandedHostKey:r,domId:u,selector:f,sourceFile:n.sourceFile,timingSource:"authored"})}return a}function LEe(t,e,n){return t.filter(r=>r.parentId===e).map(r=>({id:r.id,label:r.label,start:n.start,duration:n.duration,track:n.track,kind:"element",tagName:null,compositionId:null,parentCompositionId:n.id??null,compositionSrc:n.compositionSrc??null,assetUrl:null,stackingContextId:r.stackingContextId}))}function FEe(t,e,n,r,i,s=[]){const a=t.find(d=>d.id===r||d.domId===r);if(!a)return Z2(t,n);const o=e.find(d=>d.id===i),l=(()=>{const d=e.filter(v=>v.id!=null&&n.get(v.id)===i);return d.length>0?d:LEe(s,i,o??a)})();if(l.length===0)return Z2(t,n);const c={start:(o==null?void 0:o.start)??a.start,sourceFile:(o==null?void 0:o.compositionSrc)??a.compositionSrc??void 0},u=a.key??a.id,f=new Map(s.map(d=>[d.id,d])),h=jEe(l,{start:a.start,end:a.start+a.duration,track:a.track},c,u,t,f);if(h.length===0)return Z2(t,n);const m=new Set;for(let d=i;d&&!(m.has(d)||(m.add(d),d===r));)d=n.get(d);const y=d=>m.has(i)&&t.some(v=>(v.domId??v.id)===i)?(d.domId??d.id)===i:(d.key??d.id)===u;return t.filter(d=>(d.key??d.id)===u||m.has(d.domId??d.id)||!n.has(d.domId??d.id)).flatMap(d=>y(d)?[d,...h]:[d])}function rS(){const t=fe(l=>l.elements),e=fe(l=>l.clipManifest),n=fe(l=>l.clipParentMap),r=fe(l=>l.domClipChildren),i=fe(l=>l.selectedElementId),s=fe(l=>l.currentTime),{rawId:a,selectedRawId:o}=x.useMemo(()=>!e||e.length===0||n.size===0?{rawId:null,selectedRawId:null}:{rawId:DEe({selectedElementId:i,currentTime:s,manifest:e,parentMap:n}),selectedRawId:cae(i,e,n)},[e,n,i,s]);return x.useMemo(()=>{if(!e||e.length===0||n.size===0)return t;if(!a)return Z2(t,n);const l=o?n.get(a):a;if(!l)return Z2(t,n);const c=EEe(a,n)??l;return FEe(t,e,n,c,l,r)},[t,e,n,r,a,o])}const $Ee={clip:"rgba(255,255,255,0.055)",clipActive:"rgba(60,230,172,0.16)",accent:"#3CE6AC",label:"rgba(255,255,255,0.5)"},Cj={shellBackground:"#0A0A0B",shellBorder:"rgba(255,255,255,0.05)",rulerBorder:"rgba(255,255,255,0.16)",rowBackground:"#101014",rowBorder:"rgba(255,255,255,0.06)",gutterBackground:"#0E0F12",gutterBorder:"rgba(255,255,255,0.10)",textPrimary:"rgba(255,255,255,0.92)",textSecondary:"rgba(255,255,255,0.62)",tickText:"rgba(255,255,255,0.34)",tickMajor:"rgba(255,255,255,0.10)",tickMinor:"rgba(255,255,255,0.06)",clipBackground:"#141922",clipBackgroundActive:"#181e28",clipBorder:"rgba(255,255,255,0.10)",clipBorderHover:"rgba(255,255,255,0.18)",clipBorderActive:"rgba(255,255,255,0.24)",clipShadow:"none",clipShadowHover:"0 2px 8px rgba(0,0,0,0.2)",clipShadowActive:"0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04)",clipShadowDragging:"0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06)",handleColor:"rgba(255,255,255,0.2)",panelResizeSeam:"rgba(255,255,255,0.12)",panelResizeActive:"rgba(255,255,255,0.24)",clipRadius:"8px"};function BEe(t){return $Ee}function VEe({isHovered:t,isSelected:e,isDragging:n}){return n?.95:e?.82:t?.76:0}function HEe({element:t,draggedElementId:e,previewStart:n,previewTrack:r}){return(t.key??t.id)!==e||n===null||r===null?t:{...t,start:n,track:r}}function Xt(t){return Math.round(t*1e3)/1e3}function ba(t){return Math.round(t*100)/100}function qI(t){var e,n;try{const r=pj(t);if(r!=null)return r;const i=(e=t.style)==null?void 0:e.zIndex;if(i&&i!=="auto"){const l=parseInt(i,10);if(Number.isFinite(l))return l}const s=(n=t.ownerDocument)==null?void 0:n.defaultView;if(!s)return 0;const a=s.getComputedStyle(t).zIndex;if(a==="auto"||a==="")return 0;const o=parseInt(a,10);return Number.isFinite(o)?o:0}catch{return 0}}function uae(t){return t.stackingContextId??t.parentCompositionId??t.compositionAncestors[0]??""}function fae(t){return{key:zn(t),track:t.track,zIndex:t.zIndex??0,stackingContextId:t.stackingContextId??null,parentCompositionId:t.parentCompositionId??null,compositionAncestors:t.compositionAncestors??[]}}function QEe(t,e){return t.start<e.start+e.duration&&e.start<t.start+t.duration}const LP=.35;function hae(t){var e;return((e=t.tag)==null?void 0:e.toLowerCase())==="audio"}function zEe(t,e){return t.elements.some(n=>zn(n)===e)}function dae(t,e,n){return t.elements.some(r=>zn(r)!==n&&QEe(r,e))}function pae(t,e,n){(e.zIndex??0)!==n&&t.push({key:zn(e),zIndex:n,domId:e.domId,selector:e.selector,selectorIndex:e.selectorIndex,sourceFile:e.sourceFile})}function mae(t,e,n,r){let i=0;for(const s of e.elements){if(zn(s)===r)continue;const o=t.length;pae(t,s,n),t.length>o&&(i+=1)}return i}function ZEe(t,e){return t.filter(n=>n.kind==="visual"&&n.contextKey===e)}function qv(t,e){return t.find(n=>n.id===e)??null}function iS(t){const e=[];return pae(e,t.element,t.targetZIndex),e}function GEe(t){const e=zn(t.element),n=t.bottomZIndex+1,r=iS({element:t.element,targetZIndex:n});let i=0,s=n+1;for(let a=t.beforeIndex;a>=0;a-=1){const o=t.layers[a];if(!o)continue;const l=o.zIndex>=s?o.zIndex:s;i+=mae(r,o,l,e),s=l+1}return{changes:r,siblingChanges:i}}function UEe(t){const e=zn(t.element),n=t.topZIndex-1,r=iS({element:t.element,targetZIndex:n});let i=0,s=n-1;for(let a=t.afterIndex;a<t.layers.length;a+=1){const o=t.layers[a];if(!o)continue;const l=o.zIndex<=s?o.zIndex:s;i+=mae(r,o,l,e),s=l-1}return{changes:r,siblingChanges:i}}function XEe(t){const e=t.beforeLayer.zIndex,n=t.afterLayer.zIndex;if(e-n>1)return iS({element:t.element,targetZIndex:Math.floor((e+n)/2)});const r=t.layers.findIndex(o=>o.id===t.beforeLayer.id),i=t.layers.findIndex(o=>o.id===t.afterLayer.id),s=GEe({element:t.element,layers:t.layers,beforeIndex:r,bottomZIndex:n}),a=UEe({element:t.element,layers:t.layers,afterIndex:i,topZIndex:e});return s.siblingChanges<=a.siblingChanges?s.changes:a.changes}function WEe(t){const e=qv(t.layers,t.layerId);return!e||dae(e,t.element,zn(t.element))?null:iS({element:t.element,targetZIndex:e.zIndex})}function OG(t){const e=qv(t.layers,t.layerId);return e?iS({element:t.element,targetZIndex:e.zIndex+t.offset}):null}function qEe(t){switch(t.placement.type){case"onto":return WEe({element:t.element,layers:t.layers,layerId:t.placement.layerId});case"above":return OG({element:t.element,layers:t.layers,layerId:t.placement.layerId,offset:1});case"below":return OG({element:t.element,layers:t.layers,layerId:t.placement.layerId,offset:-1});case"between":{const e=qv(t.layers,t.placement.beforeLayerId),n=qv(t.layers,t.placement.afterLayerId);return e&&n?XEe({element:t.element,layers:t.layers,beforeLayer:e,afterLayer:n}):null}}}function YEe(t){if(hae(t.element))return null;const e=uae(fae(t.element)),n=ZEe(t.layers,e),r=qEe({element:t.element,layers:n,placement:t.placement});return r&&r.length>0?{contextKey:e,placement:t.placement,zIndexChanges:r}:null}function KEe(t,e){const n=t[0],r=t[t.length-1];if(!n||!r)return null;if(e<-LP)return{type:"above",layerId:n.id};if(e>t.length-1+LP)return{type:"below",layerId:r.id};const i=Math.round(e),s=t[i];if(s&&Math.abs(e-i)<=LP)return{type:"onto",layerId:s.id};const a=Math.max(0,Math.min(t.length,Math.ceil(e)));if(a<=0)return{type:"above",layerId:n.id};if(a>=t.length)return{type:"below",layerId:r.id};const o=t[a-1],l=t[a];return o&&l?{type:"between",beforeLayerId:o.id,afterLayerId:l.id}:null}function JEe(t){if(t.placement.type!=="onto")return t.placement;const e=qv(t.layers,t.placement.layerId);return e?dae(e,t.element,t.draggedKey)?t.targetPosition<t.currentIndex?{type:"above",layerId:e.id}:t.targetPosition>t.currentIndex?{type:"below",layerId:e.id}:t.placement:t.placement:null}function e3e(t,e){return e.type==="onto"?e.layerId:e.type==="between"?`preview:${t}:between:${e.beforeLayerId}:${e.afterLayerId}`:`preview:${t}:${e.type}:${e.layerId}`}function t3e(t,e){if(e.type==="onto")return Math.max(0,t.indexOf(e.layerId));if(e.type==="between")return Math.max(0,t.indexOf(e.afterLayerId));const n=Math.max(0,t.indexOf(e.layerId));return e.type==="above"?n:n+1}function n3e(t){if(hae(t.element))return null;const e=uae(fae(t.element)),n=new Map(t.layers.map(c=>[c.id,c])),r=t.layerOrder.map(c=>n.get(c)??null).filter(c=>c!=null&&c.kind==="visual"&&c.contextKey===e),i=zn(t.element),s=r.findIndex(c=>zEe(c,i));if(s<0)return null;const a=s+t.trackDeltaRaw,o=KEe(r,a);if(!o)return null;const l=JEe({layers:r,element:t.element,draggedKey:i,placement:o,targetPosition:a,currentIndex:s});return l?{previewLayerId:e3e(i,l),previewLayerIndex:t3e(t.layerOrder,l),stackingReorder:YEe({element:t.element,layers:r,placement:l})}:null}const kd=72,G2=32,Lo=232,Ui=48,Ag=28,_a=24,fa=3,r3e=18;function i3e(t,e){let n=0,r=t.length;for(;n<r;){const i=Math.floor((n+r)/2);(t[i]??Number.POSITIVE_INFINITY)<e?n=i+1:r=i}return n}function kj(t,e,n,r=new Set){if(!(t!=null&&t.length))return[];const i=(n==null?void 0:n.start)??Number.NEGATIVE_INFINITY,s=(n==null?void 0:n.end)??Number.POSITIVE_INFINITY,a=new Set;for(let o=i3e(t,i);o<t.length;o++){const l=t[o];if(l===void 0||l>=s)break;a.add(o)}for(const o of r)o>=0&&o<t.length&&a.add(o);return[...a].sort((o,l)=>o-l).map(o=>({index:o,time:t[o],strength:e==null?void 0:e[o]}))}function Sg(t){return Ui+Math.max(0,Math.trunc(t))*Ag}const s3e=fa/Ui,e0=50,gae=Math.round(Ui*1.5),a3e=48;function o3e(t,e){return t.map(n=>{let r=0,i=0;for(const s of n)e!=null&&e.has(s.clipId)&&(r=Math.max(r,s.laneCount),i=Math.max(i,s.automationLaneCount??0));return Ui+Math.max(0,Math.trunc(r))*Ag+i*kd})}function O6(t){return t===void 0||!Number.isFinite(t)||t<=0?Ui:t}const YI=new WeakMap,bE=Object.freeze([]);function Ej(t,e){const n=Object.freeze(e.map(O6)),r=Object.freeze(n.map((f,h)=>{const m=t[h];return m!==void 0&&Number.isFinite(m)?m:h})),i=[0];for(const f of n)i.push((i.at(-1)??0)+f);Object.freeze(i);const s=new Map(r.map((f,h)=>[f,h])),a=f=>O6(n[f]),o=f=>{if(n.length===0)return f*Ui;if(f<=0)return f*a(0);if(f>=n.length)return(i[n.length]??0)+(f-n.length)*Ui;const h=Math.floor(f);return(i[h]??0)+(f-h)*a(h)},l=f=>{const h=f-_a-e0;if(n.length===0)return h/Ui;if(h<0)return h/a(0);const m=i[n.length]??0;if(h>=m)return n.length+(h-m)/Ui;let y=1,d=n.length;for(;y<d;){const b=Math.floor((y+d)/2);(i[b]??0)>h?d=b:y=b+1}const v=y-1;return v+(h-(i[v]??0))/a(v)},c={rowKeys:r,rowHeights:n,rowOffsets:i,rowsHeight:i.at(-1)??0,canvasHeight:_a+e0+(i.at(-1)??0)+gae,getRowIndex:f=>s.get(f)??-1,getRowHeight:a,getRowTop:f=>_a+e0+o(f),getRowFromY:l,getRowPositionFromY:f=>{const h=l(f),m=Math.floor(h);return{rowFloat:h,row:m,fraction:h-m,rowHeight:a(m)}}},u=Object.freeze(c);return YI.set(n,u),u}function Tj(t){const e=YI.get(t);if(e)return e;const n=Ej(t.map((r,i)=>i),t);return YI.set(t,n),n}function yae(t,e=bE){return O6(e[t])}function l3e(t,e){return Tj(e).getRowTop(t)-_a-e0}function FP(t,e=bE){return _a+e0+l3e(t,e)}function KI(t,e=bE){return Tj(e).getRowFromY(t)}function c3e(t,e=bE){return Tj(e).getRowPositionFromY(t)}function u3e(t){return fa/O6(t)}const CG=160,xae=60,f3e=1.2;function h3e(t,e,n){const r=Number.isFinite(e)&&e>0?e:0,i=Math.max(r*f3e,xae);return!Number.isFinite(t)||t<=n?100:(t-n-2)/i}function d3e(t){const e=Number.isFinite(t.pps)?Math.max(t.pps,0):0;return Math.max(t.trackContentWidth,t.viewportWidth-t.contentOrigin-2,t.dragGhostEndPx??0,t.resizeGhostEndPx??0,xae*e)}function vE(t){return t.clientX-t.rectLeft+t.scrollLeft-t.contentOrigin}function p3e(t,e,n){return t==="fit"||!Number.isFinite(e)||!Number.isFinite(n)?!1:e-n>1}function m3e(t,e,n){return e==="fit"?0:n}function kG(t){const e=Math.max(0,t.currentPixelsPerSecond),n=Math.max(0,t.nextPixelsPerSecond);if(!Number.isFinite(t.pointerX)||!Number.isFinite(t.currentScrollLeft)||!Number.isFinite(t.duration)||t.duration<=0||e<=0||n<=0)return Math.max(0,t.currentScrollLeft);const r=Math.max(0,vE({clientX:t.pointerX,rectLeft:0,scrollLeft:t.currentScrollLeft,contentOrigin:t.contentOrigin})),i=Math.max(0,Math.min(t.duration,r/e));return Math.max(0,t.contentOrigin+i*n-t.pointerX)}const C6=9;function JI(t,e,n){return!Number.isFinite(t)||!Number.isFinite(e)?n-C6/2:n+Math.max(0,t)*Math.max(0,e)-C6/2}function bae(t){const{clientX:e,viewportLeft:n,scrollLeft:r,contentOrigin:i,pixelsPerSecond:s,duration:a}=t;if(!(s>0)||!Number.isFinite(a))return 0;const o=vE({clientX:e,rectLeft:n,scrollLeft:r,contentOrigin:i});return Math.max(0,Math.min(a,o/s))}const EG=.75;function g3e(t){const e=Number.isFinite(t.currentScrollLeft)?Math.max(0,t.currentScrollLeft):0,n=Number.isFinite(t.maxScrollLeft)?Math.max(0,t.maxScrollLeft):0,r=t.viewportWidth-t.contentOrigin;if(!Number.isFinite(t.playheadX)||!Number.isFinite(t.contentOrigin)||!Number.isFinite(r)||r<=0||n<=0)return Math.min(n,e);const i=e+t.contentOrigin,s=i+r*EG;let a=e;return t.playheadX>s?a=t.playheadX-t.contentOrigin-r*EG:t.playheadX<i&&(a=t.playheadX-t.contentOrigin),Math.max(0,Math.min(n,a))}function y3e(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?!0:t-e<=1}function x3e(t,e){return t.length===0?0:e==null||e<0?t[0]:e>=t.length?Math.max(...t)+1:t[e]??t[t.length-1]??0}function b3e(t,e,n){const r=vE({clientX:e,rectLeft:t.rectLeft,scrollLeft:t.scrollLeft,contentOrigin:t.contentOrigin}),i=n-t.rectTop+t.scrollTop,s=Math.round(r/Math.max(t.pixelsPerSecond,1)*100)/100,a=Math.max(0,t.clampStartToDuration===!1?s:Math.min(t.duration,s)),o=Math.floor(KI(i,t.rowHeights));return{start:a,track:x3e(t.trackOrder,o)}}function v3e(t){return t.kind==="composition"||t.compositionSrc||t.playbackStartAttr!=null||t.sourceDuration!=null&&Number.isFinite(t.sourceDuration)&&t.sourceDuration>0?!0:["video","audio","img"].includes(t.tag.toLowerCase())}function A3e(t){return!!(t.domId||t.selector)}function sS(t){if(t.timingSource==="implicit"||t.timelineLocked)return{canMove:!1,canTrimStart:!1,canTrimEnd:!1};const e=A3e(t),n=Number.isFinite(t.duration)&&t.duration>0,r=v3e(t);return{canMove:e&&(r||n),canTrimEnd:e&&n,canTrimStart:e&&n}}const S3e=.1,w3e=.05;function O3e(t,e,n){return Math.min(Math.max(t,e),n)}function w1(t){return ba(t)}function AE(t){return Math.max(w3e,t??S3e)}function vae(t){return Math.max(.1,t??1)}function Aae(t,e,n){const r=vae(t.playbackRate),i=t.playbackStart!=null?t.playbackStart/r:Number.POSITIVE_INFINITY;return{minDelta:-Math.min(t.start-e,i),maxDelta:t.duration-n}}function Sae(t,e){const n=vae(t.playbackRate);return{start:t.start+e,duration:t.duration-e,playbackStart:t.playbackStart!=null?Math.max(0,t.playbackStart+e*n):void 0}}function C3e(t,e,n,r=AE()){if(e.length===0)return 0;if(n==="end"){const o=Math.max(...e.map(l=>r-l.duration));return w1(Math.max(t,o))}const i=e.map(o=>Aae(o,0,r)),s=Math.max(...i.map(o=>o.minDelta)),a=Math.min(...i.map(o=>o.maxDelta));return w1(O3e(t,s,a))}function k3e(t,e,n,r=AE()){const i=C3e(n,t,e,r);return{delta:i,members:t.map(s=>{if(e==="end")return{start:s.start,duration:w1(s.duration+i),playbackStart:s.playbackStart};const a=Sae(s,i);return{start:w1(a.start),duration:w1(a.duration),playbackStart:a.playbackStart!=null?w1(a.playbackStart):void 0}})}}function TG(t){return t.key??t.id}function E3e(t){const e=t.tag.toLowerCase();return t.kind==="composition"||e==="audio"||e==="video"}function T3e(t,e){const n=sS({tag:t.tag,kind:t.kind,duration:t.duration,domId:t.domId,selector:t.selector,compositionSrc:t.compositionSrc,playbackStart:t.playbackStart,playbackStartAttr:t.playbackStartAttr,sourceDuration:t.sourceDuration,timingSource:t.timingSource,timelineLocked:t.timelineLocked});return e==="start"?n.canTrimStart:n.canTrimEnd}function P3e(t,e,n,r){if(e.size<=1||!e.has(n))return null;const i=t.filter(s=>e.has(TG(s)));return i.length<=1||!i.every(s=>T3e(s,r))?null:i.map(s=>({element:s,key:TG(s),start:s.start,duration:s.duration,playbackStart:r==="start"&&E3e(s)?s.playbackStart??0:s.playbackStart,playbackRate:s.playbackRate}))}function M3e(t,e,n,r=AE()){return k3e(t,e,n,r).members.map((s,a)=>({element:t[a].element,key:t[a].key,start:s.start,duration:s.duration,playbackStart:s.playbackStart}))}function N3e(t,e){const n=t.members.find(s=>s.key===t.grabbedKey),r=t.edge==="start"?e.previewStart-((n==null?void 0:n.start)??e.previewStart):e.previewDuration-((n==null?void 0:n.duration)??e.previewDuration),i=M3e(t.members,t.edge,r);return t.changes=i,t.hasChanged=i.some((s,a)=>s.start!==t.members[a].start||s.duration!==t.members[a].duration||s.playbackStart!==t.members[a].playbackStart),i.find(s=>s.key===t.grabbedKey)}const O1=ba;function Yv(t,e,n){return Math.min(Math.max(t,e),n)}const PG=.55,RO=40,MG=12;function Pj(t,e,n,r=0){const i=(a,o,l)=>{if(l<a+RO){const c=Math.min(1,Math.max(0,1-(l-a)/RO));return-Math.round(MG*c)}if(l>o-RO){const c=Math.min(1,Math.max(0,1-(o-l)/RO));return Math.round(MG*c)}return 0},s=Math.min(t.right,t.left+Math.max(0,r));return{x:i(s,t.right,e),y:i(t.top,t.bottom,n)}}function D3e(t,e,n){const r=(t.currentScrollLeft??0)-(t.originScrollLeft??0),i=(e-t.originClientX+r)/Math.max(t.pixelsPerSecond,1),s=n-t.originRow,a=Math.round(s),o=Yv(O1(t.start+i),0,Math.max(0,t.maxStart));if(t.stackingElement){const v=t.timelineLayers&&t.layerOrder?n3e({element:{...t.stackingElement,duration:t.duration},layers:t.timelineLayers,layerOrder:t.layerOrder,trackDeltaRaw:s}):null;return{start:o,track:t.track,previewLayerId:v==null?void 0:v.previewLayerId,previewLayerIndex:v==null?void 0:v.previewLayerIndex,stackingReorder:(v==null?void 0:v.stackingReorder)??null}}const l=Math.max(0,t.trackOrder.indexOf(t.track)),c=l+a,u=Yv(c,0,Math.max(0,t.trackOrder.length-1)),f=Math.min(...t.trackOrder),h=Math.max(...t.trackOrder);let m=t.trackOrder[u]??t.track;const y=l===0,d=l===t.trackOrder.length-1;return y&&c<0&&l+s<=-PG?m=f-1:d&&c>t.trackOrder.length-1&&l+s>=t.trackOrder.length-1+PG&&(m=h+1),{start:o,track:m}}function I3e(t,e,n){const r=AE(t.minDuration),i=(n-t.originClientX)/Math.max(t.pixelsPerSecond,1);if(e==="end"){const c=Yv(O1(t.duration+i),r,Math.max(r,t.maxEnd-t.start));return{start:t.start,duration:c,playbackStart:t.playbackStart}}const{minDelta:s,maxDelta:a}=Aae(t,t.minStart,r),o=Yv(i,s,a),l=Sae(t,o);return{start:O1(l.start),duration:O1(l.duration),playbackStart:l.playbackStart!=null?O1(l.playbackStart):void 0}}function _3e(t){if(t.capabilities.canMove)return null;const e=Math.max(0,t.width),n=Yv(t.offsetX,0,e),r=Math.max(0,t.handleWidth);return n<=r&&!t.capabilities.canTrimStart?"resize-start":n>=Math.max(0,e-r)&&!t.capabilities.canTrimEnd?"resize-end":"move"}function R3e(t,e){return{start:t.start,end:t.start+t.duration,anchorX:e.anchorX,anchorY:e.anchorY}}function j3e({rangeStart:t,rangeEnd:e,elements:n,prompt:r}){const i=Math.min(t,e),s=Math.max(t,e),a=n.map(o=>`- #${o.id} (${o.tag}) - ${as(o.start)} to ${as(o.start+o.duration)}, track ${o.track}`).join(`
|
|
72
72
|
`);return`Edit the following HyperFrames composition:
|
|
73
73
|
|
|
@@ -201,7 +201,7 @@ Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=1
|
|
|
201
201
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Zn.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
|
|
202
202
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return $f(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,e=this.input.charCodeAt(this.pos),(r!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-r.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return dy(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};Zn.readHexChar=function(t){var e=this.pos,n=this.readInt(16,t);return n===null&&this.invalidStringToken(e,"Bad character escape sequence"),n};Zn.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Td(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,t+=this.input.slice(n,this.pos);var s=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(e?Eu:Td)(a,r)||this.invalidStringToken(s,"Invalid Unicode escape"),t+=$f(a),n=this.pos}else break;e=!1}return t+this.input.slice(n,this.pos)};Zn.readWord=function(){var t=this.readWord1(),e=he.name;return this.keywords.test(t)&&(e=Kj[t]),this.finishToken(e,t)};var TMe="8.17.0";ys.acorn={Parser:ys,version:TMe,defaultOptions:u_,Position:Jv,SourceLocation:TE,getLineInfo:ule,Node:DE,TokenType:lr,tokTypes:he,keywordTypes:Kj,TokContext:ec,tokContexts:mi,isIdentifierChar:Td,isIdentifierStart:Eu,Token:iL,isNewLine:dy,lineBreak:xo,lineBreakG:qPe,nonASCIIwhitespace:lle};function eA(t,e){return ys.parse(t,e)}function Q0(t,e,n,r,i){n||(n=dt),(function s(a,o,l){var c=l||a.type;aL(n,c,a,o,s),e[c]&&e[c](a,o)})(t,r,i)}function Of(t,e,n,r,i){var s=[];n||(n=dt),(function a(o,l,c){var u=c||o.type,f=o!==s[s.length-1];f&&s.push(o),aL(n,u,o,l,a),e[u]&&e[u](o,l||s,s),f&&s.pop()})(t,r,i)}function PMe(t,e,n,r,i){n||(n=dt);var s;(function a(o,l,c){var u=c||o.type;aL(n,u,o,l,a),s!==o&&(e(o,l,u),s=o)})(t,r,i)}function sL(t,e,n){n(t,e)}function z0(t,e,n){}function aL(t,e,n,r,i){if(t[e]==null)throw new Error("No walker function defined for node type "+e);t[e](n,r,i)}var dt={};dt.Program=dt.BlockStatement=dt.StaticBlock=function(t,e,n){for(var r=0,i=t.body;r<i.length;r+=1){var s=i[r];n(s,e,"Statement")}};dt.Statement=sL;dt.EmptyStatement=z0;dt.ExpressionStatement=dt.ParenthesizedExpression=dt.ChainExpression=function(t,e,n){return n(t.expression,e,"Expression")};dt.IfStatement=function(t,e,n){n(t.test,e,"Expression"),n(t.consequent,e,"Statement"),t.alternate&&n(t.alternate,e,"Statement")};dt.LabeledStatement=function(t,e,n){return n(t.body,e,"Statement")};dt.BreakStatement=dt.ContinueStatement=z0;dt.WithStatement=function(t,e,n){n(t.object,e,"Expression"),n(t.body,e,"Statement")};dt.SwitchStatement=function(t,e,n){n(t.discriminant,e,"Expression");for(var r=0,i=t.cases;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.SwitchCase=function(t,e,n){t.test&&n(t.test,e,"Expression");for(var r=0,i=t.consequent;r<i.length;r+=1){var s=i[r];n(s,e,"Statement")}};dt.ReturnStatement=dt.YieldExpression=dt.AwaitExpression=function(t,e,n){t.argument&&n(t.argument,e,"Expression")};dt.ThrowStatement=dt.SpreadElement=function(t,e,n){return n(t.argument,e,"Expression")};dt.TryStatement=function(t,e,n){n(t.block,e,"Statement"),t.handler&&n(t.handler,e),t.finalizer&&n(t.finalizer,e,"Statement")};dt.CatchClause=function(t,e,n){t.param&&n(t.param,e,"Pattern"),n(t.body,e,"Statement")};dt.WhileStatement=dt.DoWhileStatement=function(t,e,n){n(t.test,e,"Expression"),n(t.body,e,"Statement")};dt.ForStatement=function(t,e,n){t.init&&n(t.init,e,"ForInit"),t.test&&n(t.test,e,"Expression"),t.update&&n(t.update,e,"Expression"),n(t.body,e,"Statement")};dt.ForInStatement=dt.ForOfStatement=function(t,e,n){n(t.left,e,"ForInit"),n(t.right,e,"Expression"),n(t.body,e,"Statement")};dt.ForInit=function(t,e,n){t.type==="VariableDeclaration"?n(t,e):n(t,e,"Expression")};dt.DebuggerStatement=z0;dt.FunctionDeclaration=function(t,e,n){return n(t,e,"Function")};dt.VariableDeclaration=function(t,e,n){for(var r=0,i=t.declarations;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.VariableDeclarator=function(t,e,n){n(t.id,e,"Pattern"),t.init&&n(t.init,e,"Expression")};dt.Function=function(t,e,n){t.id&&n(t.id,e,"Pattern");for(var r=0,i=t.params;r<i.length;r+=1){var s=i[r];n(s,e,"Pattern")}n(t.body,e,t.expression?"Expression":"Statement")};dt.Pattern=function(t,e,n){t.type==="Identifier"?n(t,e,"VariablePattern"):t.type==="MemberExpression"?n(t,e,"MemberPattern"):n(t,e)};dt.VariablePattern=z0;dt.MemberPattern=sL;dt.RestElement=function(t,e,n){return n(t.argument,e,"Pattern")};dt.ArrayPattern=function(t,e,n){for(var r=0,i=t.elements;r<i.length;r+=1){var s=i[r];s&&n(s,e,"Pattern")}};dt.ObjectPattern=function(t,e,n){for(var r=0,i=t.properties;r<i.length;r+=1){var s=i[r];s.type==="Property"?(s.computed&&n(s.key,e,"Expression"),n(s.value,e,"Pattern")):s.type==="RestElement"&&n(s.argument,e,"Pattern")}};dt.Expression=sL;dt.ThisExpression=dt.Super=dt.MetaProperty=z0;dt.ArrayExpression=function(t,e,n){for(var r=0,i=t.elements;r<i.length;r+=1){var s=i[r];s&&n(s,e,"Expression")}};dt.ObjectExpression=function(t,e,n){for(var r=0,i=t.properties;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.FunctionExpression=dt.ArrowFunctionExpression=dt.FunctionDeclaration;dt.SequenceExpression=function(t,e,n){for(var r=0,i=t.expressions;r<i.length;r+=1){var s=i[r];n(s,e,"Expression")}};dt.TemplateLiteral=function(t,e,n){for(var r=0,i=t.quasis;r<i.length;r+=1){var s=i[r];n(s,e)}for(var a=0,o=t.expressions;a<o.length;a+=1){var l=o[a];n(l,e,"Expression")}};dt.TemplateElement=z0;dt.UnaryExpression=dt.UpdateExpression=function(t,e,n){n(t.argument,e,"Expression")};dt.BinaryExpression=dt.LogicalExpression=function(t,e,n){n(t.left,e,"Expression"),n(t.right,e,"Expression")};dt.AssignmentExpression=dt.AssignmentPattern=function(t,e,n){n(t.left,e,"Pattern"),n(t.right,e,"Expression")};dt.ConditionalExpression=function(t,e,n){n(t.test,e,"Expression"),n(t.consequent,e,"Expression"),n(t.alternate,e,"Expression")};dt.NewExpression=dt.CallExpression=function(t,e,n){if(n(t.callee,e,"Expression"),t.arguments)for(var r=0,i=t.arguments;r<i.length;r+=1){var s=i[r];n(s,e,"Expression")}};dt.MemberExpression=function(t,e,n){n(t.object,e,"Expression"),t.computed&&n(t.property,e,"Expression")};dt.ExportNamedDeclaration=dt.ExportDefaultDeclaration=function(t,e,n){if(t.declaration&&n(t.declaration,e,t.type==="ExportNamedDeclaration"||t.declaration.id?"Statement":"Expression"),t.source&&n(t.source,e,"Expression"),t.attributes)for(var r=0,i=t.attributes;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.ExportAllDeclaration=function(t,e,n){if(t.exported&&n(t.exported,e),n(t.source,e,"Expression"),t.attributes)for(var r=0,i=t.attributes;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.ImportAttribute=function(t,e,n){n(t.value,e,"Expression")};dt.ImportDeclaration=function(t,e,n){for(var r=0,i=t.specifiers;r<i.length;r+=1){var s=i[r];n(s,e)}if(n(t.source,e,"Expression"),t.attributes)for(var a=0,o=t.attributes;a<o.length;a+=1){var l=o[a];n(l,e)}};dt.ImportExpression=function(t,e,n){n(t.source,e,"Expression"),t.options&&n(t.options,e,"Expression")};dt.ImportSpecifier=dt.ImportDefaultSpecifier=dt.ImportNamespaceSpecifier=dt.Identifier=dt.PrivateIdentifier=dt.Literal=z0;dt.TaggedTemplateExpression=function(t,e,n){n(t.tag,e,"Expression"),n(t.quasi,e,"Expression")};dt.ClassDeclaration=dt.ClassExpression=function(t,e,n){return n(t,e,"Class")};dt.Class=function(t,e,n){t.id&&n(t.id,e,"Pattern"),t.superClass&&n(t.superClass,e,"Expression"),n(t.body,e)};dt.ClassBody=function(t,e,n){for(var r=0,i=t.body;r<i.length;r+=1){var s=i[r];n(s,e)}};dt.MethodDefinition=dt.PropertyDefinition=dt.Property=function(t,e,n){t.computed&&n(t.key,e,"Expression"),t.value&&n(t.value,e,"Expression")};const oL=new Set(["type","start","end","loc","range","__hfProvenance","__hfOrder"]),MMe=new Set(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"]),NMe=new Set(["set","to","from","fromTo"]),DMe=8,IMe=512;function lL(t){return!!t&&MMe.has(t.type)}function _E(t){return!!t&&typeof t=="object"&&typeof t.type=="string"}function Vle(t,e){for(const n of Object.keys(t)){if(oL.has(n)||Hle(t,n))continue;const r=t[n];if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=e(r[i]);else t[n]=e(r)}}function cL(t){return structuredClone(t)}function d_(t,e){(t==null?void 0:t.type)==="Identifier"?e.add(t.name):(t==null?void 0:t.type)==="AssignmentPattern"?d_(t.left,e):(t==null?void 0:t.type)==="RestElement"&&d_(t.argument,e)}function _Me(t){var e;return lL(t)?t.params??[]:t.type==="VariableDeclarator"?[t.id]:t.type==="CatchClause"?[t.param]:t.type==="AssignmentExpression"&&((e=t.left)==null?void 0:e.type)==="Identifier"?[t.left]:[]}function RMe(t){const e=new Set,n=r=>{if(!_E(r))return r;for(const i of _Me(r))d_(i,e);return Vle(r,n),r};return n(t),e}function Hle(t,e){return t.computed?!1:t.type==="MemberExpression"&&e==="property"||t.type==="Property"&&e==="key"}function Qle(t,e){const n=RMe(t);let r=e;if(n.size>0){r=new Map(e);for(const i of n)r.delete(i)}return r.size===0?t:zle(t,r)}function zle(t,e){return _E(t)?t.type==="Identifier"&&e.has(t.name)?cL(e.get(t.name)):(Vle(t,n=>zle(n,e)),t):t}function Zle(t,e){return t&&typeof t=="object"&&(t.__hfProvenance=e),t}function w4(t){return t==null?void 0:t.__hfProvenance}function Gle(t){return{type:"Literal",value:t,raw:String(t)}}function Og(t,e){if(_E(t)){e(t);for(const n of Object.keys(t)){if(oL.has(n))continue;const r=t[n];if(Array.isArray(r))for(const i of r)Og(i,e);else Og(r,e)}}}function jMe(t){var n,r;let e=(n=t.callee)==null?void 0:n.object;for(;(e==null?void 0:e.type)==="CallExpression";)e=(r=e.callee)==null?void 0:r.object;return(e==null?void 0:e.type)==="Identifier"?e.name:null}function Ule(t,e){var n,r;return jMe(t)!==e?!1:((r=(n=t.callee)==null?void 0:n.property)==null?void 0:r.type)==="Identifier"&&NMe.has(t.callee.property.name)}function LMe(t,e){let n=!1;return Og(t,r=>{r.type==="CallExpression"&&Ule(r,e)&&(n=!0)}),n}function RE(t){return typeof t.start=="number"&&typeof t.end=="number"?[t.start,t.end]:void 0}const FMe=new Set(["ArrayExpression","BinaryExpression","ChainExpression","ConditionalExpression","Identifier","Literal","LogicalExpression","MemberExpression","ObjectExpression","Property","SpreadElement","TemplateElement","TemplateLiteral","UnaryExpression"]);function $Me(t,e){let n=!0;const r=(i,s,a)=>{if(!(!_E(i)||!n)){if(!FMe.has(i.type)){n=!1;return}if(i.type==="UnaryExpression"&&i.operator==="delete"){n=!1;return}if(i.type==="Identifier"){!(s&&a?Hle(s,a):!1)&&i.name!=="undefined"&&!e.has(i.name)&&(n=!1);return}for(const o of Object.keys(i)){if(oL.has(o))continue;const l=i[o];if(Array.isArray(l))for(const c of l)r(c,i,o);else r(l,i,o)}}};return r(t),n}const QO=new WeakMap;function BMe(t,e){var n;return t.type==="Identifier"?{name:t.name}:t.type!=="AssignmentPattern"||((n=t.left)==null?void 0:n.type)!=="Identifier"||!$Me(t.right,e)?null:{name:t.left.name,defaultExpression:t.right}}function uL(t){if(QO.has(t))return QO.get(t)??null;const e=[],n=new Set;for(const r of t.params??[]){const i=BMe(r,n);if(!i)return QO.set(t,null),null;e.push(i),n.add(i.name)}return QO.set(t,e),e}function Xle(t){var e;return lL(t)&&((e=t.body)==null?void 0:e.type)==="BlockStatement"&&uL(t)!==null}function VMe(t,e){let n=!1;return Og(t,r=>{var i;r.type==="CallExpression"&&((i=r.callee)==null?void 0:i.type)==="Identifier"&&e.has(r.callee.name)&&(n=!0)}),n}function HMe(t){var n,r;if(((n=t.declarations)==null?void 0:n.length)!==1)return null;const e=t.declarations[0];return((r=e.id)==null?void 0:r.type)==="Identifier"&&Xle(e.init)?[e.id.name,e.init]:null}function QMe(t){return t.type==="FunctionDeclaration"?t.id&&Xle(t)?[t.id.name,t]:null:t.type==="VariableDeclaration"?HMe(t):null}function zMe(t){const e=new Map;for(const n of t.body??[]){const r=QMe(n);r&&e.set(r[0],r[1])}return e}function ZMe(t,e){const n=new Set;for(const[r,i]of t)LMe(i.body,e)&&n.add(r);for(let r=!0;r;){r=!1;for(const[i,s]of t)!n.has(i)&&VMe(s.body,n)&&(n.add(i),r=!0)}return n}function JU(t,e){t.set(e,(t.get(e)??0)+1)}function GMe(){return{type:"Identifier",name:"undefined"}}function UMe(t){var e;return(t==null?void 0:t.type)==="Identifier"&&t.name==="undefined"||(t==null?void 0:t.type)==="UnaryExpression"&&t.operator==="void"&&((e=t.argument)==null?void 0:e.type)==="Literal"&&t.argument.value===0}function Wle(t,e){var r,i;if((r=t.arguments)!=null&&r.some(s=>(s==null?void 0:s.type)==="SpreadElement"))return null;const n=new Map;for(let s=0;s<e.length;s++){const a=e[s],o=(i=t.arguments)==null?void 0:i[s];o&&!UMe(o)?n.set(a.name,o):a.defaultExpression?n.set(a.name,Qle(cL(a.defaultExpression),n)):n.set(a.name,GMe())}return n}function XMe(t,e){var r;if(t.type!=="ExpressionStatement")return;const n=t.expression;if(!((n==null?void 0:n.type)!=="CallExpression"||((r=n.callee)==null?void 0:r.type)!=="Identifier"))return e.has(n.callee.name)?n:void 0}function WMe(t,e){const n=new Set(e.keys()),r=new Map,i=new Map,s=new Set;Og(t,o=>{o.type==="Identifier"&&n.has(o.name)&&JU(r,o.name);const l=XMe(o,n);if(!l)return;JU(i,l.callee.name);const c=e.get(l.callee.name),u=c&&uL(c);(!u||!Wle(l,u))&&s.add(l.callee.name)});const a=new Map;for(const[o,l]of e)!s.has(o)&&(r.get(o)??0)===1+(i.get(o)??0)&&a.set(o,l);return a}function qMe(t,e){const n=zMe(t);if(n.size===0)return n;const r=ZMe(n,e);for(const i of[...n.keys()])r.has(i)||n.delete(i);return n.size===0?n:WMe(t,n)}function YMe(t,e){var n,r;if(t.type==="FunctionDeclaration")return!!t.id&&e.get(t.id.name)===t;if(t.type==="VariableDeclaration"&&((n=t.declarations)==null?void 0:n.length)===1){const i=t.declarations[0];return((r=i.id)==null?void 0:r.type)==="Identifier"&&e.get(i.id.name)===i.init}return!1}function fL(t){return(t==null?void 0:t.type)==="BlockStatement"?t.body??[]:t?[{type:"ExpressionStatement",expression:t}]:[]}function KMe(t,e,n){for(const r of t)Og(r,i=>{i.type==="CallExpression"&&Ule(i,n.timelineVar)&&(Zle(i,{...e}),i.__hfOrder=n.order.n++)})}function hL(t,e,n,r){const i=Qle(cL({type:"BlockStatement",body:t}),e);return Zle(i,n),KMe(i.body,n,r),i.body=Yle(i.body,{...r,depth:r.depth+1}),[i]}function JMe(t,e){const n=e.helpers.get(t.callee.name);if(!n)return null;const r=uL(n);if(!r)return null;const i=Wle(t,r);if(!i)return null;const s={kind:"helper",fn:t.callee.name,callSite:++e.site.n,sourceRange:RE(t)};return hL(n.body.body,i,s,e)}function eNe(t,e){var n;if(t.operator==="+=")return Y2(e(t.right));if(t.operator==="-="){const r=Y2(e(t.right));return r===void 0?void 0:-r}if(t.operator==="="&&((n=t.right)==null?void 0:n.type)==="BinaryExpression")return Y2(e(t.right.right))}function tNe(t){var e,n;return(t==null?void 0:t.type)==="UpdateExpression"?((e=t.argument)==null?void 0:e.name)??null:(t==null?void 0:t.type)==="AssignmentExpression"?((n=t.left)==null?void 0:n.name)??null:null}function nNe(t,e,n){if(tNe(t)===e)return t.type==="UpdateExpression"?t.operator==="++"?1:-1:eNe(t,n)}function Y2(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function rNe(t,e,n){return t==="<"?e<n:t==="<="?e<=n:t===">"?e>n:t===">="?e>=n:!1}function iNe(t){var n,r;if((t==null?void 0:t.type)!=="VariableDeclaration"||((n=t.declarations)==null?void 0:n.length)!==1)return null;const e=t.declarations[0];return((r=e.id)==null?void 0:r.type)==="Identifier"?{name:e.id.name,initExpr:e.init}:null}function sNe(t,e){var o;const n=iNe(t.init),r=t.test;if(!n||(r==null?void 0:r.type)!=="BinaryExpression"||((o=r.left)==null?void 0:o.name)!==n.name)return null;const i=Y2(e(n.initExpr)),s=Y2(e(r.right)),a=nNe(t.update,n.name,e);return i===void 0||s===void 0||!a?null:{v:n.name,start:i,end:s,op:r.operator,step:a}}function aNe(t,e){const n=sNe(t,e.resolve);if(!n)return null;const r=fL(t.body),i=[],s=++e.site.n;let a=0;for(let o=n.start;rNe(n.op,o,n.end);o+=n.step){if(a>=IMe)return null;const l={kind:"loop",callSite:s,iteration:a,sourceRange:RE(t)};i.push(...hL(r,new Map([[n.v,Gle(o)]]),l,e)),a++}return i}function oNe(t){var e,n;if((t==null?void 0:t.type)==="VariableDeclaration"){const r=(n=(e=t.declarations)==null?void 0:e[0])==null?void 0:n.id;return(r==null?void 0:r.type)==="Identifier"?r.name:null}return(t==null?void 0:t.type)==="Identifier"?t.name:null}function qle(t,e,n,r,i,s){const a=[],o=++s.site.n;return t.forEach((l,c)=>{if(!l)return;const u=new Map;n&&u.set(n,l),r&&u.set(r,Gle(c));const f={kind:"loop",callSite:o,iteration:c,sourceRange:i};a.push(...hL(e,u,f,s))}),a}function lNe(t,e){var r;if(((r=t.right)==null?void 0:r.type)!=="ArrayExpression")return null;const n=oNe(t.left);return n?qle(t.right.elements??[],fL(t.body),n,null,RE(t),e):null}function cNe(t){var n,r;const e=[];for(const i of[(n=t.params)==null?void 0:n[0],(r=t.params)==null?void 0:r[1]])if(!i)e.push(null);else{if(i.type!=="Identifier")return null;e.push(i.name)}return{el:e[0],idx:e[1]}}function uNe(t){var e,n;return(t==null?void 0:t.type)==="MemberExpression"&&((e=t.property)==null?void 0:e.name)==="forEach"&&((n=t.object)==null?void 0:n.type)==="ArrayExpression"}function fNe(t){var n;if(!uNe(t.callee))return null;const e=(n=t.arguments)==null?void 0:n[0];return lL(e)?{elements:t.callee.object.elements??[],cb:e}:null}function hNe(t,e){const n=fNe(t);if(!n)return null;const r=cNe(n.cb);return r?qle(n.elements,fL(n.cb.body),r.el,r.idx,RE(t),e):null}function dNe(t,e){var n;return((n=t.callee)==null?void 0:n.type)==="Identifier"&&e.helpers.has(t.callee.name)?JMe(t,e):hNe(t,e)}function pNe(t,e){var n;return e.depth>=DMe?null:t.type==="ForStatement"?aNe(t,e):t.type==="ForOfStatement"?lNe(t,e):t.type==="ExpressionStatement"&&((n=t.expression)==null?void 0:n.type)==="CallExpression"?dNe(t.expression,e):null}function Yle(t,e){const n=[];for(const r of t){const i=pNe(r,e);i?n.push(...i):n.push(r)}return n}function mNe(t,e,n){const r=qMe(t,e),i={helpers:r,timelineVar:e,resolve:n,depth:0,site:{n:0},order:{n:0}},s=(t.body??[]).filter(a=>!YMe(a,r));t.body=Yle(s,i)}const gNe=new Set(["set","to","from","fromTo"]),yNe=new Set(["querySelector","querySelectorAll"]),xNe=new Set(["forEach","map"]),Kle=new Set(["Program","BlockStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]);function bNe(t){try{return eA(t,{ecmaVersion:"latest",sourceType:"script",locations:!0})}catch{return eA(t,{ecmaVersion:"latest",sourceType:"module",locations:!0})}}const Jle=Symbol("hf.constNodes");function vNe(t){return t[Jle]}const ANe=new Set(["min","max","round","floor","ceil","abs","sqrt","sign","trunc"]),SNe={PI:Math.PI,E:Math.E,SQRT2:Math.SQRT2};function wNe(t,e){var i,s,a,o,l;if(((i=t.object)==null?void 0:i.type)==="Identifier"&&t.object.name==="Math"){const c=(s=t.property)==null?void 0:s.name;return typeof c=="string"?SNe[c]:void 0}const n=dL(t.object,e);if(!n)return;let r;if(t.computed){const c=os(t.property,e);n.type==="ArrayExpression"&&typeof c=="number"?r=(a=n.elements)==null?void 0:a[c]:n.type==="ObjectExpression"&&(typeof c=="string"||typeof c=="number")&&(r=Pd(n,String(c)))}else n.type==="ObjectExpression"&&(r=Pd(n,((o=t.property)==null?void 0:o.name)??((l=t.property)==null?void 0:l.value)));return r?os(r,e):void 0}function ONe(t,e,n){var i,s,a;if(!e.computed)return t.type==="ObjectExpression"?Pd(t,((i=e.property)==null?void 0:i.name)??((s=e.property)==null?void 0:s.value)):void 0;const r=os(e.property,n);if(t.type==="ArrayExpression"&&typeof r=="number")return(a=t.elements)==null?void 0:a[r];if(t.type==="ObjectExpression")return Pd(t,String(r))}function dL(t,e){var r;if(!t)return;if(t.type==="ArrayExpression"||t.type==="ObjectExpression")return t;if(t.type==="Identifier")return(r=vNe(e))==null?void 0:r.get(t.name);if(t.type!=="MemberExpression")return;const n=dL(t.object,e);return n?ONe(n,t,e):void 0}function os(t,e){var n,r,i,s,a,o,l;if(t){if(t.type==="NumericLiteral"||t.type==="Literal"&&typeof t.value=="number"||t.type==="StringLiteral"||t.type==="Literal"&&typeof t.value=="string"||t.type==="BooleanLiteral"||t.type==="Literal"&&typeof t.value=="boolean")return t.value;if(t.type==="UnaryExpression"&&t.operator==="-"&&t.argument){const c=os(t.argument,e);return typeof c=="number"?-c:void 0}if(t.type==="BinaryExpression"){const c=os(t.left,e),u=os(t.right,e);if(typeof c=="number"&&typeof u=="number")switch(t.operator){case"+":return c+u;case"-":return c-u;case"*":return c*u;case"/":return u!==0?c/u:void 0}if(typeof c=="string"&&t.operator==="+")return c+String(u??"");if(typeof u=="string"&&t.operator==="+")return String(c??"")+u}if(t.type==="Identifier"&&e.has(t.name))return e.get(t.name);if(t.type==="TemplateLiteral"&&((n=t.expressions)==null?void 0:n.length)===0)return((s=(i=(r=t.quasis)==null?void 0:r[0])==null?void 0:i.value)==null?void 0:s.cooked)??void 0;if(t.type==="MemberExpression")return wNe(t,e);if(t.type==="CallExpression"&&((a=t.callee)==null?void 0:a.type)==="MemberExpression"&&((o=t.callee.object)==null?void 0:o.type)==="Identifier"&&t.callee.object.name==="Math"&&ANe.has((l=t.callee.property)==null?void 0:l.name)){const c=(t.arguments??[]).map(u=>os(u,e));if(c.every(u=>typeof u=="number"))return Math[t.callee.property.name](...c)}}}function CNe(t,e){return os(t,e)}function j6(t,e){var s,a;if((t==null?void 0:t.type)!=="CallExpression")return null;const n=t.callee;if((n==null?void 0:n.type)!=="MemberExpression"||((s=n.property)==null?void 0:s.type)!=="Identifier")return null;const r=n.property.name,i=os((a=t.arguments)==null?void 0:a[0],e);return typeof i!="string"||i.length===0?null:yNe.has(r)||r==="toArray"?i:r==="getElementById"?`#${i}`:null}function O4(t,e=!0){for(let n=t.length-2;n>=0;n--){const r=t[n];if(r&&Kle.has(r.type)&&(e||r.type!=="BlockStatement"))return r}return null}function ece(t){const e=[];for(let n=t.length-1;n>=0;n--){const r=t[n];r&&Kle.has(r.type)&&e.push(r)}return e}function pL(t){for(let e=t.length-2;e>=0;e--){const n=t[e];if((n==null?void 0:n.type)==="BlockStatement"&&w4(n))return n}}function mL(t,e,n,r=Number.POSITIVE_INFINITY){const i=n.declarationsByName.get(t)??[],s=pL(e);for(const a of ece(e)){const o=i.filter(l=>l.scopeNode===a&&(!l.expandedScopeNode||l.expandedScopeNode===s)&&(l.kind==="var"||l.kind==="param"||l.node.start<r)).sort((l,c)=>c.node.start-l.node.start);if(o[0])return o[0]}}function tce(t){const e=new Map,n=new Set;Of(t,{VariableDeclarator(s,a,o){var d;const l=(d=s.id)==null?void 0:d.name;if(!l)return;const c=o.at(-2),u=c==null?void 0:c.kind;if(!u)return;const f=(c==null?void 0:c.type)!=="VariableDeclaration"||u!=="var",h=O4(o,f),m=pL(o),y=e.get(l)??[];y.push({node:s,scopeNode:h,expandedScopeNode:m,name:l,kind:u}),e.set(l,y)},FunctionDeclaration:i,FunctionExpression:i,ArrowFunctionExpression:i});const r={declarationsByName:e,reassignedDeclarations:n};return Of(t,{AssignmentExpression(s,a,o){var u;const l=((u=s.left)==null?void 0:u.type)==="Identifier"?s.left.name:void 0;if(!l)return;const c=mL(l,o,r,s.start);c&&n.add(c.node)}}),r;function i(s){for(const a of s.params??[]){if((a==null?void 0:a.type)!=="Identifier")continue;const o=e.get(a.name)??[];o.push({node:a,scopeNode:s,name:a.name,kind:"param"}),e.set(a.name,o)}}}function zO(t,e,n,r){let i=t.get(e);i||(i=new Map,t.set(e,i)),i.has(n)||i.set(n,r)}function L6(t,e,n){var r,i;for(const s of ece(e)){const a=(r=n.get(s))==null?void 0:r.get(t);if(a!==void 0)return a}return((i=n.get(null))==null?void 0:i.get(t))??null}function kNe(t){return(t==null?void 0:t.type)==="ArrowFunctionExpression"||(t==null?void 0:t.type)==="FunctionExpression"||(t==null?void 0:t.type)==="FunctionDeclaration"}function ENe(t,e,n,r){return(t==null?void 0:t.type)==="Identifier"?L6(t.name,e,r):(t==null?void 0:t.type)==="CallExpression"?j6(t,n):null}function gL(t){const e=new Map,n=new Set,r=new Map;return Object.defineProperty(e,Jle,{value:r,enumerable:!1}),Q0(t,{VariableDeclarator(i){var c;const s=(c=i.id)==null?void 0:c.name,a=i.init;if(!s||!a)return;if(a.type==="ArrayExpression"||a.type==="ObjectExpression"){r.set(s,a);return}const o=os(a,e);if(o===void 0||n.has(s))return;const l=e.get(s);l!==void 0&&l!==o?(e.delete(s),n.add(s)):l===void 0&&e.set(s,o)}}),e}function nce(t,e,n){const r=new Map;Of(t,{VariableDeclarator(s,a,o){var u;const l=(u=s.id)==null?void 0:u.name,c=j6(s.init,e);if(l&&c!==null){const f=o.at(-2),h=(f==null?void 0:f.type)!=="VariableDeclaration"||f.kind!=="var";zO(r,O4(o,h),l,c)}},AssignmentExpression(s,a,o){const l=s.left,c=j6(s.right,e);if((l==null?void 0:l.type)==="Identifier"&&c!==null){const u=mL(l.name,o,n,s.start);zO(r,(u==null?void 0:u.scopeNode)??pL(o)??O4(o),l.name,c)}}}),Of(t,{CallExpression(s,a,o){var c,u,f;const l=s.callee;if((l==null?void 0:l.type)==="MemberExpression"&&((c=l.property)==null?void 0:c.type)==="Identifier"&&xNe.has(l.property.name)){const h=ENe(l.object,o,e,r),m=(u=s.arguments)==null?void 0:u[0],y=(f=m==null?void 0:m.params)==null?void 0:f[0];h&&(y==null?void 0:y.type)==="Identifier"&&kNe(m)&&zO(r,m,y.name,h)}}});const i=new Set(["slice","filter","concat","reverse"]);return Of(t,{VariableDeclarator(s,a,o){var h,m,y,d,v;const l=(h=s.id)==null?void 0:h.name,c=s.init;if(!l||!c)return;let u;if(c.type==="MemberExpression"&&((m=c.object)==null?void 0:m.type)==="Identifier"?u=c.object.name:c.type==="CallExpression"&&((y=c.callee)==null?void 0:y.type)==="MemberExpression"&&((d=c.callee.object)==null?void 0:d.type)==="Identifier"&&((v=c.callee.property)==null?void 0:v.type)==="Identifier"&&i.has(c.callee.property.name)&&(u=c.callee.object.name),!u)return;const f=L6(u,o,r);f&&zO(r,O4(o),l,f)}}),r}function yL(t,e,n,r){var i;if(!t)return null;if(t.type==="StringLiteral"||t.type==="Literal")return typeof t.value=="string"?t.value:null;if(t.type==="Identifier")return L6(t.name,e,r);if(t.type==="CallExpression")return j6(t,n);if(t.type==="ArrayExpression"){const s=t.elements.map(a=>yL(a,e,n,r)).filter(a=>typeof a=="string"&&a.length>0);return s.length>0?s.join(", "):null}return t.type==="MemberExpression"&&((i=t.object)==null?void 0:i.type)==="Identifier"?L6(t.object.name,e,r):null}function TNe(t,e,n){const r=(t==null?void 0:t.type)==="ObjectExpression"?t:(t==null?void 0:t.type)==="Identifier"?dL(t,n):void 0;if((r==null?void 0:r.type)!=="ObjectExpression")return null;const i=Pd(e,"onUpdate"),s=i?MNe(i):void 0;return s?`proxy → ${s}`:"dwell/hold"}function PNe(t){var e,n,r;return(t==null?void 0:t.type)==="MemberExpression"&&((e=t.object)==null?void 0:e.type)==="MemberExpression"&&((n=t.object.property)==null?void 0:n.name)==="style"&&!!((r=t.property)!=null&&r.name)}function MNe(t){let e;return Q0(t,{CallExpression(n){var r,i,s,a;((r=n.callee)==null?void 0:r.type)==="MemberExpression"&&((i=n.callee.property)==null?void 0:i.name)==="setAttribute"&&typeof((a=(s=n.arguments)==null?void 0:s[0])==null?void 0:a.value)=="string"&&(e??(e=n.arguments[0].value))},AssignmentExpression(n){const r=n.left;PNe(r)&&(e??(e=`style.${r.property.name}`))}}),e}function tA(t){return(t==null?void 0:t.type)==="ObjectProperty"||(t==null?void 0:t.type)==="Property"}function F6(t){var e,n;return((e=t==null?void 0:t.key)==null?void 0:e.name)??((n=t==null?void 0:t.key)==null?void 0:n.value)}function Pd(t,e){if((t==null?void 0:t.type)==="ObjectExpression"){for(const n of t.properties??[])if(tA(n)&&F6(n)===e)return n.value}}function NNe(t,e,n){const r=Pd(t,e);return r?n.slice(r.start,r.end):void 0}function x0(t,e,n){var i,s;const r={};if((t==null?void 0:t.type)!=="ObjectExpression")return r;for(const a of t.properties??[]){if(!tA(a))continue;const o=((i=a.key)==null?void 0:i.name)??((s=a.key)==null?void 0:s.value);if(!o)continue;const l=os(a.value,e);l!==void 0?r[o]=l:r[o]=`__raw:${n.slice(a.value.start,a.value.end)}`}return r}function eX(t){var e,n,r;return(t==null?void 0:t.type)==="CallExpression"&&((e=t.callee)==null?void 0:e.type)==="MemberExpression"&&((n=t.callee.object)==null?void 0:n.name)==="gsap"&&((r=t.callee.property)==null?void 0:r.name)==="timeline"}function C4(t){var e;if(!t||t.type!=="MemberExpression")return null;if(t.computed){const n=t.property;return(n==null?void 0:n.type)==="Literal"&&typeof n.value=="string"?n.value:null}return((e=t.property)==null?void 0:e.type)==="Identifier"?t.property.name:null}function DNe(t){return(t==null?void 0:t.type)==="MemberExpression"&&C4(t)!==null}function jE(t,e){if((t==null?void 0:t.type)!=="MemberExpression"||(e==null?void 0:e.type)!=="MemberExpression"||C4(t)!==C4(e)||C4(t)===null)return!1;const n=t.object,r=e.object;return(n==null?void 0:n.type)==="Identifier"&&(r==null?void 0:r.type)==="Identifier"?n.name===r.name:(n==null?void 0:n.type)==="MemberExpression"&&(r==null?void 0:r.type)==="MemberExpression"?jE(n,r):!1}function rce(t,e){return t.kind==="identifier"?t.name:e.slice(t.node.start,t.node.end)}function INe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lM(t,e){var s,a;const n=(s=t.arguments)==null?void 0:s[0];if(!n||n.type!=="ObjectExpression")return;const r=(a=n.properties)==null?void 0:a.find(o=>tA(o)&&F6(o)==="defaults");if(!(r!=null&&r.value)||r.value.type!=="ObjectExpression")return;const i={};for(const o of r.value.properties??[]){if(!tA(o))continue;const l=F6(o),c=os(o.value,e);l==="ease"&&typeof c=="string"&&(i.ease=c),l==="duration"&&typeof c=="number"&&(i.duration=c)}return Object.keys(i).length>0?i:void 0}function xL(t,e){let n=null,r=null,i=0,s;const a=e??new Map;return Q0(t,{VariableDeclarator(o){var l;eX(o.init)&&(i+=1,!r&&((l=o.id)==null?void 0:l.type)==="Identifier"&&(n=o.id.name,r={kind:"identifier",name:o.id.name},s=lM(o.init,a)))},AssignmentExpression(o){if(eX(o.right)&&(i+=1,!r)){const l=o.left;(l==null?void 0:l.type)==="Identifier"?(n=l.name,r={kind:"identifier",name:l.name},s=lM(o.right,a)):DNe(l)&&(r={kind:"member",node:l},s=lM(o.right,a))}}}),{timelineVar:n,ref:r,timelineCount:i,defaults:s}}const _Ne=new Set(["duration","ease","delay"]),RNe=new Set(["onComplete","onStart","onUpdate","onRepeat"]),jNe=new Set(["stagger","yoyo","repeat","repeatDelay","snap","overwrite","immediateRender"]);function LNe(t,e){var r,i;let n=(r=t.callee)==null?void 0:r.object;for(;(n==null?void 0:n.type)==="CallExpression";)n=(i=n.callee)==null?void 0:i.object;return e.kind==="identifier"?(n==null?void 0:n.type)==="Identifier"&&n.name===e.name:jE(n,e.node)}function ice(t,e,n,r){const i=[];function s(a,o){var c,u,f,h;if(!a||typeof a!="object")return;const l=[...o,a];if(a.type==="CallExpression"){const m=a.callee,y=(c=a.arguments)==null?void 0:c[0],d=(m==null?void 0:m.type)==="MemberExpression"&&((u=m.object)==null?void 0:u.type)==="Identifier"&&m.object.name==="gsap"&&((f=m.property)==null?void 0:f.type)==="Identifier"&&m.property.name==="set"&&((y==null?void 0:y.type)==="StringLiteral"||(y==null?void 0:y.type)==="Literal"&&typeof y.value=="string");if((m==null?void 0:m.type)==="MemberExpression"&&((h=m.property)==null?void 0:h.type)==="Identifier"&&(LNe(a,e)||d)&&gNe.has(m.property.name)){const v=m.property.name,b=a.arguments,w=b.length>=1?yL(b[0],l,n,r)??"__unresolved__":"__unresolved__";v==="fromTo"&&b.length>=3?i.push({node:a,ancestors:l,method:"fromTo",selector:w,fromArg:b[1],varsArg:b[2],positionArg:b[3]}):v!=="fromTo"&&b.length>=2&&i.push({node:a,ancestors:l,method:v,selector:w,varsArg:b[1],positionArg:b[2],...d?{global:!0}:{}})}}for(const m of Object.keys(a)){if(m==="type"||m==="start"||m==="end"||m==="loc")continue;const y=a[m];if(Array.isArray(y))for(const d of y)d&&typeof d=="object"&&d.type&&s(d,l);else y&&typeof y=="object"&&y.type&&s(y,l)}}return s(t,[]),i}const sce=/^(\d+(?:\.\d+)?)%$/;function $6(t,e){const n=os(t,e);return typeof n=="string"?n:void 0}function FNe(t,e,n){var a,o;const r=[];let i,s;for(const l of t.properties??[]){if(l.type!=="ObjectProperty"&&l.type!=="Property")continue;const c=((a=l.key)==null?void 0:a.value)??((o=l.key)==null?void 0:o.name);if(typeof c!="string")continue;const u=sce.exec(c);if(u){const f=Number.parseFloat(u[1]??"0"),h=x0(l.value,e,n),m={};let y;for(const[d,v]of Object.entries(h))if(d==="ease"&&typeof v=="string")y=v;else{if(d==="duration")continue;(typeof v=="number"||typeof v=="string")&&(m[d]=v)}r.push({percentage:f,properties:m,...y?{ease:y}:{}})}else c==="ease"?i=$6(l.value,e)??i:c==="easeEach"&&(s=$6(l.value,e)??s)}return r.sort((l,c)=>l.percentage-c.percentage),{format:"percentage",keyframes:r,...i?{ease:i}:{},...s?{easeEach:s}:{}}}function $Ne(t,e,n){var s,a;const r=(s=(t.properties??[]).find(o=>{var l,c;return(((l=o.key)==null?void 0:l.name)??((c=o.key)==null?void 0:c.value))==="keyframes"}))==null?void 0:s.value;if(!r||r.type!=="ArrayExpression")return;const i=[];for(const o of r.elements??[]){if(!o||o.type!=="ObjectExpression")continue;const l=x0(o,e,n);i.push(l.duration)}return(a=EE(i))==null?void 0:a.totalDuration}function BNe(t,e,n){const r=t.elements??[],i=[];for(const o of r){if(!o||o.type!=="ObjectExpression")continue;const l=x0(o,e,n),c={};let u,f;for(const[h,m]of Object.entries(l))h==="duration"?u=m:h==="ease"&&typeof m=="string"?f=m:(typeof m=="number"||typeof m=="string")&&(c[h]=m);i.push({properties:c,duration:u,ease:f})}const s=EE(i.map(o=>o.duration));return s?{format:"object-array",keyframes:i.map((o,l)=>({percentage:s.percentages[l],properties:o.properties,...o.ease?{ease:o.ease}:{}}))}:void 0}function VNe(t,e){var o,l,c;const n=new Map;let r,i;for(const u of t.properties??[]){if(u.type!=="ObjectProperty"&&u.type!=="Property")continue;const f=((o=u.key)==null?void 0:o.name)??((l=u.key)==null?void 0:l.value);if(typeof f=="string")if(((c=u.value)==null?void 0:c.type)==="ArrayExpression"){const h=[];for(const m of u.value.elements??[]){const y=os(m,e);(typeof y=="number"||typeof y=="string")&&h.push(y)}h.length>0&&n.set(f,h)}else f==="ease"?r=$6(u.value,e)??r:f==="easeEach"&&(i=$6(u.value,e)??i)}const s=Math.max(...[...n.values()].map(u=>u.length),0),a=[];for(let u=0;u<s;u++){const f=s>1?Math.round(u/(s-1)*100):0,h={};for(const[m,y]of n)u<y.length&&(h[m]=y[u]);a.push({percentage:f,properties:h})}return{format:"simple-array",keyframes:a,...r?{ease:r}:{},...i?{easeEach:i}:{}}}function HNe(t,e,n){var a,o,l;if(!t)return;if(t.type==="ArrayExpression")return BNe(t,e,n);if(t.type!=="ObjectExpression")return;const r=t.properties??[];let i=!1,s=!1;for(const c of r){if(c.type!=="ObjectProperty"&&c.type!=="Property")continue;const u=((a=c.key)==null?void 0:a.value)??((o=c.key)==null?void 0:o.name);if(typeof u=="string"&&sce.test(u)){i=!0;break}((l=c.value)==null?void 0:l.type)==="ArrayExpression"&&(s=!0)}if(i)return FNe(t,e,n);if(s)return VNe(t,e)}function QNe(t,e,n){if(!t)return;let r,i=!1,s=1,a=!1;if(t.type==="ObjectExpression")for(const c of t.properties??[]){if(!tA(c))continue;const u=F6(c);if(u==="path")r=c.value;else if(u==="autoRotate"){const f=os(c.value,e);i=typeof f=="number"?f:f===!0}else if(u==="curviness"){const f=os(c.value,e);typeof f=="number"&&(s=f)}else u==="type"&&os(c.value,e)==="cubic"&&(a=!0)}else t.type==="ArrayExpression"&&(r=t);if(!r||r.type!=="ArrayExpression")return;const o=r.elements??[],l=[];for(const c of o){if(!c||c.type!=="ObjectExpression")continue;const u=x0(c,e,n),f=typeof u.x=="number"?u.x:void 0,h=typeof u.y=="number"?u.y:void 0;f!==void 0&&h!==void 0&&l.push({x:f,y:h})}return doe(l,s,i,a)}function ace(t,e,n,r){var E,M;const i=w4(t.node),s=x0(t.varsArg,e,n),a={},o={};let l,c=!1,u;for(const[N,I]of Object.entries(s))if(!_Ne.has(N)&&!RNe.has(N)){if(N==="keyframes"){const _=Pd(t.varsArg,"keyframes");l=HNe(_,e,n),!l&&_&&(c=!0);continue}if(N==="motionPath"){const _=Pd(t.varsArg,"motionPath");u=QNe(_,e,n);continue}if(N!=="easeEach"){if(jNe.has(N)){const _=NNe(t.varsArg,N,n);_!==void 0?o[N]=`__raw:${_}`:I!==void 0&&(o[N]=I);continue}(typeof I=="number"||typeof I=="string")&&(a[N]=I)}}if(l&&typeof s.easeEach=="string"&&(l.easeEach=s.easeEach),u){const{waypoints:N}=u;if(!l)l={format:"percentage",keyframes:N.map((_,j)=>({percentage:N.length>1?Math.round(j/(N.length-1)*100):0,properties:{x:_.x,y:_.y}}))};else{const I=l.keyframes;if(I.length===N.length)for(let _=0;_<I.length;_++){const j=I[_],L=N[_];j&&L&&(j.properties.x=L.x,j.properties.y=L.y)}}}let f;if(t.method==="fromTo"&&t.fromArg){f={};const N=x0(t.fromArg,e,n);for(const[I,_]of Object.entries(N))(typeof _=="number"||typeof _=="string")&&(f[I]=_)}const h=!!t.positionArg,m=h?CNe(t.positionArg,e):0,y=typeof m=="number"||typeof m=="string"?m:h?`__raw:${n.slice(t.positionArg.start,t.positionArg.end)}`:0;let d=typeof s.duration=="number"?s.duration:void 0;const v=typeof s.ease=="string"?s.ease:void 0;d===void 0&&l&&(d=$Ne(t.varsArg,e,n));let b=t.selector,w;if(b==="__unresolved__"){const N=(E=t.node.arguments)==null?void 0:E[0],I=TNe(N,t.varsArg,e);if(I&&(b=I,(N==null?void 0:N.type)==="Identifier")){const _=mL(N.name,t.ancestors,r,t.node.start);if(((M=_==null?void 0:_.node.init)==null?void 0:M.type)==="ObjectExpression"&&!r.reassignedDeclarations.has(_.node)){const j=w4(_.scopeNode)??w4(_.expandedScopeNode),L=j&&(j.kind==="helper"||j.kind==="loop")?`:${j.kind}:${j.callSite??""}:${j.iteration??""}`:"";w=`proxy:${N.name}@${_.node.start}${L}`}}}const O={targetSelector:b,method:t.method,position:y,properties:a,fromProperties:f,duration:d,ease:v};w&&(O.targetIdentity=w),h||(O.implicitPosition=!0);let k=QG(a);if(!k&&l){const N={};for(const I of l.keyframes)for(const _ of Object.keys(I.properties))N[_]=!0;k=QG(N)}return k&&(O.propertyGroup=k),t.global&&(O.global=!0),Object.keys(o).length>0&&(O.extras=o),l&&(O.keyframes=l),u&&(O.arcPath=u.arcPath),c&&(O.hasUnresolvedKeyframes=!0),b==="__unresolved__"&&(O.hasUnresolvedSelector=!0),i&&(O.provenance=i),O}function zNe(t){if(typeof t=="number")return t;if(typeof t!="string")return;const e=t.startsWith("__raw:")?t.slice(6):t,n=/(?:each\s*:\s*)?(-?\d+(?:\.\d+)?)/.exec(e);if(!n)return;const r=Number.parseFloat(n[1]);return Number.isFinite(r)?r:void 0}function tX(t){return t==="opacity"||t.startsWith("scale")?1:0}function ZNe(t,e){const n={...t.properties};let r,i;if(t.method==="fromTo")r={...t.fromProperties??{}},i=n;else if(t.method==="from"){r=n,i={};for(const s of Object.keys(n))i[s]=tX(s)}else{r={...t.fromProperties??{}};for(const s of Object.keys(n))r[s]===void 0&&(r[s]=tX(s));i=n}return[{percentage:0,properties:{...r,stagger:e}},{percentage:100,properties:{...i,stagger:e}}]}function GNe(t){var e;for(const n of t){if(n.keyframes||n.arcPath)continue;const r=zNe((e=n.extras)==null?void 0:e.stagger);r!==void 0&&(n.keyframes={format:"percentage",keyframes:ZNe(n,r)})}}const UNe=.5;function XNe(t,e,n){const r=t.trim();if(r==="")return e;if(r.startsWith("+=")){const s=Number.parseFloat(r.slice(2));return Number.isFinite(s)?e+s:null}if(r.startsWith("-=")){const s=Number.parseFloat(r.slice(2));return Number.isFinite(s)?e-s:null}if(r==="<")return n;if(r===">")return e;if(r.startsWith("<")){const s=Number.parseFloat(r.slice(1));return Number.isFinite(s)?n+s:null}if(r.startsWith(">")){const s=Number.parseFloat(r.slice(1));return Number.isFinite(s)?e+s:null}const i=Number.parseFloat(r);return Number.isFinite(i)?i:null}function WNe(t,e,n,r){const i=new Map;return Of(t,{CallExpression(s,a,o){var h,m,y,d;const l=s.callee;if((l==null?void 0:l.type)!=="MemberExpression"||((h=l.object)==null?void 0:h.name)!=="gsap"||((m=l.property)==null?void 0:m.name)!=="set")return;const c=yL((y=s.arguments)==null?void 0:y[0],o,e,n);if(!c)return;const u=x0((d=s.arguments)==null?void 0:d[1],e,r),f=i.get(c)??{};for(const[v,b]of Object.entries(u))(typeof b=="number"||typeof b=="string")&&(f[v]=b);i.set(c,f)}}),i}function nX(t,e){for(const[n,r]of Object.entries(e))t[n]=r;return t}function qNe(t,e){const n={...t.fromProperties??{}};let r=!1;for(const i of Object.keys(t.properties))n[i]===void 0&&e[i]!==void 0&&(n[i]=e[i],r=!0);r&&(t.fromProperties=n)}function YNe(t,e){const n=new Map;for(const[r,i]of e)n.set(r,{...i});for(const r of t){const i=r.targetSelector;if(r.method==="set"){n.set(i,nX(n.get(i)??{},r.properties));continue}const s=n.get(i);r.method==="to"&&s&&qNe(r,s),n.set(i,nX(n.get(i)??{},r.properties))}}function oce(t,e){if(e)for(const n of t)n.method!=="set"&&(n.duration===void 0&&e.duration!==void 0&&(n.duration=e.duration),n.ease===void 0&&e.ease!==void 0&&(n.ease=e.ease))}function lce(t,e,n){const r=/^([A-Za-z_$][\w$]*)\s*(?:([+-])=\s*([\d.]+))?$/.exec(t.trim());if(!r)return null;const i=r[1];let s=e.get(i);if(s===void 0&&(s=n,e.set(i,s)),r[2]&&r[3]){const a=Number.parseFloat(r[3]);if(Number.isFinite(a))return r[2]==="+"?s+a:s-a}return s}function KNe(t,e,n,r){return t.implicitPosition?e:typeof t.position=="number"?t.position:typeof t.position=="string"?lce(t.position,r,e)??XNe(t.position,e,n):e}function cce(t,e=[]){let n=0,r=0;const i=new Map;let s=0;const a=[...e].sort((l,c)=>l.order-c.order),o=l=>{let c;typeof l.position=="number"?c=l.position:typeof l.position=="string"?c=lce(l.position,i,n)??n:c=n,i.set(l.name,Math.max(0,c))};for(t.forEach((l,c)=>{for(;s<a.length&&a[s].order<=c;)o(a[s]),s++;if(l.method==="set"&&l.global){l.resolvedStart=0;return}const u=l.method==="set"?0:l.duration??UNe,f=KNe(l,n,r,i);f!=null&&(l.resolvedStart=Math.max(0,f),r=l.resolvedStart,n=Math.max(n,l.resolvedStart+u))});s<a.length;)o(a[s++])}function JNe(t,e,n,r){const i=r.map(a=>{var o,l,c;return(c=(l=(o=a.node.callee)==null?void 0:o.property)==null?void 0:l.loc)==null?void 0:c.start}),s=[];return Q0(t,{CallExpression(a){var d,v,b,w,O,k;const o=a.callee,l=e.kind==="identifier"?((d=o.object)==null?void 0:d.type)==="Identifier"&&o.object.name===e.name:jE(o.object,e.node);if((o==null?void 0:o.type)!=="MemberExpression"||!l||((v=o.property)==null?void 0:v.name)!=="addLabel")return;const c=(b=a.arguments)==null?void 0:b[0],u=typeof(c==null?void 0:c.value)=="string"?c.value:void 0;if(!u)return;const f=os((w=a.arguments)==null?void 0:w[1],n),h=typeof f=="number"||typeof f=="string"?f:void 0,m=(k=(O=o.property)==null?void 0:O.loc)==null?void 0:k.start;let y=r.length;m&&(y=i.findIndex(E=>E&&(E.line>m.line||E.line===m.line&&E.column>m.column)),y===-1&&(y=r.length)),s.push({name:u,position:h,order:y})}}),s}function eDe(t,e){var i,s,a,o,l,c;const n=(a=(s=(i=t.node.callee)==null?void 0:i.property)==null?void 0:s.loc)==null?void 0:a.start,r=(c=(l=(o=e.node.callee)==null?void 0:o.property)==null?void 0:l.loc)==null?void 0:c.start;return!n||!r?0:n.line-r.line||n.column-r.column}function tDe(t,e){const n=t.node.__hfOrder,r=e.node.__hfOrder;return n===void 0&&r===void 0?eDe(t,e):n===void 0?-1:r===void 0?1:n-r}function uce(t){t.sort(tDe)}function fce(t){const e=new Map;return t.map(n=>{const r=typeof n.position=="number"?String(Math.round(n.position*1e3)):String(n.position),i=n.propertyGroup?`-${n.propertyGroup}`:"",s=`${n.targetSelector}-${n.method}-${r}${i}`,a=(e.get(s)??0)+1;e.set(s,a);const o=a===1?s:`${s}-${a}`;return{...n,id:o}})}function ar(t){try{const e=eA(t,{ecmaVersion:"latest",sourceType:"script",locations:!0}),n=gL(e),r=tce(e),i=nce(e,n,r),s=xL(e,n),a=s.ref??{kind:"identifier",name:"tl"},o=rce(a,t),l=ice(e,a,n,i);uce(l);const c=l.map(h=>ace(h,n,t,r));oce(c,s.defaults),cce(c);const u=fce(c),f=l.map((h,m)=>({id:u[m].id,call:h,animation:u[m]}));return{ast:e,timelineVar:o,hasTimeline:s.ref!==null,located:f}}catch{return null}}function nDe(t){try{const e=bNe(t),n=gL(e),r=xL(e,n),i=r.ref??{kind:"identifier",name:"tl"},s=rce(i,t);if(i.kind==="identifier")try{mNe(e,s,O=>os(O,n))}catch{}const a=tce(e),o=nce(e,n,a),l=ice(e,i,n,o);uce(l);const c=l.map(O=>ace(O,n,t,a));oce(c,r.defaults),YNe(c,WNe(e,n,o,t));const u=JNe(e,i,n,l);cce(c,u),GNe(c);const f=fce(c),h=i.kind==="identifier"?`(?:const|let|var)\\s+${s}\\s*=\\s*gsap\\.timeline\\s*\\([^)]*\\)\\s*;?`:`${INe(s)}\\s*=\\s*gsap\\.timeline\\s*\\([^)]*\\)\\s*;?`,m=t.match(new RegExp(`^[\\s\\S]*?${h}`)),y=i.kind==="identifier"?`const ${s} = gsap.timeline({ paused: true });`:`${s} = gsap.timeline({ paused: true });`,d=(m==null?void 0:m[0])??y,v=t.lastIndexOf(`${s}.`);let b="";if(v!==-1){const k=t.slice(v).indexOf(";");k!==-1&&(b=t.slice(v+k+1).trim())}const w={animations:f,timelineVar:s,preamble:d,postamble:b};return r.timelineCount>1&&(w.multipleTimelines=!0),r.timelineCount>0&&r.ref===null&&(w.unsupportedTimelinePattern=!0),w}catch{return{animations:[],timelineVar:"tl",preamble:"",postamble:""}}}function rDe(t){try{const e=eA(t,{ecmaVersion:"latest",sourceType:"script",locations:!0}),n=gL(e),i=xL(e,n).ref??{kind:"identifier",name:"tl"},s=[];return Q0(e,{ExpressionStatement(a){var y,d;const o=a.expression;if(!o||o.type!=="CallExpression")return;const l=o.callee,c=i.kind==="identifier"?((y=l.object)==null?void 0:y.type)==="Identifier"&&l.object.name===i.name:jE(l.object,i.node);if((l==null?void 0:l.type)!=="MemberExpression"||!c||((d=l.property)==null?void 0:d.name)!=="addLabel")return;const u=o.arguments??[],f=u[0],h=u[1];if((f==null?void 0:f.type)!=="Literal"||typeof f.value!="string"||!h)return;const m=os(h,n);typeof m!="number"||!Number.isFinite(m)||s.push({name:f.value,position:m})}}),s}catch{return[]}}function nA(t,e,n){if(n<=0)return 0;const r=(t-e)/n*100;return Math.max(0,Math.min(100,Math.round(r*1e3)/1e3))}function mS(t,e,n){return t>=e&&t<=e+n}function si(t){if(t.resolvedStart!=null)return t.resolvedStart;if(typeof t.position=="number")return t.position;const e=Number.parseFloat(t.position);return Number.isNaN(e)?null:e}function qi(t,e=.5){return t.duration??e}function iDe(t,e,n){for(const r of e){if(!sDe(r.targetSelector,n))continue;const i=si(r);if(i===null)continue;const s=qi(r);if(mS(t,i,s))return r}return null}function hce(t,e){const n=si(e);if(n===null)return null;const r=qi(e);return nA(t,n,r)}function sDe(t,e){return t.split(",").some(n=>n.trim()===e)}const Cg={opacity:1,x:0,y:0,scale:1,scaleX:1,scaleY:1,rotation:0,width:100,height:100};function Uo(t){return t.method==="set"||(t.method==="to"||t.method==="fromTo")&&qi(t)===0}const aDe=/^-?[A-Za-z_][\w-]*$/,b0=1;function kg(t){return aDe.test(t)?`#${t}`:`[id="${t.replace(/(["\\])/g,"\\$1")}"]`}function dce(t){if(!t)return null;const e=t.match(/^#([\w-]+)/);if(e)return e[1]??null;const n=t.match(/^\[id="((?:\\.|[^"\\])*)"\]/);return n?(n[1]??"").replace(/\\(["\\])/g,"$1"):null}const oDe=/^(#[\w-]+|\[id="(?:\\.|[^"\\])*"\])$/;function rX(t){const e=t.trim();return oDe.test(e)?dce(e):null}function p_(t,e){const n=rX(t);if(n)return[n];const r=new Set;for(const i of t.split(",")){const s=i.trim();if(s){if(!e){const a=rX(s);a&&r.add(a);continue}try{for(const a of Array.from(e.querySelectorAll(s)))a.id&&r.add(a.id)}catch{const a=dce(s);a&&r.add(a)}}}return Array.from(r)}function pce(t){return t.start-(t.expandedParentStart??0)}function yc(t){return t.id?kg(t.id):t.selector?t.selector:null}function mce(t,e){return`[${t}="${e.replace(/(["\\])/g,"\\$1")}"]`}function LE(t,e,n){try{const r=t.querySelectorAll(e);return r.length===1&&r[0]===n}catch{return!1}}function lDe(t){const e=t.ownerDocument;if(!e)return null;const n=[];for(let i=t;i;i=i.parentElement){if(i!==t){const o=i instanceof HTMLElement?i.id:"",l=i.getAttribute("data-hf-id");if(o){n.unshift(kg(o));break}if(l){n.unshift(mce("data-hf-id",l));break}}const s=i.parentElement;if(!s)break;const a=[...s.children].indexOf(i)+1;if(a<1)return null;n.unshift(`${i.tagName.toLowerCase()}:nth-child(${a})`)}if(n.length===0)return null;const r=n.join(" > ");return LE(e,r,t)?r:null}function Oc(t){if(t.id)return kg(t.id);if(t.hfId)return mce("data-hf-id",t.hfId);const e=t.element,n=e==null?void 0:e.ownerDocument;return e&&n?t.selector&&LE(n,t.selector,e)?t.selector:lDe(e):t.selector??null}function bL(t,e){return t.targetSelector&&!t.hasUnresolvedSelector?t.targetSelector:yc(e)}function gy(t,e,n){if(t===e)return!0;const r=n==null?void 0:n.ownerDocument;return!n||!r?!1:LE(r,t,n)}function gf(t,e){var r;const n=Number.parseFloat(((r=e.dataAttributes)==null?void 0:r.duration)??"");return qi(t,Number.isFinite(n)&&n>0?n:.5)}function gS(t,e,n){var s,a;if(n){const o=si(n),l=gf(n,e);if(l<=0)return 0;if(o!==null)return nA(t,o,l)}const r=Number.parseFloat(((s=e.dataAttributes)==null?void 0:s.start)??"0")||0,i=Number.parseFloat(((a=e.dataAttributes)==null?void 0:a.duration)??"1")||1;return nA(t,r,i)}function vL(t){if(!(t!=null&&t.contentWindow))return null;try{const e=t.contentWindow.gsap;return e!=null&&e.getProperty?e:null}catch{return null}}function AL(t,e){var n;try{return((n=t==null?void 0:t.contentDocument)==null?void 0:n.querySelector(e))??null}catch{return null}}function iX(t){const e={};for(const[n,r]of Object.entries(t))n!=="ease"&&(typeof r=="number"?e[n]=Math.round(r*1e3)/1e3:typeof r=="string"&&(e[n]=r));return e}function cDe(t){const e=[];let n;if(Array.isArray(t)){const r=t;return r.forEach((i,s)=>{if(!i||typeof i!="object")return;const a=r.length>1?Math.round(s/(r.length-1)*1e3)/10:0,o=iX(i);Object.keys(o).length>0&&e.push({percentage:a,properties:o})}),e.length>0?{keyframes:e}:null}for(const[r,i]of Object.entries(t)){if(r==="easeEach"){typeof i=="string"&&(n=i);continue}const s=r.match(/^(\d+(?:\.\d+)?)%$/);if(!s||!i||typeof i!="object")continue;const a=parseFloat(s[1]),o=iX(i);Object.keys(o).length>0&&e.push({percentage:a,properties:o})}return e.length===0?null:(e.sort((r,i)=>r.percentage-i.percentage),{keyframes:e,easeEach:n})}function SL(t,e,n){return t+n/100*e}function FE(t,e,n,r){var o;const i=n.find(l=>l.domId===t||(l.key??l.id)===`${e}#${t}`);if(i){const l=i.parentCompositionId,c=l?n.find(f=>f.domId===l||f.id===l):void 0,u=i.expandedParentStart??(c==null?void 0:c.start);return u!==void 0?{elStart:i.start-u,elDuration:i.duration}:l?{elStart:0,elDuration:i.duration}:{elStart:i.start,elDuration:i.duration}}const s=(o=r.find(l=>l.id===t))==null?void 0:o.hostId,a=s?n.find(l=>l.domId===s||(l.key??l.id)===`index.html#${s}`):void 0;return{elStart:0,elDuration:(a==null?void 0:a.duration)??1}}function gce(t,e,n,r){return n<=0?r:Math.round((t-e)/n*1e5)/1e3}function wL(t,e,n,r){const i=e.resolvedStart??(typeof e.position=="number"?e.position:0),s=e.duration??r;return t.map(a=>({...a,percentage:gce(SL(i,s,a.percentage),n,r,a.percentage),tweenPercentage:a.percentage,propertyGroup:e.propertyGroup,animationId:e.id}))}function m_(t){if(t.keyframes||t.method!=="set"&&(t.duration??0)!==0)return!1;const e=Object.keys(t.properties).filter(n=>n!=="immediateRender");return e.length>0&&e.every(n=>n==="x"||n==="y")}function uDe(t,e){const n=t.animationId;if(n===e.animationId)return;const r=t.collidingAnimationTargets;r!=null&&r.some(i=>i.animationId===e.animationId)||(t.collidingAnimationTargets=[...r===void 0||r.length===0?[{animationId:n,tweenPercentage:t.tweenPercentage}]:r,{animationId:e.animationId,tweenPercentage:e.tweenPercentage}])}function OL(t){var n;const e=new Map;for(const r of t){const i=e.get(r.percentage);i?(i.properties={...i.properties,...r.properties},uDe(i,r),(((n=i.collidingAnimationTargets)==null?void 0:n.length)??0)>1?delete i.ease:r.ease&&(i.ease=r.ease)):e.set(r.percentage,{...r,properties:{...r.properties}})}return Array.from(e.values()).sort((r,i)=>r.percentage-i.percentage)}function Eg(t){var c;const e=((c=t.extras)==null?void 0:c.immediateRender)==="__raw:true";if(t.method==="set"||t.duration===0&&e)return null;const n=t.properties,r=t.fromProperties;if(!n||Object.keys(n).length===0)return null;const i={},s={};if(t.method==="from")for(const[u,f]of Object.entries(n))i[u]=f,s[u]=Cg[u]??0;else if(t.method==="fromTo"&&r)Object.assign(i,r),Object.assign(s,n);else for(const[u,f]of Object.entries(n))i[u]=Cg[u]??0,s[u]=f;const a=Object.keys(s).filter(u=>typeof i[u]=="number"&&typeof s[u]=="number");if(a.length===0)return null;const o=Object.fromEntries(a.map(u=>[u,i[u]])),l=Object.fromEntries(a.map(u=>[u,s[u]]));return{format:"percentage",keyframes:[{percentage:0,properties:o},{percentage:100,properties:l,...t.ease?{ease:t.ease}:{}}],...t.ease?{ease:t.ease}:{}}}const fDe=new Set(["transformOrigin","_auto","data"]);function yce(t){return!fDe.has(t)}function hDe(t,e){return Object.keys(t).some(n=>yce(n)&&nl(n)===e)}function xce(t){var e,n;return((e=t.keyframes)==null?void 0:e.keyframes)??((n=Eg(t))==null?void 0:n.keyframes)??[]}function $E(t){const e=new Set;for(const n of xce(t))for(const r of Object.keys(n.properties))yce(r)&&e.add(nl(r));return Array.from(e)}function dDe(t,e,n){const r=nl(t),i=e==null?void 0:e.find(s=>$E(s).includes(r));return(i==null?void 0:i.id)??n??""}function bce(t){return $E(t).length>0}function pDe(t){const e=new Map;for(const n of t)for(const r of $E(n)){const i=e.get(r)??[];i.push(n),e.set(r,i)}return e}function mDe(t,e){var n;return t.ease??((n=e.keyframes)==null?void 0:n.easeEach)??e.ease}function gDe(t,e,n,r){const i=[];for(const s of t){const a=xce(s).filter(o=>hDe(o.properties,e));for(const o of wL(a,s,n,r))i.push({...o,propertyGroup:e,ease:mDe(o,s)})}return i}function CL(t,e,n){return n<=0?[]:Array.from(pDe(t),([r,i])=>({group:r,animations:i,keyframes:gDe(i,r,e,n)})).filter(r=>r.keyframes.length>0)}function yDe({id:t,animations:e,clipStart:n,clipDuration:r,clipLeftPx:i,clipWidthPx:s,accentColor:a,isSelected:o,currentPercentage:l,elementId:c,selectedKeyframes:u,rovingTargetId:f=null,onSelectSegment:h,onClickKeyframe:m,onShiftClickKeyframe:y,onContextMenuKeyframe:d,onMoveKeyframe:v,suppressClickRef:b}){const w=x.useMemo(()=>s<20||r<=0?[]:CL(e,n,r),[e,n,r,s]),O=x.useMemo(()=>w.map(k=>({...k,keyframesData:{format:"percentage",keyframes:k.keyframes}})),[w]);return p.jsx("div",{id:t,children:O.map(({group:k,keyframesData:E},M)=>p.jsx("div",{id:T6(t,W2(c,k),"content"),role:"group","aria-label":`${k} keyframes`,"data-property-group":k,"data-timeline-element-id":c,"data-timeline-property-lane":"","data-timeline-lane-top":Sg(M),className:"absolute",style:{left:i,top:Sg(M),width:s,height:Ag},children:p.jsx(uoe,{keyframesData:E,clipWidthPx:s,clipHeightPx:Ag,accentColor:a,isSelected:o,currentPercentage:l,elementId:c,clipStart:n,clipDuration:r,selectedKeyframes:u,rovingTargetId:f,onSelectSegment:h,onClickKeyframe:m,onShiftClickKeyframe:y,onContextMenuKeyframe:d,onMoveKeyframe:v,suppressClickRef:b,groupAware:!0})},k))})}const g_=.02,y_=.001,vce=7,xDe=5,sX=64,Al=vce+2;function xc(t,e){const{min:n,max:r}=t;return r<=n?0:t.scale==="log"&&n>0&&e>0?(Math.log(e)-Math.log(n))/(Math.log(r)-Math.log(n)):(e-n)/(r-n)}function BE(t,e){const n=Math.min(1,Math.max(0,e)),{min:r,max:i}=t;return t.scale==="log"&&r>0?Math.exp(Math.log(r)+n*(Math.log(i)-Math.log(r))):r+n*(i-r)}function bDe(t,e){const n=t.step>=1?0:t.step>=.1?1:2,r=t.unit===""&&t.max===1?`${Math.round(e*100)}%`:e.toFixed(n);return t.unit?`${r} ${t.unit}`:r}function vDe(t){const{range:e,a:n,b:r,t:i,v:s}=t,a=r.t-n.t;if(a<=0)return null;const o=(i-n.t)/a;if(o<=.001||o>=.999)return null;const l=xc(e,n.v),c=xc(e,r.v);if(Math.abs(c-l)<.001)return null;const u=(xc(e,s)-l)/(c-l);return u<=.001||u>=.999?null:Q6e(o,u)}function Ace(t){const{origin:e,raw:n,xOf:r,yOf:i}=t;return Math.abs(r(n.t)-r(e.t))>Math.abs(i(n.v)-i(e.v))?"time":"value"}function ADe(t){const{range:e,origin:n,raw:r}=t;if((t.axis??Ace(t))==="time")return{t:r.t,v:n.v};const s=xc(e,n.v);return{t:n.t,v:BE(e,s+(xc(e,r.v)-s)*.25)}}function kL(t,e,n){let r=t,i=n;for(const s of e){const a=Math.abs(s-t);a<i&&(i=a,r=s)}return r}function Sce(t){const{lane:e,range:n,index:r,xOf:i,yOf:s}=t,a=e.points[r],o=e.points[r+1];return!a||!o?[]:!a.curve&&a.viaX===void 0&&n.scale==="linear"?[`L ${i(o.t)} ${s(o.v)}`]:Array.from({length:sX},(l,c)=>{const u=a.t+(o.t-a.t)*(c+1)/sX;return`L ${i(u)} ${s(Lf(e,u,n.scale))}`})}function SDe(t){const{lane:e,range:n,widthPx:r,xOf:i,yOf:s}=t,a=e.points[0],o=e.points[e.points.length-1];if(!a||!o){const c=s(n.default??(n.min+n.max)/2);return`M ${Al} ${c} L ${Al+r} ${c}`}const l=[`M ${Al} ${s(a.v)}`,`L ${i(a.t)} ${s(a.v)}`];for(let c=0;c+1<e.points.length;c+=1)l.push(...Sce({lane:e,range:n,index:c,xOf:i,yOf:s}));return l.push(`L ${Al+r} ${s(o.v)}`),l.join(" ")}function wDe(t){const{lane:e,range:n,index:r,xOf:i,yOf:s}=t,a=e.points[r],o=e.points[r+1];return!a||!o?null:[`M ${i(a.t)} ${s(a.v)}`,...Sce({lane:e,range:n,index:r,xOf:i,yOf:s})].join(" ")}function EL(t,e){return t.lanes.find(n=>n.target===e)??{target:e,points:[]}}function TL(t,e){const n=e.points.length===0,r=t.lanes.some(s=>s.target===e.target),i=t.lanes.map(s=>s.target===e.target?e:s).filter(s=>s.points.length>0);return!r&&!n&&i.push(e),{version:1,lanes:i}}function B6(t,e,n){return t.points.filter(r=>r.t>=e&&r.t<=n)}function aX(t,e,n,r){return r.some(i=>Math.abs(i.t-n)<=g_)?[]:[{t:n,v:Lf(t,n,e.scale)}]}function ODe(t,e){if(e<=0)return[];if(t.length<=e)return[...t];if(e===1){const i=t[0];return i?[i]:[]}const n=[],r=(t.length-1)/(e-1);for(let i=0;i<e;i+=1){const s=t[Math.round(i*r)];s&&n.push(s)}return n}function V6(t){const{lane:e,range:n,t0:r,t1:i,inner:s}=t;if(e.points.length===0&&s.length===0)return[];const a=e.points.filter(u=>u.t<r||u.t>i),o=e.points.length===0?[]:[...aX(e,n,r,s),...aX(e,n,i,s)],l=Math.max(0,xse-a.length-o.length),c=s.length<=l?s:ODe(s,l);return[...a,...o,...c].sort((u,f)=>u.t-f.t)}function Tg(t,e){return t.t>=e.t0&&t.t<=e.t1&&t.v>=e.v0&&t.v<=e.v1}function CDe(t){const{lane:e,range:n,t0:r,t1:i,newT0:s,newT1:a}=t,o=i-r,l=a-s;if(o<=0||l<=0)return e.points;const c=B6(e,r,i).map(u=>({...u,t:s+(u.t-r)*l/o}));return V6({lane:e,range:n,t0:Math.min(r,s),t1:Math.max(i,a),inner:c})}function PL(t){var e,n;(n=(e=t.currentTarget).setPointerCapture)==null||n.call(e,t.pointerId)}const oX=8,kDe=3,lX=.02;function EDe(t,e,n,r){return t==="t0"?Math.max(0,Math.min(e,n.t1-lX)):Math.min(r,Math.max(e,n.t0+lX))}function TDe({getBox:t,lane:e,range:n,pointAt:r,xOf:i,commitPoints:s,duration:a,readOnly:o,rangeSelection:l,pointInSelectionAt:c,onRangeSelect:u,onRangeClear:f,onHint:h}){const[m,y]=x.useState(null),d=x.useRef(!1),[v,b]=x.useState(!1),w=x.useCallback(I=>{if(!l)return null;const _=t();if(!_)return null;const j=I-_.left,L=i(l.t0),B=i(l.t1),$=Math.abs(L-j)<=oX,Q=Math.abs(B-j)<=oX;return $&&Q?j<=(L+B)/2?"t0":"t1":$?"t0":Q?"t1":null},[l,t,i]),O=x.useCallback(I=>{if(o||!l)return!1;const _=w(I.clientX);return!_||c!=null&&c(I.clientX,I.clientY)?!1:(I.preventDefault(),PL(I),b(!1),d.current=!1,y({edge:_,origin:l,current:_==="t0"?l.t0:l.t1,points:e.points}),!0)},[o,l,w,e,c]),k=x.useCallback(I=>{if(m===null)return;const{edge:_,origin:j,points:L}=m,B=EDe(_,r(I.clientX,I.clientY).t,j,a);if(y({edge:_,origin:j,current:B,points:L}),!d.current){const Y=_==="t0"?j.t0:j.t1;if(Math.abs(i(B)-i(Y))<=kDe)return;d.current=!0}const $=_==="t0"?B:j.t0,Q=_==="t1"?B:j.t1;h(`${$.toFixed(2)}s → ${Q.toFixed(2)}s`),u==null||u($,Q,j.v0,j.v1),s(CDe({lane:{target:e.target,points:L},range:n,t0:j.t0,t1:j.t1,newT0:$,newT1:Q}),!1)},[m,r,a,i,h,u,s,e.target,n]),E=x.useCallback(()=>{if(m===null)return;const{edge:I,origin:_,current:j}=m;if(y(null),h(null),!d.current){f==null||f();return}d.current=!1,s(e.points,!0),u==null||u(I==="t0"?j:_.t0,I==="t1"?j:_.t1,_.v0,_.v1)},[m,h,f,s,e,u]),M=x.useCallback(()=>{if(m===null)return;const{origin:I,points:_}=m;y(null),h(null),d.current&&(d.current=!1,s(_,!1),u==null||u(I.t0,I.t1,I.v0,I.v1))},[m,h,s,u]),N=x.useCallback(I=>{o||b(w(I.clientX)!==null)},[o,w]);return{edge:(m==null?void 0:m.edge)??null,hover:v,arm:O,move:k,finish:E,cancel:M,updateHover:N}}const ML=.04;function PDe(t,e,n){return!n||!e||!Tg(e,n)?[]:t.points.flatMap((r,i)=>Tg(r,n)?[i]:[])}function MDe(t,e,n){const r=PDe(t,e,n);return r.length<=1||!e?null:{points:t.points.map(i=>({...i})),indices:r,anchor:{t:e.t,v:e.v},selection:n?{...n}:{t0:0,t1:0,v0:0,v1:0}}}function NDe(t,e,n){const r=t.points[e],i=t.points[e+1];return!r||!i?null:{points:t.points.map(s=>({...s})),indices:[e,e+1],anchor:{...n},selection:{t0:r.t,t1:i.t,v0:Math.min(r.v,i.v),v1:Math.max(r.v,i.v)}}}function wce(t){const{group:e,raw:n,shiftKey:r,altKey:i,range:s,duration:a,snapTimes:o,xOf:l,yOf:c}=t,u=e.indices.map(b=>e.points[b]);let f=n.t-e.anchor.t,h=n.v-e.anchor.v;if(r){const b=Math.abs(f*(l(1)-l(0))),w=Math.abs(h*(c(s.min)-c(s.max))/(s.max-s.min));b>=w?h=0:f=0}else if(!i){const b=e.points.filter((w,O)=>!e.indices.includes(O)).map(w=>w.t);f=kL(e.anchor.t+f,[...o??[],...b],ML)-e.anchor.t}const m=u.map(b=>b.t),y=u.map(b=>b.v),d=b=>e.indices.flatMap(w=>{const O=e.points[w+b];return!O||e.indices.includes(w+b)?[]:[Math.max(0,Math.abs(O.t-e.points[w].t)-y_)]});return f=Math.min(Math.max(f,-Math.min(Math.min(...m),...d(-1))),Math.min(a-Math.max(...m),...d(1))),h=Math.min(Math.max(h,s.min-Math.min(...y)),s.max-Math.max(...y)),{points:e.points.map((b,w)=>e.indices.includes(w)?{...b,t:b.t+f,v:b.v+h}:b),selection:{t0:e.selection.t0+f,t1:e.selection.t1+f,v0:e.selection.v0+h,v1:e.selection.v1+h},hint:`${e.indices.length} points ${f>=0?"+":""}${f.toFixed(2)}s`}}function DDe(t){var w,O,k;const{raw:e,origin:n,shiftKey:r,altKey:i,range:s,duration:a,snapTimes:o,lane:l,dragIndex:c,xOf:u,yOf:f}=t;let h=r?t.shiftAxis:null,{t:m,v:y}=e;if(r&&n&&(h??(h=Ace({origin:n,raw:e,xOf:u,yOf:f})),{t:m,v:y}=ADe({range:s,origin:n,raw:e,xOf:u,yOf:f,axis:h})),!i&&!r){const E=l.points.filter((M,N)=>N!==c).map(M=>M.t);m=kL(m,[...o??[],...E],ML)}const d=(((w=l.points[c-1])==null?void 0:w.t)??-1/0)+y_,v=(((O=l.points[c+1])==null?void 0:O.t)??1/0)-y_,b=((k=l.points[c])==null?void 0:k.t)??m;return m=v>=d?Math.min(v,Math.max(d,Math.min(a,Math.max(0,m)))):b,{t:m,v:y,shiftAxis:h}}function cX(t,e){const n=e.pointAt(t.clientX,t.clientY),r=Math.min(e.duration,Math.max(0,n.t));return{t:t.altKey?r:kL(r,e.snapTimes??[],ML),v:n.v}}function IDe({pointAt:t,xOf:e,yOf:n,duration:r,snapTimes:i,onRangeSelect:s,onRangeClear:a}){const[o,l]=x.useState(null),c=x.useRef(!1),u=x.useCallback(m=>{if(!s)return;m.preventDefault(),PL(m);const y=cX(m,{pointAt:t,duration:r,snapTimes:i});c.current=!1,l({from:y,to:y})},[s,t,r,i]),f=x.useCallback(m=>{if(o===null)return;const y=cX(m,{pointAt:t,duration:r,snapTimes:i}),{from:d}=o;l({from:d,to:y}),!(Math.max(Math.abs(e(y.t)-e(d.t)),Math.abs(n(y.v)-n(d.v)))<=3)&&(c.current=!0,s==null||s(Math.min(d.t,y.t),Math.max(d.t,y.t),Math.min(d.v,y.v),Math.max(d.v,y.v)))},[o,t,r,i,e,n,s]),h=x.useCallback(()=>{c.current||a==null||a(),c.current=!1,l(null)},[a]);return{dragging:o!==null,arm:u,move:f,finish:h}}function _De({getBox:t,lane:e,range:n,pointAt:r,xOf:i,yOf:s,segmentIndex:a,commitPoints:o,duration:l,snapTimes:c,readOnly:u,onHint:f}){const[h,m]=x.useState(null),[y,d]=x.useState(null),v=x.useRef(null),b=x.useCallback((N,I)=>{const _=t();if(!_)return null;const j=a(N,I);if(j===null)return null;const{t:L}=r(N,I),B=Lf(e,L,n.scale);return Math.abs(s(B)-(I-_.top))<=xDe?j:null},[t,e,r,n.scale,a,s]),w=x.useCallback((N,I,_)=>{v.current=NDe(e,N,r(I,_)),d(null),m(N)},[e,r]),O=x.useCallback(N=>{const I=v.current;if(!I)return;const _=wce({group:I,raw:r(N.clientX,N.clientY),shiftKey:N.shiftKey,altKey:N.altKey,range:n,duration:l,snapTimes:c,xOf:i,yOf:s});f(_.hint),o(_.points,!1)},[o,l,f,r,n,c,i,s]),k=x.useCallback(()=>{v.current=null,m(null)},[]),E=x.useCallback((N,I)=>{d(u?null:b(N,I))},[b,u]),M=x.useCallback(()=>d(null),[]);return{dragIndex:h,hoverIndex:y,hitIndex:b,arm:w,move:O,finish:k,updateHover:E,clearHover:M}}const RDe=3;function jDe(t){return t?{t:t.t,v:t.v}:{t:0,v:0}}function LDe({getBox:t,lane:e,range:n,pointAt:r,xOf:i,yOf:s,commitPoints:a,snapTimes:o,readOnly:l,onSelect:c,onRangeSelect:u,onRangeClear:f,duration:h,rangeSelection:m}){const[y,d]=x.useState(null),[v,b]=x.useState(null),[w,O]=x.useState(null),k=TDe({getBox:t,lane:e,range:n,pointAt:r,xOf:i,commitPoints:a,duration:h,readOnly:l,rangeSelection:m,pointInSelectionAt:(H,se)=>{if(!m)return!1;const ue=W(H,se),be=ue===null?null:e.points[ue];return be?Tg(be,m):!1},onRangeSelect:u,onRangeClear:f,onHint:O}),E=x.useRef(null),M=x.useRef(null),[N,I]=x.useState(null),_=IDe({pointAt:r,xOf:i,yOf:s,duration:h,snapTimes:o,onRangeSelect:u,onRangeClear:f}),j=x.useRef(null),L=x.useRef(!1),B=x.useRef(null),$=x.useCallback(H=>{I(se=>se?{index:se.index,text:H}:null)},[]),Q=x.useCallback(()=>I(null),[]),Y=x.useCallback(()=>{const H=N;if(I(null),!H)return;const se=Number(H.text);if(!Number.isFinite(se))return;const ue=Math.min(n.max,Math.max(n.min,se));a(e.points.map((be,me)=>me===H.index?{...be,v:ue}:be),!0)},[N,e,n,a]),W=x.useCallback((H,se)=>{const ue=t();if(!ue)return null;const be=H-ue.left,me=se-ue.top;for(let pe=0;pe<e.points.length;pe+=1){const ge=e.points[pe];if(ge&&Math.hypot(i(ge.t)-be,s(ge.v)-me)<=vce*1.6)return pe}return null},[t,e,i,s]),J=x.useCallback((H,se)=>{const{t:ue}=r(H,se);for(let be=0;be+1<e.points.length;be+=1){const me=e.points[be],pe=e.points[be+1];if(me&&pe&&ue>me.t&&ue<pe.t)return be}return null},[e,r]),ne=_De({getBox:t,lane:e,range:n,pointAt:r,xOf:i,yOf:s,segmentIndex:J,commitPoints:a,duration:h,snapTimes:o,readOnly:l,onHint:O}),le=x.useCallback(H=>{const se=W(H.clientX,H.clientY);if(se!==null)return{kind:"point",index:se};const ue=H.altKey?J(H.clientX,H.clientY):ne.hitIndex(H.clientX,H.clientY);return ue===null?null:{kind:H.altKey?"curve":"segment",index:ue}},[W,ne,J]),ie=x.useCallback(H=>{if(H.button!==0)return;if(H.stopPropagation(),N&&Y(),l){c==null||c(),_.arm(H);return}if(k.arm(H))return;const se=le(H);if(!se){_.arm(H);return}if(H.preventDefault(),PL(H),ne.clearHover(),se.kind==="curve"){b(se.index);return}if(se.kind==="segment"){ne.arm(se.index,H.clientX,H.clientY);return}E.current=jDe(e.points[se.index]),M.current=MDe(e,e.points[se.index],m),j.current={x:H.clientX,y:H.clientY},L.current=!1,d(se.index)},[le,e,l,c,_,N,Y,m,k,ne]),q=x.useCallback((H,se)=>{if(v===null)return;const ue=e.points[v],be=e.points[v+1];if(!ue||!be)return;const{t:me,v:pe}=r(H,se),ge=vDe({range:n,a:ue,b:be,t:me,v:pe});ge!==null&&(O(`bend ${Math.round(ge.viaX*100)}%`),a(e.points.map((Pe,ve)=>ve===v?{...Pe,curve:void 0,viaX:ge.viaX,viaY:ge.viaY}:Pe),!1))},[v,e,r,n,a]),F=x.useCallback((H,se)=>{const{points:ue,selection:be,hint:me}=wce({group:se,raw:r(H.clientX,H.clientY),shiftKey:H.shiftKey,altKey:H.altKey,range:n,duration:h,snapTimes:o,xOf:i,yOf:s});u==null||u(be.t0,be.t1,be.v0,be.v1),O(me),a(ue,!1)},[a,h,u,r,n,o,i,s]),U=x.useCallback(H=>{if(y===null)return;const se=M.current;if(se){F(H,se);return}H.shiftKey||(B.current=null);const{t:ue,v:be,shiftAxis:me}=DDe({raw:r(H.clientX,H.clientY),origin:E.current,shiftKey:H.shiftKey,altKey:H.altKey,shiftAxis:B.current,range:n,duration:h,snapTimes:o,lane:e,dragIndex:y,xOf:i,yOf:s});B.current=me;const pe=e.points.map((ge,Pe)=>Pe===y?{...ge,t:ue,v:be}:ge);O(`${bDe(n,be)} @ ${ue.toFixed(2)}s`),a(pe,!1)},[y,h,e,r,n,a,o,i,s,F]),Z=x.useCallback(H=>{const se=j.current;se&&Math.hypot(H.clientX-se.x,H.clientY-se.y)>RDe&&(L.current=!0),v!==null?q(H.clientX,H.clientY):ne.dragIndex!==null?ne.move(H):U(H)},[q,v,U,ne]),K=x.useCallback(H=>{if(k.edge!==null){H.stopPropagation(),H.buttons===0?k.cancel():k.move(H);return}if(_.dragging){H.stopPropagation(),_.move(H);return}if(v===null&&y===null&&ne.dragIndex===null){k.updateHover(H),ne.updateHover(H.clientX,H.clientY);return}H.stopPropagation(),Z(H)},[_,v,y,ne,Z,k]),ee=x.useCallback(H=>{if(k.edge!==null){H.stopPropagation(),k.finish();return}if(_.dragging){H.stopPropagation(),_.finish();return}if(y===null&&v===null&&ne.dragIndex===null)return;H.stopPropagation();const se=y,ue=se!==null&&H.shiftKey&&!L.current;if(d(null),b(null),ne.finish(),E.current=null,M.current=null,B.current=null,j.current=null,O(null),ue){a(e.points.filter((be,me)=>me!==se),!0);return}a(e.points,!0)},[_,v,y,ne,e,a,k]),re=x.useCallback(H=>{if(k.edge!==null){H.stopPropagation(),k.cancel();return}ee(H)},[k,ee]),z=x.useCallback(H=>{if(l)return;H.stopPropagation(),H.preventDefault();const se=W(H.clientX,H.clientY);if(H.altKey){const ge=se??J(H.clientX,H.clientY);if(ge===null)return;a(e.points.map((Pe,ve)=>ve===ge?{t:Pe.t,v:Pe.v}:Pe),!0);return}if(se!==null){const ge=e.points[se];ge&&I({index:se,text:String(Number(ge.v.toFixed(3)))});return}const{t:ue,v:be}=r(H.clientX,H.clientY),me=e.points.filter(ge=>Math.abs(ge.t-ue)>g_),pe=e.points.length===0&&ue>g_?[{t:0,v:be}]:[];a([...pe,...me,{t:ue,v:be}].sort((ge,Pe)=>ge.t-Pe.t),!0)},[e,r,a,l,W,J]);return{dragIndex:y,curveIndex:v,segmentDragIndex:ne.dragIndex,segmentHoverIndex:ne.hoverIndex,edgeDrag:k.edge,edgeHover:k.hover,cancelDrag:re,hint:w,hitIndex:W,segmentIndex:J,onPointerLeave:ne.clearHover,onPointerDown:ie,onPointerMove:K,endDrag:ee,onDoubleClick:z,editing:N,setEditingText:$,commitEdit:Y,cancelEdit:Q}}function FDe({text:t,leftPx:e,label:n,onChange:r,onCommit:i,onCancel:s}){return p.jsx("input",{className:"hf-automation-value pointer-events-auto absolute rounded-[3px] border border-panel-border-input bg-panel-bg-2 px-1 font-mono text-[9px] text-panel-text-1",style:{left:e,top:1,width:44,zIndex:4},onPointerDown:a=>a.stopPropagation(),onKeyDown:a=>{a.stopPropagation(),a.key==="Enter"&&i(),a.key==="Escape"&&s()},onChange:a=>r(a.target.value),onBlur:i,value:t,"aria-label":`${n} value`,autoFocus:!0})}const uX=[{id:"ramp-up",label:"Ramp up"},{id:"ramp-down",label:"Ramp down"},{id:"swell",label:"Swell"},{id:"dip",label:"Dip"}],ZO=.4,$De=.25;function fX(t,e,n){return t.points.length===0?e.default??(e.min+e.max)/2:Lf(t,n,e.scale)}function BDe(t){const{shape:e,lane:n,range:r,t0:i,t1:s}=t,a=fX(n,r,i),o=fX(n,r,s),l=(i+s)/2;switch(e){case"ramp-up":return[{t:i,v:r.min},{t:s,v:o}];case"ramp-down":return[{t:i,v:a},{t:s,v:r.min}];case"swell":return[{t:i,v:a,curve:ZO},{t:l,v:r.max,curve:-ZO},{t:s,v:o}];case"dip":return[{t:i,v:a,curve:-ZO},{t:l,v:BE(r,xc(r,a)*$De),curve:ZO},{t:s,v:o}]}}const VDe=x.memo(function({x:e,y:n,onClose:r,onInsertShape:i,onSimplify:s,canSimplify:a}){const o=F0(r),l="block w-full px-2 py-1 text-left text-[11px] text-panel-text-1 hover:bg-panel-bg-3 disabled:opacity-40",c=140,u=uX.length*24+32,f=n+u-window.innerHeight,h=e+c>window.innerWidth?e-c:e,m=f>0?n-f-8:n;return Fl.createPortal(p.jsxs("div",{ref:o,className:"hf-automation-menu fixed z-[200] min-w-[140px] rounded border border-panel-border-input bg-panel-bg-2 py-1 shadow-lg",style:{left:h,top:m},children:[uX.map(y=>p.jsx("button",{type:"button",className:l,onClick:()=>{i(y.id),r()},children:y.label},y.id)),p.jsx("div",{className:"my-1 border-t border-panel-border-input"}),p.jsx("button",{type:"button",className:l,disabled:!a,title:a?void 0:"Fewer than three points in the selection",onClick:()=>{s(),r()},children:"Simplify"})]}),document.body)});function HDe(t,e,n=.02){if(t.length<=2)return t;const r=new Array(t.length).fill(!1),i=r.length-1;r[0]=!0,r[i]=!0;const s=[[0,i]];for(;s.length>0;){const a=s.pop();if(!a)break;const[o,l]=a,c=t[o],u=t[l];if(!c||!u||l-o<2)continue;const f=xc(e,c.v),h=xc(e,u.v),m=u.t-c.t;let y=-1,d=n;for(let v=o+1;v<l;v+=1){const b=t[v];if(!b)continue;const w=m>0?(b.t-c.t)/m:0,O=Math.abs(xc(e,b.v)-(f+w*(h-f)));O>d&&(d=O,y=v)}y>=0&&(r[y]=!0,s.push([o,y],[y,l]))}return t.filter((a,o)=>r[o])}function QDe({path:t,lane:e,range:n,accentColor:r,activeSegment:i,xOf:s,yOf:a}){const o=i===null?null:wDe({lane:e,range:n,index:i,xOf:s,yOf:a});return p.jsxs(p.Fragment,{children:[p.jsx("path",{"data-automation-envelope":"",d:t,fill:"none",stroke:r,strokeWidth:1.5,opacity:e.points.length===0?.35:.95}),o?p.jsx("path",{"data-automation-segment-active":i??void 0,d:o,fill:"none",stroke:r,strokeWidth:3,strokeLinecap:"round",opacity:1,pointerEvents:"none"}):null]})}const zDe=4.9,ZDe=Cj.rowBorder;function GDe(t,e){return!!e&&Tg(t,e)}function UDe(t,e){return{radius:zDe*(e?1.3:t?1.15:1),stroke:t?"#fff":"rgba(0,0,0,0.5)",strokeWidth:t?1.5:1}}function XDe(t){return t?"Drag a box to select points, which also selects this clip; then double-click to add a point":"Double-click to add a point, drag to shape, double-click a point to type a value, right-click or Shift+click to remove it. Drag a line segment to move both endpoints. Drag the background to draw a box around points, then Delete to remove them or drag one to move them all. Alt-drag the line to curve it. Shift locks an axis mid-drag; Alt ignores the grid."}function WDe({readOnly:t,note:e,hovered:n,hasRange:r,leftPx:i,widthPx:s}){return!t||!e||!n||r?null:p.jsx("div",{"data-automation-readonly-note":"",className:"hf-automation-readonly-note pointer-events-none absolute rounded-[3px] bg-black/85 px-1.5 py-0.5 text-[9px] text-white/80",style:{left:i+6,top:2,zIndex:3,maxWidth:Math.max(120,s-12)},children:e})}function qDe(t){return t.dragging||t.hasRange||!t.readOnly&&t.hovered?1:0}function YDe(t,e,n,r){return n?"col-resize":t?"pointer":e?"grabbing":r?"grab":"crosshair"}function KDe({duration:t,widthPx:e,leftPx:n,topPx:r,automation:i,target:s,range:a,accentColor:o,playheadSec:l,onPreview:c,onCommit:u,snapTimes:f,readOnly:h,readOnlyNote:m,onSelect:y,rangeSelection:d,onRangeSelect:v,onRangeClear:b}){var pe;const w=EL(i,s),O=x.useRef(null),[k,E]=x.useState(null),M=x.useMemo(()=>k?{target:s,points:k.points}:w,[k,s,w]);x.useEffect(()=>{k&&k.basedOn!==i&&E(null)},[i,k]),x.useEffect(()=>{E(null)},[s]);const N=kd,I=6,_=N-I*2,j=x.useCallback(ge=>Al+(t>0?ge/t*e:0),[t,e]),L=x.useCallback(ge=>I+(1-xc(a,ge))*_,[a,_]),B=x.useCallback((ge,Pe)=>{var Ce;const ve=(Ce=O.current)==null?void 0:Ce.getBoundingClientRect();if(!ve||ve.width<=0)return{t:0,v:a.default??a.min};const xe=Math.min(t,Math.max(0,(ge-ve.left-Al)/e*t)),we=1-(Pe-ve.top-I)/_;return{t:xe,v:BE(a,we)}},[t,_,a,e]),$=x.useMemo(()=>SDe({lane:M,range:a,widthPx:e,xOf:j,yOf:L}),[M,a,e,j,L]),Q=x.useCallback((ge,Pe)=>{E({points:ge,basedOn:i});const ve=TL(i,{target:s,points:ge});Pe?u(ve):c(ve)},[i,s,u,c]),Y=x.useCallback(()=>{var ge;return((ge=O.current)==null?void 0:ge.getBoundingClientRect())??null},[]),W=LDe({getBox:Y,lane:M,range:a,pointAt:B,xOf:j,yOf:L,commitPoints:Q,snapTimes:f,readOnly:h,onSelect:y,onRangeSelect:v,onRangeClear:b,duration:t,rangeSelection:d}),{dragIndex:J,curveIndex:ne,segmentDragIndex:le,segmentHoverIndex:ie,edgeDrag:q,edgeHover:F,hint:U,editing:Z}=W,K=x.useCallback(ge=>{h||Q(M.points.filter((Pe,ve)=>ve!==ge),!0)},[M,Q,h]),[ee,re]=x.useState(null),[z,H]=x.useState(!1),se=x.useCallback(ge=>{if(!d)return;const Pe=BDe({shape:ge,lane:M,range:a,t0:d.t0,t1:d.t1});Q(V6({lane:M,range:a,t0:d.t0,t1:d.t1,inner:Pe}),!0)},[d,M,a,Q]),ue=x.useCallback(()=>{if(!d)return;const ge=HDe(B6(M,d.t0,d.t1),a);Q(V6({lane:M,range:a,t0:d.t0,t1:d.t1,inner:ge}),!0)},[d,M,a,Q]),be=x.useCallback(ge=>{h||!d||Tg(B(ge.clientX,ge.clientY),d)&&(ge.preventDefault(),re({x:ge.clientX,y:ge.clientY}))},[h,d,B]),me=M.points.length>0&&l!==null?Lf(M,l,a.scale):null;return p.jsxs("div",{className:"hf-automation-lane pointer-events-none absolute",style:{top:r,left:0,right:0,height:N},"data-automation-lane":s,children:[p.jsx("div",{"data-automation-lane-border":"",className:"hf-automation-lane-border pointer-events-none absolute",style:{top:0,left:0,right:0,height:1,background:ZDe,zIndex:1}}),p.jsxs("svg",{ref:O,className:"hf-automation-svg pointer-events-auto absolute",style:{left:n-Al,top:0,width:e+Al*2,height:N,cursor:YDe(h,J!==null||ne!==null||le!==null,q!==null||F,ie!==null),opacity:h?.55:1,touchAction:"none"},width:e+Al*2,height:N,onPointerEnter:()=>H(!0),onPointerLeave:()=>{H(!1),W.onPointerLeave()},onPointerDown:W.onPointerDown,onPointerMove:W.onPointerMove,onPointerUp:W.endDrag,onPointerCancel:W.cancelDrag,onDoubleClick:W.onDoubleClick,onContextMenu:be,role:"group","aria-label":`${a.label} automation`,children:[p.jsx("title",{children:XDe(h)}),p.jsx("line",{x1:Al,x2:Al+e,y1:I+_/2,y2:I+_/2,stroke:"rgba(255,255,255,0.08)",strokeDasharray:"3 4"}),d?p.jsx("rect",{"data-automation-selection":"",x:j(d.t0),y:L(d.v1),width:Math.max(0,j(d.t1)-j(d.t0)),height:Math.max(0,L(d.v0)-L(d.v1)),fill:o,opacity:.15,stroke:o,strokeOpacity:.6,pointerEvents:"none"}):null,p.jsx(QDe,{path:$,lane:M,range:a,accentColor:o,activeSegment:le??ie,xOf:j,yOf:L}),M.points.map((ge,Pe)=>{const ve=GDe(ge,d),{radius:xe,stroke:we,strokeWidth:Ce}=UDe(ve,Pe===J);return p.jsx("circle",{"data-automation-point":Pe,...ve?{"data-automation-point-in-range":""}:{},cx:j(ge.t),cy:L(ge.v),r:xe,fill:o,stroke:we,strokeWidth:Ce,style:{cursor:h?"default":"grab",opacity:qDe({readOnly:h,hovered:z,dragging:J!==null,hasRange:!!d})},onContextMenu:Me=>{Me.preventDefault(),Me.stopPropagation(),K(Pe)}},`${Pe}-${ge.t}`)}),l!==null&&me!==null?p.jsx("circle",{"data-automation-playhead":"",cx:j(l),cy:L(me),r:2.5,fill:"#fff",opacity:.8,pointerEvents:"none"}):null]}),Z?p.jsx(FDe,{text:Z.text,leftPx:n+j(((pe=M.points[Z.index])==null?void 0:pe.t)??0)-Al-18,label:a.label,onChange:W.setEditingText,onCommit:W.commitEdit,onCancel:W.cancelEdit}):null,U?p.jsx("div",{className:"hf-automation-hint pointer-events-none absolute rounded-[3px] bg-black/80 px-1 py-0.5 font-mono text-[9px] text-white",style:{left:n+6,top:2,zIndex:3},children:U}):null,p.jsx(WDe,{readOnly:h,note:m,hovered:z,hasRange:!!d,leftPx:n,widthPx:e}),ee&&d?p.jsx(VDe,{x:ee.x,y:ee.y,onClose:()=>re(null),onInsertShape:se,onSimplify:ue,canSimplify:B6(M,d.t0,d.t1).length>=3}):null]})}const hX={version:1,lanes:[]},JDe=new Map,eIe=new Map,tIe=64;function Oce(t,e,n){const r=t.get(e);if(r!==void 0)return t.delete(e),t.set(e,r),r;const i=n();if(t.size>=tIe){const s=t.keys().next();s.done||t.delete(s.value)}return t.set(e,i),i}function VE(t){const e=t.fxChain;return e?Oce(JDe,e,()=>{try{return cE(e)}catch{return null}}):null}function Cce(t){const e=t.automation;if(!e)return hX;const n=VE(t);return Oce(eIe,`${e}\0${t.fxChain??""}`,()=>{try{const r=Sse(wse(e),n??void 0);return{...r,lanes:nIe(r.lanes,n)}}catch{return hX}})}function x_(t,e){return((e==null?void 0:e.nodes)??[]).some(n=>n.fromCarve&&n.id&&t.startsWith(`fx.${n.id}.`))}function kce(t){return Cce(t).lanes}function Ece(t,e){var s;const n=uy(t);if(!n||n.kind!=="fx")return null;const r=e==null?void 0:e.nodes.find(a=>a.id===n.nodeId),i=(s=r==null?void 0:r.params)==null?void 0:s.frequency;return typeof i=="number"?i:null}function nIe(t,e){const n=[],r=[];for(const i of t){const s=Ece(i.target,e);s===null?r.push(i):n.push({lane:i,freq:s})}return n.sort((i,s)=>s.freq-i.freq),[...n.map(i=>i.lane),...r]}function Tce(t){if(t<1e3)return`${Math.round(t)} Hz`;const e=t/1e3;return`${e>=10?Math.round(e):Number(e.toFixed(1))} kHz`}function Pce(t,e){const n=u0(t,e??void 0);if(!n)return null;const r=n.label.split(" · "),i=r.at(-1)??n.label,s=r.length>1?r.slice(0,-1).join(" · "):null,a=Ece(t,e),o=[s,a===null?null:Tce(a)].filter(Boolean).join(" ");return{name:o||i,param:o?i:""}}function rIe(t,e){return iIe(t,e)}function Vf(t){const e=new Map;for(const n of t){if(!Ko(n))continue;const r=VE(n);for(const i of kce(n)){const s=rIe(i.target,r),a=Pce(i.target,r);if(!s||!a)continue;const o=e.get(s);o?o.entries.push({element:n,lane:i}):e.set(s,{key:s,name:a.name,param:a.param,entries:[{element:n,lane:i}]})}}return[...e.values()]}function iIe(t,e){const n=Pce(t,e);return n?n.param?`${n.name} · ${n.param}`:n.name:null}function sIe({element:t,rows:e,isSelected:n,lanes:r,pps:i,top:s,accentColor:a,currentTime:o,beatTimes:l}){const c=x.useMemo(()=>(l??[]).filter(h=>h>=t.start&&h<=t.start+t.duration).map(h=>h-t.start),[l,t.start,t.duration]),u=r.bind(t,n);if(x.useEffect(()=>{var m;const h=(m=u.selection)==null?void 0:m.target;h!==void 0&&!u.lanes.some(y=>y.target===h)&&u.onRangeClear()},[u]),e.length===0)return null;const f=o>=t.start&&o<=t.start+t.duration;return p.jsx(p.Fragment,{children:e.map(({lane:h,rowIndex:m})=>{var d;const y=u0(h.target,u.chain??void 0);return y?p.jsx(KDe,{duration:t.duration,widthPx:Math.max(t.duration*i,4),leftPx:t.start*i,topPx:s+m*kd,automation:u.automation,target:h.target,range:y,accentColor:a,playheadSec:f?o-t.start:null,onPreview:u.onPreview,onCommit:u.onCommit,onSelect:u.onSelect,snapTimes:c,readOnly:u.readOnly||x_(h.target,u.chain),readOnlyNote:x_(h.target,u.chain)?"Owned by the voiceover carve — re-derived on every analysis. Change strength in the FX rack, or turn the carve off to edit these by hand.":u.readOnly?"Read-only here.":void 0,rangeSelection:((d=u.selection)==null?void 0:d.target)===h.target?{t0:u.selection.t0,t1:u.selection.t1,v0:u.selection.v0,v1:u.selection.v1}:null,onRangeSelect:(v,b,w,O)=>u.onRangeSelect(h.target,v,b,w,O),onRangeClear:u.onRangeClear},h.target):null})})}function Mce({elements:t,isSelected:e,lanes:n,pps:r,laneCount:i,topOffset:s,accentColor:a,currentTime:o,beatTimes:l}){const c=t.filter(Ko),u=new Map;Vf(c).forEach((h,m)=>{for(const y of h.entries){const d=zn(y.element),v=u.get(d);v?v.push({lane:y.lane,rowIndex:m}):u.set(d,[{lane:y.lane,rowIndex:m}])}});const f=s??Sg(i);return p.jsx(p.Fragment,{children:c.map(h=>p.jsx(sIe,{element:h,rows:u.get(zn(h))??[],isSelected:e(h),lanes:n,pps:r,top:f,accentColor:a,currentTime:o,beatTimes:l},zn(h)))})}const NL=Dc("DomEditActionsContext",null),DL=Dc("DomEditSelectionContext",null);function HE(){const t=x.useContext(NL);if(!t)throw new Error("useDomEditActionsContext must be used within DomEditProvider");return t}function yS(){return x.useContext(NL)}function yy(){const t=x.useContext(DL);if(!t)throw new Error("useDomEditSelectionContext must be used within DomEditProvider");return t}function Nce(){return x.useContext(DL)}function QE(){return{...HE(),...yy()}}function aIe({value:{domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:s,agentPromptSelectionContext:a,domEditSelectionRef:o,handleTimelineElementSelect:l,handlePreviewCanvasMouseDown:c,handlePreviewCanvasPointerMove:u,handlePreviewCanvasPointerLeave:f,applyDomSelection:h,clearDomSelection:m,handleDomStyleCommit:y,handleDomAttributeCommit:d,handleDomAttributeLiveCommit:v,handleDomAttributeQuietCommit:b,handleDomHtmlAttributeCommit:w,handleDomAttributesCommit:O,handleDomPathOffsetCommit:k,handleDomGroupPathOffsetCommit:E,handleDomZIndexReorderCommit:M,handleDomBoxSizeCommit:N,handleDomRotationCommit:I,handleDomManualEditsReset:_,handleDomTextCommit:j,handleDomRichTextCommit:L,handleDomTextFieldStyleCommit:B,handleDomAddTextField:$,handleDomRemoveTextField:Q,handleAskAgent:Y,handleAgentModalSubmit:W,handleBlockedDomMove:J,handleDomManualDragStart:ne,handleDomEditElementDelete:le,handleGroupSelection:ie,handleUngroupSelection:q,setActiveGroupElement:F,activeGroupElement:U,buildDomSelectionFromTarget:Z,buildDomSelectionForTimelineElement:K,updateDomEditHoverSelection:ee,resolveImportedFontAsset:re,setAgentModalOpen:z,setAgentPromptSelectionContext:H,setAgentModalAnchorPoint:se,selectedGsapAnimations:ue,gsapMultipleTimelines:be,gsapUnsupportedTimelinePattern:me,handleGsapUpdateProperty:pe,handleGsapUpdateMeta:ge,handleGsapDeleteAnimation:Pe,handleGsapDeleteAllForElement:ve,handleGsapAddAnimation:xe,handleGsapAddProperty:we,handleGsapRemoveProperty:Ce,handleGsapUpdateFromProperty:Me,handleGsapAddFromProperty:Ve,handleGsapRemoveFromProperty:tt,handleGsapAddKeyframe:Ze,handleGsapAddKeyframeBatch:qe,handleGsapRemoveKeyframe:pt,handleGsapMoveKeyframeToPlayhead:it,handleGsapMoveKeyframe:vt,handleGsapResizeKeyframedTween:Ot,handleGsapConvertToKeyframes:Kt,handleGsapRemoveAllKeyframes:qt,handleResetSelectedElementKeyframes:fn,commitAnimatedProperty:Jt,commitAnimatedProperties:Je,handleSetArcPath:St,handleUpdateArcSegment:At,handleUnroll:Ke,invalidateGsapCache:Be,previewIframeRef:We,commitMutation:Ye,applyMarqueeSelection:Zt,handleUpdateKeyframeEase:Te,handleUpdateSegmentEase:De,handleSetAllKeyframeEases:ze},children:st}){const Gt=x.useRef(Ye);Gt.current=Ye;const ln=x.useCallback((Pr,mt)=>Gt.current(Pr,mt),[]),Yt=x.useMemo(()=>({handleTimelineElementSelect:l,handlePreviewCanvasMouseDown:c,handlePreviewCanvasPointerMove:u,handlePreviewCanvasPointerLeave:f,applyDomSelection:h,clearDomSelection:m,handleDomStyleCommit:y,handleDomAttributeCommit:d,handleDomAttributeLiveCommit:v,handleDomAttributeQuietCommit:b,handleDomHtmlAttributeCommit:w,handleDomAttributesCommit:O,handleDomPathOffsetCommit:k,handleDomGroupPathOffsetCommit:E,handleDomZIndexReorderCommit:M,handleDomBoxSizeCommit:N,handleDomRotationCommit:I,handleDomManualEditsReset:_,handleDomTextCommit:j,handleDomRichTextCommit:L,handleDomTextFieldStyleCommit:B,handleDomAddTextField:$,handleDomRemoveTextField:Q,handleAskAgent:Y,handleAgentModalSubmit:W,handleBlockedDomMove:J,handleDomManualDragStart:ne,handleDomEditElementDelete:le,handleGroupSelection:ie,handleUngroupSelection:q,setActiveGroupElement:F,buildDomSelectionFromTarget:Z,buildDomSelectionForTimelineElement:K,updateDomEditHoverSelection:ee,resolveImportedFontAsset:re,setAgentModalOpen:z,setAgentPromptSelectionContext:H,setAgentModalAnchorPoint:se,handleGsapUpdateProperty:pe,handleGsapUpdateMeta:ge,handleGsapDeleteAnimation:Pe,handleGsapDeleteAllForElement:ve,handleGsapAddAnimation:xe,handleGsapAddProperty:we,handleGsapRemoveProperty:Ce,handleGsapUpdateFromProperty:Me,handleGsapAddFromProperty:Ve,handleGsapRemoveFromProperty:tt,handleGsapAddKeyframe:Ze,handleGsapAddKeyframeBatch:qe,handleGsapRemoveKeyframe:pt,handleGsapMoveKeyframeToPlayhead:it,handleGsapMoveKeyframe:vt,handleGsapResizeKeyframedTween:Ot,handleGsapConvertToKeyframes:Kt,handleGsapRemoveAllKeyframes:qt,handleResetSelectedElementKeyframes:fn,commitAnimatedProperty:Jt,commitAnimatedProperties:Je,handleSetArcPath:St,handleUpdateArcSegment:At,handleUnroll:Ke,invalidateGsapCache:Be,previewIframeRef:We,commitMutation:ln,applyMarqueeSelection:Zt,handleUpdateKeyframeEase:Te,handleUpdateSegmentEase:De,handleSetAllKeyframeEases:ze}),[l,c,u,f,h,m,y,d,v,b,w,O,k,E,M,N,I,_,j,L,B,$,Q,Y,W,J,ne,le,ie,q,F,Z,K,ee,re,z,H,se,pe,ge,Pe,ve,xe,we,Ce,Me,Ve,tt,Ze,qe,pt,it,vt,Ot,Kt,qt,fn,Jt,Je,St,At,Ke,Be,We,ln,Zt,Te,De,ze]),Mn=x.useMemo(()=>({domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,activeGroupElement:U,domEditSelectionRef:o,selectedGsapAnimations:ue,gsapMultipleTimelines:be,gsapUnsupportedTimelinePattern:me,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:s,agentPromptSelectionContext:a}),[t,e,n,U,o,ue,be,me,r,i,s,a]);return p.jsx(NL,{value:Yt,children:p.jsx(DL,{value:Mn,children:st})})}function Hf(t){const e=lIe(t);return e?e.isContentEditable?!0:e.closest(oIe)!==null:!1}const oIe=["input","textarea","select","[contenteditable]:not([contenteditable='false'])","[role='textbox']","[role='searchbox']","[role='combobox']",".cm-editor"].join(",");function lIe(t){return!t||typeof t!="object"?null:typeof t.closest=="function"?t:null}function Dce(t){return t.label||t.id||t.tag}function dX(t){const e=t.trim(),n=/^[a-z]+:\/\//i.test(e)?new URL(e).pathname:e;return decodeURIComponent(n).replace(/\\/g,"/").replace(/^\.?\//,"")}function cIe(t,e){const n=dX(t).split("/").filter(Boolean),r=dX(e).split("/").filter(Boolean);for(n.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")||e}function uIe(t){return/^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(t)}function fIe(t,e){const n=e.trim();if(!n)return;const r=n.replace(/\\/g,"/");if(uIe(r))return r;const i=t==null?void 0:t.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(i)return`${i}/${r.replace(/^\.?\//,"")}`}function b_(t,e){const n=e.trim();return n&&(["border-radius","border-width","font-size","letter-spacing"].includes(t)&&/^-?\d+(\.\d+)?$/.test(n)?`${n}px`:n)}function hIe(t){return/^url\(/i.test(t.trim())}function dIe(t){return t==="left"||t==="top"||t==="width"||t==="height"}function Ice(t){if(!t||typeof t!="object")return null;const e=t;return e.nodeType===1?t:e.nodeType===3&&e.parentElement?e.parentElement:null}function _ce(t){return Hf(t)}function GO(t){const n=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform)?"Cmd":"Ctrl";return t==="undo"?`${n}+Z`:`${n}+Shift+Z`}function pIe(t,e,n){return t.id?e.domId===t.id&&(e.sourceFile||"index.html")===n:!1}function mIe(t,e){return!t.isCompositionHost||!t.compositionSrc?!1:e.compositionSrc===t.compositionSrc}function gIe(t,e){return t.selector?e.selector===t.selector&&(e.selectorIndex??0)===(t.selectorIndex??0)&&(e.sourceFile??"index.html")===t.sourceFile:!1}function IL(t,e){const n=t.sourceFile||"index.html",r=t.id?e.find(a=>pIe(t,a,n)):void 0;if(r)return r.key??r.id;const i=t.selector?e.find(a=>gIe(t,a)):void 0;if(i)return i.key??i.id;const s=e.find(a=>mIe(t,a));return s?s.key??s.id:t.id&&n!=="index.html"?`${n}#${t.id}`:null}function Rce(t,e,n){let r=(t==null?void 0:t.parentElement)??null;for(;r;){const i=r.id;if(i){const s=e.find(a=>a.domId===i&&(a.sourceFile??"index.html")===n);if(s)return s.key??s.id}r=r.parentElement}return null}function H6(t,e,n){return IL(t,e)??Rce(t.element,e,t.sourceFile||n||"index.html")}function yIe(t,e,n){return t.map(r=>H6(r,e,n)).filter(r=>r!==null)}function xIe(t,e){if(!e||!Number.isFinite(e.start)||!Number.isFinite(e.duration))return null;const n=Math.max(0,e.start),r=Math.max(n,n+Math.max(0,e.duration)),i=Number.isFinite(t)?t:n;return Er(i,n,r)}function Er(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function _L(t){return Array.from(t.matchAll(/\bid="([^"]+)"/g),e=>e[1]??"")}const UO={image:3,video:5,audio:5};async function pX(t,e,n){if(n==="image")return UO.image;const r=document.createElement(n==="video"?"video":"audio");r.preload="metadata",r.src=`/api/projects/${t}/preview/${e}`;const i=await new Promise(s=>{const a=window.setTimeout(()=>s(UO[n]),3e3),o=l=>{window.clearTimeout(a),s(l)};r.addEventListener("loadedmetadata",()=>{const l=Number(r.duration);o(Number.isFinite(l)&&l>0?ba(l):UO[n])},{once:!0}),r.addEventListener("error",()=>o(UO[n]),{once:!0})});return r.src="",r.load(),i}function bIe(t=()=>`automation-gesture:${++vIe}`){let e=null;const n=r=>({key:r,ms:Number.POSITIVE_INFINITY});return{live:()=>(e??(e=t()),n(e)),commit:()=>{const r=e??t();return e=null,n(r)}}}let vIe=0;function AIe(){var c;const t=x.useRef(bIe()),e=yS(),n=((c=Nce())==null?void 0:c.domEditSelection)??null,r=fe(u=>u.elements),i=fe(u=>u.automationSelection),s=fe(u=>u.setAutomationSelection),a=fe(u=>u.clearAutomationSelection),o=x.useMemo(()=>n?H6(n,r,null):null,[n,r]),l=x.useCallback((u,f)=>{const h=VE(u),m=Cce(u),y=zn(u),d=(v,b)=>{if(!e||!f)return;const w=v.lanes.length>0?Ose(v):"",O=b?t.current.commit():t.current.live();b?e.handleDomAttributeQuietCommit(io,w,O):e.handleDomAttributeLiveCommit(io,w||null,void 0,{coalesce:O,previewOnly:!0})};return{automation:m,lanes:m.lanes,chain:h,onPreview:v=>d(v,!1),onCommit:v=>d(v,!0),onSelect:()=>void(e==null?void 0:e.handleTimelineElementSelect(u)),readOnly:!e||!f,commitTargetKey:e?o:null,selection:(i==null?void 0:i.elementKey)===y?i:null,onRangeSelect:(v,b,w,O,k)=>{e&&s({elementKey:y,target:v,t0:b,t1:w,v0:O,v1:k})},onRangeClear:()=>a()}},[e,o,i,s,a]);return x.useMemo(()=>({bind:l}),[l])}let mX=null,RL=null,_p=null;function jce(t){t!==mX&&(mX=t,RL=null,_p=null)}function SIe(t,e,n,r,i){const s=B6(e,r,i).map(a=>({...a,t:a.t-r}));return s.length===0&&e.points.length===0?!1:(jce(t),RL={sourceRange:n,span:i-r,points:s.length>0?s:[{t:0,v:Lf(e,r,n.scale)},{t:i-r,v:Lf(e,i,n.scale)}]},!0)}function Lce(t){return jce(t),RL}function wIe(t,e,n){return t.points.map(r=>({...r,t:n+r.t,v:BE(e,xc(t.sourceRange,r.v))}))}function OIe(t){_p={...t}}function CIe(t){return _p?_p.elementKey===t.elementKey&&_p.target===t.target&&_p.t0===t.t0&&_p.t1===t.t1:!1}function Fce(t){if(!t)return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"?!0:t instanceof HTMLElement&&t.isContentEditable}function Q6(t,e){return(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()===e}function jL(t){return t.key??t.id}function LL(t,e){return e?t.find(n=>jL(n)===e)??null:null}function $ce(t,e,n){const r=LL(t.elements,n.elementKey);if(!r)return null;const i=e.bind(r,n.elementKey===t.selectedElementId);if(i.readOnly)return null;const s=u0(n.target,i.chain??void 0);return s?{binding:i,lane:EL(i.automation,n.target),range:s}:null}function kIe(t,e,n){const r=$ce(t,e,n);if(!r)return null;const i=r.lane.points.filter(s=>!Tg(s,n));return i.length===r.lane.points.length?null:{onCommit:r.binding.onCommit,next:TL(r.binding.automation,{target:n.target,points:i})}}function EIe(t,e,n){var r;return n&&n.elementKey===e?n.target:(r=t.lanes[0])==null?void 0:r.target}function TIe(t,e,n){const r=LL(t.elements,t.selectedElementId);if(!r)return null;const i=jL(r),s=e.bind(r,!0);if(s.readOnly||s.commitTargetKey!==i)return null;const a=EIe(s,i,n);if(!a)return null;const o=u0(a,s.chain??void 0);return o?{elementKey:i,element:r,target:a,binding:s,lane:EL(s.automation,a),range:o}:null}function PIe(t,e){return t.currentTime>=e.start&&t.currentTime<=e.start+e.duration}function Bce(t,e,n,r){if(n>e.duration)return null;const s=r!==null&&r.elementKey===jL(e)?CIe(r)?r.t1:r.t0:PIe(t,e)?t.currentTime-e.start:null;return s===null?null:Er(s,0,e.duration-n)}function MIe(t,e,n){if(!Q6(t,"v"))return!1;const r=Lce(e.timelineProjectId);if(!r)return!1;const i=e.automationSelection,s=TIe(e,n,i);if(!s)return!1;const a=Bce(e,s.element,r.span,i);if(a===null)return!1;const o=a+r.span,l=wIe(r,s.range,a),c=V6({lane:s.lane,range:s.range,t0:a,t1:o,inner:l});t.preventDefault(),t.stopImmediatePropagation(),s.binding.onCommit(TL(s.binding.automation,{target:s.target,points:c}));const u={elementKey:s.elementKey,target:s.target,t0:a,t1:o,v0:s.range.min,v1:s.range.max};return e.setAutomationSelection(u),OIe(u),!0}function NIe(t,e,n,r){if(!Q6(t,"c"))return!1;const i=$ce(e,n,r);return!i||!SIe(e.timelineProjectId,i.lane,i.range,r.t0,r.t1)?!1:(t.preventDefault(),t.stopImmediatePropagation(),!0)}function DIe(t){if(Fce(document.activeElement))return!1;const e=fe.getState();if(Q6(t,"c"))return e.automationSelection!==null;if(!Q6(t,"v"))return!1;const n=Lce(e.timelineProjectId);if(!n)return!1;const r=LL(e.elements,e.selectedElementId);return r?Bce(e,r,n.span,e.automationSelection)!==null:!1}function IIe(t,e,n,r){if(!(t.key==="Delete"||t.key==="Backspace")||t.metaKey||t.ctrlKey)return!1;const s=kIe(e,n,r);return s?(t.preventDefault(),t.stopImmediatePropagation(),s.onCommit(s.next),!0):!1}function _Ie({lanes:t}){x.useEffect(()=>{const e=n=>{if(Fce(document.activeElement)||n.defaultPrevented)return;const r=fe.getState();if(MIe(n,r,t))return;const i=r.automationSelection;if(i){if(n.key==="Escape"){r.clearAutomationSelection();return}NIe(n,r,t,i)||IIe(n,r,t,i)}};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[t])}const zE="data-fx-carve",RIe=[160,250,400,630,1e3,1600,2500,4e3,6e3],Jr=4096,jIe=2048,LIe=/sfx|foley|whoosh|impact|riser|stinger|swoosh|thud|boom|click|ding|beep|ambien|room[-_ ]?tone/i,FIe="(?<![a-z0-9])",$Ie="(?![a-z0-9])",K2=t=>`${FIe}${t}${$Ie}`,BIe=new RegExp(`music|bgm|${K2("bed")}|soundtrack|score|${K2("song")}|theme|instrumental|track\\d`,"i"),VIe=new RegExp(`voice|${K2("vo")}|${K2("vox")}|narrat|speech|dialog|monolog|announce|${K2("tts")}|talk|interview|podcast|recap|script`,"i");function v0(...t){const e=t.filter(Boolean).join(" ");return VIe.test(e)?"voice":LIe.test(e)?"sfx":BIe.test(e)?"music":"unknown"}function HIe(t,e){const n=r=>typeof r.duration=="number"&&Number.isFinite(r.duration)?r.start+Math.max(0,r.duration):Number.POSITIVE_INFINITY;return t.start<n(e)&&e.start<n(t)}function QIe(...t){return v0(...t)!=="voice"}function zIe(...t){const e=v0(...t);return e==="music"||e==="sfx"}const Pg={enabled:!0,sources:[],strength:.25};function ZIe(t){const e=Number.isFinite(t)?Math.min(1,Math.max(0,t)):.5;return{maxCutDb:Number((2+e*16).toFixed(2)),bands:Math.max(1,Math.min(6,Math.round(1+e*6))),q:Number((1.1+e*1.2).toFixed(2)),intelligibilityBias:Number(Math.min(1,.6+e*.4).toFixed(2)),duckDb:Number((e*24).toFixed(2)),headroomDb:Number((6+e*12).toFixed(2))}}function Vce(t){const e=t,n=o=>{const l=typeof o=="number"?o:Number(o);return Number.isFinite(l)?l:null};if(t==null)return{...Pg};const r=n(t==null?void 0:t.strength),i=n(t==null?void 0:t.maxCutDb),s=r!==null?r:i!==null?(i-2)/16:Pg.strength,a=Array.isArray(t==null?void 0:t.sources)?t.sources:typeof(e==null?void 0:e.source)=="string"?[e.source]:[];return{enabled:(t==null?void 0:t.enabled)!==!1,sources:a.filter(o=>typeof o=="string"&&o!==""),strength:Math.min(1,Math.max(0,s))}}function GIe(t,e){const n=t.map(s=>({samples:s.samples,at:Math.round(s.offsetSeconds*e)})),r=n.reduce((s,a)=>Math.max(s,a.at+a.samples.length),0);if(r<=0)return new Float32Array(0);const i=new Float32Array(r);for(const{samples:s,at:a}of n){const o=a<0?-a:0;for(let l=o;l<s.length;l+=1){const c=a+l;c<0||c>=r||(i[c]=(i[c]??0)+(s[l]??0))}}return i}function UIe(t,e){const n=Math.max(t.length,Jr),r=t.length>=Jr?t:(()=>{const h=new Float32Array(Jr);return h.set(t),h})(),i=new Float32Array(Jr);for(let h=0;h<Jr;h++)i[h]=.5-.5*Math.cos(2*Math.PI*h/(Jr-1));const s=Jr/2+1,a=new Float64Array(s),o=new Float64Array(Jr),l=new Float64Array(Jr);let c=0;for(let h=0;h+Jr<=n;h+=jIe){l.fill(0);for(let m=0;m<Jr;m++)o[m]=(r[h+m]??0)*i[m];Hce(o,l);for(let m=0;m<s;m++)a[m]+=o[m]*o[m]+l[m]*l[m];c++}c===0&&(c=1);const u=[],f=[];for(let h=0;h<s;h++)u.push(h*e/Jr),f.push(a[h]/c);return{freqs:u,power:f}}function Hce(t,e){const n=t.length;for(let r=1,i=0;r<n;r++){let s=n>>1;for(;i&s;s>>=1)i^=s;i^=s,r<i&&([t[r],t[i]]=[t[i],t[r]],[e[r],e[i]]=[e[i],e[r]])}for(let r=2;r<=n;r<<=1){const i=-2*Math.PI/r,s=Math.cos(i),a=Math.sin(i);for(let o=0;o<n;o+=r){let l=1,c=0;for(let u=0;u<r/2;u++){const f=t[o+u],h=e[o+u],m=t[o+u+r/2]*l-e[o+u+r/2]*c,y=t[o+u+r/2]*c+e[o+u+r/2]*l;t[o+u]=f+m,e[o+u]=h+y,t[o+u+r/2]=f-m,e[o+u+r/2]=h-y;const d=l*s-c*a;c=l*a+c*s,l=d}}}}function Qce(t,e,n){const r=n/Math.pow(2,.16666666666666666),i=n*Math.pow(2,1/6);let s=0,a=0;for(let o=0;o<t.length;o++)t[o]>=r&&t[o]<i&&(s+=e[o],a++);return a>0?s/a:0}const XIe=30;function WIe(t,e){const n=Math.log2(t/2e3),r=Math.exp(-(n*n)/2);return e*XIe*(1-r)}function qIe(t,e,n){if(t.length===0)return[];const{freqs:r,power:i}=UIe(t,e),a=RIe.map(l=>{const c=Qce(r,i,l);return{center:l,hasEnergy:c>0,scoreDb:c>0?10*Math.log10(c)-WIe(l,n.intelligibilityBias):Number.NEGATIVE_INFINITY}}).sort((l,c)=>c.scoreDb-l.scoreDb).slice(0,Math.max(1,n.bands)).filter(l=>l.hasEnergy);if(a.length===0)return[];const o=a[0].scoreDb;return a.map(({center:l,scoreDb:c})=>{const u=Math.pow(10,(c-o)/10),f=Math.min(n.maxCutDb,Math.max(n.maxCutDb/2,n.maxCutDb*u));return{freq:l,gainDb:-Number(f.toFixed(2)),q:n.q}}).sort((l,c)=>l.freq-c.freq)}const zce=30,Zce=.05,YIe=.25,KIe=1.6,Gce=400,k4=.2,Uce=.5;function Xce(t,e){const n=[{t:0,v:0}];let r=0,i=-1;return t.forEach((s,a)=>{a!==t.length-1&&Math.abs(s.v-r)<e||(a>0&&i!==a-1&&n.push(t[a-1]),n.push(s),r=s.v,i=a)}),n}function JIe(t,e,n){if(t.length===0||n.length===0)return[];const r=new Float32Array(Jr);for(let y=0;y<Jr;y++)r[y]=.5-.5*Math.cos(2*Math.PI*y/(Jr-1));const i=Math.max(Jr,Math.ceil(t.length/Gce)),s=Jr/2+1,a=[];for(let y=0;y<s;y++)a.push(y*e/Jr);const o=[],l=n.map(()=>[]),c=new Float64Array(Jr),u=new Float64Array(Jr);for(let y=0;y<t.length;y+=i){u.fill(0);for(let v=0;v<Jr;v++)c[v]=(t[y+v]??0)*r[v];Hce(c,u);const d=[];for(let v=0;v<s;v++)d.push(c[v]*c[v]+u[v]*u[v]);o.push((y+Jr/2)/e),n.forEach((v,b)=>l[b].push(Qce(a,d,v.freq)))}const f=t.length/e,h=1-Math.exp(-(i/e)/Zce),m=1-Math.exp(-(i/e)/YIe);return n.map((y,d)=>{const v=l[d],b=Math.max(...v);let w=0;const O=[];v.forEach((E,M)=>{const N=E>0&&b>0?Math.max(0,1+10*Math.log10(E/b)/zce):0;w+=(N>w?h:m)*(N-w);const I=y.gainDb*w,_=Math.abs(I)<k4?0:Number(I.toFixed(1));O.push({t:Number(o[M].toFixed(3)),v:_})});const k=Xce(O,Uce);return k.push({t:Number(Math.max(f,k.at(-1).t).toFixed(3)),v:0}),{freq:y.freq,points:k}})}function gX(t,e,n){let r=0,i=0;for(let a=e;a<e+n;a++){const o=t[a];if(o===void 0)break;r+=o*o,i+=1}if(i===0)return Number.NEGATIVE_INFINITY;const s=Math.sqrt(r/i);return s>0?20*Math.log10(s):Number.NEGATIVE_INFINITY}function e_e(t,e,n,r,i){if(t.length===0||r.duckDb<=0)return[];const s=Math.max(Jr,Math.ceil(t.length/Gce)),a=Math.round(i*n),o=[],l=[],c=[];for(let M=0;M<t.length;M+=s)o.push(gX(t,M,Jr)),l.push(gX(e,M+a,Jr)),c.push((M+Jr/2)/n);const f=Math.max(...o)-zce,h=1-Math.exp(-(s/n)/Zce),m=1-Math.exp(-(s/n)/KIe);let y=0;const d=[];o.forEach((M,N)=>{const I=l[N]??Number.NEGATIVE_INFINITY,_=M>f&&Number.isFinite(I)?I-(M-r.headroomDb):0,j=Math.min(r.duckDb,Math.max(0,_));y+=(j>y?h:m)*(j-y);const L=y<k4?0:-Number(y.toFixed(1));d.push({t:Number(c[N].toFixed(3)),v:L})});const v=s/n;let b=c.at(-1)??0;for(;y>=k4;)y+=m*-y,b+=v,d.push({t:Number(b.toFixed(3)),v:y<k4?0:-Number(y.toFixed(1))});const w=Xce(d,Uce),O=t.length/n,k=w.at(-1),E=Number(Math.max(O,k.t).toFixed(3));return k.v===0&&k.t>=E||w.push({t:E,v:0}),w}function t_e(t){const e=t.map(n=>({type:"peaking",enabled:!0,params:{...jf("peaking"),frequency:n.freq,gain:n.gainDb,q:n.q}}));return{version:c0,nodes:e}}const n_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),x.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),r_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),x.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),i_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),x.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),s_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M87.51,64.49a12,12,0,0,1,0-17l32-32a12,12,0,0,1,17,0l32,32a12,12,0,0,1-17,17L140,53V96a12,12,0,0,1-24,0V53L104.49,64.49A12,12,0,0,1,87.51,64.49Zm64,127L140,203V160a12,12,0,0,0-24,0v43l-11.51-11.52a12,12,0,0,0-17,17l32,32a12,12,0,0,0,17,0l32-32a12,12,0,0,0-17-17Zm89-72-32-32a12,12,0,0,0-17,17L203,116H160a12,12,0,0,0,0,24h43l-11.52,11.51a12,12,0,0,0,17,17l32-32A12,12,0,0,0,240.49,119.51ZM53,140H96a12,12,0,0,0,0-24H53l11.52-11.51a12,12,0,1,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,1,0,17-17Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M232,128,128,232,24,128,128,24Z",opacity:"0.2"}),x.createElement("path",{d:"M90.34,61.66a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,0l32,32a8,8,0,0,1-11.32,11.32L136,43.31V96a8,8,0,0,1-16,0V43.31L101.66,61.66A8,8,0,0,1,90.34,61.66Zm64,132.68L136,212.69V160a8,8,0,0,0-16,0v52.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm83.32-72-32-32a8,8,0,0,0-11.32,11.32L212.69,120H160a8,8,0,0,0,0,16h52.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,237.66,122.34ZM43.31,136H96a8,8,0,0,0,0-16H43.31l18.35-18.34A8,8,0,0,0,50.34,90.34l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M96,136H64v24a8,8,0,0,1-13.66,5.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,64,96v24H96a8,8,0,0,1,0,16Zm0-72h24V96a8,8,0,0,0,16,0V64h24a8,8,0,0,0,5.66-13.66l-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,96,64Zm141.66,58.34-32-32A8,8,0,0,0,192,96v24H160a8,8,0,0,0,0,16h32v24a8,8,0,0,0,13.66,5.66l32-32A8,8,0,0,0,237.66,122.34ZM160,192H136V160a8,8,0,0,0-16,0v32H96a8,8,0,0,0-5.66,13.66l32,32a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,160,192Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M91.76,60.24a6,6,0,0,1,0-8.48l32-32a6,6,0,0,1,8.48,0l32,32a6,6,0,1,1-8.48,8.48L134,38.49V96a6,6,0,0,1-12,0V38.49L100.24,60.24A6,6,0,0,1,91.76,60.24Zm64,135.52L134,217.51V160a6,6,0,0,0-12,0v57.51l-21.76-21.75a6,6,0,0,0-8.48,8.48l32,32a6,6,0,0,0,8.48,0l32-32a6,6,0,0,0-8.48-8.48Zm80.48-72-32-32a6,6,0,0,0-8.48,8.48L217.51,122H160a6,6,0,0,0,0,12h57.51l-21.75,21.76a6,6,0,1,0,8.48,8.48l32-32A6,6,0,0,0,236.24,123.76ZM38.49,134H96a6,6,0,0,0,0-12H38.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M90.34,61.66a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,0l32,32a8,8,0,0,1-11.32,11.32L136,43.31V96a8,8,0,0,1-16,0V43.31L101.66,61.66A8,8,0,0,1,90.34,61.66Zm64,132.68L136,212.69V160a8,8,0,0,0-16,0v52.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm83.32-72-32-32a8,8,0,0,0-11.32,11.32L212.69,120H160a8,8,0,0,0,0,16h52.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,237.66,122.34ZM43.31,136H96a8,8,0,0,0,0-16H43.31l18.35-18.34A8,8,0,0,0,50.34,90.34l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M93.17,58.83a4,4,0,0,1,0-5.66l32-32a4,4,0,0,1,5.66,0l32,32a4,4,0,0,1-5.66,5.66L132,33.66V96a4,4,0,0,1-8,0V33.66L98.83,58.83A4,4,0,0,1,93.17,58.83Zm64,138.34L132,222.34V160a4,4,0,0,0-8,0v62.34L98.83,197.17a4,4,0,0,0-5.66,5.66l32,32a4,4,0,0,0,5.66,0l32-32a4,4,0,0,0-5.66-5.66Zm77.66-72-32-32a4,4,0,0,0-5.66,5.66L222.34,124H160a4,4,0,0,0,0,8h62.34l-25.17,25.17a4,4,0,0,0,5.66,5.66l32-32A4,4,0,0,0,234.83,125.17ZM33.66,132H96a4,4,0,0,0,0-8H33.66L58.83,98.83a4,4,0,0,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,1,0,5.66-5.66Z"}))]]),a_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,52H182.42L170,33.34A12,12,0,0,0,160,28H96a12,12,0,0,0-10,5.34L73.57,52H48A28,28,0,0,0,20,80V192a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V80A28,28,0,0,0,208,52Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4H80a12,12,0,0,0,10-5.34L102.42,52h51.15L166,70.66A12,12,0,0,0,176,76h32a4,4,0,0,1,4,4ZM128,84a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,84Zm0,72a24,24,0,1,1,24-24A24,24,0,0,1,128,156Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,64H176L160,40H96L80,64H48A16,16,0,0,0,32,80V192a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V80A16,16,0,0,0,208,64ZM128,168a36,36,0,1,1,36-36A36,36,0,0,1,128,168Z",opacity:"0.2"}),x.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm-44,76a36,36,0,1,1-36-36A36,36,0,0,1,164,132Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,58H179.21L165,36.67A6,6,0,0,0,160,34H96a6,6,0,0,0-5,2.67L76.78,58H48A22,22,0,0,0,26,80V192a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V80A22,22,0,0,0,208,58Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V80A10,10,0,0,1,48,70H80a6,6,0,0,0,5-2.67L99.21,46h57.57L171,67.33A6,6,0,0,0,176,70h32a10,10,0,0,1,10,10ZM128,90a42,42,0,1,0,42,42A42,42,0,0,0,128,90Zm0,72a30,30,0,1,1,30-30A30,30,0,0,1,128,162Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,60H178.13L163.32,37.78A4,4,0,0,0,160,36H96a4,4,0,0,0-3.32,1.78L77.85,60H48A20,20,0,0,0,28,80V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V80A20,20,0,0,0,208,60Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V80A12,12,0,0,1,48,68H80a4,4,0,0,0,3.33-1.78L98.13,44h59.72l14.82,22.22A4,4,0,0,0,176,68h32a12,12,0,0,1,12,12ZM128,92a40,40,0,1,0,40,40A40,40,0,0,0,128,92Zm0,72a32,32,0,1,1,32-32A32,32,0,0,1,128,164Z"}))]]),o_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),x.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),l_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),x.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),c_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),x.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),u_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M172,164a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,164Zm-12-52H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm60-64V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V48A20,20,0,0,1,56,28H90.53a51.88,51.88,0,0,1,74.94,0H200A20,20,0,0,1,220,48ZM100.29,60h55.42a28,28,0,0,0-55.42,0ZM196,52H178.59A52.13,52.13,0,0,1,180,64v8a12,12,0,0,1-12,12H88A12,12,0,0,1,76,72V64a52.13,52.13,0,0,1,1.41-12H60V212H196Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,48V216a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H96a39.83,39.83,0,0,0-8,24v8h80V64a39.83,39.83,0,0,0-8-24h40A8,8,0,0,1,208,48Z",opacity:"0.2"}),x.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,32H163.74a47.92,47.92,0,0,0-71.48,0H56A16,16,0,0,0,40,48V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm-72,0a32,32,0,0,1,32,32H96A32,32,0,0,1,128,32Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M166,152a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,152Zm-6-38H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm54-66V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V48A14,14,0,0,1,56,34H93.17a45.91,45.91,0,0,1,69.66,0H200A14,14,0,0,1,214,48ZM94,64v2h68V64a34,34,0,0,0-68,0ZM202,48a2,2,0,0,0-2-2H170.33A45.77,45.77,0,0,1,174,64v8a6,6,0,0,1-6,6H88a6,6,0,0,1-6-6V64a45.77,45.77,0,0,1,3.67-18H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200a2,2,0,0,0,2-2Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M164,152a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,152Zm-4-36H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm52-68V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V48A12,12,0,0,1,56,36H94.08a44,44,0,0,1,67.84,0H200A12,12,0,0,1,212,48ZM92,64v4h72V64a36,36,0,0,0-72,0ZM204,48a4,4,0,0,0-4-4H167.17A43.71,43.71,0,0,1,172,64v8a4,4,0,0,1-4,4H88a4,4,0,0,1-4-4V64a43.71,43.71,0,0,1,4.83-20H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200a4,4,0,0,0,4-4Z"}))]]),f_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),x.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"}))]]),h_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),x.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),d_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),x.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"}))]]),p_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M56.88,31.93A12,12,0,1,0,39.12,48.07l16,17.65C20.67,88.66,5.72,121.58,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212a131.34,131.34,0,0,0,51-10l20.09,22.1a12,12,0,0,0,17.76-16.14ZM128,188c-29.59,0-55.47-10.73-76.91-31.88A130.69,130.69,0,0,1,29.52,128c5.27-9.31,18.79-29.9,42-44.29l90.09,99.11A109.33,109.33,0,0,1,128,188Zm123-55.12c-.36.81-9,20-28,39.16a12,12,0,1,1-17-16.9A130.48,130.48,0,0,0,226.48,128a130.36,130.36,0,0,0-21.57-28.12C183.46,78.73,157.59,68,128,68c-3.35,0-6.7.14-10,.42a12,12,0,1,1-2-23.91c3.93-.34,8-.51,12-.51,36,0,68.63,13.67,94.49,39.52,19.35,19.35,28.11,38.8,28.48,39.61A12.08,12.08,0,0,1,251,132.88Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),x.createElement("path",{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M96.68,57.87a4,4,0,0,1,2.08-6.6A130.13,130.13,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41a8,8,0,0,1,0,6.5c-.35.79-8.82,19.57-27.65,38.4q-4.28,4.26-8.79,8.07a4,4,0,0,1-5.55-.36ZM213.92,210.62a8,8,0,1,1-11.84,10.76L180,197.13A127.21,127.21,0,0,1,128,208c-34.88,0-66.57-13.26-91.66-38.34C17.51,150.83,9,132.05,8.69,131.26a8,8,0,0,1,0-6.5C9,124,17.51,105.18,36.34,86.35a135,135,0,0,1,25-19.78L42.08,45.38A8,8,0,1,1,53.92,34.62Zm-65.49-48.25-52.69-58a40,40,0,0,0,52.69,58Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M52.44,36A6,6,0,0,0,43.56,44L64.44,67c-37.28,21.9-53.23,57-53.92,58.57a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206a124.91,124.91,0,0,0,52.57-11.25l23,25.29a6,6,0,0,0,8.88-8.08Zm48.62,71.32,45,49.52a34,34,0,0,1-45-49.52ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.57,134.57,0,0,1,22.69,128c4.29-8.2,20.1-35.18,50-51.91L92.89,98.3a46,46,0,0,0,61.35,67.48l17.81,19.6A113.47,113.47,0,0,1,128,194Zm6.4-99.4a6,6,0,0,1,2.25-11.79,46.17,46.17,0,0,1,37.15,40.87,6,6,0,0,1-5.42,6.53l-.56,0a6,6,0,0,1-6-5.45A34.1,34.1,0,0,0,134.4,94.6Zm111.08,35.85c-.41.92-10.37,23-32.86,43.12a6,6,0,1,1-8-8.94A134.07,134.07,0,0,0,233.31,128a134.67,134.67,0,0,0-23.86-32.07C186.78,73.42,159.38,62,128,62a120.19,120.19,0,0,0-19.69,1.6,6,6,0,1,1-2-11.83A131.12,131.12,0,0,1,128,50c43.38,0,73,20.54,90.24,37.76,18.58,18.58,26.9,37,27.24,37.81A6,6,0,0,1,245.48,130.45Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M51,37.31A4,4,0,0,0,45,42.69L67.59,67.5C29.34,89,13,124.81,12.34,126.38a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17a122.59,122.59,0,0,0,53.06-11.69l24,26.38a4,4,0,1,0,5.92-5.38ZM149.1,157.16A36,36,0,0,1,101,104.22ZM128,196c-32,0-59.89-11.65-83-34.62A135.81,135.81,0,0,1,20.44,128c3.65-7.23,20.09-36.81,52.68-54.43l22.45,24.7a44,44,0,0,0,59,64.83l20.89,23A114.94,114.94,0,0,1,128,196Zm6.78-103.36a4,4,0,0,1,1.49-7.86,44.15,44.15,0,0,1,35.54,39.09,4,4,0,0,1-3.61,4.35l-.38,0a4,4,0,0,1-4-3.63A36.1,36.1,0,0,0,134.78,92.64Zm108.88,37c-.41.91-10.2,22.58-32.38,42.45a4,4,0,0,1-2.67,1,4,4,0,0,1-2.67-7A136.71,136.71,0,0,0,235.56,128,136.07,136.07,0,0,0,211,94.62C187.89,71.65,160,60,128,60a122,122,0,0,0-20,1.63,4,4,0,0,1-1.32-7.89A129.3,129.3,0,0,1,128,52c42.7,0,71.87,20.22,88.83,37.18,18.31,18.31,26.49,36.44,26.83,37.2A4.08,4.08,0,0,1,243.66,129.63Z"}))]]),m_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,67.24a39.77,39.77,0,0,0-12.51-28.52C199.91,24,174.71,24.5,159.29,39.93L142.48,56.84a28,28,0,0,0-35.64,3.29l-9,9a20,20,0,0,0-.73,27.49L48.9,144.84A43.76,43.76,0,0,0,37,185.28l-7.5,17.19a17.66,17.66,0,0,0,3.71,19.65,19.9,19.9,0,0,0,22.15,4.19l16.31-7.13a43.88,43.88,0,0,0,39.45-12.09l48.24-48.26a20,20,0,0,0,27.47-.73l9-9a28.06,28.06,0,0,0,3.26-35.72l17.23-17.33A39.69,39.69,0,0,0,228,67.24ZM94.15,190.11a20,20,0,0,1-20,5,11.93,11.93,0,0,0-8.32.47L57,199.38,60.69,191a12,12,0,0,0,.37-8.64,19.92,19.92,0,0,1,4.81-20.55l48.2-48.22,28.28,28.3Zm105.14-111-25.37,25.52a12,12,0,0,0,0,16.95l4.88,4.89a4,4,0,0,1,0,5.66l-6.14,6.15-55-55.05,6.14-6.14a4,4,0,0,1,5.65,0L134.35,82a12,12,0,0,0,8.49,3.51h0A12,12,0,0,0,151.34,82l24.94-25.08c6.3-6.3,16.48-6.63,22.71-.74a16,16,0,0,1,.3,23Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M207.8,87.6l-25.37,25.53,4.89,4.88a16,16,0,0,1,0,22.64l-9,9a8,8,0,0,1-11.32,0l-60.68-60.7a8,8,0,0,1,0-11.32l9-9a16,16,0,0,1,22.63,0l4.88,4.89,25-25.11c10.79-10.79,28.37-11.45,39.45-1A28,28,0,0,1,207.8,87.6Z",opacity:"0.2"}),x.createElement("path",{d:"M224,67.3a35.79,35.79,0,0,0-11.26-25.66c-14-13.28-36.72-12.78-50.62,1.13L142.8,62.2a24,24,0,0,0-33.14.77l-9,9a16,16,0,0,0,0,22.64l2,2.06-51,51a39.75,39.75,0,0,0-10.53,38l-8,18.41A13.68,13.68,0,0,0,36,219.3a15.92,15.92,0,0,0,17.71,3.35L71.23,215a39.89,39.89,0,0,0,37.06-10.75l51-51,2.06,2.06a16,16,0,0,0,22.62,0l9-9a24,24,0,0,0,.74-33.18l19.75-19.87A35.75,35.75,0,0,0,224,67.3ZM97,193a24,24,0,0,1-24,6,8,8,0,0,0-5.55.31l-18.1,7.91L57,189.41a8,8,0,0,0,.25-5.75A23.88,23.88,0,0,1,63,159l51-51,33.94,34ZM202.13,82l-25.37,25.52a8,8,0,0,0,0,11.3l4.89,4.89a8,8,0,0,1,0,11.32l-9,9L112,83.26l9-9a8,8,0,0,1,11.31,0l4.89,4.89a8,8,0,0,0,5.65,2.34h0a8,8,0,0,0,5.66-2.36l24.94-25.09c7.81-7.82,20.5-8.18,28.29-.81a20,20,0,0,1,.39,28.7Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,67.3a35.79,35.79,0,0,0-11.26-25.66c-14-13.28-36.72-12.78-50.62,1.13L138.8,66.2a24,24,0,0,0-33.14.77l-5,5a16,16,0,0,0,0,22.64l2,2.06-51,51a39.75,39.75,0,0,0-10.53,38l-8,18.41A13.68,13.68,0,0,0,36,219.3a15.92,15.92,0,0,0,17.71,3.35L71.23,215a39.89,39.89,0,0,0,37.06-10.75l51-51,2.06,2.06a16,16,0,0,0,22.62,0l5-5a24,24,0,0,0,.74-33.18l23.75-23.87A35.75,35.75,0,0,0,224,67.3ZM97,193a24,24,0,0,1-24,6,8,8,0,0,0-5.55.31l-18.1,7.91L57,189.41a8,8,0,0,0,.25-5.75A23.88,23.88,0,0,1,63,159l51-51,33.94,34Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,67.3a35.79,35.79,0,0,0-11.26-25.66c-14-13.28-36.72-12.78-50.62,1.13L142.8,62.2a24,24,0,0,0-33.14.77l-9,9a16,16,0,0,0,0,22.64l2,2.06-51,51a39.75,39.75,0,0,0-10.53,38l-8,18.41A13.68,13.68,0,0,0,36,219.3a15.92,15.92,0,0,0,17.71,3.35L71.23,215a39.89,39.89,0,0,0,37.06-10.75l51-51,2.06,2.06a16,16,0,0,0,22.62,0l9-9a24,24,0,0,0,.74-33.18l19.75-19.87A35.75,35.75,0,0,0,224,67.3ZM97,193a24,24,0,0,1-24,6,8,8,0,0,0-5.55.31l-18.1,7.91L57,189.41a8,8,0,0,0,.25-5.75A23.88,23.88,0,0,1,63,159l51-51,33.94,34ZM202.13,82l-25.37,25.52a8,8,0,0,0,0,11.3l4.89,4.89a8,8,0,0,1,0,11.32l-9,9L112,83.26l9-9a8,8,0,0,1,11.31,0l4.89,4.89a8,8,0,0,0,11.33,0l24.94-25.09c7.81-7.82,20.5-8.18,28.29-.81a20,20,0,0,1,.39,28.7Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,67.37a31.82,31.82,0,0,0-10-22.82c-12.46-11.8-32.66-11.33-45,1.05L142.82,67.86l-2-2a20,20,0,0,0-28.28,0l-9,9a12,12,0,0,0,0,17l4.89,4.89L54.55,150.52A35.81,35.81,0,0,0,45.42,186l-8.6,19.7a9.7,9.7,0,0,0,2,10.79A12,12,0,0,0,52.15,219l18.72-8.18a35.9,35.9,0,0,0,34.59-9.37l53.86-53.87,4.88,4.89a12,12,0,0,0,17,0l9-9a20,20,0,0,0,0-28.3l-2.06-2.06,22.55-22.69A31.75,31.75,0,0,0,220,67.37ZM99.81,195.78a28,28,0,0,1-28,7,4,4,0,0,0-2.78.15l-20,8.75a4,4,0,0,1-4.43-.84,1.73,1.73,0,0,1-.36-1.93l9.19-21.06a4,4,0,0,0,.12-2.88,27.87,27.87,0,0,1,6.74-28.77l53.85-53.87,39.6,39.61Zm79.78-85.47a4,4,0,0,0,0,5.65l4.89,4.89a12,12,0,0,1,0,17l-9,9a4,4,0,0,1-5.66,0L109.18,86.1a4,4,0,0,1,0-5.66l9-9a12,12,0,0,1,17,0L140,76.36a4,4,0,0,0,2.83,1.17h0a4,4,0,0,0,2.83-1.18l25-25.1c9.33-9.34,24.52-9.73,33.87-.89A24,24,0,0,1,205,84.79Z"}))]]),g_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),y_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M180.49,143.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L155,152l-15.52-15.51a12,12,0,1,1,17-17Zm-64-24a12,12,0,0,0-17,0l-24,24a12,12,0,0,0,0,17l24,24a12,12,0,0,0,17-17L101,152l15.52-15.51A12,12,0,0,0,116.49,119.51ZM220,88V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88ZM160,57V80h23Zm36,155V104H148a12,12,0,0,1-12-12V44H60V212Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-104,88a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L91.31,152Zm72-12.68-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32l24,24A8,8,0,0,1,181.66,157.66ZM152,88V44l44,44Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M180.24,147.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L167.51,152l-19.75-19.76a6,6,0,1,1,8.48-8.48Zm-72-24a6,6,0,0,0-8.48,0l-24,24a6,6,0,0,0,0,8.48l24,24a6,6,0,1,0,8.48-8.48L88.49,152l19.75-19.76A6,6,0,0,0,108.24,123.76ZM214,88V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.52L158,46.48Zm44,134V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200A2,2,0,0,0,202,216Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M178.83,149.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L170.34,152l-21.17-21.17a4,4,0,1,1,5.66-5.66Zm-72-24a4,4,0,0,0-5.66,0l-24,24a4,4,0,0,0,0,5.66l24,24a4,4,0,1,0,5.66-5.66L85.66,152l21.17-21.17A4,4,0,0,0,106.83,125.17ZM212,88V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.65Zm48,132V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200A4,4,0,0,0,204,216Z"}))]]),x_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,180c0,8.67,5.5,16,12,16a10.27,10.27,0,0,0,7.33-3.43,12,12,0,1,1,17.34,16.6A34,34,0,0,1,60,220C40.15,220,24,202,24,180s16.15-40,36-40a34,34,0,0,1,24.67,10.83,12,12,0,1,1-17.34,16.6A10.27,10.27,0,0,0,60,164C53.5,164,48,171.31,48,180Zm97.51-5.71c-5.12-3.45-11.32-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,143,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.49,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,125.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C157,187.53,153.33,179.53,145.51,174.27Zm68,0c-5.12-3.45-11.32-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,211,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.49,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,193.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C225,187.53,221.33,179.53,213.51,174.27ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.2,14.2,0,0,0,10.22-4.66A8,8,0,1,1,85.77,206.4,30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.77,9.6,8,8,0,1,1-11.55,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.35-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.18,14.18,0,0,0,10.06-4.5,8.2,8.2,0,0,1,10.9-.91,8,8,0,0,1,.81,11.81A30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.38,9.19,8.26,8.26,0,0,1,.74,11.09,8,8,0,0,1-11.9.38A14.2,14.2,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.35-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,116V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v28a4,4,0,0,1-4,4H44A4,4,0,0,1,40,116ZM152,88h44L152,44Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M46,180c0,12.13,8.07,22,18,22a16.21,16.21,0,0,0,11.66-5.28,6,6,0,0,1,8.67,8.3A28.09,28.09,0,0,1,64,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.09,28.09,0,0,1,20.33,9,6,6,0,0,1-8.67,8.3A16.21,16.21,0,0,0,64,158C54.07,158,46,167.86,46,180Zm81-6.77c-10.85-3.13-13.4-4.69-13-7.91a6.56,6.56,0,0,1,2.88-5.08c5.59-3.79,17.66-1.82,21.44-.84a6,6,0,1,0,3.06-11.6c-2-.53-20.09-5-31.2,2.48a18.62,18.62,0,0,0-8.09,13.54c-1.79,14.19,12.27,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.21,9.76a6.89,6.89,0,0,1-3,5.34c-5.6,3.73-17.48,1.64-21.18.62A6,6,0,1,0,110.48,212a59.29,59.29,0,0,0,14.67,2c5.49,0,11.55-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C151.83,180.39,136.92,176.08,127,173.22Zm64,0c-10.85-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.65-1.83,21.44-.84a6,6,0,0,0,3.07-11.6c-2-.54-20.1-5-31.21,2.48a18.64,18.64,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.77,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,174.47,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C215.83,180.39,200.91,176.08,191,173.22ZM202,94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,1,1-12,0ZM193.5,82,158,46.48V82Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,1,1,85.77,206.4,30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.77,9.6,8,8,0,1,1-11.55,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M44,180c0,13.23,9,24,20,24a18.15,18.15,0,0,0,13.11-5.9,4,4,0,0,1,5.78,5.54A26.13,26.13,0,0,1,64,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a26.13,26.13,0,0,1,18.89,8.36,4,4,0,0,1-5.78,5.54A18.15,18.15,0,0,0,64,156C53,156,44,166.77,44,180Zm82.49-4.85c-10.53-3-15.08-4.91-14.43-10.08a8.57,8.57,0,0,1,3.75-6.49c6.26-4.23,18.77-2.24,23.07-1.11a4,4,0,0,0,2-7.74,61.11,61.11,0,0,0-10.47-1.61c-8.12-.54-14.54.75-19.1,3.82a16.63,16.63,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.25,3.25,16.47,5.49,15.63,11.94a8.93,8.93,0,0,1-3.9,6.75c-6.28,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.79,57.79,0,0,0,125.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C149.64,181.84,136.26,178,126.49,175.15Zm64,0c-10.53-3-15.08-4.91-14.43-10.08a8.57,8.57,0,0,1,3.75-6.49c6.26-4.23,18.77-2.24,23.07-1.11a4,4,0,0,0,2-7.74,61.33,61.33,0,0,0-10.48-1.61c-8.11-.54-14.54.75-19.09,3.82a16.63,16.63,0,0,0-7.22,12.13c-1.59,12.49,10.46,16,20.14,18.77,11.25,3.25,16.46,5.49,15.63,11.94a8.93,8.93,0,0,1-3.9,6.75c-6.28,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.7,57.7,0,0,0,189.19,212c5.17,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C213.63,181.84,200.26,178,190.49,175.15ZM204,92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88v24a4,4,0,0,1-8,0Zm-5.65-8L156,41.65V84Z"}))]]),b_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,128a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v12a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v76A12,12,0,0,0,48,128ZM183,80H160V57ZM68,160v48a12,12,0,0,1-24,0V196H32v12a12,12,0,0,1-24,0V160a12,12,0,0,1,24,0v12H44V160a12,12,0,0,1,24,0Zm60,0a12,12,0,0,1-12,12h-4v36a12,12,0,0,1-24,0V172H84a12,12,0,0,1,0-24h32A12,12,0,0,1,128,160Zm72,0v48a12,12,0,0,1-24,0v-9.36l-.11.16a12,12,0,0,1-19.78,0l-.11-.16V208a12,12,0,0,1-24,0V160a12,12,0,0,1,21.89-6.8L166,170.82l12.11-17.62A12,12,0,0,1,200,160Zm56,48a12,12,0,0,1-12,12H220a12,12,0,0,1-12-12V160a12,12,0,0,1,24,0v36h12A12,12,0,0,1,256,208Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M216,120V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v24a8,8,0,0,0,16,0ZM160,51.31,188.69,80H160ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M44,128H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v84A4,4,0,0,0,44,128ZM152,44l44,44H152ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M214,120V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v80a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v26a6,6,0,0,0,12,0ZM158,46.48,193.52,82H158ZM66,160v48a6,6,0,0,1-12,0V190H30v18a6,6,0,0,1-12,0V160a6,6,0,0,1,12,0v18H54V160a6,6,0,0,1,12,0Zm56,0a6,6,0,0,1-6,6H106v42a6,6,0,0,1-12,0V166H84a6,6,0,0,1,0-12h32A6,6,0,0,1,122,160Zm72,0v48a6,6,0,0,1-12,0V178l-13.2,17.6a6,6,0,0,1-9.6,0L146,178v30a6,6,0,0,1-12,0V160a6,6,0,0,1,10.8-3.6L164,182l19.2-25.6A6,6,0,0,1,194,160Zm56,48a6,6,0,0,1-6,6H216a6,6,0,0,1-6-6V160a6,6,0,0,1,12,0v42h22A6,6,0,0,1,250,208Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,120V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v24a8,8,0,0,0,16,0ZM160,51.31,188.69,80H160ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212,88a4,4,0,0,0-1.17-2.83l-2-2h0l-54-54A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v80a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v28a4,4,0,0,0,8,0ZM156,41.65,198.34,84H156ZM64,160v48a4,4,0,0,1-8,0V188H28v20a4,4,0,0,1-8,0V160a4,4,0,0,1,8,0v20H56V160a4,4,0,0,1,8,0Zm56,0a4,4,0,0,1-4,4H104v44a4,4,0,0,1-8,0V164H84a4,4,0,0,1,0-8h32A4,4,0,0,1,120,160Zm72,0v48a4,4,0,0,1-8,0V172l-16.8,22.4a4,4,0,0,1-6.4,0L144,172v36a4,4,0,0,1-8,0V160a4,4,0,0,1,7.2-2.4L164,185.33l20.8-27.73A4,4,0,0,1,192,160Zm56,48a4,4,0,0,1-4,4H216a4,4,0,0,1-4-4V160a4,4,0,0,1,8,0v44h24A4,4,0,0,1,248,208Z"}))]]),v_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M120,140H104a12,12,0,0,0-12,12v56a12,12,0,0,0,24,0v-4h4a32,32,0,0,0,0-64Zm0,40h-4V164h4a8,8,0,0,1,0,16Zm104,20.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,196,220c-19.85,0-36-17.94-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,196,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,208,176h4a12,12,0,0,1,12,12ZM80,152v38a30,30,0,0,1-60,0,12,12,0,0,1,24,0,6,6,0,0,0,12,0V152a12,12,0,0,1,24,0ZM48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.48l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM160,57l23,23H160Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M120,144H104a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm96,0v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-9,13.26A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152ZM120,144H104a8,8,0,0,0-8,8v55.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8v-8h7.4c15.24,0,28.13-11.92,28.59-27.15A28,28,0,0,0,120,144Zm-.35,40H112V160h8a12,12,0,0,1,11.94,13.16A12.23,12.23,0,0,1,119.65,184ZM216,200.87a8,8,0,0,1-2.26,5.57A30,30,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.21,8.21,0,0,1,3,10.64,8,8,0,0,1-11.55,2.88A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1-8-8.53,8.17,8.17,0,0,1,8.25-7.47H208a8,8,0,0,1,8,8ZM80,152v37.41c0,14.22-11.18,26.26-25.41,26.58A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.75,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M120,146H104a6,6,0,0,0-6,6v56a6,6,0,0,0,12,0V198h10a26,26,0,0,0,0-52Zm0,40H110V158h10a14,14,0,0,1,0,28Zm94-2v16.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,192,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,9.95A15.25,15.25,0,0,0,192,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a15.75,15.75,0,0,0,10-3.73V190h-2a6,6,0,0,1,0-12h8A6,6,0,0,1,214,184ZM78,152v38a24,24,0,0,1-48,0,6,6,0,0,1,12,0,12,12,0,0,0,24,0V152a6,6,0,0,1,12,0ZM212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88A6,6,0,0,0,212.24,83.76ZM158,82V46.48L193.52,82Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M120,144H104a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm96,0v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-9,13.26A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M120,148H104a4,4,0,0,0-4,4v56a4,4,0,0,0,8,0V196h12a24,24,0,0,0,0-48Zm0,40H108V156h12a16,16,0,0,1,0,32Zm92-4v16.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,192,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.45,17.45,0,0,0,192,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8A4,4,0,0,1,212,184ZM76,152v38a22,22,0,0,1-44,0,4,4,0,0,1,8,0,14,14,0,0,0,28,0V152a4,4,0,0,1,8,0ZM210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v20a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,84V41.65L198.34,84Z"}))]]),A_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212H180a12,12,0,0,0,0,24h20a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-4.22,139.85a24.75,24.75,0,0,1-10.95,18.06c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,0,1,6.46-23.12c6.81,1.86,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.52-5.39-1.56-11-3.18-15.75-6.27-7.62-4.92-11.21-12.45-10.11-21.2a24.45,24.45,0,0,1,10.69-17.75c6.06-4.09,14.17-5.84,24.1-5.18A68.53,68.53,0,0,1,143,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.48,1.58,11.68,3.37,16.8,6.82C153.33,179.55,157,187.55,155.78,196.82ZM84,152v38a30,30,0,0,1-60,0,12,12,0,0,1,24,0,6,6,0,0,0,12,0V152a12,12,0,0,1,24,0Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H164a4,4,0,0,1,4,4V228a4,4,0,0,0,4,4h28a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.58,20.58,0,0,1,9-14.95c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.57,4.57,0,0,0-2,3.67c-.11.9-.13,1.09,1.12,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM80,152v37.41c0,14.22-11.18,26.26-25.41,26.58A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.75,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM145.83,196.06a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a58.89,58.89,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.78-1-15.85-3-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.09,147.84,180.4,145.83,196.06ZM78,152v38a24,24,0,0,1-48,0,6,6,0,0,1,12,0,12,12,0,0,0,24,0V152a6,6,0,0,1,12,0Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4H176a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,0,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM76,152v38a22,22,0,0,1-44,0,4,4,0,0,1,8,0,14,14,0,0,0,28,0V152a4,4,0,0,1,8,0Z"}))]]),S_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M151.78,196.8a24.73,24.73,0,0,1-10.95,18c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,1,1,6.46-23.11c6.81,1.85,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.53-5.39-1.56-11-3.17-15.75-6.26-7.63-4.92-11.21-12.45-10.11-21.19a24.45,24.45,0,0,1,10.69-17.76c6.06-4.09,14.17-5.83,24.1-5.17A69,69,0,0,1,139,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.47,1.58,11.68,3.37,16.8,6.82C149.33,179.53,153,187.53,151.78,196.8ZM68,140a12,12,0,0,0-12,12v38a6,6,0,0,1-12,0,12,12,0,0,0-24,0,30,30,0,0,0,60,0V152A12,12,0,0,0,68,140Zm138.75,40,15-21a12,12,0,0,0-19.53-14L192,159.34,181.76,145a12,12,0,0,0-19.53,14l15,21-15,21A12,12,0,1,0,181.76,215L192,200.62,202.23,215A12,12,0,0,0,221.76,201ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A60.43,60.43,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM72,144a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0,8,8,0,0,0-16,0,26,26,0,0,0,52,0V152A8,8,0,0,0,72,144Zm140.65,1.49a8,8,0,0,0-11.16,1.86L188,166.24l-13.49-18.89a8,8,0,0,0-13,9.3L178.17,180l-16.68,23.35a8,8,0,0,0,13,9.3L188,193.76l13.49,18.89a8,8,0,0,0,13-9.3L197.83,180l16.68-23.35A8,8,0,0,0,212.65,145.49ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a60.63,60.63,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.57,4.57,0,0,0-2,3.67c-.11.9-.13,1.08,1.12,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM80,152v37.4c0,14.23-11.18,26.27-25.41,26.59A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.76,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Zm134.51,4.65L197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M145.83,196.05a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a59.41,59.41,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.79-1-15.85-2.95-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.08,147.84,180.39,145.83,196.05ZM72,146a6,6,0,0,0-6,6v38a12,12,0,0,1-24,0,6,6,0,0,0-12,0,24,24,0,0,0,48,0V152A6,6,0,0,0,72,146Zm139.49,1.12a6,6,0,0,0-8.37,1.39L188,169.67,172.88,148.5a6,6,0,0,0-9.76,7L180.63,180,163.12,204.5a6,6,0,1,0,9.76,7L188,190.31l15.12,21.16a6,6,0,1,0,9.76-7L195.37,180l17.51-24.51A6,6,0,0,0,211.49,147.11ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a60.63,60.63,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.58,20.58,0,0,1,9-14.95c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM72,144a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0,8,8,0,0,0-16,0,26,26,0,0,0,52,0V152A8,8,0,0,0,72,144Zm140.65,1.49a8,8,0,0,0-11.16,1.86L188,166.24l-13.49-18.89a8,8,0,0,0-13,9.3L178.17,180l-16.68,23.35a8,8,0,0,0,13,9.3L188,193.76l13.49,18.89a8,8,0,0,0,13-9.3L197.83,180l16.68-23.35A8,8,0,0,0,212.65,145.49ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,1,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM72,148a4,4,0,0,0-4,4v38a14,14,0,0,1-28,0,4,4,0,0,0-8,0,22,22,0,0,0,44,0V152A4,4,0,0,0,72,148Zm138.32.75a4,4,0,0,0-5.58.92L188,173.12l-16.75-23.45a4,4,0,0,0-6.51,4.66L183.08,180l-18.34,25.67a4,4,0,0,0,.93,5.58,4,4,0,0,0,5.58-.92L188,186.88l16.74,23.45A4,4,0,0,0,208,212a3.91,3.91,0,0,0,2.32-.75,4,4,0,0,0,.93-5.58L192.92,180l18.33-25.67A4,4,0,0,0,210.32,148.75ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z"}))]]),w_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M100,152v56a12,12,0,0,1-24,0V190.07l-6.17,8.81a12,12,0,0,1-19.66,0L44,190.07V208a12,12,0,0,1-24,0V152a12,12,0,0,1,21.83-6.88L60,171.07l18.17-25.95A12,12,0,0,1,100,152Zm84,28a40,40,0,0,1-40,40H128a12,12,0,0,1-12-12V152a12,12,0,0,1,12-12h16A40,40,0,0,1,184,180Zm-24,0a16,16,0,0,0-16-16h-4v32h4A16,16,0,0,0,160,180Zm60-92V224a12,12,0,0,1-24,0V104H148a12,12,0,0,1-12-12V44H60v64a12,12,0,0,1-24,0V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88Zm-60-8h23L160,57Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V224a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM144,144H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h16a36,36,0,0,0,0-72Zm0,56h-8V160h8a20,20,0,0,1,0,40Zm-40-48v56a8,8,0,0,1-16,0V177.38L74.55,196.59a8,8,0,0,1-13.1,0L48,177.38V208a8,8,0,0,1-16,0V152a8,8,0,0,1,14.55-4.59L68,178.05l21.45-30.64A8,8,0,0,1,104,152Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H196a4,4,0,0,1,4,4V224a8,8,0,0,0,9.19,7.91,8.15,8.15,0,0,0,6.81-8.16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-8,56H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h15.32c19.66,0,36.21-15.48,36.67-35.13A36,36,0,0,0,144,144Zm-.49,56H136V160h8a20,20,0,0,1,20,20.77C163.58,191.59,154.34,200,143.51,200ZM104,152v55.73A8.17,8.17,0,0,1,96.53,216,8,8,0,0,1,88,208V177.38l-13.32,19a8.3,8.3,0,0,1-4.2,3.2,8,8,0,0,1-9-3L48,177.38v30.35A8.17,8.17,0,0,1,40.53,216,8,8,0,0,1,32,208V152.31a8.27,8.27,0,0,1,4.56-7.53,8,8,0,0,1,10,2.63L68,178.05l21.27-30.39a8.28,8.28,0,0,1,8.06-3.55A8,8,0,0,1,104,152Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V224a6,6,0,0,0,12,0V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM144,146H128a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6h16a34,34,0,0,0,0-68Zm0,56H134V158h10a22,22,0,0,1,0,44Zm-42-50v56a6,6,0,0,1-12,0V171L72.92,195.44a6,6,0,0,1-9.84,0L46,171v37a6,6,0,0,1-12,0V152a6,6,0,0,1,10.92-3.44l23.08,33,23.08-33A6,6,0,0,1,102,152Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V224a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM144,144H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h16a36,36,0,0,0,0-72Zm0,56h-8V160h8a20,20,0,0,1,0,40Zm-40-48v56a8,8,0,0,1-16,0V177.38L74.55,196.59a8,8,0,0,1-13.1,0L48,177.38V208a8,8,0,0,1-16,0V152a8,8,0,0,1,14.55-4.59L68,178.05l21.45-30.64A8,8,0,0,1,104,152Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V224a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM144,148H128a4,4,0,0,0-4,4v56a4,4,0,0,0,4,4h16a32,32,0,0,0,0-64Zm0,56H132V156h12a24,24,0,0,1,0,48Zm-44-52v56a4,4,0,0,1-8,0V164.69l-20.72,29.6a4,4,0,0,1-6.56,0L44,164.69V208a4,4,0,0,1-8,0V152a4,4,0,0,1,7.28-2.29L68,185l24.72-35.31A4,4,0,0,1,100,152Z"}))]]),O_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm104-60a12,12,0,0,1-12,12H140v12a12,12,0,0,1-24,0V164H104a12,12,0,0,1,0-24h12V128a12,12,0,0,1,24,0v12h12A12,12,0,0,1,164,152Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,160H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16a8,8,0,0,1,0,16Zm0-72V43.31L196.69,88Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-42-66a6,6,0,0,1-6,6H134v18a6,6,0,0,1-12,0V158H104a6,6,0,0,1,0-12h18V128a6,6,0,0,1,12,0v18h18A6,6,0,0,1,158,152Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-44-68a4,4,0,0,1-4,4H132v20a4,4,0,0,1-8,0V156H104a4,4,0,0,1,0-8h20V128a4,4,0,0,1,8,0v20h20A4,4,0,0,1,156,152Z"}))]]),C_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M56,140H40a12,12,0,0,0-12,12v56a12,12,0,0,0,24,0v-4h4a32,32,0,0,0,0-64Zm0,40H52V164h4a8,8,0,0,1,0,16Zm176,20.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,204,220c-19.85,0-36-17.95-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,204,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,216,176h4a12,12,0,0,1,12,12ZM160,152v56a12,12,0,0,1-8.34,11.43A12.15,12.15,0,0,1,148,220a12,12,0,0,1-9.76-5L120,189.44V208a12,12,0,0,1-24,0V152a12,12,0,0,1,21.76-7L136,170.55V152a12,12,0,0,1,24,0ZM48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM160,57l23,23H160Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M60,144H44a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H52V160h8a12,12,0,0,1,0,24Zm164,16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,200,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.45,29.45,0,0,1,16.48,5.11,8,8,0,0,1-9,13.27A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1,0-16h8a8,8,0,0,1,8,8ZM156,152v56a8,8,0,0,1-5.56,7.62A7.91,7.91,0,0,1,148,216a8,8,0,0,1-6.51-3.35L116,177v31a8,8,0,0,1-16,0V152a8,8,0,0,1,14.51-4.65L140,183V152a8,8,0,0,1,16,0ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152ZM60,144H44a8,8,0,0,0-8,8v55.72A8.17,8.17,0,0,0,43.47,216,8,8,0,0,0,52,208v-8h7.4c15.24,0,28.14-11.92,28.59-27.15A28,28,0,0,0,60,144Zm-.35,40H52V160h8a12,12,0,0,1,12,13.16A12.25,12.25,0,0,1,59.65,184ZM224,200.87a8,8,0,0,1-2.26,5.57A30.07,30.07,0,0,1,200,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.21,8.21,0,0,1,3,10.64,8,8,0,0,1-11.55,2.88A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1-8-8.53,8.17,8.17,0,0,1,8.25-7.47H216a8,8,0,0,1,8,8ZM156,152v55.76a8.22,8.22,0,0,1-4.12,7.24,8,8,0,0,1-10.39-2.35L116,177v30.76a8.17,8.17,0,0,1-7.47,8.26,8,8,0,0,1-8.53-8V152.31a8.27,8.27,0,0,1,4.53-7.52,8,8,0,0,1,10,2.56L140,183V152.27a8.17,8.17,0,0,1,7.47-8.25A8,8,0,0,1,156,152Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M60,146H44a6,6,0,0,0-6,6v56a6,6,0,0,0,12,0V198H60a26,26,0,0,0,0-52Zm0,40H50V158H60a14,14,0,0,1,0,28Zm162,14.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,9.95A15.25,15.25,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a15.75,15.75,0,0,0,10-3.73V190h-2a6,6,0,0,1,0-12h8a6,6,0,0,1,6,6ZM154,152v56a6,6,0,0,1-4.17,5.71A5.78,5.78,0,0,1,148,214a6,6,0,0,1-4.88-2.51L114,170.72V208a6,6,0,0,1-12,0V152a6,6,0,0,1,10.88-3.49L142,189.28V152a6,6,0,0,1,12,0ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M60,144H44a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H52V160h8a12,12,0,0,1,0,24Zm164,16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,200,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a29.45,29.45,0,0,1,16.48,5.11,8,8,0,0,1-9,13.27A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1,0-16h8a8,8,0,0,1,8,8ZM156,152v56a8,8,0,0,1-5.56,7.62A7.91,7.91,0,0,1,148,216a8,8,0,0,1-6.51-3.35L116,177v31a8,8,0,0,1-16,0V152a8,8,0,0,1,14.51-4.65L140,183V152a8,8,0,0,1,16,0ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M60,148H44a4,4,0,0,0-4,4v56a4,4,0,0,0,8,0V196H60a24,24,0,0,0,0-48Zm0,40H48V156H60a16,16,0,0,1,0,32Zm160,12.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,200,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.45,17.45,0,0,0,200,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8a4,4,0,0,1,4,4ZM152,152v56a4,4,0,0,1-2.78,3.81A3.93,3.93,0,0,1,148,212a4,4,0,0,1-3.25-1.67L112,164.48V208a4,4,0,0,1-8,0V152a4,4,0,0,1,7.25-2.33L144,195.52V152a4,4,0,0,1,8,0Zm52-40a4,4,0,0,0,8,0V88a4,4,0,0,0-1.17-2.83l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52ZM156,84V41.65L198.34,84Z"}))]]),k_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,1,0,24,0V88a12,12,0,0,0-3.51-8.48l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM183,80H160V57ZM87.78,196.8a24.72,24.72,0,0,1-10.94,18c-6,4-13.27,5.15-19.74,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,1,1,6.46-23.11c6.82,1.85,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.82-2.64-9.88-3.53-5.39-1.56-11-3.17-15.75-6.26-7.62-4.92-11.21-12.45-10.1-21.19a24.44,24.44,0,0,1,10.68-17.76c6.07-4.09,14.17-5.82,24.1-5.17A69,69,0,0,1,75,142a12,12,0,0,1-6.1,23.21c-6.35-1.63-13.61-1.51-16.07-.33a79.69,79.69,0,0,0,7.92,2.59c5.47,1.58,11.67,3.37,16.8,6.82C85.33,179.53,89,187.53,87.78,196.8ZM155.3,156l-20,56a12,12,0,0,1-22.6,0l-20-56A12,12,0,1,1,115.3,148L124,172.3,132.7,148A12,12,0,1,1,155.3,156ZM224,188v12.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,196,220c-19.85,0-36-17.94-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,196,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,208,176h4A12,12,0,0,1,224,188Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,1,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-72.18,145a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31Zm63.72-41.62-20,56a8,8,0,0,1-15.07,0l-20-56a8,8,0,1,1,15.06-5.38L124,184.21l12.46-34.9a8,8,0,0,1,15.07,5.38ZM216,184v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-8.95,13.26A13.27,13.27,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.38,13.38,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44ZM87.82,196.31a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31Zm63.72-41.62-19.9,55.72a8.25,8.25,0,0,1-6.5,5.51,8,8,0,0,1-8.67-5.23L96.59,155a8.21,8.21,0,0,1,4.5-10.45,8,8,0,0,1,10.45,4.76L124,184.21l12.46-34.9a8,8,0,0,1,15.07,5.38ZM216,184v16.87a8,8,0,0,1-2.26,5.57A30,30,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.22,8.22,0,0,1,3,10.64,8,8,0,0,1-11.54,2.88A13.27,13.27,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.38,13.38,0,0,0,8-2.71V192a8,8,0,0,1-8-8.53,8.18,8.18,0,0,1,8.26-7.47H208A8,8,0,0,1,216,184Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.75l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,1,0,12,0V88A6,6,0,0,0,212.24,83.75ZM158,46.48,193.52,82H158ZM85.83,196.05a18.85,18.85,0,0,1-8.3,13.81C72.71,213.05,66.66,214,61.16,214a59.38,59.38,0,0,1-14.67-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.57-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.2-2.48a6,6,0,0,1-3,11.6c-3.79-1-15.85-2.95-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C72.93,176.08,87.85,180.39,85.83,196.05Zm63.82-42-20,56a6,6,0,0,1-11.3,0l-20-56a6,6,0,1,1,11.3-4L124,190.15,138.35,150a6,6,0,0,1,11.3,4ZM214,184v16.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,192,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,10A15.25,15.25,0,0,0,192,158c-9.92,0-18,9.87-18,22s8.08,22,18,22a15.7,15.7,0,0,0,10-3.74V190h-2a6,6,0,0,1,0-12h8A6,6,0,0,1,214,184Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M87.82,196.31a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,1,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.65,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm-13.3,64.47a8,8,0,0,0-10.23,4.84L124,184.21l-12.47-34.9a8,8,0,1,0-15.06,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,146.7,144.47ZM208,176h-8a8,8,0,0,0,0,16v5.29a13.38,13.38,0,0,1-8,2.71c-8.82,0-16-9-16-20s7.18-20,16-20a13.27,13.27,0,0,1,7.53,2.38,8,8,0,0,0,8.95-13.26A29.38,29.38,0,0,0,192,144c-17.64,0-32,16.15-32,36s14.36,36,32,36a30.06,30.06,0,0,0,21.78-9.6,8,8,0,0,0,2.22-5.53V184A8,8,0,0,0,208,176Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,1,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v20a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM83.85,195.8a17,17,0,0,1-7.43,12.41C72,211.12,66.38,212,61.2,212A57.89,57.89,0,0,1,47,210.11a4,4,0,1,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.11,61.11,0,0,1,10.47,1.61,4,4,0,0,1-2,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C72.27,178,85.65,181.84,83.85,195.8Zm63.92-42.45-20,56a4,4,0,0,1-7.53,0l-20-56a4,4,0,1,1,7.53-2.7L124,196.11l16.23-45.46a4,4,0,1,1,7.53,2.7ZM212,184v16.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,192,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.43,17.43,0,0,0,192,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8A4,4,0,0,1,212,184Z"}))]]),E_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212H180a12,12,0,0,0,0,24h20a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-4.22,139.85a24.75,24.75,0,0,1-10.95,18.06c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,0,1,6.46-23.12c6.81,1.86,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.52-5.39-1.56-11-3.18-15.75-6.27-7.62-4.92-11.21-12.45-10.11-21.2a24.45,24.45,0,0,1,10.69-17.75c6.06-4.09,14.17-5.83,24.1-5.18A68.53,68.53,0,0,1,143,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.48,1.58,11.68,3.37,16.8,6.82C153.33,179.55,157,187.55,155.78,196.82ZM92,152a12,12,0,0,1-12,12H72v44a12,12,0,0,1-24,0V164H40a12,12,0,0,1,0-24H80A12,12,0,0,1,92,152Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM88,152a8,8,0,0,1-8,8H68v48a8,8,0,0,1-16,0V160H40a8,8,0,0,1,0-16H80A8,8,0,0,1,88,152Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H164a4,4,0,0,1,4,4V228a4,4,0,0,0,4,4h28a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM88,152.53A8.17,8.17,0,0,1,79.73,160H68v47.73A8.17,8.17,0,0,1,60.53,216,8,8,0,0,1,52,208V160H40.27A8.17,8.17,0,0,1,32,152.53,8,8,0,0,1,40,144H80A8,8,0,0,1,88,152.53Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM145.83,196.06a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a58.89,58.89,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.78-1-15.85-3-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.09,147.84,180.4,145.83,196.06ZM86,152a6,6,0,0,1-6,6H66v50a6,6,0,0,1-12,0V158H40a6,6,0,0,1,0-12H80A6,6,0,0,1,86,152Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM216,88V216a16,16,0,0,1-16,16H176a8,8,0,0,1,0-16h24V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4H176a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,0,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM84,152a4,4,0,0,1-4,4H64v52a4,4,0,0,1-8,0V156H40a4,4,0,0,1,0-8H80A4,4,0,0,1,84,152Z"}))]]),T_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M221.76,201A12,12,0,1,1,202.23,215L192,200.62,181.76,215A12,12,0,1,1,162.23,201l15-21-15-21a12,12,0,0,1,19.53-14L192,159.34,202.23,145a12,12,0,0,1,19.53,14l-15,21Zm-80.25-26.73c-5.12-3.45-11.33-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,139,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.48,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,121.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C153,187.53,149.33,179.53,141.51,174.27ZM76,140H36a12,12,0,0,0,0,24h8v44a12,12,0,0,0,24,0V164h8a12,12,0,0,0,0-24ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M214.51,156.65,197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM123.6,171.31c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.11-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,138,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.94c-2,15.89,13.65,20.42,23,23.12,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.14,3.93-4.6,3.06-15.17,1.56-19.55.35A8,8,0,1,0,106,214a60.43,60.43,0,0,0,15.18,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C150,179,133.49,174.17,123.6,171.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm62.51,68.65L197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,2.3-11.46,8.19,8.19,0,0,1,10.88,2.38L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3Zm-66.7,39.66a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A60.43,60.43,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM88,152.53A8.18,8.18,0,0,1,79.73,160H68v47.72A8.18,8.18,0,0,1,60.53,216,8,8,0,0,1,52,208V160H40.27A8.18,8.18,0,0,1,32,152.53,8,8,0,0,1,40,144H80A8,8,0,0,1,88,152.53Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.88,155.48,195.37,180l17.51,24.51a6,6,0,1,1-9.76,7L188,190.31l-15.12,21.16a6,6,0,1,1-9.76-7L180.63,180l-17.51-24.51a6,6,0,0,1,9.76-7L188,169.67l15.12-21.17a6,6,0,1,1,9.76,7Zm-89.83,17.74c-10.86-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.66-1.83,21.45-.84a6,6,0,0,0,3.06-11.6c-2-.53-20.1-5-31.21,2.48a18.61,18.61,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,106.48,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C147.84,180.39,132.92,176.08,123.05,173.22ZM80,146H40a6,6,0,0,0,0,12H54v50a6,6,0,0,0,12,0V158H80a6,6,0,0,0,0-12ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M214.51,156.65,197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM123.6,171.31c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.11-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,138,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.14,3.93-4.6,3.06-15.17,1.56-19.55.35A8,8,0,0,0,105.94,214a60.63,60.63,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C150,179,133.49,174.17,123.6,171.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M211.25,154.33,192.92,180l18.33,25.67a4,4,0,0,1-.93,5.58A3.91,3.91,0,0,1,208,212a4,4,0,0,1-3.26-1.67L188,186.88l-16.75,23.45a4,4,0,0,1-6.51-4.66L183.08,180l-18.34-25.67a4,4,0,0,1,6.51-4.66L188,173.12l16.74-23.45a4,4,0,0,1,6.51,4.66Zm-88.76,20.82c-10.53-3-15.08-4.91-14.42-10.08a8.51,8.51,0,0,1,3.75-6.49c6.25-4.23,18.77-2.24,23.06-1.11a4,4,0,0,0,2.05-7.74,61.33,61.33,0,0,0-10.48-1.61c-8.12-.54-14.54.75-19.1,3.82a16.66,16.66,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.26,3.25,16.47,5.49,15.64,11.94a8.94,8.94,0,0,1-3.91,6.75c-6.27,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.89,57.89,0,0,0,121.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C145.64,181.84,132.26,178,122.49,175.15ZM80,148H40a4,4,0,0,0,0,8H56v52a4,4,0,0,0,8,0V156H80a4,4,0,0,0,0-8ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z"}))]]),P_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM183,80H160V57Zm-25.27,79-15,21,15,21A12,12,0,1,1,138.24,215L128,200.65,117.76,215A12,12,0,1,1,98.24,201l15-21-15-21A12,12,0,1,1,117.76,145L128,159.35,138.24,145A12,12,0,1,1,157.76,159ZM92,152a12,12,0,0,1-12,12H72v44a12,12,0,0,1-24,0V164H40a12,12,0,0,1,0-24H80A12,12,0,0,1,92,152Zm136,0a12,12,0,0,1-12,12h-8v44a12,12,0,0,1-24,0V164h-8a12,12,0,0,1,0-24h40A12,12,0,0,1,228,152Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),x.createElement("path",{d:"M48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Zm-5.49,105.34L137.83,180l16.68,23.35a8,8,0,0,1-13,9.3L128,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L118.17,180l-16.68-23.35a8,8,0,1,1,13-9.3L128,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM92,152a8,8,0,0,1-8,8H72v48a8,8,0,0,1-16,0V160H44a8,8,0,0,1,0-16H84A8,8,0,0,1,92,152Zm128,0a8,8,0,0,1-8,8H200v48a8,8,0,0,1-16,0V160H172a8,8,0,0,1,0-16h40A8,8,0,0,1,220,152Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M154.31,156.92,137.83,180l16.53,23.14a8.18,8.18,0,0,1-1.22,11,8,8,0,0,1-11.65-1.48L128,193.76l-13.49,18.89a8,8,0,0,1-11.64,1.49,8.17,8.17,0,0,1-1.23-11L118.17,180l-16.48-23.08a8.22,8.22,0,0,1,1.46-11.28,8,8,0,0,1,11.36,1.71L128,166.24l13.49-18.89a8,8,0,0,1,11.36-1.71A8.22,8.22,0,0,1,154.31,156.92ZM84,144H44.27A8.18,8.18,0,0,0,36,151.47,8,8,0,0,0,44,160H56v47.73A8.17,8.17,0,0,0,63.47,216,8,8,0,0,0,72,208V160H83.73A8.18,8.18,0,0,0,92,152.53,8,8,0,0,0,84,144Zm128,0H172.27a8.18,8.18,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h12v47.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V160h11.73a8.18,8.18,0,0,0,8.25-7.47A8,8,0,0,0,212,144ZM40,116V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v28a4,4,0,0,1-4,4H44A4,4,0,0,1,40,116ZM152,88h44L152,44Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Zm-5.12,109L135.37,180l17.51,24.51a6,6,0,1,1-9.76,7L128,190.32l-15.12,21.17a6,6,0,0,1-9.76-7L120.63,180l-17.51-24.51a6,6,0,1,1,9.76-7L128,169.68l15.12-21.17a6,6,0,0,1,9.76,7ZM90,152a6,6,0,0,1-6,6H70v50a6,6,0,0,1-12,0V158H44a6,6,0,0,1,0-12H84A6,6,0,0,1,90,152Zm128,0a6,6,0,0,1-6,6H198v50a6,6,0,0,1-12,0V158H172a6,6,0,0,1,0-12h40A6,6,0,0,1,218,152Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Zm-5.49,105.34L137.83,180l16.68,23.35a8,8,0,0,1-13,9.3L128,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L118.17,180l-16.68-23.35a8,8,0,1,1,13-9.3L128,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM92,152a8,8,0,0,1-8,8H72v48a8,8,0,0,1-16,0V160H44a8,8,0,0,1,0-16H84A8,8,0,0,1,92,152Zm128,0a8,8,0,0,1-8,8H200v48a8,8,0,0,1-16,0V160H172a8,8,0,0,1,0-16h40A8,8,0,0,1,220,152Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M204,112a4,4,0,0,0,8,0V88a4,4,0,0,0-1.17-2.83l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52ZM156,41.65,198.34,84H156Zm-4.75,112.67L132.92,180l18.33,25.67a4,4,0,1,1-6.5,4.65L128,186.88l-16.75,23.44a4,4,0,1,1-6.5-4.65L123.08,180l-18.33-25.68a4,4,0,1,1,6.5-4.65L128,173.12l16.75-23.45a4,4,0,1,1,6.5,4.65ZM88,152a4,4,0,0,1-4,4H68v52a4,4,0,0,1-8,0V156H44a4,4,0,0,1,0-8H84A4,4,0,0,1,88,152Zm128,0a4,4,0,0,1-4,4H196v52a4,4,0,0,1-8,0V156H172a4,4,0,0,1,0-8h40A4,4,0,0,1,216,152Z"}))]]),M_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212a12,12,0,0,0,0,24h4a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-1.91,84.69a12,12,0,0,0-11.92-.15L126.5,152.44A20,20,0,0,0,108,140H48a20,20,0,0,0-20,20v48a20,20,0,0,0,20,20h60a20,20,0,0,0,18.5-12.44l19.67,10.93A12,12,0,0,0,164,216V152A12,12,0,0,0,158.09,141.66ZM104,204H52V164h52Zm36-8.39-12-6.67v-9.88l12-6.67Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,88H152V32Zm-88,72a8,8,0,0,0-8-8H48a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V196l32,20V152l-32,20Z",opacity:"0.2"}),x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM112,208H48V160h64v48Zm32-6.43-16-10V176.43l16-10Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM144,201.57l-16-10V176.43l16-10Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158Zm-3.09,100.27a6,6,0,0,0-6.09.16L126,161.17V160a14,14,0,0,0-14-14H48a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h64a14,14,0,0,0,14-14v-1.17l22.82,14.26A6,6,0,0,0,158,216V152A6,6,0,0,0,154.91,146.75ZM114,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V160a2,2,0,0,1,2-2h64a2,2,0,0,1,2,2Zm32-2.83-20-12.5V175.33l20-12.5Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM112,208H48V160h64v48Zm32-6.43-16-10V176.43l16-10Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4h-8a4,4,0,0,0,0,8h8a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM153.94,148.5a4,4,0,0,0-4.06.11L124,164.78V160a12,12,0,0,0-12-12H48a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12v-4.78l25.88,16.17A4,4,0,0,0,152,220a4.06,4.06,0,0,0,1.94-.5A4,4,0,0,0,156,216V152A4,4,0,0,0,153.94,148.5ZM116,208a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V160a4,4,0,0,1,4-4h64a4,4,0,0,1,4,4Zm32,.78-24-15V174.22l24-15Z"}))]]),N_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,100h72v56H44Zm96-24V60h24V76Zm-24,0H92V60h24Zm0,104v16H92V180Zm24,0h24v16H140Zm0-24V100h72v56Zm72-80H188V60h24ZM68,60V76H44V60ZM44,180H68v16H44Zm144,16V180h24v16Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M32,176H224v24a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8ZM216,48H40a8,8,0,0,0-8,8V80H224V56A8,8,0,0,0,216,48Z",opacity:"0.2"}),x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM184,56h32V72H184ZM72,200H40V184H72ZM72,72H40V56H72Zm48,128H88V184h32Zm0-128H88V56h32Zm48,128H136V184h32Zm0-128H136V56h32Zm48,128H184V184h32v16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,86h84v84H38Zm96-12V54h36V74Zm-12,0H86V54h36Zm0,108v20H86V182Zm12,0h36v20H134Zm0-12V86h84v84ZM218,56V74H182V54h34A2,2,0,0,1,218,56ZM40,54H74V74H38V56A2,2,0,0,1,40,54ZM38,200V182H74v20H40A2,2,0,0,1,38,200Zm178,2H182V182h36v18A2,2,0,0,1,216,202Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,84h88v88H36Zm96-8V52h40V76Zm-8,0H84V52h40Zm0,104v24H84V180Zm8,0h40v24H132Zm0-8V84h88v88ZM220,56V76H180V52h36A4,4,0,0,1,220,56ZM40,52H76V76H36V56A4,4,0,0,1,40,52ZM36,200V180H76v24H40A4,4,0,0,1,36,200Zm180,4H180V180h40v20A4,4,0,0,1,216,204Z"}))]]),D_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),x.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),I_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Zm-84-88a12,12,0,0,1,12,12v12h12a12,12,0,0,1,0,24H140v12a12,12,0,0,1-24,0V156H104a12,12,0,0,1,0-24h12V120A12,12,0,0,1,128,108Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),x.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,144Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H134v18a6,6,0,0,1-12,0V150H104a6,6,0,0,1,0-12h18V120a6,6,0,0,1,12,0v18h18A6,6,0,0,1,158,144Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,144Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H132v20a4,4,0,0,1-8,0V148H104a4,4,0,0,1,0-8h20V120a4,4,0,0,1,8,0v20h20A4,4,0,0,1,156,144Z"}))]]),__e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M207.86,123.18l16.78-21a99.14,99.14,0,0,0-10.07-24.29l-26.7-3a81,81,0,0,0-6.81-6.81l-3-26.71a99.43,99.43,0,0,0-24.3-10l-21,16.77a81.59,81.59,0,0,0-9.64,0l-21-16.78A99.14,99.14,0,0,0,77.91,41.43l-3,26.7a81,81,0,0,0-6.81,6.81l-26.71,3a99.43,99.43,0,0,0-10,24.3l16.77,21a81.59,81.59,0,0,0,0,9.64l-16.78,21a99.14,99.14,0,0,0,10.07,24.29l26.7,3a81,81,0,0,0,6.81,6.81l3,26.71a99.43,99.43,0,0,0,24.3,10l21-16.77a81.59,81.59,0,0,0,9.64,0l21,16.78a99.14,99.14,0,0,0,24.29-10.07l3-26.7a81,81,0,0,0,6.81-6.81l26.71-3a99.43,99.43,0,0,0,10-24.3l-16.77-21A81.59,81.59,0,0,0,207.86,123.18ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),x.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8.06,8.06,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8.06,8.06,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,130.16q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm83.93-32.49q.13-3.51,0-7l15.83-19.79a4,4,0,0,0,.75-3.53A103.64,103.64,0,0,0,218,75.9a4,4,0,0,0-3-2l-25.19-2.8c-1.58-1.71-3.24-3.37-4.95-4.95L182.07,41a4,4,0,0,0-2-3A104,104,0,0,0,154.82,27.5a4,4,0,0,0-3.53.74L131.51,44.07q-3.51-.14-7,0L104.7,28.24a4,4,0,0,0-3.53-.75A103.64,103.64,0,0,0,75.9,38a4,4,0,0,0-2,3l-2.8,25.19c-1.71,1.58-3.37,3.24-4.95,4.95L41,73.93a4,4,0,0,0-3,2A104,104,0,0,0,27.5,101.18a4,4,0,0,0,.74,3.53l15.83,19.78q-.14,3.51,0,7L28.24,151.3a4,4,0,0,0-.75,3.53A103.64,103.64,0,0,0,38,180.1a4,4,0,0,0,3,2l25.19,2.8c1.58,1.71,3.24,3.37,4.95,4.95l2.8,25.2a4,4,0,0,0,2,3,104,104,0,0,0,25.28,10.46,4,4,0,0,0,3.53-.74l19.78-15.83q3.51.13,7,0l19.79,15.83a4,4,0,0,0,2.5.88,4,4,0,0,0,1-.13A103.64,103.64,0,0,0,180.1,218a4,4,0,0,0,2-3l2.8-25.19c1.71-1.58,3.37-3.24,4.95-4.95l25.2-2.8a4,4,0,0,0,3-2,104,104,0,0,0,10.46-25.28,4,4,0,0,0-.74-3.53Zm.17,42.83-24.67,2.74a4,4,0,0,0-2.55,1.32,76.2,76.2,0,0,1-6.48,6.48,4,4,0,0,0-1.32,2.55l-2.74,24.66a95.45,95.45,0,0,1-19.64,8.15l-19.38-15.51a4,4,0,0,0-2.5-.87h-.24a73.67,73.67,0,0,1-9.16,0,4,4,0,0,0-2.74.87l-19.37,15.5a95.33,95.33,0,0,1-19.65-8.13l-2.74-24.67a4,4,0,0,0-1.32-2.55,76.2,76.2,0,0,1-6.48-6.48,4,4,0,0,0-2.55-1.32l-24.66-2.74a95.45,95.45,0,0,1-8.15-19.64l15.51-19.38a4,4,0,0,0,.87-2.74,77.76,77.76,0,0,1,0-9.16,4,4,0,0,0-.87-2.74l-15.5-19.37A95.33,95.33,0,0,1,43.9,81.66l24.67-2.74a4,4,0,0,0,2.55-1.32,76.2,76.2,0,0,1,6.48-6.48,4,4,0,0,0,1.32-2.55l2.74-24.66a95.45,95.45,0,0,1,19.64-8.15l19.38,15.51a4,4,0,0,0,2.74.87,73.67,73.67,0,0,1,9.16,0,4,4,0,0,0,2.74-.87l19.37-15.5a95.33,95.33,0,0,1,19.65,8.13l2.74,24.67a4,4,0,0,0,1.32,2.55,76.2,76.2,0,0,1,6.48,6.48,4,4,0,0,0,2.55,1.32l24.66,2.74a95.45,95.45,0,0,1,8.15,19.64l-15.51,19.38a4,4,0,0,0-.87,2.74,77.76,77.76,0,0,1,0,9.16,4,4,0,0,0,.87,2.74l15.5,19.37A95.33,95.33,0,0,1,212.1,174.34Z"}))]]),R_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),x.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),j_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),L_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),x.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),F_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M209.84,47.44A91.42,91.42,0,0,0,144.62,20h-.35A91.44,91.44,0,0,0,79.15,47L17.76,109.17a20,20,0,0,0,.08,28.21L46.5,166a19.89,19.89,0,0,0,14.15,5.86h.11a19.86,19.86,0,0,0,14.2-6l60.87-62.39a12.07,12.07,0,0,1,16.77-.12,11.63,11.63,0,0,1,3.5,8.35,12.85,12.85,0,0,1-3.66,9.11L90.19,181a20,20,0,0,0-.21,28.5l28.66,28.66a20.08,20.08,0,0,0,28.15.14l61.76-60.44.09-.09C244.65,141.78,245.18,83.31,209.84,47.44ZM60.62,146.21l-23-23L55.81,104.8l22.88,22.88Zm72.2,72.18-23-23,18.61-18,22.88,22.87Zm58.89-57.62L168.48,183.5,145.7,160.73,169.21,138l.15-.14a37,37,0,0,0,10.74-26.37,35.44,35.44,0,0,0-10.85-25.41,36.2,36.2,0,0,0-50.44.48l-.1.11L95.46,110.49,72.68,87.72l23.5-23.8A67.55,67.55,0,0,1,144.27,44h.26a67.62,67.62,0,0,1,48.21,20.29C218.85,90.78,218.38,134.05,191.71,160.77Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M168.36,200.36l-30,29.35a8,8,0,0,1-11.26-.05L98.46,201a8,8,0,0,1,.08-11.4l30-29Zm-142-82.76a8,8,0,0,0,0,11.28L55,157.54a8,8,0,0,0,11.38-.06l29.18-29.92L55.77,87.77Z",opacity:"0.2"}),x.createElement("path",{d:"M207,50.25A87.46,87.46,0,0,0,144.6,24h-.33A87.48,87.48,0,0,0,82,49.81L50.11,82.11h0L20.61,112a16,16,0,0,0,.06,22.56l28.66,28.66a15.92,15.92,0,0,0,11.32,4.69h.09a16,16,0,0,0,11.36-4.82L133,100.69a16.08,16.08,0,0,1,22.41-.21,15.6,15.6,0,0,1,4.73,11.19,16.89,16.89,0,0,1-4.85,12L93,183.88a16,16,0,0,0-.17,22.79l28.66,28.66a16.06,16.06,0,0,0,22.52.12L205.81,175C240.26,140.5,240.79,84.56,207,50.25ZM60.65,151.89,32,123.24,55.8,99.12l28.52,28.52ZM132.79,224l-28.68-28.65,24.38-23.57L157,200.32Zm61.76-60.44-26.11,25.54L140,160.68l26.44-25.57.1-.09a33,33,0,0,0,9.57-23.5A31.44,31.44,0,0,0,166.47,89a32.2,32.2,0,0,0-44.9.5L95.49,116.18,67,87.74,93.35,61.09A71.51,71.51,0,0,1,144.27,40h.27a71.55,71.55,0,0,1,51.05,21.48C223.25,89.55,222.75,135.38,194.55,163.58Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M207,50.25A87.46,87.46,0,0,0,144.6,24h-.33A87.48,87.48,0,0,0,82,49.81L20.61,112a16,16,0,0,0,.06,22.56l28.66,28.66a15.92,15.92,0,0,0,11.32,4.69h.09a16,16,0,0,0,11.36-4.82L133,100.69a16.08,16.08,0,0,1,22.41-.21,15.6,15.6,0,0,1,4.73,11.19,16.89,16.89,0,0,1-4.85,12L93,183.88a16,16,0,0,0-.17,22.79l28.66,28.66a16.06,16.06,0,0,0,22.52.12L205.81,175C240.26,140.5,240.79,84.56,207,50.25ZM60.65,151.89,32,123.24,61.42,93.43,89.9,121.91ZM132.79,224l-28.68-28.65,30.13-29.13,28.49,28.48Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M205.56,51.65A85.5,85.5,0,0,0,144.6,26h-.33A85.45,85.45,0,0,0,83.42,51.22L22,113.39a14,14,0,0,0,.06,19.74l28.66,28.66a13.89,13.89,0,0,0,9.9,4.1h.08a13.9,13.9,0,0,0,9.94-4.21l60.87-62.4A18.1,18.1,0,0,1,156.76,99a17.63,17.63,0,0,1,5.34,12.62,19,19,0,0,1-5.44,13.44L94.37,185.31a14,14,0,0,0-.15,19.95l28.67,28.66a14.05,14.05,0,0,0,19.7.1l61.8-60.49C238.07,139.86,238.6,85.18,205.56,51.65ZM62.08,153.29a2,2,0,0,1-1.42.6,2.15,2.15,0,0,1-1.42-.58L30.57,124.65a2,2,0,0,1,0-2.82L55.79,96.28l31.34,31.34Zm72.11,72.15a2,2,0,0,1-2.82,0l-28.66-28.66a2,2,0,0,1-.59-1.43,2,2,0,0,1,.6-1.41L128.51,169l31.34,31.33ZM196,165l-27.52,26.94-31.29-31.29,27.9-27,.07-.08a30.93,30.93,0,0,0,9-22.06,29.47,29.47,0,0,0-9-21.15,30.17,30.17,0,0,0-42.08.46L95.51,119,64.22,87.74,91.94,59.68A73.47,73.47,0,0,1,144.27,38h.28A73.52,73.52,0,0,1,197,60.08C225.44,88.92,224.94,136,196,165Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M207,50.25A87.46,87.46,0,0,0,144.6,24h-.33A87.48,87.48,0,0,0,82,49.81L20.61,112a16,16,0,0,0,.06,22.56l28.66,28.66a15.92,15.92,0,0,0,11.32,4.69h.09a16,16,0,0,0,11.36-4.82L133,100.69a16.08,16.08,0,0,1,22.41-.21,15.6,15.6,0,0,1,4.73,11.19,16.89,16.89,0,0,1-4.85,12L93,183.88a16,16,0,0,0-.17,22.79l28.66,28.66a16.06,16.06,0,0,0,22.52.12L205.81,175C240.26,140.5,240.79,84.56,207,50.25ZM60.65,151.89,32,123.24,55.8,99.12l28.52,28.52ZM132.79,224l-28.68-28.65,24.38-23.57L157,200.32Zm61.76-60.44-26.11,25.54L140,160.68l26.44-25.57.1-.09a33,33,0,0,0,9.57-23.5A31.44,31.44,0,0,0,166.47,89a32.2,32.2,0,0,0-44.9.5L95.49,116.18,67,87.74,93.35,61.09A71.51,71.51,0,0,1,144.27,40h.27a71.55,71.55,0,0,1,51.05,21.48C223.25,89.55,222.75,135.38,194.55,163.58Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M204.13,53.06A83.41,83.41,0,0,0,144.59,28h-.32A83.46,83.46,0,0,0,84.85,52.62L23.46,114.8a12,12,0,0,0,0,16.92l28.67,28.66a11.89,11.89,0,0,0,8.48,3.51h.07a12,12,0,0,0,8.52-3.61l60.89-62.42a20.1,20.1,0,0,1,28-.27,19.54,19.54,0,0,1,6,14,20.87,20.87,0,0,1-6,14.86L95.76,186.75a12,12,0,0,0-.12,17.09L124.3,232.5a12,12,0,0,0,16.89.08L203,172.12C235.88,139.21,236.4,85.8,204.13,53.06ZM63.51,154.69a3.93,3.93,0,0,1-2.83,1.2h0a4,4,0,0,1-2.83-1.17L29.16,126.06a4,4,0,0,1,0-5.64l26.63-27L89.94,127.6Zm72.08,72.18a4,4,0,0,1-5.63,0l-28.67-28.66a4,4,0,0,1,0-5.69l27.2-26.3,34.16,34.15Zm61.76-60.44-28.94,28.32-34.12-34.12,29.41-28.44a29,29,0,0,0,8.4-20.64,27.51,27.51,0,0,0-8.41-19.72,28.14,28.14,0,0,0-39.25.41L95.53,121.87,61.4,87.75,90.52,58.26A75.51,75.51,0,0,1,144.27,36h.29a75.53,75.53,0,0,1,53.87,22.67C227.63,88.3,227.13,136.65,197.35,166.43Z"}))]]),$_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,36H160a20,20,0,0,0-20,20v88a12,12,0,0,1-24,0V56A20,20,0,0,0,96,36H56A20,20,0,0,0,36,56v88a92,92,0,0,0,92,92h.71c50.34-.38,91.3-42.1,91.3-93V56A20,20,0,0,0,200,36Zm-4,24V84H164V60ZM92,60V84H60V60Zm36.52,152H128a68,68,0,0,1-68-68V108H92v36a36,36,0,0,0,72,0V108h32v35C196,180.77,165.73,211.72,128.52,212Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M104,56V96H48V56a8,8,0,0,1,8-8H96A8,8,0,0,1,104,56Zm96-8H160a8,8,0,0,0-8,8V96h56V56A8,8,0,0,0,200,48Z",opacity:"0.2"}),x.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V88H160V56ZM96,56V88H56V56Zm32.55,160A72,72,0,0,1,56,144V104H96v40a32,32,0,0,0,64,0V104h40v39C200,183,168,215.71,128.55,216Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V96H160V56ZM96,56V96H56V56Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,42H160a14,14,0,0,0-14,14v88a18,18,0,0,1-36,0V56A14,14,0,0,0,96,42H56A14,14,0,0,0,42,56v88a86,86,0,0,0,86,86h.65c47.06-.35,85.35-39.38,85.35-87V56A14,14,0,0,0,200,42ZM160,54h40a2,2,0,0,1,2,2V90H158V56A2,2,0,0,1,160,54ZM56,54H96a2,2,0,0,1,2,2V90H54V56A2,2,0,0,1,56,54Zm72.56,164H128a74,74,0,0,1-74-74V102H98v42a30,30,0,0,0,60,0V102h44v41C202,184.05,169.06,217.7,128.56,218Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V88H160V56ZM96,56V88H56V56Zm32.55,160A72,72,0,0,1,56,144V104H96v40a32,32,0,0,0,64,0V104h40v39C200,183,168,215.71,128.55,216Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,44H160a12,12,0,0,0-12,12v88a20,20,0,0,1-40,0V56A12,12,0,0,0,96,44H56A12,12,0,0,0,44,56v88a84,84,0,0,0,84,84h.64c46-.34,83.36-38.47,83.36-85V56A12,12,0,0,0,200,44Zm-40,8h40a4,4,0,0,1,4,4V92H156V56A4,4,0,0,1,160,52ZM56,52H96a4,4,0,0,1,4,4V92H52V56A4,4,0,0,1,56,52Zm72.58,168H128a76,76,0,0,1-76-76V100h48v44a28,28,0,0,0,56,0V100h48v43C204,185.15,170.17,219.69,128.58,220Z"}))]]),B_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),x.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z"}))]]),V_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M156,112a12,12,0,0,1-12,12H124v20a12,12,0,0,1-24,0V124H80a12,12,0,0,1,0-24h20V80a12,12,0,0,1,24,0v20h20A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),x.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24A8,8,0,0,1,152,112Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M150,112a6,6,0,0,1-6,6H118v26a6,6,0,0,1-12,0V118H80a6,6,0,0,1,0-12h26V80a6,6,0,0,1,12,0v26h26A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M152,112a8,8,0,0,1-8,8H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M148,112a4,4,0,0,1-4,4H116v28a4,4,0,0,1-8,0V116H80a4,4,0,0,1,0-8h28V80a4,4,0,0,1,8,0v28h28A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z"}))]]),H_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),Q_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M211.45,52.51l-80-24A12,12,0,0,0,116,40V140.22A52,52,0,1,0,140,184V104.13l64.55,19.36A12,12,0,0,0,220,112V64A12,12,0,0,0,211.45,52.51ZM88,212a28,28,0,1,1,28-28A28,28,0,0,1,88,212ZM196,95.87l-56-16.8V56.13l56,16.8Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M128,184a40,40,0,1,1-40-40A40,40,0,0,1,128,184Z",opacity:"0.2"}),x.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M209.72,58.25l-80-24A6,6,0,0,0,122,40V153.05A46,46,0,1,0,134,184V96.06l72.28,21.69A6,6,0,0,0,214,112V64A6,6,0,0,0,209.72,58.25ZM88,218a34,34,0,1,1,34-34A34,34,0,0,1,88,218ZM202,103.94l-68-20.4V48.06l68,20.4Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M209.15,60.17l-80-24A4,4,0,0,0,124,40V158.75A44,44,0,1,0,132,184V93.38l74.85,22.45A4,4,0,0,0,212,112V64A4,4,0,0,0,209.15,60.17ZM88,220a36,36,0,1,1,36-36A36,36,0,0,1,88,220ZM204,106.62,132,85V45.38L204,67Z"}))]]),z_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),x.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),Z_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z",opacity:"0.2"}),x.createElement("path",{d:"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z"}))]]),G_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),x.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),U_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),X_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M238.78,183.79,98.28,87.65A40.18,40.18,0,0,0,100,76a40,40,0,1,0-15.29,31.45l30,20.56-30,20.56a40,40,0,1,0,3.57,59.74h0A39.73,39.73,0,0,0,100,180a40.18,40.18,0,0,0-1.72-11.66L136,142.54l89.22,61.06a12,12,0,0,0,13.56-19.81ZM71.31,191.33h0A16,16,0,1,1,76,180,16,16,0,0,1,71.31,191.33ZM48.69,87.3a16,16,0,1,1,22.62,0h0A16,16,0,0,1,48.69,87.3Zm112.82,23.24a12,12,0,0,1,3.13-16.68L225.22,52.4a12,12,0,0,1,13.56,19.81l-60.59,41.46a12,12,0,0,1-16.68-3.13Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M40.2,95.8a28,28,0,1,1,39.6,0A28,28,0,0,1,40.2,95.8Zm0,64.4a28,28,0,1,0,39.6,0A28,28,0,0,0,40.2,160.2Z",opacity:"0.2"}),x.createElement("path",{d:"M157.73,113.13A8,8,0,0,1,159.82,102L227.48,55.7a8,8,0,0,1,9,13.21l-67.67,46.3a7.92,7.92,0,0,1-4.51,1.4A8,8,0,0,1,157.73,113.13Zm80.87,85.09a8,8,0,0,1-11.12,2.08L136,137.7,93.49,166.78a36,36,0,1,1-9-13.19L121.83,128,84.44,102.41a35.86,35.86,0,1,1,9-13.19l143,97.87A8,8,0,0,1,238.6,198.22ZM80,180a20,20,0,1,0-5.86,14.14A19.85,19.85,0,0,0,80,180ZM74.14,90.13a20,20,0,1,0-28.28,0A19.85,19.85,0,0,0,74.14,90.13Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M236.52,187.09l-143-97.87a36,36,0,1,0-14.38,17.27l21.39,21.69L79.15,149.54l0,0a35.91,35.91,0,1,0,14.38,17.27l26.91-18.41L170,198.64a32.26,32.26,0,0,0,22.7,9.37,31.52,31.52,0,0,0,4.11-.27l.28,0,36.27-6.11a8,8,0,0,0,3.19-14.5Zm-162.38-97A20,20,0,1,1,80,76,20,20,0,0,1,74.14,90.13Zm0,104A20,20,0,1,1,80,180,20,20,0,0,1,74.14,194.15Zm61-101.5L169.94,57.4a32.19,32.19,0,0,1,26.84-9.14l.28,0,36,6.07a8.21,8.21,0,0,1,6.09,4.42,8,8,0,0,1-2.67,10.12l-69.93,47.85a4,4,0,0,1-4.51,0l-26.31-18A4,4,0,0,1,135.18,92.65Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M159.38,112a6,6,0,0,1,1.57-8.34l67.66-46.31a6,6,0,0,1,6.78,9.91l-67.67,46.3a6,6,0,0,1-8.34-1.56ZM237,197.09a6,6,0,0,1-8.34,1.56L136,135.27,91,166.06A34,34,0,1,1,84,156a1.8,1.8,0,0,0,.19.2L125.37,128,84.23,99.84,84,100a34,34,0,1,1,7-10.1l144.38,98.8A6,6,0,0,1,237,197.09ZM75.56,91.55a22,22,0,1,0-31.12,0,21.88,21.88,0,0,0,31.12,0ZM82,180a22,22,0,1,0-6.44,15.56h0A21.88,21.88,0,0,0,82,180Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M157.73,113.13A8,8,0,0,1,159.82,102L227.48,55.7a8,8,0,0,1,9,13.21l-67.67,46.3a7.92,7.92,0,0,1-4.51,1.4A8,8,0,0,1,157.73,113.13Zm80.87,85.09a8,8,0,0,1-11.12,2.08L136,137.7,93.49,166.78a36,36,0,1,1-9-13.19L121.83,128,84.44,102.41a35.86,35.86,0,1,1,9-13.19l143,97.87A8,8,0,0,1,238.6,198.22ZM80,180a20,20,0,1,0-5.86,14.14A19.85,19.85,0,0,0,80,180ZM74.14,90.13a20,20,0,1,0-28.28,0A19.85,19.85,0,0,0,74.14,90.13Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M161,110.87a4,4,0,0,1,1.05-5.56L229.74,59a4,4,0,0,1,4.52,6.61l-67.67,46.3a4,4,0,0,1-5.56-1ZM235.3,196a4,4,0,0,1-5.56,1L136,132.85,88.47,165.38a32,32,0,1,1-5.84-8c.45.45.89.92,1.31,1.4l45-30.78-45-30.78c-.42.48-.86,1-1.31,1.4a31.86,31.86,0,1,1,5.84-8l49.69,34h0l96.09,65.76A4,4,0,0,1,235.3,196ZM77,93a24.42,24.42,0,0,0,2.82-3.38s0,0,0,0l0,0A24,24,0,1,0,77,93ZM84,180a23.75,23.75,0,0,0-4.15-13.49l0-.06,0,0A24.5,24.5,0,0,0,77,163,24,24,0,1,0,77,197h0A23.85,23.85,0,0,0,84,180Z"}))]]),W_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,176H52V52H204Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34Zm2,174a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z"}))]]),q_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,24v56H60V60ZM60,196V140H196v56Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),x.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,16v64H56V56Zm0,144H56V136H200v64Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H44a4,4,0,0,1-4-4V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Zm-4,80H44a4,4,0,0,0-4,4v60a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42ZM56,54H200a2,2,0,0,1,2,2v66H54V56A2,2,0,0,1,56,54ZM200,202H56a2,2,0,0,1-2-2V134H202v66A2,2,0,0,1,200,202Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,16v64H56V56Zm0,144H56V136H200v64Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44ZM56,52H200a4,4,0,0,1,4,4v68H52V56A4,4,0,0,1,56,52ZM200,204H56a4,4,0,0,1-4-4V132H204v68A4,4,0,0,1,200,204Z"}))]]),Y_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),x.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),x.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),x.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),K_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M90.86,50.89a12,12,0,0,0-21.72,0l-64,136a12,12,0,0,0,21.71,10.22L42.44,164h75.12l15.58,33.11a12,12,0,0,0,21.72-10.22ZM53.74,140,80,84.18,106.27,140ZM200,84c-13.85,0-24.77,3.86-32.45,11.48a12,12,0,1,0,16.9,17c3-3,8.26-4.52,15.55-4.52,11,0,20,7.18,20,16v4.39A47.28,47.28,0,0,0,200,124c-24.26,0-44,17.94-44,40s19.74,40,44,40a47.18,47.18,0,0,0,22-5.38A12,12,0,0,0,244,192V124C244,101.94,224.26,84,200,84Zm0,96c-11,0-20-7.18-20-16s9-16,20-16,20,7.18,20,16S211,180,200,180Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M232,164c0,15.46-14.33,28-32,28s-32-12.54-32-28,14.33-28,32-28S232,148.54,232,164ZM34.82,152h90.36L80,56Z",opacity:"0.2"}),x.createElement("path",{d:"M87.24,52.59a8,8,0,0,0-14.48,0l-64,136a8,8,0,1,0,14.48,6.81L39.9,160h80.2l16.66,35.4a8,8,0,1,0,14.48-6.81ZM47.43,144,80,74.79,112.57,144ZM200,96c-12.76,0-22.73,3.47-29.63,10.32a8,8,0,0,0,11.26,11.36c3.8-3.77,10-5.68,18.37-5.68,13.23,0,24,9,24,20v3.22A42.76,42.76,0,0,0,200,128c-22.06,0-40,16.15-40,36s17.94,36,40,36a42.73,42.73,0,0,0,24-7.25,8,8,0,0,0,16-.75V132C240,112.15,222.06,96,200,96Zm0,88c-13.23,0-24-9-24-20s10.77-20,24-20,24,9,24,20S213.23,184,200,184Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,156c0,6.5-7.33,12-16,12s-16-5.5-16-12,7.33-12,16-12S200,149.5,200,156ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM143.37,172.88l-44-104a8,8,0,0,0-14.74,0l-44,104a8,8,0,0,0,14.74,6.24L66.84,152h50.32l11.47,27.12a8,8,0,0,0,14.74-6.24ZM216,124c0-15.44-14.36-28-32-28a34.86,34.86,0,0,0-20.78,6.68,8,8,0,0,0,9.56,12.83A18.84,18.84,0,0,1,184,112c8.56,0,15.8,5.36,16,11.76v8A35.24,35.24,0,0,0,184,128c-17.64,0-32,12.56-32,28s14.36,28,32,28a35.13,35.13,0,0,0,16.93-4.26A8,8,0,0,0,216,176ZM73.61,136h36.78L92,92.53Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M85.43,53.45a6,6,0,0,0-10.86,0l-64,136a6,6,0,1,0,10.86,5.11L38.63,158h82.74l17.2,36.55a6,6,0,1,0,10.86-5.11ZM44.28,146,80,70.09,115.72,146ZM200,98c-12.21,0-21.71,3.28-28.23,9.74a6,6,0,0,0,8.46,8.52c4.18-4.15,10.84-6.26,19.77-6.26,14.34,0,26,9.87,26,22v7.24A40.36,40.36,0,0,0,200,130c-20.95,0-38,15.25-38,34s17.05,34,38,34a40.36,40.36,0,0,0,26-9.24V192a6,6,0,0,0,12,0V132C238,113.25,221,98,200,98Zm0,88c-14.34,0-26-9.87-26-22s11.66-22,26-22,26,9.87,26,22S214.34,186,200,186Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M87.24,52.59a8,8,0,0,0-14.48,0l-64,136a8,8,0,1,0,14.48,6.81L39.9,160h80.2l16.66,35.4a8,8,0,1,0,14.48-6.81ZM47.43,144,80,74.79,112.57,144ZM200,96c-12.76,0-22.73,3.47-29.63,10.32a8,8,0,0,0,11.26,11.36c3.8-3.77,10-5.68,18.37-5.68,13.23,0,24,9,24,20v3.22A42.76,42.76,0,0,0,200,128c-22.06,0-40,16.15-40,36s17.94,36,40,36a42.73,42.73,0,0,0,24-7.25,8,8,0,0,0,16-.75V132C240,112.15,222.06,96,200,96Zm0,88c-13.23,0-24-9-24-20s10.77-20,24-20,24,9,24,20S213.23,184,200,184Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M83.62,54.3a4,4,0,0,0-7.24,0l-64,136a4,4,0,0,0,7.24,3.4L37.36,156h85.28l17.74,37.7a4,4,0,1,0,7.24-3.4ZM41.13,148,80,65.39,118.87,148ZM200,100c-11.67,0-20.69,3.08-26.82,9.16a4,4,0,1,0,5.64,5.68c4.57-4.54,11.7-6.84,21.18-6.84,15.44,0,28,10.77,28,24v11.92A37.78,37.78,0,0,0,200,132c-19.85,0-36,14.35-36,32s16.15,32,36,32a37.78,37.78,0,0,0,28-11.92V192a4,4,0,0,0,8,0V132C236,114.36,219.85,100,200,100Zm0,88c-15.44,0-28-10.77-28-24s12.56-24,28-24,28,10.77,28,24S215.44,188,200,188Z"}))]]),J_e=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M212,56V88a12,12,0,0,1-24,0V68H140V188h20a12,12,0,0,1,0,24H96a12,12,0,0,1,0-24h20V68H68V88a12,12,0,0,1-24,0V56A12,12,0,0,1,56,44H200A12,12,0,0,1,212,56Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,56V184a16,16,0,0,1-16,16H72a16,16,0,0,1-16-16V56Z",opacity:"0.2"}),x.createElement("path",{d:"M208,56V88a8,8,0,0,1-16,0V64H136V192h24a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16h24V64H64V88a8,8,0,0,1-16,0V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,96a8,8,0,0,1-16,0V88H136v88h12a8,8,0,0,1,0,16H108a8,8,0,0,1,0-16h12V88H88v8a8,8,0,0,1-16,0V80a8,8,0,0,1,8-8h96a8,8,0,0,1,8,8Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M206,56V88a6,6,0,0,1-12,0V62H134V194h26a6,6,0,0,1,0,12H96a6,6,0,0,1,0-12h26V62H62V88a6,6,0,0,1-12,0V56a6,6,0,0,1,6-6H200A6,6,0,0,1,206,56Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,56V88a8,8,0,0,1-16,0V64H136V192h24a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16h24V64H64V88a8,8,0,0,1-16,0V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M204,56V88a4,4,0,0,1-8,0V60H132V196h28a4,4,0,0,1,0,8H96a4,4,0,0,1,0-8h28V60H60V88a4,4,0,0,1-8,0V56a4,4,0,0,1,4-4H200A4,4,0,0,1,204,56Z"}))]]),eRe=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),x.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),tRe=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),x.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),nRe=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M60,96v64a12,12,0,0,1-24,0V96a12,12,0,0,1,24,0ZM88,20A12,12,0,0,0,76,32V224a12,12,0,0,0,24,0V32A12,12,0,0,0,88,20Zm40,32a12,12,0,0,0-12,12V192a12,12,0,0,0,24,0V64A12,12,0,0,0,128,52Zm40,32a12,12,0,0,0-12,12v64a12,12,0,0,0,24,0V96A12,12,0,0,0,168,84Zm40-16a12,12,0,0,0-12,12v96a12,12,0,0,0,24,0V80A12,12,0,0,0,208,68Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,96v64H48V96Z",opacity:"0.2"}),x.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,152a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,32a8,8,0,0,1-16,0V72a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V88a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,8a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M54,96v64a6,6,0,0,1-12,0V96a6,6,0,0,1,12,0ZM88,26a6,6,0,0,0-6,6V224a6,6,0,0,0,12,0V32A6,6,0,0,0,88,26Zm40,32a6,6,0,0,0-6,6V192a6,6,0,0,0,12,0V64A6,6,0,0,0,128,58Zm40,32a6,6,0,0,0-6,6v64a6,6,0,0,0,12,0V96A6,6,0,0,0,168,90Zm40-16a6,6,0,0,0-6,6v96a6,6,0,0,0,12,0V80A6,6,0,0,0,208,74Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M52,96v64a4,4,0,0,1-8,0V96a4,4,0,0,1,8,0ZM88,28a4,4,0,0,0-4,4V224a4,4,0,0,0,8,0V32A4,4,0,0,0,88,28Zm40,32a4,4,0,0,0-4,4V192a4,4,0,0,0,8,0V64A4,4,0,0,0,128,60Zm40,32a4,4,0,0,0-4,4v64a4,4,0,0,0,8,0V96A4,4,0,0,0,168,92Zm40-16a4,4,0,0,0-4,4v96a4,4,0,0,0,8,0V80A4,4,0,0,0,208,76Z"}))]]),rRe=new Map([["bold",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",x.createElement(x.Fragment,null,x.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),x.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",x.createElement(x.Fragment,null,x.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",x.createElement(x.Fragment,null,x.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",x.createElement(x.Fragment,null,x.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),iRe=x.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),zt=x.forwardRef((t,e)=>{const{alt:n,color:r,size:i,weight:s,mirrored:a,children:o,weights:l,...c}=t,{color:u="currentColor",size:f,weight:h="regular",mirrored:m=!1,...y}=x.useContext(iRe);return x.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:i??f,height:i??f,fill:r??u,viewBox:"0 0 256 256",transform:a||m?"scale(-1, 1)":void 0,...y,...c},!!n&&x.createElement("title",null,n),o,l.get(s??h))});zt.displayName="IconBase";const Wce=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:n_e}));Wce.displayName="ArrowClockwiseIcon";const sRe=Wce,qce=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:r_e}));qce.displayName="ArrowCounterClockwiseIcon";const aRe=qce,Yce=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:i_e}));Yce.displayName="ArrowLeftIcon";const oRe=Yce,Kce=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:s_e}));Kce.displayName="ArrowsOutCardinalIcon";const lRe=Kce,Jce=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:a_e}));Jce.displayName="CameraIcon";const cRe=Jce,z6=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:o_e}));z6.displayName="CaretRightIcon";const FL=z6,eue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:l_e}));eue.displayName="CheckIcon";const tue=eue,nue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:c_e}));nue.displayName="CheckCircleIcon";const rue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:u_e}));rue.displayName="ClipboardTextIcon";const uRe=rue,iue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:f_e}));iue.displayName="ClockIcon";const fRe=iue,sue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:h_e}));sue.displayName="CopyIcon";const aue=sue,oue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:d_e}));oue.displayName="EyeIcon";const ZE=oue,lue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:p_e}));lue.displayName="EyeSlashIcon";const $L=lue,cue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:m_e}));cue.displayName="EyedropperIcon";const hRe=cue,uue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:g_e}));uue.displayName="FileIcon";const dRe=uue,fue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:y_e}));fue.displayName="FileCodeIcon";const pRe=fue,hue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:x_e}));hue.displayName="FileCssIcon";const mRe=hue,due=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:b_e}));due.displayName="FileHtmlIcon";const gRe=due,pue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:v_e}));pue.displayName="FileJpgIcon";const yRe=pue,mue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:A_e}));mue.displayName="FileJsIcon";const xRe=mue,gue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:S_e}));gue.displayName="FileJsxIcon";const bRe=gue,yue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:w_e}));yue.displayName="FileMdIcon";const vRe=yue,xue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:O_e}));xue.displayName="FilePlusIcon";const yX=xue,bue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:C_e}));bue.displayName="FilePngIcon";const ARe=bue,vue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:k_e}));vue.displayName="FileSvgIcon";const SRe=vue,Aue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:E_e}));Aue.displayName="FileTsIcon";const wRe=Aue,Sue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:T_e}));Sue.displayName="FileTsxIcon";const ORe=Sue,wue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:P_e}));wue.displayName="FileTxtIcon";const CRe=wue,Oue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:M_e}));Oue.displayName="FileVideoIcon";const kRe=Oue,Cue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:N_e}));Cue.displayName="FilmStripIcon";const ERe=Cue,kue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:D_e}));kue.displayName="FolderSimpleIcon";const TRe=kue,Eue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:I_e}));Eue.displayName="FolderSimplePlusIcon";const Tue=Eue,Pue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:__e}));Pue.displayName="GearIcon";const PRe=Pue,Mue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:R_e}));Mue.displayName="GridFourIcon";const MRe=Mue,Nue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:j_e}));Nue.displayName="ImageIcon";const Due=Nue,Iue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:L_e}));Iue.displayName="LightningIcon";const NRe=Iue,_ue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:F_e}));_ue.displayName="MagnetIcon";const DRe=_ue,Rue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:$_e}));Rue.displayName="MagnetStraightIcon";const IRe=Rue,jue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:B_e}));jue.displayName="MagnifyingGlassMinusIcon";const _Re=jue,Lue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:V_e}));Lue.displayName="MagnifyingGlassPlusIcon";const RRe=Lue,Fue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:H_e}));Fue.displayName="MinusIcon";const jRe=Fue,$ue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:Q_e}));$ue.displayName="MusicNoteIcon";const LRe=$ue,Bue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:z_e}));Bue.displayName="PaletteIcon";const FRe=Bue,Vue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:Z_e}));Vue.displayName="PathIcon";const $Re=Vue,Hue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:G_e}));Hue.displayName="PencilSimpleIcon";const BRe=Hue,Que=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:U_e}));Que.displayName="PlusIcon";const zue=Que,Zue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:X_e}));Zue.displayName="ScissorsIcon";const VRe=Zue,Gue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:W_e}));Gue.displayName="SquareIcon";const HRe=Gue,Uue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:q_e}));Uue.displayName="SquareSplitVerticalIcon";const QRe=Uue,Xue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:Y_e}));Xue.displayName="StackIcon";const zRe=Xue,Wue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:K_e}));Wue.displayName="TextAaIcon";const ZRe=Wue,que=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:J_e}));que.displayName="TextTIcon";const GRe=que,Yue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:eRe}));Yue.displayName="TrashIcon";const Kue=Yue,E4=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:tRe}));E4.displayName="WarningIcon";const Jue=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:nRe}));Jue.displayName="WaveformIcon";const URe=Jue,BL=x.forwardRef((t,e)=>x.createElement(zt,{ref:e,...t,weights:rRe}));BL.displayName="XIcon";const XRe=BL,gi=t=>({title:n,...r})=>p.jsx(t,{alt:n,"aria-label":n,"aria-hidden":n?void 0:!0,...r}),efe=gi(tue),WRe=gi(fRe),VL=gi(ZE),GE=gi(ERe),Mg=gi(zRe),qRe=gi(lRe),tfe=gi(LRe),nfe=gi(FRe),YRe=gi(jRe),Xo=gi(zue),rfe=gi(HRe),ife=gi(QRe),v_=gi(GRe),Md=gi(XRe),KRe=gi(NRe),sfe=({title:t,style:e,...n})=>{const r=e!=null&&e.transform?`${e.transform} rotate(90deg)`:"rotate(90deg)";return p.jsx(FL,{alt:t,"aria-label":t,"aria-hidden":t?void 0:!0,style:{...e,transform:r},...n})},afe=gi(FL),HL=gi(uRe),Jo=gi(aRe),JRe=gi(cRe),ofe=gi(sRe),Z6=gi(PRe),lfe=gi(VRe),e9e=gi(hRe),t9e=gi(Kue);function cfe({clipCount:t}){return t<2?null:p.jsx("span",{"aria-label":`${t} clips`,title:`${t} clips`,className:"shrink-0 rounded-full bg-white/10 px-1 text-[9px] leading-[14px] tabular-nums text-white/55",children:t})}function n9e(t){return[...new Set(t.map(e=>e.track))].sort((e,n)=>e-n)}function ufe(t,e){const n=t.indexOf(e);return n<0?null:n+1}function UE(t){return t===null?"":` ${t}`}function r9e(t,e){return t?`Show track${e}`:`Hide track${e}`}function i9e(t){const e=t?$L:ZE;return p.jsx(e,{size:14,weight:"bold","aria-hidden":"true"})}function ffe({hidden:t,trackNumber:e,trackDisplayNumber:n,visible:r,onToggle:i}){if(!r)return p.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 shrink-0"});const s=UE(n),a=r9e(t,s);return p.jsx("button",{type:"button","aria-label":a,title:a,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-[-1px] focus-visible:outline-[#3CE6AC] ${t?"text-[#3CE6AC] hover:text-white":"text-white/35 hover:text-white/75"}`,onPointerDown:o=>o.stopPropagation(),onClick:o=>{o.stopPropagation(),i==null||i(e,!t,n)},children:i9e(t)})}function s9e({trackNumber:t,trackDisplayNumber:e,trackLabel:n,clipCount:r,showTrackLabel:i,isTrackHidden:s,isAudioTrack:a,onToggleTrackHidden:o,trailing:l}){return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[a&&p.jsx(tfe,{size:12,weight:"fill","aria-hidden":"true",className:"text-white/35"}),i&&p.jsx("span",{className:"min-w-0 break-words text-[11px] leading-tight",children:n}),i&&p.jsx(cfe,{clipCount:r}),p.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[p.jsx(ffe,{hidden:s,trackNumber:t,trackDisplayNumber:e,visible:!a||s,onToggle:o}),l]})]})})}function hfe(t){const e=new Set([...Hd(t).map(r=>r.id),...Array.from(t.querySelectorAll("[id]")).map(r=>r.id)]);if(!e.has("voiceover"))return"voiceover";let n=2;for(;e.has(`voiceover-${n}`);)n+=1;return`voiceover-${n}`}function dfe(t){return typeof(t==null?void 0:t.then)=="function"}const pfe=Symbol("carve-aborted");function a9e(t,e,n){if(!n||e.sources.length<2)return e;const r=new Set(Hd(t).map(s=>s.id));if(e.sources.some(s=>r.has(s)))return e;const i=hfe(t);return n(e.sources,i).then(()=>({...e,sources:[i]}))}function o9e(t,e,n){const r=t&&e?a9e(e,t,n):t;return dfe(r)?r.catch(()=>pfe):r}function l9e(t,e){var r;const n=e?(r=t.get(e))==null?void 0:r.id:void 0;return new Set([e,n].filter(i=>!!i))}function c9e(t,e,n,r){const i=new Map(Hd(t).flatMap(l=>l.memberIds.map(c=>[c,l]))),s=l9e(i,r),a=new Set,o=[];for(const l of e){const c=i.get(l.id);if(s.has(l.id)||c&&s.has(c.id))continue;if(!c){n(l)&&o.push({id:l.id,label:l.id,kind:v0(l.id,l.getAttribute("src"))});continue}if(a.has(c.id))continue;const u=c.memberIds.map(f=>t.getElementById(f)).filter(f=>(f==null?void 0:f.tagName)==="AUDIO");u.some(n)&&(a.add(c.id),o.push({id:c.id,label:`${c.label} (${u.length})`,kind:v0(c.label,...u.flatMap(f=>[f.id,f.getAttribute("src")]))}))}return o}function u9e(t,e){var r;if(((r=e==null?void 0:e.tagName)==null?void 0:r.toLowerCase())===ga)return{couldBeBed:!1,autoBed:!1};const n=[t,e==null?void 0:e.getAttribute("src"),e==null?void 0:e.getAttribute("data-label")];return{couldBeBed:QIe(...n),autoBed:zIe(...n)}}function f9e(t,e,n){try{const r=e.getAttribute(zE);if(!r)return!1;const i=Vce(JSON.parse(r)).sources;return Cse(t,i).includes(n)}catch{return!1}}function h9e(t,e){if(!t||!e)return null;const r=Array.from(t.querySelectorAll(`[${zE}]`)).find(i=>i.id!==e&&f9e(t,i,e));return r?r.id||"another track":null}const Ni=(t,e,n,r,i)=>({id:t,label:n,family:e,description:r,nodes:i}),xX=(t,e,n)=>[{type:t,label:n,params:{frequency:e,q:.707,poles:"2"}},{type:t,label:n,params:{frequency:e,q:.707,poles:"2"}}],QL=[Ni("voice-clean","voice","Clean Voice","Cuts rumble and mud, evens out the level, adds a little clarity.",[{type:"highpass",label:"Remove Rumble",params:{frequency:80,q:.707,poles:"2"}},{type:"peaking",label:"Reduce Mud",params:{frequency:250,gain:-3,q:1.2}},{type:"compressor",label:"Even Out Loudness",params:{threshold:-20,ratio:3,attack:12,release:180,makeup:3}},{type:"peaking",label:"Add Clarity",params:{frequency:3e3,gain:2.5,q:1}},{type:"limiter",label:"Peak Ceiling",params:{limit:-1,attack:5,release:50}}]),Ni("voice-broadcast","voice","Broadcast","Denser and more forward — a radio-presenter sound.",[{type:"highpass",label:"Remove Rumble",params:{frequency:90,q:.707,poles:"2"}},{type:"peaking",label:"Reduce Boxiness",params:{frequency:400,gain:-3,q:1.4}},{type:"compressor",label:"Even Out Loudness",params:{threshold:-24,ratio:4,attack:8,release:150,makeup:5}},{type:"peaking",label:"Add Clarity",params:{frequency:2500,gain:3,q:.9}},{type:"highshelf",label:"Add Air",params:{frequency:8e3,gain:2}},{type:"saturate",label:"Warmth",params:{type:"tanh",threshold:-12,output:0}},{type:"limiter",label:"Peak Ceiling",params:{limit:-1,attack:5,release:60}}]),Ni("voice-warm","voice","Close & Warm","Intimate and lightly handled, for a voice close to the mic.",[{type:"highpass",label:"Remove Rumble",params:{frequency:70,q:.707,poles:"2"}},{type:"lowshelf",label:"Add Weight",params:{frequency:180,gain:2}},{type:"compressor",label:"Even Out Loudness",params:{threshold:-18,ratio:2.5,attack:20,release:250,makeup:2}},{type:"peaking",label:"Add Clarity",params:{frequency:3e3,gain:1.5,q:.8}},{type:"limiter",label:"Peak Ceiling",params:{limit:-1.5}}]),Ni("rumble-cut","repair","Cut Rumble","Removes traffic, handling and air-conditioning from under a voice.",[{type:"highpass",label:"Cut Rumble",params:{frequency:100,q:.707,poles:"2"}}]),Ni("room-gate","repair","Quiet Between Phrases","Silences the gaps between words. Room tone under speech stays — this closes the pauses, it does not remove noise.",[{type:"gate",label:"Silence the Gaps",params:{threshold:-45,range:-18,ratio:10,attack:2,release:180}}]),Ni("boom-tame","repair","Tame Boominess","Takes out the chestiness of a voice too close to the mic.",[{type:"peaking",label:"Tame Boominess",params:{frequency:200,gain:-4,q:1.4}}]),Ni("harsh-tame","repair","Soften Harshness","Rounds off a brittle upper-mid. Broad and always-on; sibilance proper wants the measuring version.",[{type:"peaking",label:"Soften Harshness",params:{frequency:3200,gain:-3,q:1.6}}]),Ni("telephone","character","Telephone","Down the line — the narrow band of a phone call.",[...xX("highpass",300,"Strip the Bass"),...xX("lowpass",3400,"Strip the Treble"),{type:"peaking",label:"Phone Honk",params:{frequency:1200,gain:6,q:1.2}},{type:"peaking",label:"De-mud",params:{frequency:550,gain:-4,q:1}},{type:"saturate",label:"Circuit Grit",params:{type:"tanh",threshold:-9,output:-2}}]),Ni("radio-am","character","AM Radio","Narrow, gritty and a little crushed.",[{type:"highpass",label:"Strip the Bass",params:{frequency:220,q:.707,poles:"2"}},{type:"lowpass",label:"Strip the Treble",params:{frequency:2200,q:.707,poles:"2"}},{type:"peaking",label:"IF Droop",params:{frequency:1200,gain:-5,q:.9}},{type:"lowshelf",label:"Boxy",params:{frequency:500,gain:4}},{type:"saturate",label:"Radio Grit",params:{type:"tanh",threshold:-8,output:-1}},{type:"bitcrush",label:"Carrier Hiss",params:{bits:8,samples:1,mix:.45}}]),Ni("megaphone","character","Megaphone","Shouted through a horn, with the slap that comes with it.",[{type:"highpass",label:"Strip the Bass",params:{frequency:700,q:.707,poles:"2"}},{type:"lowpass",label:"Strip the Treble",params:{frequency:4e3,q:.707,poles:"2"}},{type:"peaking",label:"Horn Honk",params:{frequency:1900,gain:14,q:3}},{type:"peaking",label:"Horn Ring",params:{frequency:3200,gain:6,q:3}},{type:"saturate",label:"Overdrive",params:{type:"hard",threshold:-5,output:-3}},{type:"delay",label:"Horn Slap",params:{time:65,feedback:.2,mix:.28}}]),Ni("lofi-tape","character","Tape","Worn, warm and slightly unsteady, like a played-out cassette.",[{type:"lowpass",label:"Tape Rolloff",params:{frequency:6500,q:.707,poles:"2"}},{type:"lowshelf",label:"Add Weight",params:{frequency:120,gain:2}},{type:"saturate",label:"Tape Warmth",params:{type:"tanh",threshold:-14,output:0}},{type:"bitcrush",label:"Tape Noise",params:{bits:12,samples:2,mix:.35}},{type:"chorus",label:"Wow & Flutter",params:{delay:6,depth:.6,speed:.4,mix:.15}}]),Ni("pa-system","character","Tannoy","Announced across a concourse.",[{type:"highpass",label:"Strip the Bass",params:{frequency:250,q:.707,poles:"2"}},{type:"lowpass",label:"Strip the Treble",params:{frequency:5e3,q:.707,poles:"2"}},{type:"peaking",label:"Tannoy Honk",params:{frequency:2400,gain:9,q:2}},{type:"saturate",label:"Driver Grit",params:{type:"tanh",threshold:-10,output:-1}},{type:"reverb",label:"Concourse",params:{size:.54,damping:.48,wet:.25,dry:.8}}]),Ni("intercom","character","Intercom","Buzzed through a door panel, squelch and all.",[{type:"gate",label:"Squelch",params:{threshold:-40,range:-30,ratio:10,attack:1,release:120}},{type:"highpass",label:"Strip the Bass",params:{frequency:500,q:.707,poles:"2"}},{type:"lowpass",label:"Strip the Treble",params:{frequency:3e3,q:.707,poles:"2"}},{type:"peaking",label:"Panel Honk",params:{frequency:2e3,gain:6,q:2}},{type:"bitcrush",label:"Crunch",params:{bits:11,samples:1,mix:.3}}]),Ni("doofus-worble","character","Doofus Worble","Seasick and wobbling — no straight signal left.",[{type:"chorus",label:"Worble",params:{delay:14.6,depth:2.57,speed:10,mix:1}}]),Ni("chipmunk","character","Chipmunk","Small, fast and squeaky.",[{type:"pitchshift",label:"Up High",params:{semitones:7,mix:1}},{type:"highshelf",label:"Extra Sparkle",params:{frequency:4e3,gain:3}}]),Ni("giant","character","Giant","Huge, slow and deep.",[{type:"pitchshift",label:"Down Low",params:{semitones:-5,mix:1}},{type:"lowshelf",label:"Add Weight",params:{frequency:150,gain:4}},{type:"compressor",label:"Hold It Together",params:{threshold:-18,ratio:3,attack:10,release:120,knee:6,makeup:2,mix:1}}]),Ni("monster","character","Monster","Deep, rough and too close.",[{type:"pitchshift",label:"Down Low",params:{semitones:-8,mix:1}},{type:"saturate",label:"Growl",params:{type:"tanh",threshold:-12,output:-1}},{type:"reverb",label:"Right Behind You",params:{size:.3,damping:.5,wet:.22,dry:.85}}]),Ni("room-tight","space","Tight Room","A small hard room — presence without wash.",[{type:"reverb",label:"Tight Room",params:{size:.25,damping:.6,wet:.18,dry:.9}}]),Ni("room-natural","space","Natural Room","Sounds recorded somewhere rather than nowhere.",[{type:"reverb",label:"Natural Room",params:{size:.5,damping:.5,wet:.25,dry:.85}}]),Ni("hall","space","Hall","Long and open, for something that should sit far back.",[{type:"reverb",label:"Hall",params:{size:.9,damping:.3,wet:.4,dry:.75}}]),Ni("slap-echo","space","Slap Echo","One quick repeat — rockabilly vocal, not a wash.",[{type:"delay",label:"Slap Echo",params:{time:110,feedback:.12,mix:.22}}]),Ni("dub-throw","space","Dub Throw","Repeats that trail off well behind the beat.",[{type:"delay",label:"Dub Throw",params:{time:375,feedback:.55,mix:.3}}])];QL.map(t=>t.id);const d9e=new Map(QL.map(t=>[t.id,t]));function XE(t){return d9e.get(t)}const bX=["voice","repair","character","space"];function p9e(t){return QL.filter(e=>e.family===t)}function cM(t,e){const n=[];let r={...e,nodes:[...e.nodes]};for(const i of t.nodes){const s={type:i.type,id:cy(r),fromPreset:t.id,...i.label?{label:i.label}:{},enabled:!0,params:Vd(i.type,i.params)};n.push(s),r={...r,nodes:[...r.nodes,s]}}return n}function zL(t,e,n={}){if(n.replaceChain)return{version:c0,nodes:cM(e,{version:c0,nodes:[]})};const r=t.nodes.findIndex(l=>l.fromPreset===e.id);if(r===-1)return{...t,nodes:[...t.nodes,...cM(e,t)]};const i=t.nodes.filter(l=>l.fromPreset!==e.id),s=i.slice(0,r),a=i.slice(r),o=cM(e,{...t,nodes:i});return{...t,nodes:[...s,...o,...a]}}const t0={gain:{title:"Volume",does:"Turns this track up or down.",reachFor:"It's too loud, or too quiet, against everything else.",primary:"gain",primaryEnds:{low:"Silent",high:"Louder"},params:{gain:{label:"Level",ends:{low:"Silent",high:"Louder"}}}},highpass:{title:"Remove Rumble",does:"Cuts the very bottom — traffic, footsteps, air conditioning, hands on the mic.",reachFor:"There's a low hum or thump under everything.",primary:"frequency",primaryEnds:{low:"Only the deepest",high:"Thins it out"},band:[20,300],params:{frequency:{label:"Cut below",hint:"Everything under this is removed.",ends:{low:"Only the deepest",high:"Thins it out"}},q:{label:"Sharpness",hint:"How abruptly the cut starts."},poles:{label:"Steepness",hint:"How fast it falls away below the point."}}},lowpass:{title:"Muffle",does:"Takes the top off, like the sound is coming through a door.",reachFor:"You want something to sound distant, or behind something else.",primary:"frequency",primaryEnds:{low:"Very muffled",high:"Barely changed"},band:[1e3,2e4],params:{frequency:{label:"Cut above",ends:{low:"Very muffled",high:"Barely changed"}},q:{label:"Sharpness"},poles:{label:"Steepness"}}},peaking:{title:"Shape One Range",does:"Lifts or lowers one part of the sound and leaves the rest alone.",reachFor:"One quality is wrong — boomy, boxy, harsh — but the rest is fine.",primary:"gain",primaryEnds:{low:"Take it out",high:"Bring it forward"},band:[20,2e4],params:{frequency:{label:"Where",hint:"Which part of the sound to change."},gain:{label:"How much",ends:{low:"Take it out",high:"Bring it forward"}},q:{label:"How wide",hint:"A narrow setting fixes one note; a wide one changes the whole character."}}},lowshelf:{title:"Bass",does:"More or less weight underneath everything.",reachFor:"It sounds thin, or too heavy.",primary:"gain",primaryEnds:{low:"Thinner",high:"Heavier"},band:[20,300],params:{frequency:{label:"Up to",hint:"Everything below this is lifted or dropped."},gain:{label:"How much",ends:{low:"Thinner",high:"Heavier"}}}},highshelf:{title:"Brightness",does:"More or less sparkle at the top.",reachFor:"It sounds dull, or too fizzy.",primary:"gain",primaryEnds:{low:"Duller",high:"Brighter"},band:[2e3,2e4],params:{frequency:{label:"From",hint:"Everything above this is lifted or dropped."},gain:{label:"How much",ends:{low:"Duller",high:"Brighter"}}}},compressor:{title:"Even Out Loudness",does:"Brings the quiet parts up and holds the loud parts down, so nothing jumps out at the listener.",reachFor:"Some parts are much louder than others.",primary:"strength",primaryEnds:{low:"Barely touched",high:"Very even, quite squashed"},params:{threshold:{label:"Starts working at",hint:"Anything louder than this gets held down."},ratio:{label:"How hard",hint:"How much of the excess is removed."},attack:{label:"How fast it grabs",ends:{low:"Instant",high:"Lets peaks through"}},release:{label:"How fast it lets go",ends:{low:"Snappy",high:"Smooth"}},knee:{label:"How gradual"},makeup:{label:"Volume back up",hint:"Compression makes things quieter; this puts the level back."},mix:{label:"Blend with the original"}}},limiter:{title:"Peak Ceiling",does:"Nothing gets louder than this, ever. A safety net at the end of the chain.",reachFor:"You want to be sure it never clips or spikes.",primary:"limit",primaryEnds:{low:"A lot of headroom",high:"Right up to the edge"},params:{limit:{label:"Never exceed",ends:{low:"A lot of headroom",high:"Right up to the edge"}},attack:{label:"How fast it catches"},release:{label:"How fast it recovers"},level_out:{label:"Level after"}}},gate:{title:"Silence the Gaps",does:"Mutes the pauses. Whatever sits underneath stays — this closes the gaps, it does not remove noise.",reachFor:"You can hear the room in the gaps.",primary:"strength",primaryEnds:{low:"Only true silence",high:"Cuts quiet parts too"},params:{threshold:{label:"Quieter than this is a gap"},range:{label:"How far to duck the gaps",hint:"Not all the way down, usually — total silence sounds broken."},ratio:{label:"How hard"},attack:{label:"How fast it opens"},release:{label:"How fast it closes",ends:{low:"Clips tails short",high:"Leaves tails intact"}},knee:{label:"How gradual"}}},saturate:{title:"Warmth",does:"Adds a little grit and density, the way analogue gear does.",reachFor:"It sounds clean but lifeless.",primary:"strength",primaryEnds:{low:"Just a sheen",high:"Openly distorted"},params:{type:{label:"Character",hint:"Different flavours of the same idea. Tanh is the gentle one."},threshold:{label:"How much drive",ends:{low:"Just a sheen",high:"Openly distorted"}},output:{label:"Level after",hint:"Drive makes things louder; this puts it back."},oversample:{label:"Quality",hint:"Higher costs more but sounds cleaner."}}},bitcrush:{title:"Lo-Fi",does:"Crushes the sound down to fewer steps, like an old sampler or a bad phone line.",reachFor:"You want it to sound cheap or digital on purpose.",primary:"strength",primaryEnds:{low:"Slightly gritty",high:"Destroyed"},params:{bits:{label:"How many steps",ends:{low:"Destroyed",high:"Clean"}},samples:{label:"How rough",hint:"Holds each value for longer, which dulls and grits it."},mix:{label:"Blend with the original"}}},pitchshift:{title:"Higher or Lower",does:"Shifts everything up or down without changing its speed.",reachFor:"It should sound squeakier, or deeper.",primary:"semitones",primaryEnds:{low:"Much deeper",high:"Much higher"},params:{semitones:{label:"How far",ends:{low:"Much deeper",high:"Much higher"}},mix:{label:"Blend with the original"}}},delay:{title:"Echo",does:"Repeats the sound after a gap.",reachFor:"You want space, or a rhythmic effect.",primary:"mix",primaryEnds:{low:"A hint",high:"Washed out"},params:{time:{label:"Gap between repeats"},feedback:{label:"How many repeats",ends:{low:"One",high:"Trails away for ages"}},mix:{label:"How loud",ends:{low:"A hint",high:"Washed out"}}}},reverb:{title:"Room",does:"Puts the sound somewhere, instead of nowhere.",reachFor:"It sounds dry and stuck to the speaker.",primary:"strength",primaryEnds:{low:"A small tight room",high:"A big open hall"},params:{size:{label:"How big the space is"},damping:{label:"How soft the walls are",ends:{low:"Hard and bright",high:"Soft and dark"}},wet:{label:"How much room"},dry:{label:"How much original"}}},chorus:{title:"Thicken",does:"Doubles the sound slightly out of tune, which makes it wider and less exact.",reachFor:"It sounds thin or too plain on its own.",primary:"mix",primaryEnds:{low:"Just wider",high:"Obviously wobbling"},params:{delay:{label:"Spread"},depth:{label:"How much wobble"},speed:{label:"How fast it wobbles"},mix:{label:"How much",ends:{low:"Just wider",high:"Obviously wobbling"}}}},phaser:{title:"Swirl",does:"A filter that sweeps up and down, giving a moving, hollow shimmer.",reachFor:"You want movement, or a 1970s flavour.",primary:"out_gain",primaryEnds:{low:"Subtle",high:"Strong"},params:{in_gain:{label:"Depth in"},out_gain:{label:"How strong",ends:{low:"Subtle",high:"Strong"}},delay:{label:"Where it sweeps"},decay:{label:"How resonant"},speed:{label:"How fast it sweeps"},type:{label:"Shape of the sweep"}}}},W1=[{from:20,to:80,name:"Rumble",says:"traffic, footsteps, handling"},{from:80,to:250,name:"Weight",says:"body, warmth, low end"},{from:250,to:600,name:"Mud",says:"boxy, muffled, cardboard"},{from:600,to:2e3,name:"Middle",says:"the body of the sound"},{from:2e3,to:5e3,name:"Presence",says:"definition, consonants"},{from:5e3,to:1e4,name:"Edge",says:"harshness, sibilance"},{from:1e4,to:2e4,name:"Air",says:"sparkle, openness"}];function m9e(t){if(!Number.isFinite(t))return;const e=W1[0],n=W1.at(-1);return e&&t<e.from?e:n&&t>=n.to?n:W1.find(r=>t>=r.from&&t<r.to)}const g9e={"voice-clean":"My voice sounds amateur","voice-broadcast":"I want it to sound like radio","voice-warm":"I want it intimate and close","rumble-cut":"There's a hum or thump underneath","room-gate":"I can hear the room in the gaps","boom-tame":"It sounds boomy","harsh-tame":"It's harsh and tiring to listen to",telephone:"Make it sound like a phone call","radio-am":"Make it sound like an old radio",megaphone:"Make it sound shouted through a horn","lofi-tape":"Make it sound like an old tape","pa-system":"Make it sound like a station announcement",intercom:"Make it sound like a door intercom","doofus-worble":"Make it wobble like it is seasick",chipmunk:"Make it small and squeaky",giant:"Make it huge and deep",monster:"Make it a monster","room-tight":"It sounds dry and stuck to the speaker","room-natural":"It should sound like a real place",hall:"It should sound far away and big","slap-echo":"I want one quick echo","dub-throw":"I want long trailing echoes"},ci=(t,e=0)=>typeof t=="number"?t:e,Qm=t=>{const e=ci(t);return e>=1e3?`${(e/1e3).toFixed(e%1e3===0?0:1)} kHz`:`${Math.round(e)} Hz`},XO=(t,e)=>t<.34?e[0]:t<.67?e[1]:e[2],uM={gain:t=>ci(t.gain)===0?"No change":ci(t.gain)>0?`Up ${ci(t.gain)} dB`:`Down ${Math.abs(ci(t.gain))} dB`,highpass:t=>`Cutting everything below ${Qm(t.frequency)}`,lowpass:t=>`Muffled above ${Qm(t.frequency)}`,peaking:t=>ci(t.gain)===0?`Sitting on ${Qm(t.frequency)}, doing nothing yet`:`${ci(t.gain)>0?"Lifting":"Cutting"} ${Qm(t.frequency)} by ${Math.abs(ci(t.gain))} dB`,lowshelf:t=>ci(t.gain)===0?"Doing nothing yet":`${ci(t.gain)>0?"More":"Less"} weight below ${Qm(t.frequency)}`,highshelf:t=>ci(t.gain)===0?"Doing nothing yet":`${ci(t.gain)>0?"More":"Less"} sparkle above ${Qm(t.frequency)}`,compressor:t=>`Evening out — ${XO(Math.min(1,(ci(t.ratio,3)-1)/7),["gentle","moderate","firm"])}`,limiter:t=>`Nothing louder than ${ci(t.limit,-1)} dB`,gate:t=>`Closing gaps quieter than ${ci(t.threshold,-45)} dB`,saturate:t=>`${XO(Math.min(1,Math.abs(ci(t.threshold,-6))/30),["A little","Some","Heavy"])} warmth`,bitcrush:t=>`Crushed to ${ci(t.bits,8)} bits`,pitchshift:t=>ci(t.semitones,0)===0?"Unchanged pitch":`${ci(t.semitones,0)>0?"Up":"Down"} ${Math.abs(ci(t.semitones,0))} semitones`,delay:t=>`Echo every ${ci(t.time,250)} ms`,reverb:t=>`${XO(ci(t.size,.7),["A small","A medium","A large"])} room, ${XO(ci(t.wet,.35),["lightly","moderately","heavily"])}`,chorus:t=>`Thickened${ci(t.mix,.5)>.6?", wobbling":""}`,phaser:()=>"Swirling"},y9e={voice:"Voice",repair:"Fix",character:"Character",space:"Space"};function mfe({trackKind:t,onPick:e,onAudition:n,onAuditionTracked:r}){const i=x.useRef(new Set),s=o=>{i.current.has(o)||(i.current.add(o),r==null||r(o))},a=t==="music"||t==="sfx"?bX.filter(o=>o!=="voice"):bX;return p.jsx("div",{className:"hf-fx-preset-menu space-y-1.5 rounded-[4px] border border-panel-border-input p-1.5",onMouseLeave:n?()=>n(null):void 0,onBlur:n?()=>n(null):void 0,children:a.map(o=>p.jsxs("div",{className:"hf-fx-preset-group space-y-0.5",children:[p.jsx("span",{className:"hf-fx-preset-group-label block font-mono text-[9px] uppercase tracking-wide text-panel-text-2",children:y9e[o]}),p9e(o).map(l=>p.jsxs("button",{type:"button",className:"hf-fx-preset-item block w-full rounded-[3px] bg-panel-surface py-1 pl-1.5 pr-8 text-left text-panel-text-1 hover:text-panel-text-0",title:`${l.description} (${l.nodes.length} effect${l.nodes.length===1?"":"s"})`,onClick:()=>e(l.id),onMouseEnter:()=>{s(l.id),n==null||n(l.id)},onFocus:()=>{s(l.id),n==null||n(l.id)},children:[p.jsx("span",{className:"hf-fx-preset-problem block truncate text-[10px]",children:g9e[l.id]??l.description}),p.jsxs("span",{className:"block truncate font-mono text-[9px] text-panel-text-2",children:[p.jsx("span",{className:"hf-fx-preset-name",children:l.label}),p.jsxs("span",{className:"hf-fx-preset-count",children:[" · ",l.nodes.length," effect",l.nodes.length===1?"":"s"]})]}),n?p.jsxs("span",{className:"hf-fx-preset-wave","aria-hidden":"true",children:[p.jsx("span",{}),p.jsx("span",{}),p.jsx("span",{}),p.jsx("span",{})]}):null]},l.id))]},o))})}function $a(t,e={}){Pt(`audio_fx_${t}`,e)}function gfe(t){return t.fromPreset?"preset":t.fromCarve?"carve":t.fromEq?"eq":t.fromLeveller?"leveller":"hand"}function x9e(t){const e=(t==null?void 0:t.nodes)??[],n=new Map;for(const r of e){const i=gfe(r);n.set(i,(n.get(i)??0)+1)}return{node_count:e.length,nodes_from_preset:n.get("preset")??0,nodes_from_carve:n.get("carve")??0,nodes_from_eq:n.get("eq")??0,nodes_from_leveller:n.get("leveller")??0,nodes_by_hand:n.get("hand")??0,preset_count:new Set(e.map(r=>r.fromPreset).filter(Boolean)).size,bypassed_count:e.filter(r=>r.enabled===!1).length}}const Hl=t=>({track_kind:t.trackKind??"unknown"});function b9e(t,e,n,r,i){$a("preset_applied",{preset:t,family:e,node_count:n,mode:r,...Hl(i)})}function v9e(t,e){$a("preset_removed",{preset:t,...Hl(e)})}function A9e(t,e,n){$a("preset_amount",{preset:t,amount:e,...Hl(n)})}function S9e(t,e,n){$a("preset_automated",{preset:t,enabled:e,...Hl(n)})}function yfe(t,e){$a("preset_auditioned",{preset:t,...Hl(e)})}function fM(t,e,n,r){$a("node_added",{effect:t,via:e,job:n??"none",...Hl(r)})}function w9e(t,e,n){$a("node_removed",{effect:t,origin:e,...Hl(n)})}function O9e(t,e,n){$a("node_bypassed",{effect:t,bypassed:e,...Hl(n)})}function C9e(t,e,n){$a("node_moved",{effect:t,direction:e,...Hl(n)})}function k9e(t,e,n,r,i){$a("param_committed",{effect:t,param:e,value:n,surface:r,...Hl(i)})}function E9e(t,e,n){$a("profile_committed",{effect:t,strength:e,...Hl(n)})}function T9e(t,e){$a("carve_changed",{action:t,strength:e.strength,source_count:e.sourceCount})}function vX(t){$a("leveller",{action:t})}function P9e(t,e){$a("eq_changed",{band:t,value:e})}function M9e(t,e,n){$a("chain_observed",{...x9e(t),first_sight:e.firstSight,panel_edits:e.panelEdits,authored_outside:e.panelEdits===0,has_carve:e.hasCarve,has_automation:e.hasAutomation,...Hl(n)})}function xfe(t,e,n){const r=XE(e);if(!r)return null;const i=zL(t,r),s=t.nodes.some(a=>a.fromPreset===r.id);return b9e(r.id,r.family,r.nodes.length,s?"reapply":"append",{trackKind:n}),i}function bfe(t,e,n){const r=x.useRef(null),i=x.useCallback(c=>{e&&(c?(r.current??(r.current=t),e(c(r.current)),n==null||n(!0)):r.current&&(n==null||n(!1),e(r.current),r.current=null))},[t,e,n]),s=x.useCallback(()=>r.current??t,[t]),a=x.useCallback(()=>{r.current=null,n==null||n(!1)},[n]),o=x.useRef(e);o.current=e;const l=x.useRef(n);return l.current=n,x.useEffect(()=>()=>{var c,u;r.current&&((c=l.current)==null||c.call(l,!1),(u=o.current)==null||u.call(o,r.current))},[]),{audition:i,clearAudition:a,storedChain:s}}const AX=260,$h=8,N9e=160;function D9e(t){const e=Math.min(Math.max(t.left,$h),Math.max($h,window.innerWidth-AX-$h)),n=window.innerHeight-t.bottom,r=t.top,i=n<260&&r>n,s=(i?r:n)-$h-4,a=Math.min(Math.max(N9e,s),window.innerHeight-$h*2),o=l=>Math.max($h,Math.min(l,Math.max($h,window.innerHeight-a-$h)));return{position:"fixed",left:e,width:AX,maxHeight:a,...i?{bottom:o(window.innerHeight-t.top+4)}:{top:o(t.bottom+4)}}}function I9e(t,e){const n=XE(e);return n?zL(t,n):t}function _9e({anchorRect:t,chain:e,trackKind:n,onClose:r,onChainChange:i,onChainPreview:s,onAuditionTransport:a,onOpenRack:o}){const l=x.useRef(null),{audition:c,clearAudition:u,storedChain:f}=bfe(e,s,a);x.useEffect(()=>{const y=d=>{l.current&&!l.current.contains(d.target)&&r()};return document.addEventListener("pointerdown",y,!0),()=>document.removeEventListener("pointerdown",y,!0)},[r]);const h=y=>{const d=xfe(f(),y,n);d&&(u(),i(d),r())},m=y=>{y.key==="Escape"&&(y.stopPropagation(),c(null),r())};return p.jsxs("div",{ref:l,role:"dialog","aria-label":"Effects",className:"z-[200] flex flex-col overflow-hidden rounded-md border border-white/10 bg-[#1b1b1f] p-2 shadow-xl",style:D9e(t),onKeyDown:m,onPointerDown:y=>y.stopPropagation(),children:[p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:p.jsx(mfe,{trackKind:n,onPick:h,onAudition:s?y=>c(y?d=>I9e(d,y):null):void 0,onAuditionTracked:y=>yfe(y,{trackKind:n})})}),p.jsxs("div",{className:"mt-2 flex shrink-0 items-center justify-between border-t border-white/10 pt-2 text-[10px] text-white/55",children:[p.jsx("button",{type:"button",className:"hover:text-white",onClick:()=>{r(),o()},children:"+ effect"}),p.jsx("button",{type:"button",className:"hover:text-white",onClick:()=>{r(),o()},children:"Open rack ›"})]})]})}function R9e(t,e){if(!t||t.length===0||t.some(r=>e>=r.start&&e<r.start+r.duration))return null;const n=t.map(r=>r.start).sort((r,i)=>r-i);return n.find(r=>r>e)??n[0]??null}function vfe(){const t=x.useRef(null);return(e,n)=>{const r=fe.getState();if(e){if(r.isPlaying||t.current!==null)return;t.current=r.currentTime;const s=R9e(n,r.currentTime);s!==null&&r.requestSeek(s),r.requestPlayback(!0);return}const i=t.current;i!==null&&(t.current=null,r.requestPlayback(!1,i))}}const j9e={width:256,height:160};function SX(t){const{left:e,top:n}=Q7(t,{width:window.innerWidth,height:window.innerHeight},j9e,{offset:4});return{left:e,top:n}}function L9e({anchorRect:t,clipCount:e,defaultLabel:n,refusal:r,onCancel:i,onConfirm:s}){const[a,o]=x.useState(n??"Voiceover"),l=x.useRef(null);if(x.useEffect(()=>{var u;return(u=l.current)==null?void 0:u.select()},[]),r)return p.jsx("div",{role:"dialog","aria-label":"This track cannot be grouped",className:"z-[200] w-64 rounded-md border border-white/10 bg-[#1b1b1f] p-3 text-[11px] leading-snug text-white/75 shadow-xl",style:{position:"fixed",...SX(t)},onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Escape"&&(u.stopPropagation(),i())},children:p.jsx("p",{children:r})});const c=()=>s(a.trim()||n||"Voiceover");return p.jsxs("div",{role:"dialog","aria-label":"Name this group",className:"z-[200] w-64 rounded-md border border-white/10 bg-[#1b1b1f] p-3 text-[11px] text-white/75 shadow-xl",style:{position:"fixed",...SX(t)},onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Escape"&&(u.stopPropagation(),i()),u.key==="Enter"&&c()},children:[p.jsx("p",{className:"mb-1.5 font-medium text-white",children:"Name this group"}),p.jsx("input",{ref:l,type:"text","aria-label":"Group name",value:a,onChange:u=>o(u.currentTarget.value),className:"w-full rounded border border-white/20 bg-black/30 px-1.5 py-1 text-[11px] text-white outline-none focus:border-[#3CE6AC]"}),p.jsxs("p",{className:"mt-2 leading-snug",children:["Effects you add to the group apply to ",e===2?"both":`all ${e}`," clips at once, and they share one volume."]}),p.jsxs("div",{className:"mt-2.5 flex justify-end gap-1.5",children:[p.jsx("button",{type:"button",className:"rounded border border-white/20 px-2 py-1 text-[10px] text-white/75 hover:bg-white/10",onClick:i,children:"Cancel"}),p.jsx("button",{type:"button",className:"rounded border border-[#3CE6AC] bg-[#3CE6AC]/15 px-2 py-1 text-[10px] font-semibold text-[#3CE6AC] hover:bg-[#3CE6AC]/25",onClick:c,children:"Group"})]})]})}function F9e(t){if(!t)return{version:1,nodes:[]};try{return cE(t)}catch{return{version:1,nodes:[]}}}function A_(t){const[e,n]=x.useState(!1),r=x.useRef(null),[i,s]=x.useState(null),a=vfe(),o=x.useRef(!1),l=()=>{var f;s(((f=r.current)==null?void 0:f.getBoundingClientRect())??null),n(!0)};if(t.variant==="group-pointer")return p.jsxs("div",{className:"relative shrink-0",children:[p.jsx("button",{type:"button",tabIndex:-1,ref:r,"aria-label":"Effects — group these clips first",title:"Group these clips to add effects to all of them",className:"flex h-6 items-center justify-center rounded border-0 bg-transparent px-1 text-[10px] font-semibold text-white/35 hover:text-white/75",onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),l()},children:"FX"}),e&&i&&Fl.createPortal(p.jsx(L9e,{refusal:t.refusal,anchorRect:i,clipCount:t.clipCount,defaultLabel:t.defaultLabel,onCancel:()=>n(!1),onConfirm:f=>{n(!1),t.onGroupClips(f)}}),document.body)]});const c=F9e(t.fxChainRaw),u=L6e(c).length;return p.jsxs("div",{className:"relative shrink-0",children:[p.jsxs("button",{type:"button",tabIndex:-1,ref:r,"aria-label":u>0?`Effects — ${u} applied`:"Effects",title:"Effects",className:`flex h-6 items-center justify-center gap-0.5 rounded border-0 bg-transparent px-1 text-[10px] font-semibold transition-colors ${e||u>0?"text-[#3CE6AC]":"text-white/35 hover:text-white/75"}`,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),l()},children:["FX",u>0?` ${u}`:""]}),e&&i&&Fl.createPortal(p.jsx(_9e,{anchorRect:i,chain:c,trackKind:t.trackKind,onClose:()=>n(!1),onChainChange:t.onChainChange,onChainPreview:t.onChainPreview,onAuditionTransport:f=>{var h;f&&(o.current=t.isMuted===!0),o.current&&((h=t.onSetMutedLive)==null||h.call(t,!f)),f||(o.current=!1),a(f,t.auditionSpans)},onOpenRack:t.onOpenRack}),document.body)]})}function Afe({name:t,isExpanded:e,lanesId:n,onToggle:r}){return p.jsx("button",{type:"button",tabIndex:-1,"aria-expanded":e,"aria-controls":n,"aria-label":`${e?"Hide":"Show"} ${t} lanes`,title:`${e?"Hide":"Show"} lanes`,className:`ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-[11px] leading-none focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${e?"text-[#3CE6AC]":"text-white/55 hover:text-white"}`,onPointerDown:i=>i.stopPropagation(),onClick:i=>{i.stopPropagation(),r()},children:p.jsx("span",{"aria-hidden":"true",children:"∿"})})}function $9e({name:t,clipCount:e,isExpanded:n,gutterBackground:r,columnWidth:i,lanesId:s,onToggleClipExpanded:a,children:o}){return p.jsxs("div",{className:"absolute left-0 top-0 flex items-center gap-1.5 overflow-hidden px-1.5 text-[11px]",style:{width:i,height:Ui,color:"#ffffff",background:r},children:[p.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-[13px] leading-none text-white/40",children:"◇"}),p.jsx("span",{className:"min-w-0 flex-1 break-words font-medium leading-tight",children:t}),p.jsx(cfe,{clipCount:e}),o,p.jsx(Afe,{name:t,isExpanded:n,lanesId:s,onToggle:a})]})}function rA(t){return String(Math.round(t*100)/100)}function B9e(t,e,n){var i,s;const r=n??((i=e.keyframes)==null?void 0:i.easeEach)??e.ease;return!r||r==="none"?t:((s=Bv.parseEase(r))==null?void 0:s(t))??t}function V9e(t,e){var n;return(((n=t.keyframes)==null?void 0:n.keyframes)??[]).filter(r=>e in r.properties).map(r=>({percentage:r.percentage,value:r.properties[e],ease:r.ease}))}function H9e(t,e){return typeof t.value!="number"||typeof e.value!="number"||t.percentage===e.percentage?null:{from:t.value,to:e.value}}function Q9e(t,e,n){const r=V9e(t,e),i=r.filter(l=>l.percentage<=n).at(-1),s=r.find(l=>l.percentage>=n);if(!i)return s==null?void 0:s.value;if(!s)return i.value;const a=H9e(i,s);if(!a)return i.value;const o=(n-i.percentage)/(s.percentage-i.percentage);return a.from+(a.to-a.from)*B9e(o,t,s.ease)}function z9e(t,e,n){var s;const r=new Set;for(const a of((s=t.keyframes)==null?void 0:s.keyframes)??[])for(const o of Object.keys(a.properties))nl(o)===e&&r.add(o);const i={};for(const a of r){const o=Q9e(t,a,n);o!==void 0&&(i[a]=o)}return i}function Z9e(t,e){var r,i;if(t==="visual"&&("opacity"in e||"autoAlpha"in e))return"Opacity";if(t!=="other")return`${((r=t[0])==null?void 0:r.toUpperCase())??""}${t.slice(1)}`;const n=Object.keys(e)[0];return n?`${((i=n[0])==null?void 0:i.toUpperCase())??""}${n.slice(1)}`:"Other"}function G9e(t){return Object.values(t).map(e=>typeof e=="number"?rA(e):e).join(", ")}function U9e(t){const e=t.x,n=t.y;return typeof e=="number"&&typeof n=="number"?`${rA(e)}, ${rA(n)}`:null}function X9e(t){return typeof t.rotation=="number"?`${rA(t.rotation)}°`:null}function W9e(t){const e=t.opacity??t.autoAlpha;return typeof e=="number"?`${rA(Math.abs(e)<=1?e*100:e)}%`:null}const hM={position:U9e,rotation:X9e,visual:W9e};function wX(t,e){var n;return((n=hM[t])==null?void 0:n.call(hM,e))??G9e(e)}function q9e(t,e){return t.keyframes.reduce((n,r)=>!n||Math.abs(r.percentage-e)<Math.abs(n.percentage-e)?r:n,null)}function Y9e(t,e){return t.find(n=>{const r=si(n);return r!==null&&mS(e,r,qi(n))})}function K9e(t,e,n,r){var s;const i=((s=e.currentKeyframe)==null?void 0:s.animationId)??(n==null?void 0:n.animationId);return r??t.animations.find(a=>a.id===i)}function J9e(t,e,n,r,i){var s;return((s=t.currentKeyframe)==null?void 0:s.tweenPercentage)??(e?hce(r,e):null)??Uj(n,i)}function e7e(t,e,n,r,i){return t?{animationId:t.id,propertyGroup:e.group,tweenPercentage:n,properties:r,remove:i.currentKeyframe!==null}:null}function t7e(t,e,n){const r=loe(t.keyframes,n),i=q9e(t,n),s=Y9e(t.animations,e),a=K9e(t,r,i,s),o=t.keyframes.filter(u=>u.animationId===(a==null?void 0:a.id)),l=J9e(r,a,o,e,n),c=a?z9e(a,t.group,l):{};return{navigation:r,values:c,label:Z9e(t.group,c),toggleTarget:e7e(a,t,l,c,r)}}function n7e({navigation:t,label:e,expandedElement:n,onSeek:r,children:i}){const s="relative h-5 w-3 border-0 bg-transparent p-0 text-white/55 hover:text-white disabled:text-white/15 focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC] before:absolute before:left-1/2 before:top-1/2 before:h-6 before:w-6 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']",a=o=>{o&&(r==null||r(n.start+o.percentage/100*n.duration))};return p.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[p.jsx("button",{type:"button","aria-label":`Previous ${e} keyframe`,disabled:!t.prevKeyframe,className:s,onClick:o=>{o.stopPropagation(),a(t.prevKeyframe)},children:"‹"}),i,p.jsx("button",{type:"button","aria-label":`Next ${e} keyframe`,disabled:!t.nextKeyframe,className:s,onClick:o=>{o.stopPropagation(),a(t.nextKeyframe)},children:"›"})]})}function r7e({lanesId:t,lane:e,laneIndex:n,isLastLane:r,expandedElement:i,currentTime:s,clipPercentage:a,gutterBackground:o,columnWidth:l,onTogglePropertyGroupKeyframe:c,onSeek:u,rovingTargetId:f=null}){const h=i.key??i.id,{navigation:m,values:y,label:d,toggleTarget:v}=t7e(e,s,a);return p.jsxs("div",{id:T6(t,W2(h,e.group),"header"),"data-timeline-focus-id":W2(h,e.group),"data-timeline-element-id":h,tabIndex:f===W2(h,e.group)?0:-1,"data-property-group":e.group,"data-timeline-lane-top":Sg(n),className:"absolute left-0 flex items-center gap-1 overflow-hidden px-1.5 text-[10px] text-white/65",style:{top:Sg(n),width:l,height:Ag,background:o},children:[p.jsxs("span",{className:"relative h-full w-3 shrink-0","aria-hidden":"true",children:[p.jsx("span",{className:"absolute left-1.5 top-0 w-px bg-white/15",style:{height:r?"50%":"100%"}}),p.jsx("span",{className:"absolute left-1.5 top-1/2 h-px w-1.5 bg-white/15"})]}),p.jsx("span",{className:"w-[46px] shrink-0 truncate text-white",title:d,children:d}),p.jsx(n7e,{navigation:m,label:d,expandedElement:i,onSeek:u,children:p.jsx("button",{type:"button","aria-pressed":!!m.currentKeyframe,"aria-label":`${m.currentKeyframe?"Remove":"Add"} ${d} keyframe`,title:`${m.currentKeyframe?"Remove":"Add"} ${d} keyframe`,className:"flex h-6 w-6 shrink-0 items-center justify-center border-0 bg-transparent p-0 text-[11px] text-[#3CE6AC] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC]",onClick:b=>{b.stopPropagation(),v&&(c==null||c(i,v))},children:m.currentKeyframe?"◆":"◇"})}),p.jsx("span",{className:"min-w-0 flex-1 truncate text-right tabular-nums text-white/45",title:wX(e.group,y),children:wX(e.group,y)})]})}function i7e({target:t,label:e,name:n,param:r,alsoAutomatedBy:i,top:s,isLastLane:a,gutterBackground:o,columnWidth:l,onRemove:c,isCarve:u,onReveal:f}){return p.jsxs("div",{"data-automation-lane-label":e,"data-timeline-lane-top":s,className:"absolute left-0 flex items-center gap-1 overflow-hidden px-1.5 text-[10px] text-white/65",style:{top:s,width:l,height:kd,background:o},children:[p.jsxs("span",{className:"relative h-full w-3 shrink-0","aria-hidden":"true",children:[p.jsx("span",{className:"absolute left-1.5 top-0 w-px bg-white/15",style:{height:a?"50%":"100%"}}),p.jsx("span",{className:"absolute left-1.5 top-1/2 h-px w-1.5 bg-white/15"})]}),p.jsxs("button",{type:"button",tabIndex:-1,"aria-label":f?`Show ${e} in the effect rack`:void 0,title:f?`Show ${e} in the effect rack`:e,disabled:!f,className:"flex min-w-0 flex-1 flex-col justify-center rounded border-0 bg-transparent p-0 text-left leading-tight enabled:hover:text-white focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC]",onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),f==null||f()},children:[p.jsx("span",{"data-automation-lane-name":"",className:"truncate font-mono text-[9px] text-white/70",children:n}),r?p.jsx("span",{"data-automation-lane-param":"",className:"truncate font-mono text-[9px] text-white/40",children:r}):null,i?p.jsxs("span",{"data-automation-lane-also":"",className:"truncate text-[9px] text-[#F5C542]/80",title:`${i} is also fading this — the two multiply.`,children:[i," is also fading this."]}):null]}),c&&t!==null&&!u&&p.jsx("button",{type:"button","aria-label":`Remove ${e} automation`,title:`Remove ${e} automation`,className:"flex h-6 w-6 shrink-0 items-center justify-center border-0 bg-transparent p-0 text-[11px] text-white/35 hover:text-white focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC]",onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),c(t)},children:"×"})]})}const s7e="#3CE6AC59",a7e=14,OX="rgba(255,255,255,0.035)";function WO(t,e){return e?`linear-gradient(${OX}, ${OX}), ${t}`:t}function o7e({trackNumber:t,trackDisplayNumber:e,trackLabel:n,lanesId:r,contentOrigin:i,keyframeClip:s,trackElements:a,clipCount:o,isExpanded:l,animations:c,currentTime:u,isTrackHidden:f,isAudioTrack:h,isGroupMember:m=!1,theme:y,onToggleClipExpanded:d,onToggleTrackHidden:v,onTogglePropertyGroupKeyframe:b,onRemoveAutomationLane:w,onSeek:O,rovingTargetId:k=null}){const E=s?(u-s.start)/s.duration*100:0,M=s?CL(c,pce(s),s.duration):[],N=i>=Lo,I=s?s.key??s.id:null,_=x.useMemo(()=>{var me;return(me=a.find(pe=>pe.audioGroup))==null?void 0:me.audioGroup},[a]),j=x.useMemo(()=>{var me;return(me=a.find(pe=>pe.audioGroupLabel))==null?void 0:me.audioGroupLabel},[a]),L=x.useMemo(()=>{var me;return(me=a.find(pe=>pe.audioGroupAutomation))==null?void 0:me.audioGroupAutomation},[a]),B=x.useMemo(()=>{var me;return(me=a.find(pe=>pe.audioGroupFxChain))==null?void 0:me.audioGroupFxChain},[a]),$=x.useMemo(()=>new Set(Vf(_?[{id:_,tag:"audio",start:0,duration:0,track:0,...L?{automation:L}:{},...B?{fxChain:B}:{}}]:[]).map(me=>me.key)),[L,B,_]),Q=fe(me=>me.setRevealedAudioFxTarget),Y=s?A6(s):null,W=x.useMemo(()=>Vf(a).map(me=>{const pe=me.entries.find(ge=>(ge.element.key??ge.element.id)===I);return{key:me.key,label:me.key,name:me.name,param:me.param,target:(pe==null?void 0:pe.lane.target)??null,isCarve:(()=>{const ge=pe??me.entries[0];return ge?x_(ge.lane.target,VE(ge.element)):!1})()}}),[I,a]),J=M.length>0||W.length>0,ne=!!s&&J&&!h,le=o>1?`Track${UE(e)}`:(s==null?void 0:s.label)??(s==null?void 0:s.domId)??(s==null?void 0:s.id)??n,{onGroupClips:ie,onSetElementAttributeLive:q,onSetElementAttributeQuiet:F}=lS(),U=yS(),Z=h&&o===1&&a.length>0?a[0]:null,K=a.some(me=>me.audioGroup),ee=!h&&a.some(me=>me.tag.toLowerCase()==="video"),re=(me,pe,ge)=>{const Pe=pe.nodes.length?mu(pe):null;ge?q==null||q(me,Xs,Pe):F==null||F(me,Xs,Pe,"Apply preset")},z=me=>{U==null||U.handleTimelineElementSelect(me)},H=a.map(A6),se=H.every(me=>me!==null)?H:null,ue=((se==null?void 0:se.length)??0)>=2,be=me=>{var ge;const pe=(ge=U==null?void 0:U.previewIframeRef.current)==null?void 0:ge.contentDocument;!pe||!ie||!se||se.length<2||ie(se,hfe(pe),me)};return p.jsxs("div",{role:"rowheader","aria-colindex":1,className:"sticky left-0 z-[12] shrink-0",style:{width:N?Lo:i,background:WO(y.gutterBackground,m),borderRight:`1px solid ${y.gutterBorder}`,...m?{borderLeft:`2px solid ${s7e}`,paddingLeft:a7e}:{}},children:[ne?p.jsx(p.Fragment,{children:p.jsx($9e,{name:le,clipCount:o,isExpanded:l,gutterBackground:WO(y.gutterBackground,m),columnWidth:N?Lo:i,lanesId:r,onToggleClipExpanded:d,children:p.jsx(ffe,{hidden:f,trackNumber:t,trackDisplayNumber:e,visible:!h||f,onToggle:v})})}):p.jsx(p.Fragment,{children:p.jsx("div",{className:N?"flex flex-col justify-center gap-0.5 px-1.5 text-white/55":"flex flex-col items-center justify-center gap-0.5",style:{height:Ui},children:p.jsx(s9e,{trackNumber:t,trackDisplayNumber:e,trackLabel:n,clipCount:o,showTrackLabel:N,isTrackHidden:f,isAudioTrack:h,onToggleTrackHidden:v,trailing:p.jsxs(p.Fragment,{children:[Z&&p.jsx(A_,{variant:"chain",fxChainRaw:Z.fxChain,trackKind:v0(Z.id,Z.src),onChainChange:me=>re(Z,me,!1),onChainPreview:me=>re(Z,me,!0),auditionSpans:[Z],isMuted:f,onSetMutedLive:me=>q==null?void 0:q(Z,"data-hidden",me?"":null),onOpenRack:()=>z(Z)}),o>1&&!K&&(h?ue:ee)&&p.jsx(A_,{variant:"group-pointer",clipCount:a.length,defaultLabel:n,refusal:h?void 0:"Video audio can't be grouped yet — only audio clips can join a group.",onGroupClips:be}),J&&p.jsx(Afe,{name:le,isExpanded:l,lanesId:r,onToggle:d})]})})})}),l&&s&&M.map((me,pe)=>p.jsx(r7e,{lanesId:r,lane:me,laneIndex:pe,isLastLane:pe===M.length-1&&W.length===0,expandedElement:s,currentTime:u,clipPercentage:E,gutterBackground:WO(y.gutterBackground,m),columnWidth:N?Lo:i,onTogglePropertyGroupKeyframe:b,onSeek:O,rovingTargetId:k},me.group)),l&&W.map((me,pe)=>{const ge=me.target;return p.jsx(i7e,{target:me.target,label:me.label,name:me.name,param:me.param,alsoAutomatedBy:$.has(me.key)?j??_:void 0,top:Sg(M.length)+pe*kd,isLastLane:pe===W.length-1,gutterBackground:WO(y.gutterBackground,m),columnWidth:N?Lo:i,onRemove:w,isCarve:me.isCarve,onReveal:ge&&Y&&s?()=>{z(s),Q({elementKey:Y,automationTarget:ge})}:void 0},me.key)})]})}function Sfe({index:t,rowKey:e,logicalRow:n,propertyRows:r,lanesId:i,headerLanesId:s,top:a,height:o,virtualized:l,background:c,borderColor:u,rovingTargetId:f=null,children:h}){return p.jsxs("div",{role:"rowgroup","data-index":t,"data-timeline-row":t,"data-timeline-row-key":e,className:l?"absolute left-0 right-0":"relative",style:{top:l?a:void 0,height:o,background:c,borderBottom:`1px solid ${u}`},children:[p.jsx("div",{role:"row","aria-rowindex":n.logicalIndex+1,"aria-level":n.level,"aria-expanded":n.expandable?n.expanded:void 0,"data-timeline-logical-row-id":n.id,"data-timeline-focus-id":n.id,tabIndex:f===n.id?0:-1,className:"flex",style:{height:o},children:h}),r.map(m=>{const y=m.propertyGroup,d=m.items.filter(b=>b.kind==="keyframe").length,v=m.items.filter(b=>b.kind==="ease").length;return p.jsxs("div",{role:"row","aria-rowindex":m.logicalIndex+1,"aria-level":m.level,"data-property-group":y,"data-timeline-logical-row-id":m.id,className:"sr-only",children:[p.jsx("div",{role:"rowheader","aria-colindex":1,"aria-owns":T6(s,m.id,"header"),children:y}),p.jsxs("div",{role:"gridcell","aria-colindex":2,"aria-owns":T6(i,m.id,"content"),children:[d," keyframes, ",v," ease controls"]})]},m.id)})]})}function l7e({label:t,memberCount:e,onOpenFxRack:n}){return p.jsxs("button",{type:"button",tabIndex:-1,"aria-label":`Open ${t} effects`,title:"Open effects",className:"flex h-6 min-w-0 items-center gap-1.5 rounded border-0 bg-transparent p-0 text-left text-[11px] text-white hover:text-[#3CE6AC] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC]",onPointerDown:r=>r.stopPropagation(),onClick:r=>{r.stopPropagation(),n()},children:[p.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-[12px] leading-none text-white/50",children:"▤"}),p.jsx("span",{className:"min-w-0 break-words text-left font-medium leading-tight",children:t}),p.jsx("span",{className:"shrink-0 rounded-full bg-white/10 px-1 text-[9px] leading-[14px] tabular-nums text-white/55","aria-hidden":"true",title:`${e} tracks`,children:e})]})}function c7e({label:t,memberCount:e,isExpanded:n,onToggleExpanded:r,laneCount:i,isLaneOpen:s,onToggleLanes:a,fxChain:o,onFxChainChange:l,onFxChainPreview:c,auditionSpans:u,onOpenFxRack:f,columnWidth:h,theme:m}){return p.jsxs("div",{role:"rowheader","aria-colindex":1,className:"sticky left-0 z-[12] flex shrink-0 items-center gap-1.5 overflow-hidden px-1.5 text-[11px]",style:{width:h,height:Ui,color:"#ffffff",background:m.gutterBackground,borderRight:`1px solid ${m.gutterBorder}`},children:[p.jsx("button",{type:"button",tabIndex:-1,"aria-expanded":n,"aria-label":`${n?"Hide":"Show"} ${t} tracks`,title:`${n?"Hide":"Show"} tracks`,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 font-mono text-[13px] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${n?"text-white":"text-white/55 hover:text-white"}`,onPointerDown:y=>y.stopPropagation(),onClick:y=>{y.stopPropagation(),r()},children:p.jsx("span",{"aria-hidden":"true",children:n?"▾":"▸"})}),p.jsx(l7e,{label:t,memberCount:e,onOpenFxRack:f}),p.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[p.jsx(A_,{fxChainRaw:o,onChainChange:l,onChainPreview:c,auditionSpans:u,onOpenRack:f}),i>0&&p.jsxs("button",{type:"button",tabIndex:-1,"aria-expanded":s,"aria-label":`${s?"Hide":"Show"} ${t} lanes`,title:`${s?"Hide":"Show"} lanes`,className:`ml-auto flex h-6 items-center justify-center gap-0.5 rounded border-0 bg-transparent px-1 text-[11px] leading-none focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${s?"text-[#3CE6AC]":"text-white/55 hover:text-white"}`,onPointerDown:y=>y.stopPropagation(),onClick:y=>{y.stopPropagation(),a()},children:[p.jsx("span",{"aria-hidden":"true",children:"∿"}),p.jsx("span",{className:"text-[9px] tabular-nums text-white/55",children:i})]})]})]})}function wfe(t,e){return{id:t.id,domId:t.id,label:t.label,tag:"audio",start:0,duration:e,track:t.anchorKey,...t.automation?{automation:t.automation}:{},...t.fxChain?{fxChain:t.fxChain}:{}}}const u7e=33;function ZL(){const t=fe(i=>i.currentTime),e=fe(i=>i.isPlaying),n=x.useRef(t),[,r]=x.useState(0);return e||(n.current=t),x.useEffect(()=>{if(!e)return;let i=0;const s=ya.subscribe(a=>{n.current=a,i||(i=setTimeout(()=>{i=0,r(o=>o+1)},u7e))});return()=>{s(),i&&clearTimeout(i)}},[e]),e?n.current:t}function f7e({groupElement:t,groupLabel:e,top:n,columnWidth:r,gutterBackground:i,accentColor:s,onReveal:a}){const o=ZL(),l=Vf([t]);return p.jsx(p.Fragment,{children:l.map((c,u)=>{var y;const f=(y=c.entries[0])==null?void 0:y.lane;if(!f)return null;const h={name:c.name,param:c.param},m=Lf(f,o);return p.jsxs("button",{type:"button",tabIndex:-1,"data-group-lane-label":f.target,"aria-label":`Show ${e} ${h.name}${h.param?` ${h.param}`:""} in the effect rack`,className:"absolute left-0 flex items-center gap-1.5 overflow-hidden border-0 px-1.5 text-left text-[10px] text-white/65 hover:text-white focus-visible:outline focus-visible:outline-1 focus-visible:outline-[#3CE6AC]",style:{top:n+u*kd,width:r,height:kd,background:i,borderLeft:`2px solid ${s}`},title:`${e} · ${h.param?`${h.name} · ${h.param}`:h.name}`,onPointerDown:d=>d.stopPropagation(),onClick:d=>{d.stopPropagation(),a==null||a(f.target)},children:[p.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-[11px] text-white/40",children:"▤"}),p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center leading-tight",children:[p.jsx("span",{className:"truncate font-mono text-[9px] text-white/70",children:h.name}),h.param?p.jsx("span",{className:"truncate font-mono text-[9px] text-white/40",children:h.param}):null]}),p.jsx("span",{className:"shrink-0 font-mono text-[9px] tabular-nums text-white/55",children:m.toFixed(2)})]},f.target)})})}const CX="#3CE6AC";function h7e({index:t,rowKey:e,group:n,logicalRow:r,top:i,height:s,virtualized:a,contentOrigin:o,theme:l,rovingTargetId:c=null,collapsedGroupIds:u,expandedLaneOwnerIds:f,toggleGroupExpanded:h,toggleLaneOwnerExpanded:m,lanes:y,pps:d,currentTime:v,compositionDuration:b,beatTimes:w,contentGutter:O,trackContentWidth:k}){var W;const E=n.memberElements,M=wfe(n,b),N=((W=Nce())==null?void 0:W.domEditSelection)??null,I=(N==null?void 0:N.id)===n.id,_=f.has(n.id),{onSetAudioGroupAttributeLive:j,onSetAudioGroupAttributeQuiet:L}=lS(),B=yS(),$=fe(J=>J.setRevealedAudioFxTarget),Q=(J,ne)=>{const le=J.nodes.length?mu(J):null;ne?j==null||j(n.id,Xs,le):L==null||L(n.id,Xs,le,"Apply preset")},Y=J=>{const ne=B==null?void 0:B.handleTimelineElementSelect(M);!ne||!J||ne.then(()=>$({elementKey:n.id,automationTarget:J}))};return p.jsxs(Sfe,{index:t,rowKey:e,logicalRow:r,propertyRows:[],lanesId:"",headerLanesId:"",top:i,height:s,virtualized:a,background:l.rowBackground,borderColor:l.rowBorder,rovingTargetId:c,children:[p.jsxs("div",{className:"sticky left-0 z-[12] shrink-0",style:{width:o>=Lo?Lo:o},children:[p.jsx(c7e,{label:n.label,memberCount:n.memberTracks.length,isExpanded:!u.has(n.id),onToggleExpanded:()=>h(n.id),laneCount:Vf([M]).length,isLaneOpen:_,onToggleLanes:()=>m(n.id),fxChain:n.fxChain,onFxChainChange:J=>Q(J,!1),onFxChainPreview:J=>Q(J,!0),auditionSpans:E,onOpenFxRack:()=>Y(),columnWidth:o>=Lo?Lo:o,theme:l}),_&&p.jsx(f7e,{groupElement:M,groupLabel:n.label,top:Ui,columnWidth:o>=Lo?Lo:o,gutterBackground:l.gutterBackground,accentColor:CX,onReveal:Y})]}),_&&p.jsx("div",{role:"gridcell","aria-colindex":2,style:{width:k,marginLeft:O},className:"relative",children:p.jsx(Mce,{elements:[M],isSelected:()=>I,lanes:y,pps:d,laneCount:0,topOffset:Ui,accentColor:CX,currentTime:v,beatTimes:w})})]})}function d7e(){return{collapsedGroupIds:fe(t=>t.collapsedGroupIds),expandedLaneOwnerIds:fe(t=>t.expandedLaneOwnerIds),toggleGroupExpanded:fe(t=>t.toggleGroupExpanded),toggleLaneOwnerExpanded:fe(t=>t.toggleLaneOwnerExpanded)}}function p7e(t,e){const n=x.useMemo(()=>{const i=new Map;for(const s of t){const a=i.get(s.physicalTrackKey)??[];a.push(s),i.set(s.physicalTrackKey,a)}return i},[t]),r=x.useMemo(()=>new Map(e.map(i=>[i.anchorKey,i])),[e]);return{logicalRowsByTrack:n,groupByAnchor:r}}function m7e(){const t=fe(i=>i.expandedClipIds),e=fe(i=>i.expandClips),n=fe(i=>i.setClipExpanded),r=fe(i=>i.toggleClipExpanded);return{toggleRowExpanded:i=>{const s=!i.some(a=>t.has(a));if(hZ({expanded:s}),s)e(i);else for(const a of i)n(a,!1)},toggleClipExpanded:i=>{hZ({expanded:!t.has(i)}),r(i)}}}function Ofe(t){return BEe()}function g7e(t){const e=new Map,n=new Map,r=new Map,i=new Map,s=new Map,a=new Map,o=new Map;for(const[l,c]of t){const u=c.find(h=>h.audioGroup);if(!(u!=null&&u.audioGroup))continue;e.set(l,u.audioGroup),r.has(u.audioGroup)||(r.set(u.audioGroup,u.audioGroupLabel??u.audioGroup),i.set(u.audioGroup,u.audioGroupVolume??1),s.set(u.audioGroup,u.audioGroupHidden??!1),a.set(u.audioGroup,u.audioGroupFxChain),o.set(u.audioGroup,u.audioGroupAutomation));const f=n.get(u.audioGroup)??[];f.push(l),n.set(u.audioGroup,f)}return{trackToGroupId:e,memberTracksByGroup:n,labelByGroup:r,volumeByGroup:i,hiddenByGroup:s,fxChainByGroup:a,automationByGroup:o}}function y7e(t,e,n,r){const i=[...n.memberTracksByGroup.get(t)??[]].sort((o,l)=>o-l),s=n.fxChainByGroup.get(t),a=n.automationByGroup.get(t);return{id:t,label:n.labelByGroup.get(t)??t,anchorKey:(i[0]??e)-.5,memberTracks:i,memberElements:i.flatMap(o=>r.get(o)??[]),volume:n.volumeByGroup.get(t)??1,hidden:n.hiddenByGroup.get(t)??!1,...s?{fxChain:s}:{},...a?{automation:a}:{}}}function x7e(t,e,n,r,i){r.push([t.anchorKey,[]]);for(const s of t.memberTracks)n.set(s,t),i&&r.push([s,e.get(s)??[]])}function b7e(t,e){const n=g7e(t),r=new Map(t),i=[],s=new Map,a=new Set,o=[];for(const[l,c]of t){const u=n.trackToGroupId.get(l);if(!u){o.push([l,c]);continue}if(a.has(u))continue;a.add(u);const f=y7e(u,l,n,r);i.push(f),x7e(f,r,s,o,!e.has(u))}return{tracks:o,groups:i,trackGroupOf:s}}function v7e(t){const e=x.useMemo(()=>{const l=new Map;for(const c of t){const u=l.get(c.track)??[];u.push(c),l.set(c.track,u)}return Array.from(l.entries()).sort(([c],[u])=>c-u)},[t]),n=fe(l=>l.collapsedGroupIds),{tracks:r,groups:i,trackGroupOf:s}=x.useMemo(()=>b7e(e,n),[e,n]),a=x.useMemo(()=>{var c;const l=new Map;for(const[u,f]of r)l.set(u,Ofe(((c=f[0])==null?void 0:c.tag)??""));return l},[r]),o=x.useMemo(()=>r.map(([l])=>l),[r]);return{tracks:r,trackStyles:a,trackOrder:o,groups:i,trackGroupOf:s}}function A7e(t){return Vf([wfe(t,0)]).length}function S7e(t,e,n){return((e==null?void 0:e.length)??0)<2?!1:n.selectedElementId?t.some(r=>(r.key??r.id)===n.selectedElementId):t.some(r=>n.isMusicTrack(r))}function w7e(t){return Ko(t)?kce(t).length:0}function O7e(t){return Vf(t).length}function C7e(t,e){return t.some(n=>e.has(n.key??n.id))}function GL(t,e,n,r,i=w7e){const s=l=>(e.get(l.key??l.id)??0)+i(l),a=t.filter(l=>s(l)>=1);if(a.length===0)return null;const o=a.find(l=>{const c=l.key??l.id;return c===n||r.has(c)});return o||a.reduce((l,c)=>s(c)>s(l)?c:l)}function k7e(t,e){const n=new Map;for(const[,r]of t)for(const i of r){const s=i.key??i.id,a=new Set;for(const o of e.get(s)??[])for(const l of $E(o))a.add(l);n.set(s,a.size)}return n}function E7e(t,e,n,r){if(n.length===0)return e;const i=new Map(n.map(s=>[s.anchorKey,s]));return t.map(([s],a)=>{const o=i.get(s);return!o||!r.has(o.id)?e[a]??Ui:Ui+A7e(o)*kd})}function T7e(t,e,n,r,i){const s=fe(u=>u.expandedClipIds),a=fe(u=>u.expandedLaneOwnerIds),{laneCounts:o,rowGeometry:l}=x.useMemo(()=>{const u=k7e(t,e),f=t.map(([,m])=>{const y=GL(m,u,n,r);if(!y)return[];const d=y.key??y.id,v=m.find(b=>s.has(b.key??b.id));return[{clipId:v?v.key??v.id:d,laneCount:u.get(d)??0,automationLaneCount:O7e(m)}]}),h=E7e(t,o3e(f,s),i,a);return{laneCounts:u,rowGeometry:Ej(t.map(([m])=>m),h)}},[s,a,e,i,t,n,r]),c=x.useRef(l);return c.current=l,{laneCounts:o,rowGeometry:l,rowGeometryRef:c,rowHeights:l.rowHeights}}function P7e(t,e,n,r){const{tracks:i,trackStyles:s,trackOrder:a,groups:o,trackGroupOf:l}=v7e(t),c=x.useRef(a);c.current=a;const{laneCounts:u,rowGeometry:f,rowGeometryRef:h,rowHeights:m}=T7e(i,e,n,r,o);return{tracks:i,trackStyles:s,trackOrder:a,trackOrderRef:c,laneCounts:u,rowGeometry:f,rowGeometryRef:h,rowHeights:m,groups:o,trackGroupOf:l}}function M7e(t,e){return x.useMemo(()=>t.map(n=>{const r=e.getRowIndex(n);return r<0?Ui:e.getRowHeight(r)}),[t,e])}function N7e(t,e){return x.useMemo(()=>{if(!(t!=null&&t.started)||e.includes(t.previewTrack))return e;const n=t.previewTrack,r=[];let i=!1;for(const s of e)!i&&Number.isInteger(s)&&s>n&&(r.push(n),i=!0),r.push(s);return i||r.push(n),r},[t,e])}function D7e(t,e,n){const r=N7e(t,e),i=M7e(r,n),s=x.useMemo(()=>Ej(r,i),[r,i]);return{displayTrackOrder:r,displayRowHeights:s.rowHeights,rowGeometry:s,totalH:s.canvasHeight}}function UL(t){return t.dragStarted&&t.selectedKeys.size>1&&t.selectedKeys.has(t.draggedKey)}function Cfe(t){return UL(t)?t.draggedPreviewStart-t.draggedOriginStart:0}function kfe(t,e){return UL(e)&&t!==e.draggedKey&&e.selectedKeys.has(t)}function I7e(t,e,n){if(!kfe(t,n))return 0;const r=Number.isFinite(e)?e:0;return Cfe(n)*r}function _7e(t,e){if(e.length===0)return t;const n=Math.min(...e),r=n===0?0:-n;return t<r?r:t}function R7e(t,e,n){const r=t&&UL(t)?Cfe(t):0;return e&&t&&r!==0?[{range:{start:n.start-r,end:n.end-r},identities:t.selectedKeys}]:[]}function ha(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kX(t,e){return e==='"'?t.replace(/"/g,"""):t.replace(/'/g,"'")}function XL(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function j7e(t){return t.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function L7e(t){const e=[];let n="",r=null,i=!1,s=0;for(const a of t){if(i){n+=a,a===";"&&(i=!1);continue}if(a==="&"){i=!0,n+=a;continue}if(r){n+=a,a===r&&(r=null);continue}if(a==='"'||a==="'"){r=a,n+=a;continue}if(a==="("){s+=1,n+=a;continue}if(a===")"){s=Math.max(0,s-1),n+=a;continue}if(a===";"&&s===0){e.push(n),n="";continue}n+=a}return n&&e.push(n),e}function F7e(t,e,n,r){const s=new RegExp(`(<[^>]*\\bid=(["'])${ha(e)}\\2[^>]*)>`,"i").exec(t);if(!s)return t;const a=s[1];return Efe(t,a,n,r)}function Efe(t,e,n,r){if(!e)return t;const i=/\bstyle=(["'])([\s\S]*?)\1/.exec(e);if(i){const s=i[2],a=i[1],o=new Map;for(const u of L7e(s)){const f=u.indexOf(":");if(f<0)continue;const h=u.slice(0,f).trim(),m=u.slice(f+1).trim();h&&o.set(h,m)}r===null?o.delete(n):o.set(n,r);const l=Array.from(o.entries()).map(([u,f])=>`${u}: ${kX(f,a)}`).join("; "),c=e.replace(i[0],`style=${a}${l}${a}`);return t.replace(e,c)}else{if(r===null)return t;const s=/\s*\/$/.test(e),o=`${s?e.replace(/\s*\/$/,""):e} style="${n}: ${kX(r,'"')}"${s?" /":""}`;return t.replace(e,o)}}function $7e(t,e,n,r){const i=Qf(t,e);if(!i)return t;const s=Efe(i.tag,i.tag,n,r);return J2(t,i,s)}function J2(t,e,n){return`${t.slice(0,e.start)}${n}${t.slice(e.end)}`}function dM(t,e,n){const i=new RegExp(`(<[^>]*\\b${e}=(["'])${ha(n)}\\2[^>]*)>`,"i").exec(t);return(i==null?void 0:i.index)==null?null:{tag:i[1],start:i.index,end:i.index+i[1].length}}function B7e(t,e){var l;const n=(l=e.selector)==null?void 0:l.match(/^\.([a-zA-Z0-9_-]+)$/);if(!n)return null;const r=n[1],i=new RegExp(`(<[^>]*\\bclass=(["'])[^"']*\\b${ha(r)}\\b[^"']*\\2[^>]*)>`,"gi"),s=e.selectorIndex??0;let a,o=0;for(;(a=i.exec(t))!==null;){if(o===s&&a.index!=null)return{tag:a[1],start:a.index,end:a.index+a[1].length};o+=1}return null}function Qf(t,e){if(e.hfId){const r=dM(t,"data-hf-id",e.hfId);if(r)return r}if(e.id){const r=dM(t,"id",e.id);if(r)return r}if(!e.selector)return null;const n=e.selector.match(/^\[data-composition-id="([^"]+)"\]$/);if(n){const r=dM(t,"data-composition-id",n[1]);if(r)return r}return B7e(t,e)}function S_(t,e,n){const r=Qf(t,e);if(!r)return;const i=n.startsWith("data-")?n:`data-${n}`,s=new RegExp(`\\b${i}=(["'])([^"']*)\\1`).exec(r.tag);return(s==null?void 0:s[2])!=null?j7e(s[2]):void 0}function xS(t,e){const n=Qf(t,e);return n==null?void 0:n.tag}function V7e(t,e,n,r){const i=Qf(t,e);if(!i)return t;const s=n.startsWith("data-")?n:`data-${n}`,a=new RegExp(`\\b${ha(s)}=(["'])([^"']*)\\1`),o=i.tag;if(r===null){if(!new RegExp(`\\b${ha(s)}(?:=(["'])[^"']*\\1)?`).test(o))return t;const f=new RegExp(`\\s+${ha(s)}(?:=(["'])[^"']*\\1)?`),h=o.replace(f,"");return J2(t,i,h)}const l=XL(r);if(a.test(o)){const u=o.replace(a,`${s}="${l}"`);return J2(t,i,u)}const c=o+` ${s}="${l}"`;return J2(t,i,c)}function H7e(t,e,n,r){const s=new RegExp(`(<[^>]*\\bid=(["'])${ha(e)}\\2[^>]*)>`,"i").exec(t);if(!s)return t;const a=s[1],o=n.startsWith("data-")?n:`data-${n}`,l=new RegExp(`\\b${ha(o)}=(["'])([^"']*)\\1`);if(r===null){if(!new RegExp(`\\b${ha(o)}(?:=(["'])[^"']*\\1)?`).test(a))return t;const f=new RegExp(`\\s+${ha(o)}(?:=(["'])[^"']*\\1)?`),h=a.replace(f,"");return t.replace(a,h)}const c=XL(r);if(l.test(a)){const u=a.replace(l,`${o}="${c}"`);return t.replace(a,u)}else{const u=a+` ${o}="${c}"`;return t.replace(a,u)}}function Q7e(t,e,n){const i=new RegExp(`(<([a-z0-9-]+)[^>]*\\bid=(["'])${ha(e)}\\3[^>]*>)`,"i").exec(t);if(!i||i.index==null)return t;const s=i[1],a=i[2],o=i.index+s.length,l=Tfe(t,a,o);return l<0?t:`${t.slice(0,o)}${n}${t.slice(l)}`}function Tfe(t,e,n){const r=new RegExp(`</?${ha(e)}\\b[^>]*>`,"gi");r.lastIndex=n;let i=1,s;for(;(s=r.exec(t))!==null;){const a=s[0];if(a.startsWith("</")){if(i-=1,i===0)return s.index;continue}a.endsWith("/>")||(i+=1)}return-1}const z7e=new Set(["loop","muted","autoplay","playsinline","controls","default","defer","disabled","hidden","nomodule","open","readonly","required","reversed","selected"]);function Pfe(t,e,n,r){if(!e)return t;if(z7e.has(n)){const l=ha(n),c=new RegExp(`(?:^|\\s)${l}(?:\\s|=|$)`).test(e);if(r===null||r===""||r==="false"){if(!c)return t;const f=new RegExp(`\\s+${l}(?:=(["'])[^"']*\\1)?`),h=e.replace(f,"");return t.replace(e,h)}if(c)return t;const u=e+` ${n}`;return t.replace(e,u)}const s=new RegExp(`\\b${ha(n)}=(["'])([^"']*)\\1`);if(r===null){if(!s.test(e))return t;const l=new RegExp(`\\s+${ha(n)}=(["'])[^"']*\\1`),c=e.replace(l,"");return t.replace(e,c)}const a=XL(r);if(s.test(e)){const l=e.replace(s,`${n}="${a}"`);return t.replace(e,l)}const o=e+` ${n}="${a}"`;return t.replace(e,o)}function Z7e(t,e,n,r){const s=new RegExp(`(<[^>]*\\bid=(["'])${ha(e)}\\2[^>]*)>`,"i").exec(t);return s?Pfe(t,s[1],n,r):t}function G7e(t,e,n,r){const i=Qf(t,e);if(!i)return t;const s=Pfe(i.tag,i.tag,n,r);return J2(t,i,s)}function U7e(t,e,n){const r=Qf(t,e);if(!r)return t;const i=/^<([a-z0-9-]+)/i.exec(r.tag),s=i==null?void 0:i[1];if(!s)return t;const a=Tfe(t,s,r.end+1);return a<0?t:`${t.slice(0,r.end+1)}${n}${t.slice(a)}`}function X7e(t,e,n){switch(n.type){case"inline-style":return F7e(t,e,n.property,n.value);case"attribute":return H7e(t,e,n.property,n.value);case"html-attribute":return Z7e(t,e,n.property,n.value);case"text-content":return n.value!==null?Q7e(t,e,n.value):t;default:return t}}function pd(t,e,n){if(e.id){const r=X7e(t,e.id,n);if(r!==t||!e.selector)return r}switch(n.type){case"inline-style":return $7e(t,e,n.property,n.value);case"attribute":return V7e(t,e,n.property,n.value);case"html-attribute":return G7e(t,e,n.property,n.value);case"text-content":return n.value!==null?U7e(t,e,n.value):t;default:return t}}const EX=new WeakMap;function bS(t,e,n){let r=EX.get(t);r||(r=new Map,EX.set(t,r));const s=(r.get(e)??Promise.resolve()).then(n,n);return r.set(e,s),s.then(()=>{(r==null?void 0:r.get(e))===s&&r.delete(e)},()=>{(r==null?void 0:r.get(e))===s&&r.delete(e)}),s}function WL(t,e,n){const r=[...new Set(e)].sort(),i=s=>{const a=r[s];return a===void 0?n():bS(t,a,()=>i(s+1))};return i(0)}const Mfe="__studioSaveAttempt";class n0 extends Error{constructor(n,r,i={}){super(n);Et(this,"statusCode");Et(this,"alreadyToasted");this.name="StudioSaveHttpError",this.statusCode=r,this.alreadyToasted=i.alreadyToasted??!1}}class Nfe extends Error{constructor(e,n){super(e,n),this.name="StudioSaveNetworkError"}}class A0 extends n0{constructor(n){super(`Save conflict: ${n.filePath} changed outside this Studio session`,409);Et(this,"filePath");Et(this,"currentVersion");Et(this,"currentContent");Et(this,"attemptedContent");this.name="StudioFileConflictError",this.filePath=n.filePath,this.currentVersion=n.currentVersion,this.currentContent=n.currentContent,this.attemptedContent=n.attemptedContent}}function T4(t,e){const r=t[e];return typeof r=="number"&&Number.isFinite(r)?r:void 0}function Dfe(){if(typeof DOMException<"u")return new DOMException("Save aborted","AbortError");const t=new Error("Save aborted");return t.name="AbortError",t}function TX(t){if(t!=null&&t.aborted)throw Dfe()}function W7e(t,e){if(!t||typeof t!="object")return t;try{Object.defineProperty(t,Mfe,{value:e,configurable:!0})}catch{}return t}function Tu(t){return t instanceof Error&&t.message?t.message:typeof t=="string"&&t.trim()?t:"Unknown save failure"}function PX(t){if(!t||typeof t!="object")return t;try{Object.defineProperty(t,"alreadyToasted",{value:!0,configurable:!0})}catch{}return t}function qL(t){if(!t||typeof t!="object")return!1;if(t.alreadyToasted===!0)return!0;const e=t.cause;return e!==t&&qL(e)}function iA(t){if(!t||typeof t!="object")return;const e=T4(t,"statusCode")??T4(t,"status")??T4(t,"status_code");if(e!=null)return e;const n=t.cause;if(n&&n!==t)return iA(n)}function Ife(t){if(!t||typeof t!="object")return;const e=T4(t,Mfe);if(e!=null)return e;const n=t.cause;if(n&&n!==t)return Ife(n)}function q7e(t){return t instanceof Error&&t.name==="AbortError"}function Y7e(t){if(q7e(t))return!1;if(t instanceof Nfe)return!0;const e=iA(t);return e==null?!1:e===408||e===425||e===429||e>=500}function K7e(t){const e=t.statusCode??iA(t.error)??null,n=t.attempt??Ife(t.error)??void 0;return{source:t.source,error_message:Tu(t.error),status_code:e,file_path:t.filePath??t.targetSourceFile??void 0,mutation_type:t.mutationType??void 0,attempt:n,label:t.label??void 0,target_id:t.targetId??void 0,target_selector:t.targetSelector??void 0,target_source_file:t.targetSourceFile??void 0}}function xy(t){Pt("save_failure",K7e(t))}async function Nd(t,e,n={}){let r="";try{r=await t.text()}catch{r=""}const i=r.trim().slice(0,300),s=i?`${e} (${t.status}): ${i}`:`${e} (${t.status})`;return new n0(s,t.status,n)}async function J7e(t,e={}){const n=e.retries??3,r=e.baseDelayMs??500,i=e.maxDelayMs??8e3,s=e.jitterRatio??.25,a=e.random??Math.random,o=e.shouldRetry??Y7e,l=e.sleep??((u,f)=>new Promise((h,m)=>{TX(f);const y=()=>{globalThis.clearTimeout(d),m(Dfe())},d=globalThis.setTimeout(()=>{f==null||f.removeEventListener("abort",y),h()},u);f==null||f.addEventListener("abort",y,{once:!0})})),c=n+1;for(let u=1;u<=c;u++)try{return TX(e.signal),await t(u)}catch(f){const h=W7e(f,u);if(u>=c||!o(h,u))throw h;const m=u-1,y=Math.min(r*2**m,i),d=y*s,v=Math.round(y+(a()*2-1)*d),b=Math.max(0,Math.min(i,v));await l(b,e.signal)}throw new Error("Save retry loop exited unexpectedly")}async function YL(t,e){const n=await fetch(`/api/projects/${t}/files/${encodeURIComponent(e)}`);if(!n.ok)throw await Nd(n,`Failed to read ${e}`);const r=await n.json();if(typeof r.content!="string")throw new Error(`Missing file contents for ${e}`);return r.content}async function rl({label:t,kind:e,coalesceKey:n,coalesceMs:r,files:i,readFile:s,writeFile:a,recordEdit:o,diskContent:l}){return WL(a,Object.keys(i),async()=>{const c={};for(const[h,m]of Object.entries(i)){const y=await s(h);y!==m&&(c[h]={before:y,after:m})}const u=Object.keys(c);if(u.length===0)return[];const f=[];try{for(const h of u)await a(h,c[h].after,(l==null?void 0:l[h])??c[h].before),f.push(h);await o({label:t,kind:e,coalesceKey:n,coalesceMs:r,files:c})}catch(h){try{for(const m of f.reverse())await a(m,c[m].before,c[m].after)}catch(m){throw new AggregateError([h,m],"Failed to save project files and rollback did not complete")}throw h}return u})}const eje=64,tje=2,nje="rec709",sA=16,_fe=4,Qn={hueDegrees:{min:0,max:360},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}},rje=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],ije=["shadows","midtones","highlights"],sje=["master","red","green","blue"],aje=["hueVsHue","hueVsSaturation","hueVsLuma"],oje=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],lje=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"],Rfe=1024,aA=sA;function MX(t,e,n,r){const i=((2*t+e)*n-t*r)/(t+e);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Cs(t,e){const n=t[e];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function cje(t){const e=[],n=[];let r=Cs(t,0);for(const a of t.slice(1)){const o=a[0]-r[0];e.push(o),n.push((a[1]-r[1])/o),r=a}const i=Cs(n,0);if(t.length===2)return[i,i];const s=new Array(t.length);s[0]=MX(Cs(e,0),Cs(e,1),i,Cs(n,1)),s[s.length-1]=MX(Cs(e,e.length-1),Cs(e,e.length-2),Cs(n,n.length-1),Cs(n,n.length-2));for(let a=1;a<t.length-1;a+=1){const o=Cs(n,a-1),l=Cs(n,a);if(o===0||l===0||Math.sign(o)!==Math.sign(l)){s[a]=0;continue}const c=Cs(e,a-1),u=Cs(e,a),f=2*u+c,h=u+2*c;s[a]=(f+h)/(f/o+h/l)}return s}function jfe(t,e){if(t.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(e)||e<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(const[r,i]of t){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function uje(t,e,n){if(!Number.isFinite(e)||!Number.isFinite(n)||e>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(t.some(([,r])=>r<e||r>n))throw new RangeError(`Curve outputs must be between ${e} and ${n}`)}function fje(t,e,n,r,i){const s=n[0]-e[0],a=Math.min(1,Math.max(0,(t-e[0])/s)),o=a*a,l=o*a;return(2*l-3*o+1)*e[1]+(l-2*o+a)*s*r+(-2*l+3*o)*n[1]+(l-o)*s*i}function Lfe(t,e,n,r,i){uje(t,r,i);const s=cje(t),a=new Float32Array(e);let o=0;for(let l=0;l<e;l+=1){const c=n(l);for(;o<t.length-2&&c>Cs(t,o+1)[0];)o+=1;const u=Cs(t,o),f=Cs(t,o+1),h=fje(c,u,f,Cs(s,o),Cs(s,o+1));a[l]=Math.min(i,Math.max(r,h))}return a}function hje(t,e=Rfe){var n,r;if(jfe(t,e),t.length>aA)throw new RangeError(`A color curve supports at most ${aA} points`);if(t.some(([i])=>i<0||i>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(((n=t[0])==null?void 0:n[0])!==0||((r=t[t.length-1])==null?void 0:r[0])!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return Lfe(t,e,i=>i/(e-1),0,1)}function dje(t,e,n,r=Rfe){var l;if(t.length<3)throw new RangeError("A hue curve requires at least three points");if(t.length>aA)throw new RangeError(`A hue curve supports at most ${aA} points`);const i=[...t].sort((c,u)=>c[0]-u[0]);for(let c=0;c<i.length;c+=1){const u=i[c];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(c>0&&u[0]===((l=i[c-1])==null?void 0:l[0]))throw new RangeError("Hue curve inputs must be unique")}const s=i.slice(-2).map(([c,u])=>[c-360,u]),a=i.slice(0,2).map(([c,u])=>[c+360,u]),o=[...s,...i,...a];return jfe(o,r),Lfe(o,r,c=>c/r*360,e,n)}const pje="data-color-grading",WE="data-hf-color-grading-source-hidden",mje="data-hf-authored-opacity",gje="__hf_color_grading_",Ffe=nje,G6={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},U6={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},oA={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5},$fe=[{id:"noir",label:"Noir",group:"Classic",colors:["#000000","#ffffff"]},{id:"ink-paper",label:"Ink & Paper",group:"Classic",colors:["#1a1a2e","#f5f5dc"]},{id:"terminal",label:"Terminal",group:"Classic",colors:["#001100","#00ff00"]},{id:"amber-glow",label:"Amber Glow",group:"Classic",colors:["#1a0f00","#ffcc00"]},{id:"handheld-green",label:"Handheld Green",group:"Classic",colors:["#0f380f","#306230","#8bac0f","#9bbc0f"]},{id:"golden-hour",label:"Golden Hour",group:"Mood",colors:["#1a1205","#4a3510","#8b6914","#d4a017","#fff8dc"]},{id:"deep-sea",label:"Deep Sea",group:"Mood",colors:["#0a1628","#1a3a5c","#2d6187","#5ba4c9","#a8dce8"]},{id:"arctic-night",label:"Arctic Night",group:"Mood",colors:["#0a0a14","#1a2a4a","#3a5a8a","#6a9aca","#cae8ff"]},{id:"synthwave",label:"Synthwave",group:"Mood",colors:["#120458","#7b2cbf","#e040fb","#ff6ec7","#fff59d"]},{id:"vaporwave",label:"Vaporwave",group:"Mood",colors:["#1a0a2e","#3d1a5c","#ff71ce","#01cdfe","#fffb96"]},{id:"forest",label:"Forest",group:"Mood",colors:["#1a2e1a","#2d4a2d","#4a7c4a","#7ab37a","#c8e6c8"]},{id:"sepia",label:"Sepia",group:"Mono",colors:["#1a1610","#3d3020","#6b5a40","#a89070","#e8dcc8"]},{id:"blueprint",label:"Blueprint",group:"Mono",colors:["#001830","#003060","#0050a0","#0080e0","#e0f0ff"]},{id:"warm-print",label:"Warm Print",group:"HyperFrames",colors:["#17121a","#824c50","#e09873","#f7ddb1"]},{id:"electric-ink",label:"Electric Ink",group:"HyperFrames",colors:["#080717","#3c185f","#7e2278","#d9339f","#ff6b66","#aafae0"]}],KL=rje,JL=ije,eF=sje,tF=aje,Bfe=oje,Vfe=lje,NX={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},DX={vignette:.18};function Ss(t,e,n={},r={},i={},s=1){return{id:t,label:e,intensity:s,adjust:{...G6,...n},details:{...U6,...r},effects:{...oA,...i}}}const vS=[Ss("neutral","Neutral"),Ss("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Ss("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Ss("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Ss("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Ss("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Ss("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Ss("vintage-wash","Vintage Wash",NX,DX),Ss("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Ss("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Ss("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Ss("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Ss("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Ss("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Ss("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Ss("home-movie-8mm","8mm Home Movie",NX,{...DX,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Ss("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Ss("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],yje=new Map(vS.map(t=>[t.id,t])),Hfe={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},zm={hue:0,amount:0,level:0},X6={amount:Qn.unit,level:Qn.signedUnit},nd=[[0,0],[1,1]],q1=[],Qfe={hueVsHue:Qn.secondaryHueShift,hueVsSaturation:Qn.signedUnit,hueVsLuma:Qn.signedUnit},pM={center:0,range:180,softness:0},mM={min:0,max:1,softness:.05},zfe={vignette:Qn.unit,vignetteMidpoint:Qn.unit,vignetteRoundness:Qn.signedUnit,vignetteFeather:Qn.unit,grain:Qn.unit,grainSize:Qn.unit,grainRoughness:Qn.unit},uf=Qn.unit,Zfe=Qn.effects,qE=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"],xje=[{id:"essentials",label:"Essentials",description:"Common optical, focus, and privacy-oriented primitives."},{id:"retro-glitch",label:"Retro & Glitch",description:"Tape, film, CRT, channel separation, and digital disruption."},{id:"print",label:"Print",description:"Halftone, limited-ink, dither, and screen-print rendering."},{id:"art",label:"Art",description:"ASCII, engraved, crosshatched, and painterly rendering."}],bje={blur:{family:"essentials",label:"Blur",description:"Defocus or soften a full media layer."},pixelate:{family:"essentials",label:"Pixelate",description:"Turn a media layer into a block mosaic."},bloom:{family:"essentials",label:"Bloom",description:"Add thresholded glow around bright image regions."},chromaBleed:{family:"retro-glitch",label:"Chroma Softening",description:"Smear color like low-bandwidth video."},tapeDamage:{family:"retro-glitch",label:"Tape Damage",description:"Add moving tracking errors and tape noise."},filmArtifacts:{family:"retro-glitch",label:"Film Artifacts",description:"Add deterministic dust and film wear."},scanlines:{family:"retro-glitch",label:"Scanlines",description:"Overlay configurable horizontal display lines."},crtCurvature:{family:"retro-glitch",label:"CRT Curvature",description:"Warp media toward curved CRT geometry."},chromaticAberration:{family:"retro-glitch",label:"Channel Separation",description:"Offset color channels by angle."},digitalGlitch:{family:"retro-glitch",label:"Digital Glitch",description:"Compose tears, blocks, and color splits."},halftone:{family:"print",label:"Halftone",description:"Render source color through a print-dot raster."},twoInkPrint:{family:"print",label:"Two-Ink Print",description:"Reduce media to a two-ink print treatment."},dither:{family:"print",label:"Ordered Dither",description:"Quantize media into an ordered limited palette."},monoScreen:{family:"print",label:"Mono Screen",description:"Build monochrome dot, shape, or line artwork."},ascii:{family:"art",label:"ASCII",description:"Render media as configurable procedural glyph cells."},engraving:{family:"art",label:"Engraving",description:"Translate luminance into directional engraved lines."},crosshatch:{family:"art",label:"Crosshatch",description:"Translate media into layered hand-hatched lines."},kuwahara:{family:"art",label:"Kuwahara Paint",description:"Apply edge-preserving painterly smoothing."}},nF=vS.filter(t=>qE.some(e=>t.effects[e]>1e-4)),Gfe=vS.filter(t=>!nF.includes(t)),lA={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},vje=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];function Aje(t){return Zfe[t]??uf}const Sje=new Set(["ascii","dither","monoScreen","engraving","crosshatch"]),wje=new Set(["blur","bloom","kuwahara"]);function rF(){return{version:tje,targetTags:["img","video"],colorSpace:Ffe,intensity:{identity:1,min:0,max:1},palette:{minColors:2,maxColors:6,colorFormat:"#rrggbb"},lut:{format:"3d-cube",maxCubeSize:eje,intensity:{...uf}},presets:[...Gfe,...nF].map(t=>({id:t.id,label:t.label,intensity:t.intensity})),adjustments:KL.map(t=>({key:t,identity:G6[t],...Hfe[t]})),wheels:{zones:JL,controls:{hue:{identity:0,unit:"degrees",wrap:!0,min:Qn.hueDegrees.min,maxExclusive:Qn.hueDegrees.max},amount:{identity:0,...X6.amount},level:{identity:0,...X6.level}}},curves:{channels:eF,input:{min:0,max:1},output:{min:0,max:1},minPoints:2,maxPoints:sA,implicitEndpoints:!0,endpointsCountTowardMax:!0},hueCurves:{channels:tF.map(t=>({key:t,input:{min:0,maxExclusive:360,unit:"degrees",wrap:!0},output:Qfe[t]})),minPoints:3,maxPoints:sA},secondaries:{max:_fe,hue:{center:{min:Qn.hueDegrees.min,maxExclusive:Qn.hueDegrees.max,unit:"degrees",wrap:!0},range:{...Qn.secondaryHueRange,unit:"degrees"},softness:{...Qn.secondaryHueSoftness,unit:"degrees"},rangePlusSoftnessMax:Qn.secondaryHueCombinedMax},saturation:{min:{...uf},max:{...uf},relation:"min < max",softness:{...Qn.secondarySoftRangeSoftness}},luma:{min:{...uf},max:{...uf},relation:"min < max",softness:{...Qn.secondarySoftRangeSoftness}},correction:{hueShift:{...Qn.secondaryHueShift,unit:"degrees"},saturation:{...Qn.signedUnit},luma:{...Qn.signedUnit},temperature:{...Qn.signedUnit},tint:{...Qn.signedUnit}}},effectFamilies:xje,finishing:Bfe.map(t=>({key:t,identity:U6[t],...zfe[t]})),effects:qE.map(t=>{const e=lA[t];return{key:t,...bje[t],apply:{...e},supportsPalette:Sje.has(t),renderLane:wje.has(t)?"multipass":"single-pass",controls:Vfe.filter(n=>Object.hasOwn(e,n)).map(n=>({key:n,identity:oA[n],recommended:e[n]??oA[n],...Aje(n)}))}}),palettes:$fe.map(({id:t,label:e,group:n,colors:r})=>({id:t,label:e,group:n,colors:r})),animatable:vje}}const Oje=/^#[0-9a-f]{6}$/i;function Cje(t){return!Array.isArray(t)||t.length<2||t.length>6||!t.every(e=>typeof e=="string"&&Oje.test(e))?null:t.map(e=>e.toLowerCase())}function Ra(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function cA(t,e,n){return Number.isFinite(t)?Math.min(n,Math.max(e,t)):0}function Ufe(t,e){const n=typeof t=="number"?t:Number(t);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):e}function Ia(t,e){const n=typeof t=="number"?t:Number(t);return Number.isFinite(n)?cA(n,e.min,e.max):0}function iF(t,e=0){const n=typeof t=="number"?t:Number(t);return Number.isFinite(n)?(n%360+360)%360:e}function w_(t,e,n){const r=cA((n-t)/(e-t),0,1);return r*r*(3-2*r)}function IX(t,e,n,r){return t<e?r<=0?0:w_(e-r,e,t):t>n?r<=0?0:1-w_(n,n+r,t):1}function kje(t,e,n,r){const i=Math.abs(((t-r.hue.center+540)%360+360)%360-180);return(r.hue.range<179.999&&e<.001?0:i<=r.hue.range?1:r.hue.softness<=0?0:1-w_(r.hue.range,r.hue.range+r.hue.softness,i))*IX(e,r.saturation.min,r.saturation.max,r.saturation.softness)*IX(n,r.luma.min,r.luma.max,r.luma.softness)}function Eje(t){const e=Ra(t)?t:{};return JL.reduce((n,r)=>{const i=Ra(e[r])?e[r]:{};return n[r]={hue:iF(i.hue,zm.hue),amount:Ia(i.amount??zm.amount,X6.amount),level:Ia(i.level??zm.level,X6.level)},n},{shadows:{...zm},midtones:{...zm},highlights:{...zm}})}function Tje(t){if(!Array.isArray(t)||t.length!==2)return null;const e=Number(t[0]),n=Number(t[1]);return Number.isFinite(e)&&Number.isFinite(n)?[cA(e,0,1),cA(n,0,1)]:null}function Xfe(t){return t.some((e,n)=>{var r;return n>0&&e[0]===((r=t[n-1])==null?void 0:r[0])})}function Pje(t){var e,n;(((e=t[0])==null?void 0:e[0])??0)>0&&t.unshift([0,0]),(((n=t.at(-1))==null?void 0:n[0])??1)<1&&t.push([1,1])}function Mje(t){if(!Array.isArray(t)||t.length<2)return nd;const e=[];for(const n of t){const r=Tje(n);if(!r)return nd;e.push(r)}return e.sort((n,r)=>n[0]-r[0]),Xfe(e)||(Pje(e),e.length>sA)?nd:e}function Nje(t){const e=Ra(t)?t:{};return eF.reduce((n,r)=>(n[r]=Mje(e[r]),n),{master:nd,red:nd,green:nd,blue:nd})}function Dje(t,e){if(!Array.isArray(t)||t.length!==2)return null;const n=Number(t[0]),r=Number(t[1]);return Number.isFinite(n)&&Number.isFinite(r)?[iF(n),cA(r,e.min,e.max)]:null}function Ije(t,e){if(!Array.isArray(t)||t.length<3||t.length>sA)return q1;const n=[];for(const r of t){const i=Dje(r,e);if(!i)return q1;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),Xfe(n)?q1:n}function _je(t){const e=Ra(t)?t:{};return tF.reduce((n,r)=>(n[r]=Ije(e[r],Qfe[r]),n),{hueVsHue:q1,hueVsSaturation:q1,hueVsLuma:q1})}function _X(t){const e=Ra(t)?t:{},n=Ia(e.min??mM.min,uf),r=Ia(e.max??mM.max,uf);return{min:Math.min(n,r),max:Math.max(n,r),softness:Ia(e.softness??mM.softness,Qn.secondarySoftRangeSoftness)}}function Rje(t){const e=Ra(t)?t:{},n=Ia(e.range??pM.range,Qn.secondaryHueRange);return{center:iF(e.center,pM.center),range:n,softness:Ia(e.softness??pM.softness,{min:Qn.secondaryHueSoftness.min,max:Qn.secondaryHueCombinedMax-n})}}function jje(t){return{hueShift:Ia(t.hueShift??0,Qn.secondaryHueShift),saturation:Ia(t.saturation??0,Qn.signedUnit),luma:Ia(t.luma??0,Qn.signedUnit),temperature:Ia(t.temperature??0,Qn.signedUnit),tint:Ia(t.tint??0,Qn.signedUnit)}}function Lje(t){return!Ra(t)||!Ra(t.key)||!Ra(t.correction)?null:{enabled:t.enabled!==!1,key:{hue:Rje(t.key.hue),saturation:_X(t.key.saturation),luma:_X(t.key.luma)},correction:jje(t.correction)}}function Fje(t){if(!Array.isArray(t))return[];const e=[];for(const n of t.slice(0,_fe)){const r=Lje(n);r&&e.push(r)}return e}function $je(t){if(t==null)return null;const e=String(t).trim();return e||null}function Bje(t){if(t==null)return null;if(typeof t=="string"){const n=t.trim();return n?{src:n,intensity:1}:null}if(!Ra(t))return null;const e=t.src;return typeof e!="string"||e.trim()===""?null:{src:e.trim(),intensity:Ufe(t.intensity,1)}}function Vje(t){if(typeof t=="string"){const e=t.trim();if(!e)return null;if(e.startsWith("{"))try{const n=JSON.parse(e);return Ra(n)?n:null}catch{return null}return{preset:e}}return Ra(t)?t:null}function Hje(t){return t?yje.get(t)??null:null}function Cc(t){const e=Vje(t);if(!e||e.enabled===!1)return null;const n=$je(e.preset),r=Hje(n),i=(r==null?void 0:r.adjust)??G6,s=(r==null?void 0:r.details)??U6,a=(r==null?void 0:r.effects)??oA,o=Ra(e.adjust)?e.adjust:{},l=Ra(e.details)?e.details:{},c=Ra(e.effects)?e.effects:{},u=KL.reduce((m,y)=>(m[y]=Ia(o[y]??i[y],Hfe[y]),m),{...G6}),f=Bfe.reduce((m,y)=>(m[y]=Ia(l[y]??s[y],zfe[y]),m),{...U6}),h=Vfe.reduce((m,y)=>(m[y]=Ia(c[y]??a[y],Zfe[y]??uf),m),{...oA});return{enabled:!0,preset:n,intensity:Ufe(e.intensity,(r==null?void 0:r.intensity)??1),adjust:u,wheels:Eje(e.wheels),curves:Nje(e.curves),hueCurves:_je(e.hueCurves),secondaries:Fje(e.secondaries),details:f,effects:h,palette:Cje(e.palette),lut:Bje(e.lut),colorSpace:typeof e.colorSpace=="string"&&e.colorSpace.trim()?e.colorSpace.trim():Ffe}}function Wfe(t){return JL.some(e=>Math.abs(t[e].amount)>1e-4||Math.abs(t[e].level)>1e-4)}function qfe(t){return eF.some(e=>t[e].some(([n,r])=>Math.abs(n-r)>1e-4))}function Yfe(t){return tF.some(e=>t[e].some(([,n])=>Math.abs(n)>1e-4))}function Qje(t){return t.some(e=>e.enabled&&Object.values(e.correction).some(n=>Math.abs(n)>1e-4))}function O_(t){const e=Cc(t);if(!e)return"";const{enabled:n,wheels:r,curves:i,hueCurves:s,secondaries:a,palette:o,...l}=e;return JSON.stringify({...l,...Wfe(r)?{wheels:r}:{},...qfe(i)?{curves:i}:{},...Yfe(s)?{hueCurves:s}:{},...a.length>0?{secondaries:a}:{},...o?{palette:o}:{}})}function r0(t){return t!=null&&t.enabled?Math.abs(t.details.vignette)>1e-4||Math.abs(t.details.grain)>1e-4||qE.some(n=>Math.abs(t.effects[n])>1e-4)?!0:t.intensity===0?!1:t.lut&&t.lut.intensity!==0?!0:KL.some(n=>Math.abs(t.adjust[n])>1e-4)||(t.wheels?Wfe(t.wheels):!1)||(t.curves?qfe(t.curves):!1)||(t.hueCurves?Yfe(t.hueCurves):!1)||(t.secondaries?Qje(t.secondaries):!1):!1}function RX(t){var e;return t?(e=t.secondaries)!=null&&e.length?!0:r0(t):!1}function Kfe(t){return t.getAttribute(mje)}function Jfe(t,e){e===""?t.removeProperty("opacity"):t.setProperty("opacity",e)}const ehe="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/MotionPathPlugin.min.js";function zje(t){var r,i;if(!(t!=null&&t.contentWindow)||!t.contentDocument)return;const e=t.contentWindow,n=t.contentDocument;if(e.MotionPathPlugin){try{(r=e.gsap)!=null&&r.registerPlugin&&e.gsap.registerPlugin(e.MotionPathPlugin)}catch{}return}if((i=e.gsap)!=null&&i.registerPlugin&&!e.__hfMotionPathPluginLoading)try{e.__hfMotionPathPluginLoading=!0;const s=n.createElement("script");s.src=ehe;const a=()=>{var o;e.__hfMotionPathPluginLoading=!1;try{e.MotionPathPlugin&&((o=e.gsap)!=null&&o.registerPlugin)&&e.gsap.registerPlugin(e.MotionPathPlugin)}catch{}};s.onload=a,s.onerror=a,n.head.appendChild(s)}catch{e.__hfMotionPathPluginLoading=!1}}function Zje(t){return t.includes("gsap.timeline")||t.includes("__timelines")||t.includes(".to(")||t.includes(".set(")}function YE(t){const e=[],n=t.querySelectorAll("script:not([src])");for(const r of n)Zje(r.textContent||"")&&e.push(r);return e}function W6(t){const e=new DOMParser().parseFromString(t,"text/html"),n=YE(e);return n.length!==1?null:n[0].textContent||null}function Gje(t,e){const n=t.__timelines;return n?e.length>0?e.every(r=>n[r]!=null):Object.keys(n).filter(r=>r!=="__proxied").length>0:!1}function C_(t,e){var n,r,i,s;(r=(n=t.__player)==null?void 0:n.seek)==null||r.call(n,e),(i=t.__hfForceTimelineRebind)==null||i.call(t),(s=t.__hfStudioManualEditsApply)==null||s.call(t)}function the(t,e){const n=t==null?void 0:t.contentWindow;if(!(n!=null&&n.__hfForceTimelineRebind))return!1;try{return n.__hfSuppressSceneMutations?n.__hfSuppressSceneMutations(()=>C_(n,e)):C_(n,e),!0}catch{return!1}}function sF(t,e,n={}){var b,w;const{onAsyncFailure:r,currentTimeOverride:i,authoredHtml:s}=n;if(!t||!e)return"cannot-soft-reload";const a=t.contentWindow,o=t.contentDocument;if(!a||!o||!a.gsap||!a.__hfForceTimelineRebind)return"cannot-soft-reload";const l=[...e.matchAll(/__timelines\s*\[\s*["'`]([^"'`]+)["'`]\s*\]/g)].map(O=>O[1]).filter(O=>O!=="__proxied");if(l.length===0)return"cannot-soft-reload";const c=YE(o);if(c.length===0)return"cannot-soft-reload";const u=c.filter(O=>l.some(k=>{const E=O.textContent||"";return E.includes(`__timelines["${k}"]`)||E.includes(`__timelines['${k}']`)}));if(c.length>1&&u.length===0)return"cannot-soft-reload";const f=i??((w=(b=a.__player)==null?void 0:b.getTime)==null?void 0:w.call(b))??0;let h=!1,m;const y=O=>{if(m===void 0)try{m=s?new DOMParser().parseFromString(s,"text/html"):null}catch{m=null}if(!m)return null;const k=O.getAttribute("data-hf-id");return k?m.querySelector(`[data-hf-id="${k}"]`):O.id?m.getElementById(O.id):null},d=O=>{const k=y(O);return k instanceof HTMLElement?k.style.opacity:Kfe(O)},v=()=>{var I,_,j;const O=a.__timelines,k=[];if(O)for(const L of l){const B=O[L];if(B){if(B.getChildren)try{for(const $ of B.getChildren(!0))if(typeof $.targets=="function")for(const Q of $.targets())k.push(Q)}catch{}try{(I=B.kill)==null||I.call(B)}catch{}delete O[L]}}const E=new Set(k);for(const L of o.querySelectorAll("[style*='transform']"))L.style.transform&&"_gsap"in L&&!E.has(L)&&(E.add(L),k.push(L));if(k.length>0&&((_=a.gsap)!=null&&_.set)){const L=[];for(const B of k){const $=B;((j=$.style)==null?void 0:j.cssText)!=null&&L.push([$,$.style.cssText])}try{a.gsap.set(k,{clearProps:"all"})}catch{}for(const[B,$]of L){const Q=B.style;Q.cssText=$,Q.removeProperty("transform");const Y=d(B);Y!==null?Jfe(Q,Y):B.hasAttribute(WE)&&Q.getPropertyValue("opacity")==="0"&&Q.getPropertyPriority("opacity")==="important"&&Q.removeProperty("opacity")}}for(const L of u)L.remove();const M=()=>{var B;a.MotionPathPlugin&&((B=a.gsap)!=null&&B.registerPlugin)&&a.gsap.registerPlugin(a.MotionPathPlugin);const L=o.createElement("script");L.textContent=`(function(){${e}
|
|
203
203
|
})();`,o.body.appendChild(L),C_(a,f)};if(/motionPath\s*[:{]/.test(e)&&!a.MotionPathPlugin&&a.gsap){if(h=!0,a.__hfMotionPathPluginLoading){const B=Date.now(),$=a.setInterval(()=>{a.MotionPathPlugin?(a.clearInterval($),M()):(!a.__hfMotionPathPluginLoading||Date.now()-B>1e4)&&(a.clearInterval($),r==null||r())},50);return}a.__hfMotionPathPluginLoading=!0;const L=o.createElement("script");L.src=ehe,L.onload=()=>{a.__hfMotionPathPluginLoading=!1,M()},L.onerror=()=>{a.__hfMotionPathPluginLoading=!1,r==null||r()},o.head.appendChild(L);return}M()};try{return a.__hfSuppressSceneMutations?a.__hfSuppressSceneMutations(v):v(),h||Gje(a,l)?"applied":"verify-failed"}catch{return"cannot-soft-reload"}}function Uje(t,e){if(!t||!Number.isFinite(e)||e<=0)return!1;const n=Array.from(t.querySelectorAll("[data-composition-id]")),r=n.find(i=>{var s;return!((s=i.parentElement)!=null&&s.closest("[data-composition-id]"))})??n[0]??null;return r?(r.setAttribute("data-duration",pi(e)),!0):!1}const Xje=5*6e4,uA=new Map;function nhe(t){for(const[e,n]of uA)t-n>=Xje&&uA.delete(e)}function rhe(t,e=Date.now()){nhe(e),uA.set(t,e)}function Wje(t,e=Date.now()){return nhe(e),!t||!uA.has(t)?!1:(uA.delete(t),!0)}async function qje(t){const e=new TextEncoder().encode(t),n=await globalThis.crypto.subtle.digest("SHA-256",e);return`"sha256:${Array.from(new Uint8Array(n),i=>i.toString(16).padStart(2,"0")).join("")}"`}async function Yje(t,e,n){return n!==void 0?qje(n):t.get(e)}function Kje(){return globalThis.crypto.randomUUID()}function Ql(){const t=Kje();return rhe(t),{"X-Hyperframes-Write-Token":t}}class fA extends Error{}class q6 extends fA{}async function Js(t,e){if(e.includes("\0")||e.includes(".."))throw new Error(`Unsafe path: ${e}`);const n=await fetch(`/api/projects/${encodeURIComponent(t)}/files/${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read ${e}`);const r=await n.json();if(typeof r.content!="string")throw new Error(`Missing file contents for ${e}`);return r.content}async function Jje(t){const e=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-mutation-capabilities`);if(!e.ok)throw new q6("Server does not support owned GSAP mutations");const n=await e.json().catch(()=>null);if(!aF(n)||n.atomicOwnershipPairs!==!0)throw new q6("Invalid GSAP mutation capability response")}async function eLe(t,e,n,r){if(e.includes("\0")||e.includes(".."))throw new Error(`Unsafe path: ${e}`);const i=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-mutation-rollback/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expected:n,restore:r})});if(!i.ok)throw new Error(`Failed to restore ${e}`);const s=await i.json();if(s.restored===!0&&s.conflict===!1)return"restored";if(s.restored===!1&&s.conflict===!0)return"conflict";throw new Error(`Invalid restore response for ${e}`)}function ihe(t,e){try{Uje((t==null?void 0:t.contentDocument)??null,e)}catch{}}function Y6(t){const e=mj((t==null?void 0:t.contentDocument)??null);e>0&&(fe.getState().setDuration(e),ihe(t,e))}function hA(t){const e=fe.getState().duration;return()=>{fe.getState().duration!==e&&(fe.getState().setDuration(e),ihe(t,e))}}function aF(t){return typeof t=="object"&&t!==null}function tLe(t){if(!aF(t)||typeof t.mutated!="boolean"||typeof t.before!="string"||typeof t.after!="string"||t.mutated!==(t.before!==t.after)||"changed"in t&&t.changed!==t.mutated)throw new q6("Invalid owned GSAP mutation response");return{mutated:t.mutated,scriptText:typeof t.scriptText=="string"?t.scriptText:null,before:t.before,after:t.after}}function nLe(t,e){return aF(t)&&typeof t.error=="string"?t.error:e}async function she(t,e,n,r){let i;try{i=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-mutations/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json",...Ql()},body:JSON.stringify(n)})}catch(a){throw new fA(`${r}: mutation outcome unknown`,{cause:a})}const s=await i.json().catch(()=>null);if(!i.ok)throw new fA(nLe(s,r));return tLe(s)}function rLe(t,e){return the(t,e)}function iLe(t,e,n,r,i){if(!e.mutated&&i){rLe(t,n)||r();return}if(!t||!e.scriptText){r();return}sF(t,e.scriptText,{onAsyncFailure:r,currentTimeOverride:n})==="cannot-soft-reload"&&r()}async function ahe(t){let e={mutated:!1,scriptText:null};if(t.gsapMutation)try{e=await t.gsapMutation()}catch(n){t.onGsapError(n),n instanceof fA&&t.reloadPreview();return}iLe(t.iframe,e,fe.getState().currentTime,t.reloadPreview,t.rebindWhenUnmutated)}const sLe=1e4;async function aLe(t,e,n){let r=!1;for(let i=e.length-1;i>=0;i-=1){const s=e[i];if(!(!s||s.before===s.after))try{await eLe(t,s.path,s.after,s.before)==="conflict"&&(r=!0)}catch(a){r=!0,n(a)}}return r?"convergence-required":"restored"}async function jX(t,e,n,r){throw await aLe(t,e,n)==="convergence-required"?new fA("GSAP rollback could not safely restore every owned write; preview reload required",{cause:r}):r}async function ohe(t){const e=[],n=async(i,s)=>{const a=s();if(!a)return{mutated:!1,scriptText:null};const o=await a;if(!o.mutated)return o;if(o.before===void 0||o.after===void 0)throw new q6(`GSAP mutation returned no owned before/after pair for ${i}`);const l=[...e].reverse().find(u=>u.path===i),c={path:i,before:o.before,after:o.after};if(e.push(c),l&&l.after!==c.before)throw new Error(`GSAP mutation ownership chain broke for ${i}`);return o};let r;try{await Jje(t.projectId),r=await t.gsapMutation(n)}catch(i){return jX(t.projectId,e,t.onRollbackError,i)}if(r.mutated)try{const i=new Map;for(const a of e){const o=i.get(a.path);o?o.after=a.after:i.set(a.path,{before:a.before,after:a.after})}const s={};for(const[a,o]of i){if(await Js(t.projectId,a)!==o.after)throw new Error(`GSAP mutation ownership lost for ${a}`);o.before!==o.after&&(s[a]=o)}Object.keys(s).length>0&&await t.recordEdit({label:t.label,kind:"timeline",coalesceKey:t.coalesceKey,coalesceMs:sLe,files:s})}catch(i){return jX(t.projectId,e,t.onRollbackError,i)}return r}async function lhe(t,e,n,r){return r===0||!n?{mutated:!1,scriptText:null}:she(t,e,{type:"shift-positions",targetSelector:`#${n}`,delta:r},"shift-positions failed")}async function che(t,e,n,r,i,s,a){return!n||i<=0||a<=0?{mutated:!1,scriptText:null}:r===s&&i===a?{mutated:!1,scriptText:null}:she(t,e,{type:"scale-positions",targetSelector:`#${n}`,oldStart:r,oldDuration:i,newStart:s,newDuration:a},"scale-positions failed")}function LX(t){const{projectId:e,targetPath:n,domId:r,edit:i}=t,s=i.kind==="shift"?i.delta!==0:i.from.start!==i.to.start||i.from.duration!==i.to.duration,a=(l,c)=>i.kind==="shift"?lhe(l,n,c,i.delta):che(l,n,c,i.from.start,i.from.duration,i.to.start,i.to.duration),o=l=>console.error(`[Timeline] Failed to ${i.kind} GSAP positions`,l);return ahe({iframe:t.iframe,reloadPreview:t.reloadPreview,gsapMutation:s&&r&&e?()=>ohe({projectId:e,label:t.label,coalesceKey:t.coalesceKey,recordEdit:t.recordEdit,gsapMutation:l=>l(n,()=>a(e,r)),onRollbackError:o}):void 0,onGsapError:o,rebindWhenUnmutated:!0})}async function FX(t){const e=t.activeCompPath||"index.html",n=t.changes.some(i=>t.resolveChangePath(i.element)!==e),r=i=>console.error(`[Timeline] ${t.errorLabel}`,i);await ahe({iframe:t.iframe,reloadPreview:t.reloadPreview,gsapMutation:()=>ohe({projectId:t.projectId,label:t.label,coalesceKey:t.coalesceKey,recordEdit:t.recordEdit,gsapMutation:async i=>{let s=!1,a=null;for(const o of t.changes){const l=t.resolveChangePath(o.element),c=await i(l,()=>t.mutateChange(o,l));s=s||c.mutated,l===e&&(a=c.scriptText)}return{mutated:s,scriptText:n?null:a}},onRollbackError:r}),onGsapError:r,rebindWhenUnmutated:!n})}const uhe=["position","display","top","left","right","bottom","inset","width","height","gap","justify-content","align-items","flex-direction","font-size","font-style","font-weight","font-family","line-height","letter-spacing","text-align","text-transform","color","background-color","background-image","opacity","mix-blend-mode","border-radius","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","outline-color","overflow","clip-path","box-shadow","filter","backdrop-filter","z-index","transform","object-fit","object-position"];function eu(t){if(!t)return null;const e=t.trim();if(!e.endsWith("px"))return null;const n=parseFloat(e);return Number.isFinite(n)?n:null}function oLe(t){const e=(t??"none").trim();if(!e||e==="none")return!0;const n=e.match(/^matrix\(([^)]+)\)$/i);if(n&&n[1]){const a=n[1].split(",");if(a.length!==6)return!1;const o=a.map(y=>Number.parseFloat(y.trim()));if(o.some(y=>!Number.isFinite(y)))return!1;const[l=0,c=0,u=0,f=0,h=0,m=0]=o;return Math.abs(l-1)<1e-4&&Math.abs(c)<1e-4&&Math.abs(u)<1e-4&&Math.abs(f-1)<1e-4&&Math.abs(h)<1e-4&&Math.abs(m)<1e-4}const r=e.match(/^matrix3d\(([^)]+)\)$/i);if(!r||!r[1])return!1;const i=r[1].split(",").map(a=>Number.parseFloat(a.trim()));if(i.length!==16||i.some(a=>!Number.isFinite(a)))return!1;const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return i.every((a,o)=>Math.abs(a-(s[o]??0))<1e-4)}function lLe(t){if(!t.hasStableTarget||t.isInsideLockedComposition)return{canSelect:!t.isInsideLockedComposition,canEditStyles:!1,canCrop:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:t.isInsideLockedComposition?"This element belongs to a locked composition.":"Studio could not resolve a stable patch target for this element."};if(!t.existsInSource)return{canSelect:!0,canEditStyles:!1,canCrop:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:"This element is generated by a script and cannot be edited visually."};if(t.isCompositionRoot)return{canSelect:!0,canEditStyles:!0,canCrop:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:"The root composition defines the preview bounds."};const e=t.computedStyles??{},n=e.position,r=eu(t.inlineStyles.left)??eu(e.left),i=eu(t.inlineStyles.top)??eu(e.top),s=eu(t.inlineStyles.width)??eu(e.width),a=eu(t.inlineStyles.height)??eu(e.height),o=!oLe(e.transform),l=(n==="absolute"||n==="fixed")&&r!=null&&i!=null&&!o,c=l&&(s!=null||a!=null),u=!t.isCompositionHost,f=u?void 0:"Select an internal layer to transform it.";return{canSelect:!0,canEditStyles:!(t.isCompositionHost&&t.isMasterView),canCrop:!0,canMove:l,canResize:c,canApplyManualOffset:u,canApplyManualSize:u,canApplyManualRotation:u,reasonIfDisabled:f}}function oF(t){const e=t.tag===ga,n=t.tag!=="audio"&&!e;return{text:t.hasEditableText&&!t.isCompositionHost&&!t.isInsideLockedComposition,media:t.tag==="video"||t.tag==="audio"||t.tag==="img",audioFx:t.tag==="audio"||e,colorGrading:t.tag==="video"||t.tag==="img",timing:!e&&(t.hasTimingStart||t.animationCount>0),animation:t.animationCount>0&&t.tag!=="audio"&&!e,layout:n,style:n}}function cLe(t){return{capabilities:lLe(t),sections:oF(t)}}function kc(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"&&t.nodeType===1}function uLe(t){return["div","span","p","strong","h1","h2","h3","h4","h5","h6"].includes(t)}function fhe(t){const e=t.ownerDocument.defaultView;if(!e)return!0;let n=t;for(;n;){const r=e.getComputedStyle(n);if(r.display==="none"||r.visibility==="hidden")return!1;const i=Number.parseFloat(r.opacity);if(Number.isFinite(i)&&i<=.01&&!n.hasAttribute(WE))return!1;n=n.parentElement}return!0}function hhe(t){var r;const e={},n=(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t);if(!n)return e;for(const i of uhe){const s=n.getPropertyValue(i);s&&(e[i]=s)}return e}function dhe(t){const e={};for(const n of uhe){const r=t.style.getPropertyValue(n);r&&(e[n]=r)}return e}function fLe(t){const e={};for(const n of t.attributes)n.name.startsWith("data-")&&(e[n.name.slice(5)]=n.value);return e}function k_(t,e){let n=t;for(;n;){const r=n;if(e.some(i=>r.hasAttribute(i)))return r;n=n.parentElement}return null}let P4=new Map;function $X(t){P4=t}function hLe(t){if(!t||P4.size===0)return;const e=t.getAttribute("data-hf-original-composition-id"),n=t.getAttribute("data-composition-id");return(e?P4.get(e):void 0)??(n?P4.get(n):void 0)}function AS(t,e){const n=k_(t,["data-composition-file","data-composition-src"]),r=k_(t,["data-composition-id"]),i=(n==null?void 0:n.getAttribute("data-composition-file"))??(n==null?void 0:n.getAttribute("data-composition-src"))??(r==null?void 0:r.getAttribute("data-composition-file"))??(r==null?void 0:r.getAttribute("data-composition-src"))??hLe(r)??e??"index.html";return{sourceFile:i,compositionPath:i}}function BX(t){const e=t==null?void 0:t.trim();if(!e)return;let n=e;try{n=new URL(e,"http://studio.local").pathname}catch{n=e}for(const r of["/preview/comp/","/preview/"]){const i=n.indexOf(r);if(i<0)continue;return n.slice(i+r.length).replace(/^\/+/,"")||e}return e}function phe(t){const e=globalThis.CSS;if(typeof(e==null?void 0:e.escape)=="function")return e.escape(t);if(t==="-")return"\\-";let n="";for(let r=0;r<t.length;r+=1){const i=t[r]??"",s=i.charCodeAt(0);if(s===0){n+="�";continue}const a=s>=48&&s<=57,o=s>=65&&s<=90,l=s>=97&&s<=122,c=s>=1&&s<=31||s===127,u=r===0&&a,f=r===1&&t.startsWith("-")&&a;if(c||u||f){n+=`\\${s.toString(16)} `;continue}if(o||l||a||i==="-"||i==="_"||s>=128){n+=i;continue}n+=`\\${i}`}return n}function Cf(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}function dLe(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function qO(t){var e;return((e=t.replace(/\.html$/i,"").replace(/^compositions\//i,"").split("/").at(-1))==null?void 0:e.replace(/[-_]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()))??t}function SS(t){if(t.id)return`#${phe(t.id)}`;const e=t.getAttribute("data-composition-id");if(e)return`[data-composition-id="${Cf(e)}"]`;const n=t.getAttribute("data-hf-group");return n?`[data-hf-group="${Cf(n)}"]`:mhe(t)}function mhe(t){const e=Array.from(t.classList).map(r=>r.trim()).filter(Boolean);if(e.length===0)return;const n=e.find(r=>r!=="clip"&&!r.startsWith("__hf-"))??e[0];return n?`.${phe(n)}`:void 0}function ghe(t){const e=t.getAttribute("data-composition-id");if(e&&e!=="main")return qO(e);const n=t.getAttribute("data-composition-src")??t.getAttribute("data-composition-file");if(n)return qO(n);const r=t.getAttribute("data-hf-group");if(r)return r;if(t.id)return qO(t.id);const i=mhe(t);if(i)return qO(i.replace(/^\./,""));const s=(t.textContent??"").trim().replace(/\s+/g," ");return s?s.length>40?`${s.slice(0,39)}…`:s:t.tagName.toLowerCase()}function lF(t,e,n,r,i){if(n!=null&&n.startsWith("."))return cse(t,e,n,r,s=>kc(s)?AS(s,i).sourceFile:void 0)}function by(t){return fhe(t)}const VX=new Set(["img","video","canvas","svg","audio"]);function pLe(t){const e=t.ownerDocument.defaultView;if(!e)return!1;const n=e.getComputedStyle(t);return!!(n.backgroundImage!=="none"||n.backgroundColor&&n.backgroundColor!=="transparent"&&n.backgroundColor!=="rgba(0, 0, 0, 0)"||n.borderWidth&&parseFloat(n.borderWidth)>0&&n.borderStyle!=="none"||n.boxShadow&&n.boxShadow!=="none")}function mLe(t){const e=t.tagName.toLowerCase();if(VX.has(e)||pLe(t))return!1;const{children:n}=t;if(n.length===0)return(t.textContent??"").trim().length===0;for(let r=0;r<n.length;r+=1){const i=n[r];if(kc(i)&&(VX.has(i.tagName.toLowerCase())||by(i)))return!1}return!0}function gLe(t){const e=t.getBoundingClientRect();return!(e.width<=1||e.height<=1||!by(t)||mLe(t))}const yLe=new Set(["base","br","canvas","link","meta","script","source","style","template","track","wbr"]);function xLe(t){var r;const e=t.tagName.toLowerCase();if(yLe.has(e))return!1;const n=(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t);return!((n==null?void 0:n.display)==="none"||(n==null?void 0:n.visibility)==="hidden")}function Ng(t,e){if(!xLe(t)||t.hasAttribute("data-composition-id"))return null;const n=SS(t);if(!n)return null;const{sourceFile:r}=AS(t,e);return{id:t.id||void 0,hfId:t.getAttribute("data-hf-id")||void 0,selector:n,selectorIndex:lF(t.ownerDocument,t,n,r,e),sourceFile:r}}function bLe(t){let e=t;for(;e;){if(e.classList.contains("clip")&&(!(e.hasAttribute("data-composition-src")||e.hasAttribute("data-composition-file"))||e===t))return e;e=e.parentElement}return null}function vLe(t,e){if(e.preferClipAncestor){const n=bLe(t);if(n)return n}return t}function ALe(t,e){const n=[];for(const s of t)kc(s)&&gLe(s)&&Ng(s,e.activeCompositionPath)&&n.push(s);if(n.length===0)return[];const r=[];let i=n[0];for(let s=1;s<n.length;s++){const a=n[s];i.contains(a)||r.push(i),i=a}return r.push(i),r}function Ds(t,e,n=null){const r=s=>kc(s)&&(!e.sourceFile||AS(s,n).sourceFile===e.sourceFile),i=s=>dLe(t,s).filter(r);if(e.hfId){const s=i(`[data-hf-id="${Cf(e.hfId)}"]`)[0];if(s)return s}if(e.id){const s=i(`[id="${Cf(e.id)}"]`)[0];if(s)return s}return e.selector?i(e.selector)[e.selectorIndex??0]??null:null}function yhe(t,e,n){var f;const r=typeof e.id=="string"?e.id:"",i=BX(e.compositionSrc)??((f=n.compIdToSrc)==null?void 0:f.get(r)),s=i??BX(e.sourceFile)??n.activeCompositionPath??"index.html",a=Cf(r),o=i?Cf(i):null,l=e.selector??(i?`[data-composition-src="${o}"],[data-composition-file="${o}"],[data-composition-id="${a}"]`:a?`[data-composition-id="${a}"]`:void 0);if(l||e.domId){const h=Ds(t,{id:e.domId??void 0,selector:l,selectorIndex:e.selectorIndex,sourceFile:s},n.activeCompositionPath);if(h)return h}const c=!!(e.domId||e.selector||i);if(n.isMasterView||c||!n.activeCompositionPath)return null;const u=t.querySelector("[data-composition-id]");return kc(u)&&AS(u,n.activeCompositionPath).sourceFile===s?u:null}function SLe(t,e){return Array.from(t.children).filter(n=>kc(n)&&Ng(n,e.activeCompositionPath)!==null)}let wLe=0;function OLe(t){const{selectedKeyframes:e,selectedElementId:n}=fe.getState();if(!n)return;const r=t.selectedGsapAnimations.filter(c=>c.keyframes),i=r.length===1?r[0]:void 0,s=new Map(r.map(c=>[c.id,c])),a=new Map;for(const c of e){const u=F5e(n,c);if(!u)continue;const f=u.animationId?s.get(u.animationId):i;if(!f)continue;const h=u.tweenPercentage??u.percentage;a.set(`${f.id}\0${h}`,{animationId:f.id,percentage:h})}const o=[...a.values()];if(o.length===0)return;const l={coalesceKey:`delete-keyframes:${++wLe}`,coalesceMs:Number.POSITIVE_INFINITY};for(const[c,u]of o.entries())t.handleGsapRemoveKeyframe(u.animationId,u.percentage,{...l,...c===o.length-1?{softReload:!0}:{skipReload:!0}})}function CLe(t){var n,r;if(!t)return!1;const e=((r=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.HTMLElement)??globalThis.HTMLElement;return t instanceof e}function kLe(t){var s,a;if(t.element.tag==="audio")return Promise.resolve();const e=t.stackingReorder??null;if(e==null||e.zIndexChanges.length===0)return Promise.resolve();const n=new Map(t.timelineElements.map(o=>[zn(o),o])),r=((s=t.iframe)==null?void 0:s.contentDocument)??null,i=[];for(const o of e.zIndexChanges){const l=n.get(o.key),c=o.domId??(l==null?void 0:l.domId),u=o.selector??(l==null?void 0:l.selector),f=o.selectorIndex??(l==null?void 0:l.selectorIndex),h=o.sourceFile??(l==null?void 0:l.sourceFile)??t.activeCompPath??"index.html",m=r?Ds(r,{id:c,selector:u,selectorIndex:f,sourceFile:h},t.activeCompPath):null;if(!CLe(m))return Promise.resolve();qI(m)!==o.zIndex&&i.push({element:m,zIndex:o.zIndex,id:c??(l==null?void 0:l.id)??o.key,selector:u,selectorIndex:f,sourceFile:h,key:o.key})}return i.length===0?Promise.resolve():Promise.resolve((a=t.commit)==null?void 0:a.call(t,i,t.coalesceKey)).then(()=>{})}function K6(t){const e=fe.getState();return t<=e.duration?!1:(e.setDuration(t),!0)}function Zd(t){return t.domId?{id:t.domId,hfId:t.hfId,selector:t.selector,selectorIndex:t.selectorIndex}:t.hfId?{hfId:t.hfId,selector:t.selector,selectorIndex:t.selectorIndex}:t.selector?{selector:t.selector,selectorIndex:t.selectorIndex}:null}function wS(t,e,n=null){try{const r=t==null?void 0:t.contentDocument;return r?e.kind==="composition"&&e.compositionSrc?yhe(r,e,{activeCompositionPath:n,isMasterView:!0}):Ds(r,{hfId:e.hfId,id:e.domId,selector:e.selector,selectorIndex:e.selectorIndex,sourceFile:e.sourceFile||n||"index.html"},n):null}catch{return null}}function J6(t,e,n,r=null){try{const i=wS(t,e,r);if(!i)return;for(const[s,a]of n)i.setAttribute(s,a)}catch{}}function eC(t){return t.playbackStartAttr==="playback-start"||t.kind==="composition"?"data-playback-start":"data-media-start"}function ELe(t,e,n,r){if(r.playbackStart!=null)return{attrName:eC(n).slice(5),value:r.playbackStart};const i=r.start-n.start;if(i===0)return null;const s=S_(t,e,"playback-start")??S_(t,e,"media-start"),a=s!=null?parseFloat(s):void 0;return a==null||!Number.isFinite(a)?null:{attrName:eC(n).slice(5),value:Math.max(0,a+i*Math.max(n.playbackRate??1,.1))}}function xhe(t,e,n,r,i){if(!Number.isFinite(n)||!Number.isFinite(r))return console.warn(`[Timeline] buildTimelineMoveTimingPatch: non-finite timing (start=${n}, duration=${r}) — patch skipped`),t;let s=pd(t,e,{type:"attribute",property:"start",value:pi(n)});return i!=null&&Number.isFinite(i)&&(s=pd(s,e,{type:"attribute",property:"track-index",value:pi(i)})),Ij(s,gj(s))}function bhe(t,e,n,r){const i=ELe(t,e,n,r);let s=pd(t,e,{type:"attribute",property:"start",value:pi(r.start)});return s=pd(s,e,{type:"attribute",property:"duration",value:pi(r.duration)}),i&&(s=pd(s,e,{type:"attribute",property:i.attrName,value:pi(i.value)})),Ij(s,gj(s))}async function TLe(t){const e=t.element.sourceFile||t.activeCompPath||"index.html",n=await Js(t.projectId,e),r=Zd(t.element);if(!r)throw new Error(`Timeline element ${t.element.id} is missing a patchable target`);const i=t.buildPatches(n,r);if(i===n)throw new Error(`Unable to patch timeline element ${t.element.id} in ${e}`);t.pendingTimelineEditPathRef.current.add(e),t.domEditSaveTimestampRef.current=Date.now(),await rl({projectId:t.projectId,label:t.label,kind:"timeline",coalesceKey:t.coalesceKey,files:{[e]:i},readFile:async()=>n,writeFile:t.writeProjectFile,recordEdit:t.recordEdit}),t.domEditSaveTimestampRef.current=Date.now()}async function PLe(t){const e=new Map,n=new Map;for(const i of t.changes){const s=i.element.sourceFile||t.activeCompPath||"index.html",a=e.get(s)??await Js(t.projectId,s);e.set(s,a);const o=Zd(i.element);if(!o)throw new Error(`Timeline element ${i.element.id} is missing a patchable target`);const l=n.get(s)??a;if(!Qf(l,o))throw new Error(`Unable to patch timeline element ${i.element.id} in ${s}`);const c=i.buildPatches(l,o);c!==l&&n.set(s,c)}if(n.size===0)return;const r=Object.fromEntries(n);for(const i of Object.keys(r))t.pendingTimelineEditPathRef.current.add(i);t.domEditSaveTimestampRef.current=Date.now(),await rl({projectId:t.projectId,label:t.label,kind:"timeline",coalesceKey:t.coalesceKey,coalesceMs:t.coalesceMs,files:r,readFile:async i=>e.get(i)??Js(t.projectId,i),writeFile:t.writeProjectFile,recordEdit:t.recordEdit}),t.domEditSaveTimestampRef.current=Date.now()}async function vhe({projectId:t,targetPath:e,patchTarget:n,attr:r,value:i,label:s,writeProjectFile:a,recordEdit:o,domEditSaveTimestampRef:l,pendingTimelineEditPathRef:c,patchLive:u}){const f=await Js(t,e);if(xS(f,n)===void 0)throw new Error(`Unable to patch element in ${e}`);const h=S_(f,n,r)??null;u(i);const y=pd(f,n,{type:"attribute",property:r,value:i});c.current.add(e),l.current=Date.now();try{const d=await rl({projectId:t,label:s,kind:"timeline",files:{[e]:y},readFile:async v=>v===e?f:Js(t,v),writeFile:a,recordEdit:o});return l.current=Date.now(),d}catch(d){throw u(h),d}}const tC=.03;function MLe(t,e,n){return t>=e+tC&&t<=e+n-tC}function KE(t){const e=!!(t.hfId||t.domId||t.selector),n=t.playbackRate==null||Number.isFinite(t.playbackRate)&&t.playbackRate>0;return!t.timelineLocked&&t.timingSource!=="implicit"&&e&&n&&!!t.duration&&Number.isFinite(t.duration)}function Ahe(t,e){return KE(t)&&MLe(e,t.start,t.duration)}function NLe(t,e){return t.filter(n=>Ahe(n,e))}function DLe(t,e,n,r){return e.button!==0||e.shiftKey||!r?!1:t==="start"?n.canTrimStart:n.canTrimEnd}function ILe(t,e,n){return t?t==="move"?!!n:!!e:!1}function _Le(t,e,n,r){if(t.button!==0)return{kind:"ignore"};if(fe.getState().activeTool==="razor")return{kind:"ignore"};if(t.shiftKey)return{kind:"arm-shift-click"};const i=t.currentTarget.getBoundingClientRect(),s=_3e({width:i.width,offsetX:t.clientX-i.left,handleWidth:r3e,capabilities:e});return ILe(s,n,r)?{kind:"block",intent:s,rect:i}:!r||!e.canMove?{kind:"ignore"}:{kind:"move",rect:i}}function RLe(t,e,n,r,i){const{pps:s,onResizeElement:a,onMoveElement:o,onRazorSplit:l,onRazorSplitAll:c,blockedClipRef:u,shiftClickClipRef:f,suppressClickRef:h,scrollRef:m,setShowPopover:y,setRangeSelection:d,setResizingClip:v,setDraggedClip:b,setSelectedElementId:w,onSelectElement:O}=i;return{onResizeStart:(N,I)=>{var _;DLe(N,I,r,a)&&(I.stopPropagation(),u.current=null,y(!1),d(null),v({pointerId:I.pointerId,element:t,edge:N,originClientX:I.clientX,originScrollLeft:((_=m.current)==null?void 0:_.scrollLeft)??0,previewStart:t.start,previewDuration:t.duration,previewPlaybackStart:t.playbackStart,started:!1}))},onPointerDown:N=>{var j,L;const I=_Le(N,r,a,o);if(I.kind==="ignore")return;if(I.kind==="arm-shift-click"){f.current={element:t,anchorX:N.clientX,anchorY:N.clientY};return}if(I.kind==="block"){u.current={pointerId:N.pointerId,element:t,intent:I.intent,originClientX:N.clientX,originClientY:N.clientY,started:!1};return}const{rect:_}=I;u.current=null,y(!1),d(null),b({pointerId:N.pointerId,element:t,originClientX:N.clientX,originClientY:N.clientY,originScrollLeft:((j=m.current)==null?void 0:j.scrollLeft)??0,originScrollTop:((L=m.current)==null?void 0:L.scrollTop)??0,pointerClientX:N.clientX,pointerClientY:N.clientY,pointerOffsetX:N.clientX-_.left,pointerOffsetY:N.clientY-_.top,previewStart:t.start,previewTrack:t.track,desiredTrack:t.track,insertRow:null,snapTime:null,snapType:null,started:!1})},onClick:N=>{if(N.stopPropagation(),h.current)return;const{activeTool:I}=fe.getState();if(I==="razor"&&l){const _=N.currentTarget.getBoundingClientRect(),j=N.clientX-_.left,L=n.start+j/s,B=Math.max(n.start+tC,Math.min(n.start+n.duration-tC,L));N.shiftKey&&c?c(B):l(t,B);return}w(e),O==null||O(t)}}}function jLe(t,e,n){return n?{priority:"interaction",rich:!0}:{priority:t.start<e.end&&t.start+t.duration>e.start?"visible":"overscan",rich:!1}}function LLe({element:t}){const e=fe(n=>n.lintFindingsByElement.get(t.key??t.id));return!e||e.count===0?null:p.jsx("span",{className:"absolute w-1.5 h-1.5 rounded-full bg-amber-400",style:{top:7,right:7},title:e.messages.join(`
|
|
204
|
-
`)})}function She(t,e,n,r,i={priority:"visible",rich:!1}){return p.jsxs(p.Fragment,{children:[r==null?void 0:r(t),!n&&p.jsx(LLe,{element:t}),n&&p.jsx("div",{className:"absolute inset-0 overflow-hidden",style:{borderRadius:"inherit"},children:n(t,e,i)})]})}function whe(t,e){return Number.isFinite(e)&&!t.hidden&&Number.isFinite(t.start)&&Number.isFinite(t.end)&&e>=t.start&&e<=t.end}function Ohe(t,e){return whe({start:t.start,end:t.start+Math.max(0,t.duration),hidden:t.hidden===!0},e)}function HX(t){if(t===void 0||t.trim()==="")return null;const e=Number(t);return Number.isFinite(e)?e:null}function FLe(t){if(!(t instanceof HTMLElement))return null;const e=t.dataset.elId,n=HX(t.dataset.clipStart),r=HX(t.dataset.clipEnd);return!e||n===null||r===null?null:{id:e,start:n,end:r,hidden:t.dataset.clipHidden==="true",element:t}}function $Le(t){return[...t.querySelectorAll('[data-clip="true"]')].map(FLe).filter(e=>e!==null)}function BLe(t,e){return new Set(t.filter(n=>whe(n,e)).map(n=>n.id))}function QX(t,e,n,r=!1){const i=BLe(t,n);for(const s of t){const a=i.has(s.id);(r||e.has(s.id)!==a)&&s.element.toggleAttribute("data-active",a)}e.clear();for(const s of i)e.add(s)}function VLe({scrollRef:t,currentTime:e,clipStateVersion:n,elementStateVersion:r}){const i=x.useRef([]),s=x.useRef(new Set),a=x.useCallback(o=>{const l=t.current;if(!l){i.current=[],s.current.clear();return}i.current=$Le(l),QX(i.current,s.current,o,!0)},[t]);x.useLayoutEffect(()=>{a(e)},[n,e,r,a]),wr(()=>ya.subscribe(o=>{QX(i.current,s.current,o)}))}const HLe=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function QLe(t){return HLe.has(t)}function Y1(t){return t.key??t.id}function zLe(t,e){return[...e].sort((n,r)=>n.start-r.start||n.start+n.duration-(r.start+r.duration)||Y1(n).localeCompare(Y1(r))).map(n=>{const r=Y1(n);return{id:cS(r),kind:"clip",rowId:t,elementId:r,time:n.start+n.duration/2}})}function ZLe(t,e,n,r,i){const s=GL(t,e,n,r),a=s?Y1(s):null,o=s?CL(i.get(Y1(s))??[],s.start,s.duration):[];return{activeClip:s,activeId:a,lanes:o}}function GLe(t){return{percentage:t.percentage,tweenPercentage:t.tweenPercentage,propertyGroup:t.propertyGroup,animationId:t.animationId,collidingAnimationTargets:t.collidingAnimationTargets}}function ULe(t,e,n){var o;const r=Y1(e),i=new Map;for(const l of n){const c=GLe(l),u=Sf(r,c);i.has(u)||i.set(u,{target:c,time:e.start+l.percentage/100*e.duration})}const s=[...i.entries()].sort(([l,c],[u,f])=>c.time-f.time||l.localeCompare(u)),a=[];for(let l=0;l<s.length;l+=1){const[,c]=s[l],u=(o=s[l-1])==null?void 0:o[1];u&&c.time>u.time&&c.target.animationId!==void 0&&a.push({id:Qae(r,c.target),kind:"ease",rowId:t,elementId:r,time:u.time+(c.time-u.time)/2,keyframeTarget:c.target}),a.push({id:Hae(r,c.target),kind:"keyframe",rowId:t,elementId:r,time:c.time,keyframeTarget:c.target})}return a}function XLe(t,e,n){return t===null?!1:e.has(t)||n.has(t)}function WLe(t,e,n,r,i,s,a){const o=W2(n,i.group);return{id:o,kind:"row",physicalTrackKey:t,logicalIndex:e,level:s,parentId:a,elementId:n,expandable:!1,expanded:!1,propertyGroup:i.group,items:ULe(o,r,i.keyframes)}}function qLe({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}){const f=new Map(t),h=new Map(l.map(v=>[v.anchorKey,v])),m=[];function y(v,b,w){const O=f.get(v)??[],k=$5e(v),{activeClip:E,activeId:M,lanes:N}=ZLe(O,n,r,i,u),I=eFe(O,N.length),_=XLe(M,s,o)&&I;if(m.push({id:k,kind:"row",physicalTrackKey:v,logicalIndex:m.length,level:b,parentId:w,elementId:M,expandable:I,expanded:_,items:zLe(k,O)}),!(!_||!E||!M))for(const j of N)m.push(WLe(v,m.length,M,E,j,b===1?2:3,k))}function d(v){const b=B5e(v.id),w=!a.has(v.id);if(m.push({id:b,kind:"row",physicalTrackKey:v.anchorKey,logicalIndex:m.length,level:1,parentId:null,elementId:null,groupId:v.id,expandable:v.memberTracks.length>0,expanded:w,items:[]}),o.has(v.id))for(const O of Vf(v.memberElements))m.push({id:`${b}::${O.key}`,kind:"row",physicalTrackKey:v.anchorKey,logicalIndex:m.length,level:2,parentId:b,elementId:null,expandable:!1,expanded:!1,items:[]});if(w)for(const O of v.memberTracks)y(O,2,b)}for(const v of e){const b=h.get(v);if(b){d(b);continue}c.has(v)||y(v,1,null)}return m}function Cl(t,e){for(let n=0;n<t.length;n+=1){const r=t[n];if(r.id===e)return{row:r,rowIndex:n,itemIndex:-1,target:r};const i=r.items.findIndex(s=>s.id===e);if(i>=0)return{row:r,rowIndex:n,itemIndex:i,target:r.items[i]}}return null}function YLe(t,e){return[...t.items].sort((n,r)=>Math.abs(n.time-e)-Math.abs(r.time-e)||n.time-r.time||n.id.localeCompare(r.id))[0]??t}function KLe(t,e,n,r={}){var d;const i=Cl(t,e);if(!i)return null;const{row:s,rowIndex:a,itemIndex:o,target:l}=i;if(n==="Home"||n==="End"){const v=r.timelineBoundary?n==="Home"?t[0]:t.at(-1):s;return v?r.timelineBoundary||n==="Home"?v:v.items.at(-1)??v:l}if(n==="ArrowLeft")return o<0?s.parentId?((d=Cl(t,s.parentId))==null?void 0:d.target)??s:s:o===0?s:s.items[o-1];if(n==="ArrowRight")return o<0?s.items[0]??s:s.items[o+1]??l;const c=n==="ArrowUp"||n==="PageUp"?-1:1,u=n==="PageUp"||n==="PageDown",f=r.pageSize;if(u&&(f===void 0||!Number.isFinite(f)||f<1))return l;const h=u?Math.floor(f):1,m=Math.max(0,Math.min(t.length-1,a+c*h)),y=t[m];return!y||m===a?l:l.kind==="row"?y:YLe(y,l.time)}function JLe(t,e,n){const r=Cl(e,n);if(r)return r.target;const i=Cl(t,n);if(!i)return null;if(i.itemIndex>=0){for(let a=i.itemIndex-1;a>=0;a-=1){const o=Cl(e,i.row.items[a].id);if(o)return o.target}for(let a=i.itemIndex+1;a<i.row.items.length;a+=1){const o=Cl(e,i.row.items[a].id);if(o)return o.target}}const s=Cl(e,i.row.id);if(s)return s.target;if(i.row.parentId){const a=Cl(e,i.row.parentId);if(a)return a.target}return e[i.rowIndex]??e[i.rowIndex-1]??null}function eFe(t,e){return e>0||Vf(t).length>0}function zX(t){if(!(t.target instanceof Element))return null;const e=t.target.closest("button, input, select, textarea, a[href], [contenteditable], [data-timeline-focus-id]");return e!=null&&e.dataset.timelineFocusId&&t.currentTarget.contains(e)?e:null}function tFe(t,e,n,r){if(!r||t.size===0)return 1;const i=n.getRowIndex(e),s=Math.max(0,i>=0?i:Math.floor(n.getRowFromY(r.scrollTop))),a=i>=0?n.getRowTop(i):r.scrollTop,o=Math.min(n.rowKeys.length-1,Math.floor(n.getRowFromY(a+Math.max(0,r.clientHeight-.001))));let l=0;for(let c=s;c<=o;c+=1)l+=t.get(n.rowKeys[c])??0;return Math.max(1,l)}function nFe(t){const e=t.getBoundingClientRect();t.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.left+e.width/2,clientY:e.top+e.height/2}))}function rFe({logicalRows:t,focusedTargetId:e,rowGeometry:n,scrollRef:r,onToggleRow:i}){var c,u;const s=(e&&((c=Cl(t,e))==null?void 0:c.target.id))??((u=t[0])==null?void 0:u.id)??null,a=x.useMemo(()=>{const f=new Map;for(const h of t)f.set(h.physicalTrackKey,(f.get(h.physicalTrackKey)??0)+1);return f},[t]),o=x.useCallback(f=>{var m;const h=(m=zX(f))==null?void 0:m.dataset.timelineFocusId;h&&h!==e&&fe.getState().requestTimelineFocus(h)},[e]),l=x.useCallback(f=>{const h=zX(f),m=h==null?void 0:h.dataset.timelineFocusId;if(!h||!m)return;const y=Cl(t,m);if(y){if(QLe(f.key)){if(y.target.kind==="row"&&(f.key==="ArrowRight"&&y.target.expandable&&!y.target.expanded||f.key==="ArrowLeft"&&y.target.expandable&&y.target.expanded)){f.preventDefault(),i(y.target);return}const d=KLe(t,m,f.key,{pageSize:tFe(a,y.row.physicalTrackKey,n,r.current),timelineBoundary:f.ctrlKey||f.metaKey});f.preventDefault(),d&&d.id!==m&&fe.getState().requestTimelineFocus(d.id);return}if(f.key==="ContextMenu"||f.key==="F10"&&f.shiftKey){f.preventDefault(),nFe(h);return}f.key!=="Enter"&&f.key!==" "||y.target.kind!=="row"||!y.target.expandable||(f.preventDefault(),i(y.target))}},[a,t,i,n,r]);return{rovingTargetId:s,onFocus:o,onKeyDown:l}}function iFe({pps:t,contentOrigin:e,contentGutter:n,trackContentWidth:r,theme:i,displayTrackOrder:s,rowGeometry:a,virtualRows:o,logicalRows:l,focusedTargetId:c,rowsVirtualized:u,clipIndex:f,renderTimeRange:h,visibleTimeRange:m,pinnedClipIdentities:y,trackOrder:d,tracks:v,trackStyles:b,groups:w,laneCounts:O,selectedElementId:k,selectedElementIds:E,hoveredClip:M,draggedClip:N,draggedElement:I,multiDragPreview:_,blockedClipRef:j,suppressClickRef:L,scrollRef:B,renderClipContent:$,renderClipOverlay:Q,onDrillDown:Y,onSelectElement:W,setHoveredClip:J,setShowPopover:ne,setRangeSelection:le,setResizingClip:ie,setDraggedClip:q,setSelectedElementId:F,shiftClickClipRef:U,getPreviewElement:Z,getTrackStyle:K,keyframeCache:ee,gsapAnimations:re,selectedKeyframes:z,currentTime:H,onSeek:se,onSelectSegment:ue,onClickKeyframe:be,onShiftClickKeyframe:me,onContextMenuKeyframe:pe,onMoveKeyframe:ge,onContextMenuClip:Pe,onContextMenuLane:ve,beatAnalysis:xe,onToggleTrackHidden:we,onTogglePropertyGroupKeyframe:Ce,onResizeElement:Me,onMoveElement:Ve,onRazorSplit:tt,onRazorSplitAll:Ze}){const qe=`timeline-lanes${x.useId().replaceAll(":","")}`,pt=fe(Ye=>Ye.expandedClipIds),{collapsedGroupIds:it,expandedLaneOwnerIds:vt,toggleGroupExpanded:Ot,toggleLaneOwnerExpanded:Kt}=d7e(),qt=AIe(),fn=fe(Ye=>Ye.duration);_Ie({lanes:qt});const{logicalRowsByTrack:Jt,groupByAnchor:Je}=p7e(l,w),St=x.useMemo(()=>new Set(w.flatMap(Ye=>Ye.memberTracks)),[w]),{toggleRowExpanded:At,toggleClipExpanded:Ke}=m7e(),Be=R7e(_,u,h),We=rFe({logicalRows:l,focusedTargetId:c,rowGeometry:a,scrollRef:B,onToggleRow:Ye=>{Ye.elementId&&Ke(Ye.elementId)}});return p.jsx("div",{role:"treegrid","aria-label":"Timeline tracks","aria-rowcount":l.length,"aria-colcount":2,onFocus:We.onFocus,onKeyDown:We.onKeyDown,className:u?"absolute inset-0":void 0,children:o.map(({index:Ye,rowKey:Zt})=>{var tr,gt,nr,On,_n;const Te=s[Ye];if(Te===void 0)return null;const De=Je.get(Te);if(De){const xt=(tr=Jt.get(Te))==null?void 0:tr[0];return xt?p.jsx(h7e,{index:Ye,rowKey:Zt,group:De,logicalRow:xt,top:a.getRowTop(Ye),height:a.getRowHeight(Ye),virtualized:u,contentOrigin:e,theme:i,rovingTargetId:We.rovingTargetId,collapsedGroupIds:it,expandedLaneOwnerIds:vt,toggleGroupExpanded:Ot,toggleLaneOwnerExpanded:Kt,lanes:qt,pps:t,currentTime:H,compositionDuration:fn,beatTimes:xe==null?void 0:xe.beatTimes,contentGutter:n,trackContentWidth:r},Zt):null}const ze=ufe(s,Te),st=Jt.get(Te)??[],Gt=st[0];if(!Gt)return null;const ln=a.getRowHeight(Ye),Yt=((gt=v.find(([xt])=>xt===Te))==null?void 0:gt[1])??[],Mn=u?kae(f,Te,h,y,Be):Yt,Pr=b.get(Te)??K(""),mt=(N==null?void 0:N.started)===!0&&!d.includes(Te)&&Yt.length===0,vn=i.rowBackground,mn=S7e(Yt,xe==null?void 0:xe.beatTimes,{selectedElementId:k,isMusicTrack:fy}),En=Yt.length>0&&Yt.every(xt=>xt.hidden===!0),jn=Yt.length>0&&Yt.some(Ko),et=GL(Yt,O,k,E),qn=(et==null?void 0:et.key)??(et==null?void 0:et.id),Mt=C7e(Yt,pt),hn=Mt?Ui-2*fa:void 0,Ht=Yt.map(Z),dn=`${qe}-track-${Ye}`,er=`${dn}-automation`,In=et&&qn?qt.bind(et,k===qn||E.has(qn)):null,yr=In&&!In.readOnly?xt=>In.onCommit({version:1,lanes:In.lanes.filter(Ut=>Ut.target!==xt)}):void 0;return p.jsxs(Sfe,{index:Ye,rowKey:Zt,logicalRow:Gt,propertyRows:st.slice(1),lanesId:dn,headerLanesId:`${dn} ${er}`,top:a.getRowTop(Ye),height:ln,virtualized:u,background:vn,borderColor:i.rowBorder,rovingTargetId:We.rovingTargetId,children:[p.jsx(o7e,{trackNumber:Te,trackDisplayNumber:ze,trackLabel:((nr=Yt[0])==null?void 0:nr.label)??((On=Yt[0])==null?void 0:On.domId)??((_n=Yt[0])==null?void 0:_n.id)??`Track${UE(ze)}`,lanesId:`${dn} ${er}`,contentOrigin:e,keyframeClip:et,trackElements:Yt,clipCount:Yt.length,isExpanded:Mt,animations:qn?re.get(qn)??[]:[],currentTime:H,isTrackHidden:En,isAudioTrack:jn,isGroupMember:St.has(Te),theme:i,onToggleClipExpanded:()=>{const xt=Yt.map(zn);xt.length>0&&At(xt)},onToggleTrackHidden:we,onTogglePropertyGroupKeyframe:Ce,onRemoveAutomationLane:yr,onSeek:se,rovingTargetId:We.rovingTargetId}),p.jsxs("div",{role:"gridcell","aria-colindex":2,style:{width:r,marginLeft:n,opacity:En?.35:1,transition:"opacity 120ms ease"},className:"relative",onContextMenu:xt=>{if(xt.defaultPrevented||!ve)return;const Ut=xt.currentTarget.getBoundingClientRect(),Ct=(xt.clientX-Ut.left)/t;Ct<0||(xt.preventDefault(),ve(xt,Te,Ct))},children:[p.jsx(j5e,{beatTimes:xe==null?void 0:xe.beatTimes,beatStrengths:xe==null?void 0:xe.beatStrengths,pps:t,highlightTime:N!=null&&N.started&&N.snapType==="beat"?N.snapTime:null,renderTimeRange:u?h:void 0}),mn&&p.jsx(L5e,{beatTimes:xe==null?void 0:xe.beatTimes,beatStrengths:xe==null?void 0:xe.beatStrengths,pps:t,renderTimeRange:u?h:void 0}),mt&&p.jsx("div",{className:"absolute inset-0 flex items-center",style:{paddingLeft:16,color:Pr.label,fontSize:11,letterSpacing:"0.06em",textTransform:"uppercase",opacity:.5},children:"New track"}),Mn.map(xt=>{const Ut=K(xt.tag),Ct=zn(xt),ur=Ct===qn,Dt=ur&&Mt,wt=sS(xt),gn=k===Ct||E.has(Ct),Lt=!!xt.compositionSrc,rn=Ct;if((N==null?void 0:N.started)===!0&&I!=null&&zn(I)===Ct)return null;const Ln=Z(xt),ni=jLe(Ln,m,gn||M===rn||y.has(rn)),cn=_!=null&&kfe(rn,_),Cn=cn?I7e(rn,t,_):0,rr=RLe(xt,Ct,Ln,wt,{pps:t,onResizeElement:Me,onMoveElement:Ve,onRazorSplit:tt,onRazorSplitAll:Ze,blockedClipRef:j,shiftClickClipRef:U,suppressClickRef:L,scrollRef:B,setShowPopover:ne,setRangeSelection:le,setResizingClip:ie,setDraggedClip:q,setSelectedElementId:F,onSelectElement:W}),Ti=p.jsx(zae,{onContextMenu:Mr=>{Mr.preventDefault(),Pe==null||Pe(Mr,xt)},el:Ln,pps:t,clipY:fa,clipHeight:hn,isSelected:gn,isHovered:M===rn,isDragging:!1,isActive:Ohe(Ln,H),hasCustomContent:!!$,capabilities:wt,theme:i,isComposition:Lt,tabIndex:We.rovingTargetId===cS(Ct)?0:-1,onHoverStart:()=>J(rn),onHoverEnd:()=>J(null),onResizeStart:rr.onResizeStart,onPointerDown:rr.onPointerDown,onClick:rr.onClick,onDoubleClick:Mr=>{Mr.stopPropagation(),!L.current&&Lt&&Y&&Y(xt)},children:She(Ln,Ut,$,Q,ni)},rn),Kr=ee==null?void 0:ee.get(Ct),Bi=!Dt&&Kr&&p.jsx(ZTe,{element:Ln,elementId:Ct,keyframesData:Kr,pixelsPerSecond:t,rowHeight:ln,beatsActive:mn,accentColor:Ut.accent,isSelected:gn,currentTime:H,selectedKeyframes:z,rovingTargetId:We.rovingTargetId,onClickKeyframe:be,onShiftClickKeyframe:me,onContextMenuKeyframe:pe,onMoveKeyframe:ge,onSelectSegment:ue,suppressClickRef:L},`${rn}-diamonds`),hs=ur&&p.jsx(yDe,{id:dn,animations:Dt?re.get(Ct)??[]:[],clipStart:pce(Ln),clipDuration:Ln.duration,clipLeftPx:Ln.start*t,clipWidthPx:Math.max(Ln.duration*t,4),accentColor:Ut.accent,isSelected:gn,currentPercentage:Ln.duration>0?(H-Ln.start)/Ln.duration*100:0,elementId:Ct,selectedKeyframes:z,rovingTargetId:We.rovingTargetId,onSelectSegment:Mr=>ue==null?void 0:ue(Ct,Mr),onClickKeyframe:Mr=>be==null?void 0:be(Ln,Mr),onShiftClickKeyframe:Mr=>me==null?void 0:me(Ct,Mr),onContextMenuKeyframe:(Mr,Ha)=>pe==null?void 0:pe(Mr,Ct,Ha),onMoveKeyframe:(Mr,Ha)=>(ge==null?void 0:ge(Ct,Mr,Ha))??Promise.resolve(!1),suppressClickRef:L},`${rn}-property-lanes`);return cn?p.jsxs("div",{className:"absolute inset-0",style:{transform:`translateX(${Cn}px)`,opacity:.85,zIndex:20,pointerEvents:"none"},children:[Ti,Bi,hs]},rn):p.jsxs(x.Fragment,{children:[Ti,Bi,hs]},rn)}),p.jsx("div",{id:er,children:Mt?p.jsx(Mce,{elements:Ht,isSelected:xt=>{const Ut=zn(xt);return k===Ut||E.has(Ut)},lanes:qt,pps:t,laneCount:qn?O.get(qn)??0:0,accentColor:K((et==null?void 0:et.tag)??"").accent,currentTime:H,beatTimes:xe==null?void 0:xe.beatTimes}):null})]})]},Zt)})})}const Che=8,nC={playhead:0,"clip-edge":1,beat:2};function sFe(t){const e=new Map,n=(r,i)=>{if(!Number.isFinite(r)||r<0)return;const s=Math.round(r*1e3)/1e3,a=e.get(s);(!a||nC[i]<nC[a.type])&&e.set(s,{time:s,type:i})};for(const r of t.beatTimes)n(r,"beat");for(const r of t.elements)t.excludeElementKey!=null&&(r.key??r.id)===t.excludeElementKey||(n(r.start,"clip-edge"),n(r.start+r.duration,"clip-edge"));return t.playheadTime!=null&&n(t.playheadTime,"playhead"),Array.from(e.values()).sort((r,i)=>r.time-i.time)}function rC(t,e,n){let r=null,i=n;for(const s of e){const a=Math.abs(s.time-t);(a<i||a===i&&r&&nC[s.type]<nC[r.type])&&(i=a,r=s)}return r?{time:r.time,target:r}:{time:t,target:null}}function aFe(t,e,n,r,i){if(n.length===0)return{start:t,snapTime:null,snapType:null};const s=Che/Math.max(r,1),a=rC(t,n,s),o=rC(t+e,n,s),l=a.target!==null,c=o.target!==null;let u=t,f=null;l&&(!c||Math.abs(a.time-t)<=Math.abs(o.time-(t+e)))?(u=a.time,f=a.target):c&&(u=o.time-e,f=o.target);const h=Math.max(0,i-e),m=Math.round(u*1e3)/1e3,y=Math.max(0,Math.min(h,m));return f&&Math.abs(y-m)>1e-6&&(f=null),{start:y,snapTime:(f==null?void 0:f.time)??null,snapType:(f==null?void 0:f.type)??null}}function oFe(t,e,n,r){if(n<0)return t;const i=e.indexOf(t);return i<0?t:r?i>=n?t:e[n]??t:i<n?t:e[n-1]??t}function ZX(t,e,n){return e<0?!0:n?t>=e:t<=e}function lFe(t,e,n,r){if(e.length===0)return n<0?0:n;const i=t.indexOf(e[0]),s=t.indexOf(e[e.length-1])+1;return r<Math.min(...e)?i:s}function cFe(t){var b;const{order:e,audioTracks:n,elements:r,desiredTrack:i,deliberateInsertRow:s}=t,{start:a,duration:o,dragKey:l,isAudio:c,preferInsertAbove:u}=t,f=e.findIndex(w=>n.has(w));if(s!==null&&ZX(s,f,c))return{track:i,insertRow:s};const h=oFe(i,e,f,c),m=e.filter(w=>n.has(w)===c),y=fFe({elements:r,desiredTrack:h,start:a,duration:o,trackOrder:m,excludeKey:l}),d=(b=r.find(w=>(w.key??w.id)===l))==null?void 0:b.track,v=d!=null&&h!==d&&y.track===d;if(y.needsInsert||v){const w=e.indexOf(h);if(w<0)return{track:h,insertRow:lFe(e,m,f,h)};const O=d==null?-1:e.indexOf(d),E=(v?O>w:u&&ZX(w,f,c))?w:w+1;return{track:h,insertRow:E}}return{track:y.track,insertRow:null}}function uFe(t,e,n=s3e){if(e===0||t<=0)return 0;if(t>=e)return e;const r=Math.floor(t),i=t-r;return i<n?r:i>1-n?r+1:null}function khe(t,e,n,r){return t<r&&n<e}function M4(t,e,n,r,i){return!t.some(s=>(s.key??s.id)!==i&&s.track===e&&khe(n,r,s.start,s.start+s.duration))}function fFe({elements:t,desiredTrack:e,start:n,duration:r,trackOrder:i,excludeKey:s}){const a=n+r,o=i.indexOf(e);if(o===-1)return{track:e,needsInsert:!0};if(M4(t,e,n,a,s))return{track:e,needsInsert:!1};for(let l=o-1;l>=0;l--)if(M4(t,i[l],n,a,s))return{track:i[l],needsInsert:!1};for(let l=o+1;l<i.length;l++)if(M4(t,i[l],n,a,s))return{track:i[l],needsInsert:!1};return{track:e,needsInsert:!0}}function hFe(t,e){if(!t.started||!e)return null;const n=e.getBoundingClientRect();return{left:t.pointerClientX-n.left+e.scrollLeft-t.pointerOffsetX,top:t.pointerClientY-n.top+e.scrollTop-t.pointerOffsetY}}function dFe(t,e,n){return Math.max(n,t&&e>0?t.scrollWidth/e:n)}function pFe(t,e,n,r,i){if(i.size<=1||!i.has(n))return t;const s=r.filter(o=>i.has(o.key??o.id)).map(o=>o.start),a=_7e(t-e.start,s);return e.start+a}function mFe(t,e,n,r,i){const{scroll:s,trackOrder:a,rowHeights:o,elements:l}=i,c=s?c3e(e-s.getBoundingClientRect().top+s.scrollTop,o):{rowFloat:0,fraction:0,rowHeight:yae(0,o)},u=uFe(c.rowFloat,a.length,u3e(c.rowHeight)),f=c.fraction<.5,h=i.audioTracks??new Set(l.filter(Ko).map(m=>m.track));return cFe({order:a,audioTracks:h,elements:l,desiredTrack:r,deliberateInsertRow:u,start:n,duration:t.element.duration,dragKey:t.element.key??t.element.id,isAudio:Ko(t.element),preferInsertAbove:f})}function gFe(t,e,n,r){const{scroll:i,pps:s,duration:a,trackOrder:o,elements:l,selectedKeys:c,buildSnapTargets:u}=r,f=dFe(i,s,a),h=(i==null?void 0:i.scrollTop)??t.originScrollTop,m=(i==null?void 0:i.getBoundingClientRect().top)??0,y=KI(t.originClientY-m+t.originScrollTop,r.rowHeights),d=KI(n-m+h,r.rowHeights),v=D3e({start:t.element.start,track:t.element.track,duration:t.element.duration,originClientX:t.originClientX,originRow:y,originScrollLeft:t.originScrollLeft,currentScrollLeft:(i==null?void 0:i.scrollLeft)??t.originScrollLeft,pixelsPerSecond:s,maxStart:f,trackOrder:o},e,d),b=u(t.element.key??t.element.id,!fy(t.element)),w=aFe(v.start,t.element.duration,b,s,f+t.element.duration),O=t.element.key??t.element.id,k=pFe(w.start,t.element,O,l,c),{track:E,insertRow:M}=mFe(t,n,k,v.track,r);return{...t,started:!0,pointerClientX:e,pointerClientY:n,previewStart:k,previewTrack:E,desiredTrack:v.track,insertRow:M,snapTime:w.snapTime,snapType:w.snapType}}function yFe(t,e,n){const{scroll:r,pps:i,buildSnapTargets:s}=n,a=t.originScrollLeft??(r==null?void 0:r.scrollLeft)??0,o=e+(((r==null?void 0:r.scrollLeft)??a)-a),l=t.element.sourceDuration!=null?Math.max(0,(t.element.sourceDuration-(t.element.playbackStart??0))/Math.max(t.element.playbackRate??1,.1)):Number.POSITIVE_INFINITY,c=t.element.tag.toLowerCase(),u=t.element.kind==="composition"||c==="audio"||c==="video",f=Math.max(t.element.playbackRate??1,.1),h=t.element.start+l;let m=I3e({start:t.element.start,duration:t.element.duration,originClientX:t.originClientX,pixelsPerSecond:i,minStart:0,maxEnd:h,playbackStart:t.edge==="start"&&u?t.element.playbackStart??0:t.element.playbackStart,playbackRate:t.element.playbackRate},t.edge,o);const y=s(t.element.key??t.element.id,!fy(t.element));if(y.length>0){const d=Che/Math.max(i,1);if(t.edge==="end"){const v=m.start+m.duration,b=rC(v,y,d).time,w=Math.round((b-m.start)*1e3)/1e3;b!==v&&b<=h+1e-6&&w>=.05&&(m={...m,duration:w})}else{const v=rC(m.start,y,d).time,b=m.start-v,w=m.playbackStart!=null?m.playbackStart/f:Number.POSITIVE_INFINITY,O=Math.round((m.duration+b)*1e3)/1e3;v!==m.start&&v>=0&&b<=w+1e-6&&O>=.05&&(m={...m,start:v,duration:O,playbackStart:m.playbackStart!=null?Math.round(Math.max(0,m.playbackStart-b*f)*1e3)/1e3:void 0})}}return{originScrollLeft:a,previewStart:m.start,previewDuration:m.duration,previewPlaybackStart:m.playbackStart}}function xFe(t,e,n){const r=N3e(t,e);n({originScrollLeft:e.originScrollLeft,previewStart:(r==null?void 0:r.start)??e.previewStart,previewDuration:(r==null?void 0:r.duration)??e.previewDuration,previewPlaybackStart:(r==null?void 0:r.playbackStart)??e.previewPlaybackStart,groupPreview:t.changes})}const bFe=x.memo(function({drag:e,scrollRef:n,pixelsPerSecond:r,rowHeight:i,selectedElementId:s,currentTime:a,theme:o,getTrackStyle:l,renderClipContent:c,renderClipOverlay:u}){const f=(e==null?void 0:e.started)===!0?HEe({element:e.element,draggedElementId:e.element.key??e.element.id,previewStart:e.previewStart,previewTrack:e.previewTrack}):null,h=e?hFe(e,n.current):null;return p.jsx("div",{"data-timeline-gesture-overlay":!0,className:"absolute inset-0 pointer-events-none",children:f&&h&&p.jsx("div",{"data-timeline-gesture-actor":f.key??f.id,className:"absolute",style:{top:h.top,left:h.left,width:Math.max(f.duration*r,4),height:i,zIndex:40},children:p.jsx(zae,{el:{...f,start:0},pps:r,clipY:0,isSelected:s===(f.key??f.id),isHovered:!1,isDragging:!0,isGestureActor:!0,isActive:Ohe(f,a),hasCustomContent:!!c,capabilities:sS(f),theme:o,isComposition:!!f.compositionSrc,onHoverStart:()=>{},onHoverEnd:()=>{},onResizeStart:()=>{},onClick:()=>{},onDoubleClick:()=>{},children:She(f,l(f.tag),c,u,{priority:"interaction",rich:!0})})})})}),vFe=x.memo(function(e){const{draggedClip:n,scrollRef:r,selectedElementIds:i,displayTrackOrder:s}=e,a=(n==null?void 0:n.started)===!0?s.indexOf(n.previewTrack):-1,o=yae(a,e.rowHeights),l=Math.min(o,Ui)-fa*2,{onResizeElement:c,onMoveElement:u,onToggleTrackHidden:f,onTogglePropertyGroupKeyframe:h,onRazorSplit:m,onRazorSplitAll:y}=lS(),d=fe(O=>O.beatDragging),v=(n==null?void 0:n.element)??null,b=v?zn(v):null,w=(n==null?void 0:n.started)===!0&&v&&b?{dragStarted:!0,draggedKey:b,draggedOriginStart:v.start,draggedPreviewStart:n.previewStart,selectedKeys:i}:null;return p.jsxs("div",{className:"relative",style:{height:e.totalH,width:e.contentOrigin+e.trackContentWidth},children:[p.jsx(C5e,{major:e.major,minor:e.minor,pps:e.pps,trackContentWidth:e.trackContentWidth,totalH:e.totalH,effectiveDuration:e.effectiveDuration,majorTickInterval:e.majorTickInterval,theme:e.theme,beatAnalysis:e.beatAnalysis,contentOrigin:e.contentOrigin,renderTimeRange:e.rowsVirtualized?e.renderTimeRange:void 0}),p.jsx("div",{"aria-hidden":"true",style:{height:e.rowsVirtualized?0:e0}}),p.jsx(iFe,{...e,draggedElement:v,multiDragPreview:w,onToggleTrackHidden:f,onTogglePropertyGroupKeyframe:h,onResizeElement:c,onMoveElement:u,onRazorSplit:m,onRazorSplitAll:y}),p.jsx("div",{"aria-hidden":"true",style:{height:e.rowsVirtualized?0:gae}}),e.laneGapStrips.map(O=>{const k=s.indexOf(O.track);if(k<0)return null;const E=O.kind==="hover";return(e.rowsVirtualized?O.intervals.filter(N=>N.start<e.renderTimeRange.end&&N.end>e.renderTimeRange.start):O.intervals).map(N=>p.jsx("div",{className:"pointer-events-none absolute",style:{top:FP(k,e.rowHeights)+fa,left:e.contentOrigin+N.start*e.pps,width:Math.max((N.end-N.start)*e.pps,2),height:Ui-fa*2,background:E?"rgba(60,230,172,0.18)":"rgba(60,230,172,0.055)",borderRadius:4,zIndex:25}},`gap-${O.kind}-${O.track}-${N.start}`))}),(n==null?void 0:n.started)&&n.insertRow==null&&a>=0&&p.jsx("div",{className:"absolute pointer-events-none",style:{top:FP(a,e.rowHeights)+fa,left:e.contentOrigin+n.previewStart*e.pps,width:Math.max(n.element.duration*e.pps,4),height:l,border:"1px solid rgba(60,230,172,0.55)",background:"rgba(60,230,172,0.12)",borderRadius:4,zIndex:30}}),(n==null?void 0:n.started)&&n.insertRow!=null&&p.jsx("div",{className:"absolute pointer-events-none",style:{top:FP(n.insertRow,e.rowHeights)-.5,left:e.contentOrigin,width:e.trackContentWidth,height:1,background:"#3CE6AC",boxShadow:"0 0 3px rgba(60,230,172,0.5)",zIndex:55}}),(n==null?void 0:n.started)&&n.snapTime!=null&&n.snapType!=="beat"&&p.jsx("div",{className:"absolute pointer-events-none",style:{left:e.contentOrigin+n.snapTime*e.pps,top:_a,bottom:0,width:1,background:n.snapType==="playhead"?"#3CE6AC":"rgba(255,255,255,0.6)",boxShadow:n.snapType==="playhead"?"0 0 6px rgba(60,230,172,0.5)":"0 0 6px rgba(255,255,255,0.4)",zIndex:60}}),p.jsx(bFe,{drag:n,scrollRef:r,pixelsPerSecond:e.pps,rowHeight:l,selectedElementId:e.selectedElementId,currentTime:e.currentTime,theme:e.theme,getTrackStyle:e.getTrackStyle,renderClipContent:e.renderClipContent,renderClipOverlay:e.renderClipOverlay}),e.marqueeRect&&p.jsx("div",{"aria-hidden":"true",className:"absolute pointer-events-none",style:{left:e.marqueeRect.left,top:e.marqueeRect.top,width:e.marqueeRect.width,height:e.marqueeRect.height,background:"rgba(60,230,172,0.10)",border:"1px dashed rgba(60,230,172,0.7)",borderRadius:2,zIndex:70}}),e.rangeSelection&&p.jsx("div",{className:"absolute pointer-events-none",style:{left:e.contentOrigin+Math.min(e.rangeSelection.start,e.rangeSelection.end)*e.pps,width:Math.abs(e.rangeSelection.end-e.rangeSelection.start)*e.pps,top:_a,bottom:0,backgroundColor:"rgba(59, 130, 246, 0.12)",borderLeft:"1px solid rgba(59, 130, 246, 0.4)",borderRight:"1px solid rgba(59, 130, 246, 0.4)",zIndex:50}}),p.jsx("div",{ref:e.playheadRef,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${JI(0,0,e.contentOrigin)}px`,width:C6,zIndex:100,display:d?"none":void 0},children:p.jsx(k5e,{scrubbing:e.isScrubbing})})]})});function bc(t){return Ko(t)?"audio":"visual"}const iC=t=>t.key??t.id,GX=1e-6;function AFe(t,e){return t.start<e.start+e.duration-GX&&e.start<t.start+t.duration-GX}function SFe(t,e){const n=iC(t),r=iC(e);return n<r?-1:n>r?1:0}function wFe(t,e,n){const r=[...t].sort(SFe),i=[];for(const s of r){let a=i.findIndex(o=>o.every(l=>!AFe(l,s)));a===-1&&(a=i.length,i.push([])),i[a].push(s),n.set(iC(s),e+a)}return Math.max(1,i.length)}function UX(t,e,n){const r=new Map;for(const s of t){const a=r.get(s.track);a?a.push(s):r.set(s.track,[s])}let i=0;for(const s of[...r.keys()].sort((a,o)=>a-o))i+=wFe(r.get(s),e+i,n);return i}function Ehe(t){if(t.length===0)return t;const e=new Map,n=[],r=[];for(const o of t)(bc(o)==="audio"?r:n).push(o);let i=0;i+=UX(n,i,e),UX(r,i,e);let s=!1;const a=t.map(o=>{const l=e.get(iC(o));return l==null||l===o.track?o:(s=!0,{...o,track:l,authoredTrack:o.authoredTrack??o.track})});return s?a:t}const XX=1e-6,sC=t=>JSON.stringify([t.sourceFile??null,t.stackingContextId??null]);function cF(t,e){return sC(t)===sC(e)}function OFe(t,e){return t.start<e.start+e.duration-XX&&e.start<t.start+t.duration-XX}function E_(t,e){return t.track<e.track}function Dg(t,e){return t.zIndex!==e.zIndex?t.zIndex>e.zIndex:t.domIndex!=null&&e.domIndex!=null?t.domIndex>e.domIndex:!1}function T_(t,e){return t.length>0?e(t.map(n=>n.zIndex)):null}function CFe(t,e,n,r){const i=e.filter(h=>!h.isAudio);if(i.length===0)return!1;const s=i.filter(h=>E_(t,h)),a=i.filter(h=>E_(h,t));if(s.every(h=>Dg(t,h))&&a.every(h=>Dg(h,t)))return!1;const l=T_(s,h=>Math.max(...h)),c=TFe(t,s,a);if(c!=null)return c!==t.zIndex&&r(t,c),c!==t.zIndex;const u=l!=null?l+1:0,f=Math.max(0,u);return f!==t.zIndex&&r(t,f),PFe(t,n,r),!0}function kFe(t,e,n){if(e-t>=2){const r=Math.floor((t+e)/2);return r>t&&r<e?r:null}return n(e)?e:null}function EFe(t,e){const n=t-1;return n>=0?n:e(t)?t:null}function TFe(t,e,n){const r=T_(e,a=>Math.max(...a)),i=T_(n,a=>Math.min(...a)),s=a=>{const o={...t,zIndex:a};return e.every(l=>Dg(o,l))&&n.every(l=>Dg(l,o))};return r!=null&&i!=null?kFe(r,i,s):r!=null?r+1:i!=null?EFe(i,s):null}function PFe(t,e,n){const r=[t],i=(s,a)=>{Dg(s,a)||(n(s,a.zIndex+1),r.push(s))};for(;r.length>0;){const s=r.shift();for(const a of e(s))E_(a,s)&&!Dg(a,s)&&i(a,s)}}function MFe(t,e){const n=new Set(e);if(n.size===0)return[];const r=t.filter(y=>Number.isFinite(y.zIndex)),i=new Set(r.filter(y=>n.has(y.key)).map(sC)),s=r.filter(y=>i.has(sC(y))),a=new Map(s.map(y=>[y.key,{...y}])),o=s.filter(y=>n.has(y.key)&&!y.isAudio).map(y=>a.get(y.key)).sort((y,d)=>d.track-y.track),l=new Map,c=(y,d)=>{y.zIndex=d,l.set(y.key,d)},u=[...a.values()],f=y=>u.filter(d=>d.key!==y.key&&!d.isAudio&&cF(y,d)&&OFe(y,d));for(const y of o)CFe(y,f(y),f,c);const h=new Set,m=[];for(const y of o)l.has(y.key)&&!h.has(y.key)&&(m.push({key:y.key,zIndex:l.get(y.key)}),h.add(y.key));for(const[y,d]of l)h.has(y)||(m.push({key:y,zIndex:d}),h.add(y));return m}function ev(t){return sS({tag:t.tag,kind:t.kind,duration:t.duration,domId:t.domId,selector:t.selector,compositionSrc:t.compositionSrc,playbackStart:t.playbackStart,playbackStartAttr:t.playbackStartAttr,sourceDuration:t.sourceDuration,timingSource:t.timingSource,timelineLocked:t.timelineLocked}).canMove}function NFe(t,e){const n=e.selectedKeys;if(!n)return null;const r=new Set(n),i=e.elements.includes(t.element)?e.elements:[...e.elements,t.element];for(const u of i){const f=u.expandedHostKey,h=zn(u);f&&r.has(f)&&r.has(h)&&r.delete(h)}const s=t.element.expandedHostKey,a=zn(t.element);if(!s||r.has(a))return r.size===n.size?null:{drag:t,selectedKeys:r};const o=e.elements.find(u=>zn(u)===s);if(!o||!ev(o))return null;const l=t.previewStart-t.element.start,c=u=>u===t.element.track?o.track:u;return{drag:{...t,element:o,previewStart:Math.max(0,Math.round((o.start+l)*1e3)/1e3),previewTrack:c(t.previewTrack)??o.track,desiredTrack:c(t.desiredTrack)},selectedKeys:r}}const P_=new WeakMap;function JE(t,e){let n=P_.get(t);n||(n=new Map,P_.set(t,n));const r=new Map;for(const i of e){const s=(n.get(i)??0)+1;n.set(i,s),r.set(i,s)}return r}function aC(t,e,n){var r;return((r=P_.get(t))==null?void 0:r.get(n))===e.get(n)}function M_(t,e,n){for(const r of n)aC(t,e,r.key)&&t(r.key,r.updates)}let YO=null;function uF(t){const e=YO;let n;if(e)n=e.then(t,t);else try{n=Promise.resolve(t())}catch(i){n=Promise.reject(i)}const r=n.then(()=>{},()=>{});return YO=r,r.then(()=>{YO===r&&(YO=null)}),n}function The(t){return uF(async()=>{const n=await t.commitZ();return n&&!n.durable?!1:t.mirror()})}function Phe(t){return uF(async()=>await t.commitLane()?(await t.commitZ(),!0):!1)}function Ig(t,e){return t.then(n=>{var r;return n&&((r=e.refreshAfterLaneMove)==null||r.call(e)),n})}const WX=t=>t.key??t.id,fF=(t,e)=>(t.sourceFile??null)===(e.sourceFile??null);function hF(t,e,n){const r=WX(n),i=e.filter(o=>WX(o)!==r&&fF(o,n)),s=i.find(o=>o.track===t);if(s)return s.authoredTrack??s.track;let a=null;for(const o of i)(!a||Math.abs(o.track-t)<Math.abs(a.track-t))&&(a=o);return a?Math.round((a.authoredTrack??a.track)+(t-a.track)):t}const Zr=t=>t.key??t.id,DFe=t=>Math.round(t*1e3)/1e3;let Mhe=0;function md(t,e,n,r="timing",i){if(t.length===0)return Promise.resolve(!0);const{updateElement:s,onMoveElement:a,onMoveElements:o}=e;o||console.warn(a?`[Timeline] persistMoveEdits: only single-clip onMoveElement wired — this ${t.length}-clip move degrades to a per-clip persist race (no atomic single-undo)`:`[Timeline] persistMoveEdits: no move persist handler wired — ${t.length} edit(s) applied to the store only, not saved`);const l=t.map(m=>({key:Zr(m.element),start:m.element.start,track:m.element.track,authoredTrack:m.element.authoredTrack})),c=JE(s,t.map(m=>Zr(m.element))),u=m=>{const y=m.persistTrack??(m.updates.track!==m.element.track?m.updates.track:void 0);s(Zr(m.element),y==null?m.updates:{...m.updates,authoredTrack:y})};for(const m of t)u(m);const f=t.map(m=>m.persistTrack==null||m.persistTrack===m.updates.track?m:{element:m.element,updates:{...m.updates,track:m.persistTrack}}),h=o?o(f,n,r,i):Promise.all(f.map(m=>Promise.resolve(a==null?void 0:a(m.element,m.updates))));return Promise.resolve(h).then(()=>{for(const m of t){const y=Zr(m.element);aC(s,c,y)&&u(m)}return!0},m=>{for(const y of l)aC(s,c,y.key)&&s(y.key,{start:y.start,track:y.track,authoredTrack:y.authoredTrack});return console.error("[Timeline] Failed to persist clip edits",m),!1})}function qX(t,e){return t.length===0?0:e<=0?t[0]-.5:e>=t.length?t[t.length-1]+.5:(t[e-1]+t[e])/2}function IFe(t,e){const{elements:n,selectedKeys:r}=e,i=Zr(t.element);if(!r||r.size<=1||!r.has(i))return null;const s=new Set([...r].filter(l=>{const c=n.find(u=>Zr(u)===l);return c?ev(c):!1})),a=t.previewStart-t.element.start;return{keys:s,movedStart:l=>Zr(l)===i?t.previewStart:Math.max(0,DFe(l.start+a))}}function Nhe(t,e){const n=NFe(t,e);if(n){Nhe(n.drag,{...e,selectedKeys:n.selectedKeys});return}const{elements:r,updateElement:i,onMoveElement:s}=e,a=Zr(t.element),o=t.insertRow!=null,l=t.previewTrack!==t.element.track,c=t.desiredTrack??t.previewTrack,u=o||c!==t.element.track,f=IFe(t,e);if(!o&&!l){if(t.previewStart-t.element.start===0)return;if(f){const E=r.filter(M=>f.keys.has(Zr(M))).map(M=>({element:M,updates:{start:f.movedStart(M),track:M.track}})).filter(M=>M.updates.start!==M.element.start);md(E,e);return}const w={start:t.previewStart,track:t.element.track},O={start:t.element.start,track:t.element.track},k=JE(i,[a]);i(a,w),Promise.resolve(s==null?void 0:s(t.element,w)).catch(E=>{aC(i,k,a)&&i(a,O),console.error("[Timeline] Failed to persist clip edit",E)});return}if(o){_Fe(t,e,f);return}const h={element:t.element,updates:{start:t.previewStart,track:t.previewTrack},persistTrack:hF(t.previewTrack,r,t.element)},m=u?`clip-lane-move:${Mhe++}`:void 0,y=[h];if(f)for(const b of r){if(Zr(b)===a||!f.keys.has(Zr(b)))continue;const w=f.movedStart(b);w!==b.start&&y.push({element:b,updates:{start:w,track:b.track}})}const d=r.map(b=>Zr(b)===a?{...b,start:t.previewStart,track:t.previewTrack}:f!=null&&f.keys.has(Zr(b))?{...b,start:f.movedStart(b)}:b),v=f?f.keys:null;if(!u||!e.readZIndex||!e.onStackingPatches){Ig(md(y,e,m,"lane-reorder"),e);return}Ig(Phe({commitLane:()=>md(y,e,m,"lane-reorder"),commitZ:()=>Ihe(d,a,t.element.track,t.previewTrack,v,e,m)}),e).catch(()=>{})}function Dhe(t,e,n,r,i){const{elements:s,trackOrder:a}=i,o=Zr(t);if(t.expandedParentStart!=null)return null;const l=qX(a,n),c=s.map(w=>Zr(w)===o?{...w,start:e,track:l}:r!=null&&r.keys.has(Zr(w))?{...w,start:r.movedStart(w)}:w),u=bc(t),f=w=>fF(w,t)&&bc(w)===u&&w.expandedParentStart==null,h=[...new Set(s.filter(f).map(w=>w.track))].sort((w,O)=>w-O),m=h.filter(w=>w<l).length,y=qX(h,m),d=Ehe(s.filter(f).map(w=>Zr(w)===o?{...w,start:e,track:y}:r!=null&&r.keys.has(Zr(w))?{...w,start:r.movedStart(w)}:w)),v=new Map(s.map(w=>[Zr(w),w]));for(const w of d){const O=v.get(Zr(w));if(O&&f(O)&&!ev(O)&&w.track!==(O.authoredTrack??O.track))return console.warn(`[Timeline] Track insert refused: locked clip ${Zr(O)} would need renumbering`),null}const b=[];if(r)for(const w of s){const O=Zr(w);O!==o&&r.keys.has(O)&&!f(w)&&ev(w)&&b.push({element:w,updates:{start:r.movedStart(w),track:w.track},persistTrack:w.authoredTrack})}for(const w of d){const O=v.get(Zr(w));if(!O||!ev(O))continue;const k=Zr(w)===o||r!=null&&r.keys.has(Zr(w))?(r==null?void 0:r.movedStart(O))??e:O.start;b.push({element:O,updates:{start:k,track:w.track}})}return{candidate:c,edits:b}}function _Fe(t,e,n){const r=Zr(t.element),i=Dhe(t.element,t.previewStart,t.insertRow,n,e);if(!i)return;const{candidate:s,edits:a}=i;if(a.length===0)return;const o=`clip-lane-move:${Mhe++}`;if(!e.readZIndex||!e.onStackingPatches){Ig(md(a,e,o,"track-insert"),e);return}Ig(Phe({commitLane:()=>md(a,e,o,"track-insert"),commitZ:()=>Ihe(s,r,t.element.track,t.insertRow,n?n.keys:null,e,o)}),e).catch(()=>{})}function RFe(t,e,n,r,i){if(e.kind==="move"){const a={element:t,updates:{start:t.start,track:e.displayTrack},persistTrack:e.persistTrack};return Ig(md([a],n,r,"lane-reorder",i),n)}const s=Dhe(t,t.start,e.insertRow,null,n);return!s||s.edits.length===0?Promise.resolve(!1):Ig(md(s.edits,n,r,"track-insert",i),n)}function Ihe(t,e,n,r,i,s,a){const{readZIndex:o,onStackingPatches:l}=s;if(!o||!l||r===n)return Promise.resolve();const c=t.map((h,m)=>({key:Zr(h),start:h.start,duration:h.duration,track:h.track,zIndex:o(h),isAudio:bc(h)==="audio",sourceFile:h.sourceFile,domIndex:m,stackingContextId:h.stackingContextId??null})),u=[e];if(i)for(const h of i)h!==e&&u.push(h);const f=MFe(c,u);return f.length===0?Promise.resolve():Promise.resolve(l(f,a)).then(()=>{})}function jFe(t,e,n){if(!t.hasChanged)return;const r=t.changes,i=JE(e,r.map(a=>a.key));for(const a of r)e(a.key,{start:a.start,duration:a.duration,playbackStart:a.playbackStart});if(!n){M_(e,i,t.members.map(a=>({key:a.key,updates:a})));return}const s=`clip-group-resize:${r.map(a=>a.key).join(":")}`;Promise.resolve(n(r.map(a=>({element:a.element,start:a.start,duration:a.duration,playbackStart:a.playbackStart})),{coalesceKey:s})).catch(a=>{M_(e,i,t.members.map(o=>({key:o.key,updates:o}))),console.error("[Timeline] Failed to persist group clip resize",a)})}function LFe({lifecycleRef:t,sessionEpochRef:e,cancelGestureRef:n,scrollRef:r,draggedClipRef:i,resizingClipRef:s,blockedClipRef:a,groupResizeRef:o,suppressClickRef:l,gestureSelectedKeysRef:c,elementsRef:u,trackOrderRef:f,setDraggedClipState:h,setResizingClipState:m,setShowPopover:y,setRangeSelectionRef:d,applyResizePointerRef:v,syncClipDragAutoScrollRef:b,stopClipDragAutoScrollRef:w,updateDraggedClipPreviewRef:O,publishDraggedClip:k,updateElement:E,onMoveElementRef:M,onMoveElementsRef:N,onResizeElementRef:I,onResizeElementsRef:_,onBlockedEditAttemptRef:j,readZIndexRef:L,onStackingPatchesRef:B,refreshAfterLaneMoveRef:$}){const Q=()=>{requestAnimationFrame(()=>{l.current=!1})},Y=pe=>{const ge=t.current.pointerId;return ge===null||pe.pointerId===ge},W=pe=>{if(pe===null)return;const ge=r.current;try{ge!=null&&ge.hasPointerCapture(pe)&&ge.releasePointerCapture(pe)}catch{}},J=pe=>{var ge;if(pe!==null)try{(ge=r.current)==null||ge.setPointerCapture(pe)}catch{}},ne=pe=>{i.current=null,s.current=null,o.current=null,pe&&(h(null),m(null))},le=({updateReact:pe=!0,suppressClick:ge=!1}={})=>{const Pe=t.current;return Pe.phase!=="active"?!1:(Pe.phase="cancelled",w.current(),ne(pe),W(Pe.pointerId),ge&&(l.current=!0),Pe.kind=null,Pe.pointerId=null,Pe.phase="complete",!0)};n.current=le;const ie=(pe,ge)=>{var ve;const Pe=Math.abs(pe.clientX-ge.originClientX);!ge.started&&Pe<2||(ge.started||J(ge.pointerId),y(!1),(ve=d.current)==null||ve.call(d,null),v.current(ge,pe.clientX),b.current(pe.clientX,pe.clientY))},q=(pe,ge)=>{var xe,we;const Pe=Math.hypot(pe.clientX-ge.originClientX,pe.clientY-ge.originClientY),ve=ge.intent==="move"?4:2;!ge.started&&Pe<ve||ge.started||(ge.started=!0,a.current=ge,J(ge.pointerId),l.current=!0,y(!1),(xe=d.current)==null||xe.call(d,null),(we=j.current)==null||we.call(j,ge.element,ge.intent))},F=(pe,ge)=>{var ve;const Pe=Math.hypot(pe.clientX-ge.originClientX,pe.clientY-ge.originClientY);!ge.started&&Pe<4||(ge.started||J(ge.pointerId),y(!1),(ve=d.current)==null||ve.call(d,null),k(O.current(ge,pe.clientX,pe.clientY)),b.current(pe.clientX,pe.clientY))},U=pe=>{const ge=s.current;if(ge)return Y(pe)?ie(pe,ge):void 0;const Pe=a.current;if(Pe)return Pe.pointerId!==pe.pointerId?void 0:q(pe,Pe);const ve=i.current;ve&&Y(pe)&&F(pe,ve)},Z=(pe,ge)=>{var we;if(!pe.started)return;if(l.current=!0,Q(),ge){jFe(ge,E,_.current);return}if(!(pe.previewStart!==pe.element.start||pe.previewDuration!==pe.element.duration||pe.previewPlaybackStart!==pe.element.playbackStart))return;const ve=pe.element.key??pe.element.id,xe=JE(E,[ve]);E(ve,{start:pe.previewStart,duration:pe.previewDuration,playbackStart:pe.previewPlaybackStart}),Promise.resolve((we=I.current)==null?void 0:we.call(I,pe.element,{start:pe.previewStart,duration:pe.previewDuration,playbackStart:pe.previewPlaybackStart})).catch(Ce=>{M_(E,xe,[{key:ve,updates:{start:pe.element.start,duration:pe.element.duration,playbackStart:pe.element.playbackStart}}]),console.error("[Timeline] Failed to persist clip resize",Ce)})},K=pe=>{a.current=null,pe.started&&Q()},ee=pe=>{pe.started&&(l.current=!0,Q(),Nhe(pe,{elements:u.current,trackOrder:f.current,updateElement:E,onMoveElement:M.current,onMoveElements:N.current,selectedKeys:c.current,readZIndex:L.current,onStackingPatches:B.current,refreshAfterLaneMove:$.current}))},re=()=>{var Pe,ve,xe;const pe=((Pe=o.current)==null?void 0:Pe.members.map(we=>we.element))??[((ve=s.current)==null?void 0:ve.element)??((xe=i.current)==null?void 0:xe.element)],ge=new Set(u.current.map(we=>we.key??we.id));return pe.every(we=>we===void 0||ge.has(we.key??we.id))},z=pe=>{const ge=t.current;if(ge.phase!=="active")return null;if(!Y(pe))return"ignored";if(ge.sessionEpoch!==e.current||!re())return le(),"ignored";ge.phase="committing";const Pe=ge.kind?{kind:ge.kind,drag:i.current,resize:s.current,groupResize:o.current}:"ignored";return w.current(),ne(!0),W(ge.pointerId),Pe==="ignored"&&(ge.phase="complete"),Pe},H=pe=>{try{pe.kind==="resize"&&pe.resize?Z(pe.resize,pe.groupResize):pe.kind==="drag"&&pe.drag&&ee(pe.drag)}finally{const ge=t.current;ge.kind=null,ge.pointerId=null,ge.phase="complete"}},se=pe=>{const ge=z(pe);if(ge==="ignored")return;if(ge){H(ge);return}const Pe=a.current;if(Pe)return Pe.pointerId!==pe.pointerId?void 0:K(Pe);l.current&&Q()},ue=pe=>{t.current.phase==="active"&&Y(pe)&&le({suppressClick:!0})&&Q();const ge=a.current;ge&&ge.pointerId!==pe.pointerId||(a.current=null,l.current&&Q())},be=pe=>{t.current.phase==="active"&&Y(pe)&&le({suppressClick:!0})&&Q()},me=pe=>{const ge=L3e({key:pe.key,drag:i.current,resize:s.current,blocked:a.current});ge.cancel&&(pe.preventDefault(),a.current=null,le({suppressClick:ge.suppressClick}))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",se),window.addEventListener("pointercancel",ue),window.addEventListener("lostpointercapture",be),window.addEventListener("keydown",me),()=>{le({updateReact:!1}),n.current=()=>!1,window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",se),window.removeEventListener("pointercancel",ue),window.removeEventListener("lostpointercapture",be),window.removeEventListener("keydown",me)}}const KO=[];function FFe({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,rowGeometryRef:i,onMoveElement:s,onMoveElements:a,onResizeElement:o,onResizeElements:l,onBlockedEditAttempt:c,setShowPopover:u,setRangeSelectionRef:f,readZIndex:h,onStackingPatches:m,refreshAfterLaneMove:y,sessionEpoch:d=0}){const v=fe(Je=>Je.updateElement),b=fe(Je=>{var St;return((St=Je.beatAnalysis)==null?void 0:St.beatTimes)??KO}),w=fe(Je=>{var St;return((St=Je.beatAnalysis)==null?void 0:St.beatStrengths)??KO}),O=fe(Je=>Je.beatEdits),k=fe(Je=>p0(Je.elements).musicElement),E=(k==null?void 0:k.start)??0,M=(k==null?void 0:k.playbackStart)??0,N=(k==null?void 0:k.duration)??0,I=(k==null?void 0:k.src)??null,_=x.useMemo(()=>{if(b===KO||N===0)return KO;const Je=bj(b,w,O,I),St=M+N,At=E-M;return Je.times.filter(Ke=>Ke>=M&&Ke<=St).map(Ke=>Math.round((Ke+At)*1e3)/1e3)},[b,w,O,I,E,M,N]),j=fe(Je=>Je.elements),L=fe(Je=>Je.timelineSnapEnabled),B=x.useRef({beatTimes:[],enabled:!0});B.current={beatTimes:_,enabled:L};const $=x.useRef(j);$.current=j;const Q=x.useRef(new Map),Y=x.useRef(null),W=x.useCallback((Je,St)=>{if(!B.current.enabled)return[];const At=`${Je??""}|${St?1:0}`,Ke=Q.current.get(At);if(Ke)return Ke;const Be=sFe({elements:$.current,playheadTime:fe.getState().currentTime,beatTimes:St?B.current.beatTimes:[],excludeElementKey:Je});return Q.current.set(At,Be),Be},[]),[J,ne]=x.useState(null),le=x.useRef(null),ie=x.useCallback(Je=>{le.current=Je,ne(Je)},[]),[q,F]=x.useState(null),U=x.useRef(null),Z=x.useCallback(Je=>{U.current=Je,F(Je)},[]),K=x.useRef({kind:null,phase:"complete",pointerId:null,sessionEpoch:d}),ee=x.useRef(d);ee.current=d;const re=x.useRef(new Set),z=x.useRef(()=>!1),H=x.useCallback((Je,St)=>{K.current.phase==="active"&&z.current(),K.current={kind:Je,phase:"active",pointerId:St,sessionEpoch:ee.current},re.current=new Set(fe.getState().selectedElementIds)},[]),se=x.useCallback(Je=>{if(!Je){z.current();return}H("drag",Je.pointerId),ie(Je)},[H,ie]),ue=x.useCallback(Je=>{if(!Je){z.current();return}H("resize",Je.pointerId),Z(Je)},[H,Z]),be=x.useRef(null),me=x.useRef(!1),pe=x.useRef(null),ge=x.useRef(s);ge.current=s;const Pe=x.useRef(a);Pe.current=a;const ve=x.useRef(c);ve.current=c;const xe=x.useRef(o);xe.current=o;const we=x.useRef(l);we.current=l;const Ce=x.useRef(h);Ce.current=h;const Me=x.useRef(m);Me.current=m;const Ve=x.useRef(y);Ve.current=y;const tt=x.useRef(0),Ze=x.useRef(null),qe=x.useCallback((Je,St,At)=>(Y.current||(Y.current=p0($.current).audioTracks),gFe(Je,St,At,{scroll:t.current,pps:e.current,duration:n.current,trackOrder:r.current,rowHeights:i==null?void 0:i.current.rowHeights,elements:$.current,selectedKeys:re.current,buildSnapTargets:W,audioTracks:Y.current})),[t,e,n,r,i,W]),pt=x.useCallback((Je,St)=>{const At=yFe(Je,St,{scroll:t.current,pps:e.current,buildSnapTargets:W}),Ke=Ye=>Z(U.current?{...U.current,started:!0,...Ye}:null),Be=Je.element.key??Je.element.id;let We=pe.current;if(!We||We.grabbedKey!==Be||We.edge!==Je.edge){const Ye=P3e($.current,re.current,Be,Je.edge);We=Ye?{grabbedKey:Be,edge:Je.edge,members:Ye,changes:[],hasChanged:!1}:null,pe.current=We}if(!We){Ke(At);return}xFe(We,At,Ke)},[t,e,W,Z]),it=x.useRef(pt);it.current=pt;const vt=x.useCallback(()=>{Ze.current=null,tt.current&&(cancelAnimationFrame(tt.current),tt.current=0),Q.current.clear(),Y.current=null},[]),Ot=x.useCallback(()=>{tt.current=0;const Je=le.current,St=U.current,At=Ze.current,Ke=t.current;!Je&&!St||!At||!Ke||SE(Ke,At.clientX,At.clientY)&&(Je?ie(qe(Je,At.clientX,At.clientY)):St&&it.current(St,At.clientX),tt.current=requestAnimationFrame(Ot))},[ie,t,qe]),Kt=x.useCallback((Je,St)=>{Ze.current={clientX:Je,clientY:St};const At=aS(t.current,Je,St,tt.current!==0);At==="stop"?(cancelAnimationFrame(tt.current),tt.current=0):At==="start"&&(tt.current=requestAnimationFrame(Ot))},[t,Ot]),qt=x.useRef(qe);qt.current=qe;const fn=x.useRef(Kt);fn.current=Kt;const Jt=x.useRef(vt);return Jt.current=vt,wr(()=>LFe({onStackingPatchesRef:Me,refreshAfterLaneMoveRef:Ve,readZIndexRef:Ce,onBlockedEditAttemptRef:ve,onResizeElementsRef:we,onResizeElementRef:xe,onMoveElementsRef:Pe,onMoveElementRef:ge,updateElement:v,publishDraggedClip:ie,updateDraggedClipPreviewRef:qt,stopClipDragAutoScrollRef:Jt,syncClipDragAutoScrollRef:fn,applyResizePointerRef:it,setRangeSelectionRef:f,setShowPopover:u,setResizingClipState:F,setDraggedClipState:ne,trackOrderRef:r,elementsRef:$,gestureSelectedKeysRef:re,suppressClickRef:me,groupResizeRef:pe,blockedClipRef:be,resizingClipRef:U,draggedClipRef:le,scrollRef:t,cancelGestureRef:z,sessionEpochRef:ee,lifecycleRef:K})),x.useEffect(()=>{z.current()},[d]),{draggedClip:J,setDraggedClip:se,resizingClip:q,setResizingClip:ue,blockedClipRef:be,suppressClickRef:me,stopClipDragAutoScroll:vt}}function YX(t){if(typeof document>"u"||!document.body||!document.execCommand)return!1;const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.border="0",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus({preventScroll:!0}),e.select(),e.setSelectionRange(0,t.length);try{return document.execCommand("copy")}catch{return!1}finally{e.remove()}}function $Fe(){if(typeof navigator>"u")return!1;const t=navigator.userAgent;return/Safari/i.test(t)&&!/Chrome|Chromium|CriOS|FxiOS|Edg|OPR/i.test(t)}async function zf(t){const e=$Fe();if(e&&YX(t))return!0;const n=typeof navigator<"u"?navigator.clipboard:void 0;if(n!=null&&n.writeText)try{return await n.writeText(t),!0}catch{}return!e&&YX(t)}function BFe(t,e){return`hf-edit-draft:${t.toFixed(2)}:${e.toFixed(2)}`}function VFe(t){try{return sessionStorage.getItem(t)??""}catch{return""}}function KX(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function HFe({rangeStart:t,rangeEnd:e,anchorX:n,anchorY:r,onClose:i}){const s=fe(_=>_.elements),a=Math.min(t,e),o=Math.max(t,e),l=BFe(a,o),[c,u]=x.useState(()=>VFe(l)),f=_=>{u(_),KX(l,_)},[h,m]=x.useState(!1),[y,d]=x.useState(!1),[v,b]=x.useState(!1),w=x.useRef(null),O=x.useRef(null),k=x.useMemo(()=>s.filter(_=>{const j=_.start+_.duration;return _.start<o&&j>a}),[s,a,o]);wr(()=>{setTimeout(()=>{var _;return(_=O.current)==null?void 0:_.focus()},50)}),wr(()=>{const _=j=>{j.key==="Escape"&&i()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)}),wr(()=>{const _=j=>{w.current&&!w.current.contains(j.target)&&i()};return setTimeout(()=>window.addEventListener("mousedown",_),100),()=>window.removeEventListener("mousedown",_)});const E=x.useCallback(()=>j3e({rangeStart:a,rangeEnd:o,elements:k,prompt:c}),[a,o,k,c]),M=x.useCallback(async()=>{if(!await zf(E())){b(!0);return}b(!1),KX(l,""),m(!0),setTimeout(()=>{m(!1),i()},800)},[E,i,l]),N=x.useCallback(async()=>{const _=NG(c);if(!_)return;if(!await zf(_)){b(!0);return}b(!1),d(!0),setTimeout(()=>{d(!1)},800)},[c]),I={position:"fixed",left:Math.max(8,Math.min(n-160,window.innerWidth-336)),top:Math.max(8,r-280),zIndex:200};return p.jsx("div",{ref:w,style:I,children:p.jsxs("div",{className:"w-80 bg-neutral-900 border border-neutral-700/60 rounded-xl shadow-2xl shadow-black/40 overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-neutral-800/60",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-studio-accent"}),p.jsxs("span",{className:"text-[11px] font-medium text-neutral-300",children:[as(a)," — ",as(o)]})]}),p.jsxs("span",{className:"text-[10px] text-neutral-600",children:[k.length," element",k.length!==1?"s":""]})]}),k.length>0&&p.jsx("div",{className:"px-4 py-2 border-b border-neutral-800/40 max-h-24 overflow-y-auto",children:k.map(_=>p.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[p.jsxs("span",{className:"text-[10px] font-mono text-studio-accent/80",children:["#",_.id]}),p.jsx("span",{className:"text-[10px] text-neutral-600",children:_.tag})]},_.id))}),p.jsx("div",{className:"p-3",children:p.jsx("textarea",{ref:O,value:c,onChange:_=>f(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),M())},placeholder:"What should change?",rows:2,className:"w-full px-3 py-2 text-xs bg-neutral-800/60 border border-neutral-700/40 rounded-lg text-neutral-200 placeholder:text-neutral-600 resize-none focus:outline-none focus:border-studio-accent/40 transition-colors"})}),v&&p.jsx("p",{className:"px-3 pb-2 text-[10px] text-red-400",role:"alert",children:"Copy failed — check clipboard permissions and try again."}),p.jsxs("div",{className:"grid grid-cols-2 gap-2 px-3 pb-3",children:[p.jsx("button",{onClick:N,disabled:!NG(c),className:`py-1.5 text-[11px] font-medium rounded-lg transition-all border ${y?"bg-green-500/20 text-green-400 border-green-500/30":"bg-neutral-800/70 text-neutral-200 border-neutral-700/50 hover:bg-neutral-800"} disabled:opacity-50 disabled:cursor-not-allowed`,children:y?"Prompt Copied!":"Copy Prompt"}),p.jsxs("button",{onClick:M,className:`py-1.5 text-[11px] font-medium rounded-lg transition-all ${h?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-studio-accent/15 text-studio-accent border border-studio-accent/25 hover:bg-studio-accent/25"}`,children:[h?"Copied!":"Copy to Agent",!h&&p.jsx("span",{className:"text-[9px] text-studio-accent/50 ml-1.5",children:"Cmd+Enter"})]})]})]})})}function _he(t){x.useEffect(()=>{var s;const e=t.current;if(!e)return;const n=document.activeElement,r=()=>Array.from(e.querySelectorAll('[role="menuitem"]')).filter(a=>!a.disabled);(s=r()[0])==null||s.focus();const i=a=>{var u;if(a.key!=="ArrowDown"&&a.key!=="ArrowUp"&&a.key!=="Home"&&a.key!=="End")return;const o=r();if(o.length===0)return;a.preventDefault();const l=o.findIndex(f=>f===document.activeElement);let c;a.key==="ArrowDown"?c=l<0?0:(l+1)%o.length:a.key==="ArrowUp"?c=l<0?o.length-1:(l-1+o.length)%o.length:a.key==="Home"?c=0:c=o.length-1,(u=o[c])==null||u.focus()};return e.addEventListener("keydown",i),()=>{e.removeEventListener("keydown",i),n instanceof HTMLElement&&document.contains(n)&&n.focus()}},[t])}const gM="w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-200 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left",QFe="w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left";function Rhe({state:t,onClose:e,onDelete:n,onDeleteAll:r,onEditEase:i,onCopyProperties:s,onMoveToPlayhead:a}){const o=F0(e),l={percentage:t.percentage,tweenPercentage:t.tweenPercentage,propertyGroup:t.propertyGroup,animationId:t.animationId};_he(o);const[c,u]=x.useState("idle"),f=async()=>{if(!s)return;if(await s(t.elementId,l)===!1){u("failed"),setTimeout(()=>u("idle"),1500);return}u("copied"),setTimeout(e,700)},h=200,y=10+(1+(a?1:0)+(i?1:0)+(s?1:0)+(n?1:0))*30+9,d=t.y+y-window.innerHeight,v=t.x+h>window.innerWidth?t.x-h:t.x,b=Math.max(8,d>0?t.y-d-8:t.y);return Fl.createPortal(p.jsxs("div",{ref:o,role:"menu","aria-label":"Keyframe actions",className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px] overflow-y-auto",style:{left:v,top:b,maxHeight:`calc(100vh - ${b+8}px)`},children:[a&&p.jsx("button",{type:"button",role:"menuitem",className:gM,onClick:()=>{a(t.element,l),e()},children:"Move to Playhead"}),i&&p.jsxs("button",{type:"button",role:"menuitem",className:`${gM} justify-between`,onClick:()=>{i(t.elementId,l),e()},children:[p.jsx("span",{children:"Edit Ease…"}),p.jsx("span",{className:"text-[10px] text-neutral-500",children:t.currentEase??"default"})]}),s&&p.jsx("button",{type:"button",role:"menuitem",className:gM,onClick:()=>{f()},children:c==="copied"?"Copied!":c==="failed"?"Copy failed — check permissions":"Copy Properties"}),n&&p.jsx("button",{type:"button",role:"menuitem",className:QFe,onClick:()=>{n(t.elementId,l),e()},children:"Delete Keyframe"}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60",role:"separator"}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60",role:"separator"}),p.jsx("button",{type:"button",role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-950/40 focus-visible:bg-red-950/40 outline-none cursor-pointer text-left",onClick:()=>{r(t.element,t.animationId),e()},children:"Delete All Keyframes"})]}),document.body)}const zFe=x.memo(function({x:e,y:n,element:r,currentTime:i,onClose:s,onSplit:a,onDelete:o}){const l=F0(s);_he(l);const c=200,f=n+80-window.innerHeight,h=e+c>window.innerWidth?e-c:e,m=f>0?n-f-8:n,y=KE(r)&&["video","audio","img"].includes(r.tag),d=y&&i>r.start&&i<r.start+r.duration,v=y?d?`Split at ${i.toFixed(2)}s`:"Split (move playhead inside clip)":null;return Fl.createPortal(p.jsxs("div",{ref:l,role:"menu","aria-label":"Clip actions",className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:h,top:m},children:[v&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",role:"menuitem",className:`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left outline-none focus-visible:bg-neutral-800 ${d?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!d,onClick:()=>{d&&(a(r,i),s())},children:[p.jsx("span",{children:v}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"S"})]}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60"})]}),p.jsxs("button",{type:"button",role:"menuitem",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left",onClick:()=>{o(r),s()},children:[p.jsx("span",{children:"Delete"}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]}),document.body)}),ZFe=x.memo(function({x:e,y:n,gapWidth:r,canCloseGap:i,canCloseAllGaps:s,hasAnyGaps:a,onClose:o,onCloseGap:l,onCloseAllGaps:c,onHoverAction:u}){const f=F0(o),h=200,y=n+68-window.innerHeight,d=e+h>window.innerWidth?e-h:e,v=y>0?n-y-8:n,b=k=>`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left ${k?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,w=i?void 0:r==null?"No gap here":"A clip on this track can't be moved",O=s?void 0:a?"A clip on this track can't be moved":"No gaps on this track";return Fl.createPortal(p.jsxs("div",{ref:f,className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:d,top:v},onPointerLeave:()=>u(null),children:[p.jsxs("button",{type:"button",className:b(i),disabled:!i,title:w,onPointerEnter:()=>u(i?"close-gap":null),onClick:()=>{i&&(l(),o())},children:[p.jsx("span",{children:"Close gap"}),r!=null&&p.jsxs("span",{className:"text-neutral-500 text-[10px] ml-3",children:[r.toFixed(2),"s"]})]}),p.jsx("button",{type:"button",className:b(s),disabled:!s,title:O,onPointerEnter:()=>u(s?"close-all":null),onClick:()=>{s&&(c(),o())},children:p.jsx("span",{children:"Close all gaps"})})]}),document.body)});function GFe({theme:t}){return p.jsx("div",{className:"absolute bottom-2 right-3 pointer-events-none z-20",children:p.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border",style:{background:"rgba(17,23,35,0.84)",borderColor:t.gutterBorder},children:[p.jsx("kbd",{className:"text-[9px] font-mono px-1 py-0.5 rounded",style:{color:t.textSecondary,background:"rgba(255,255,255,0.06)"},children:"Shift"}),p.jsx("span",{className:"text-[9px]",style:{color:t.textSecondary},children:"+ drag/click to edit range"})]})})}function N_({capturedElement:t,targetSessionEpoch:e,sessionEpoch:n,selectedElementId:r,elements:i}){const s=t.key??t.id;return e!==n||r!==s?null:i.find(a=>(a.key??a.id)===s)??null}function UFe(t,e,n){const r=fe.getState();return N_({capturedElement:t,targetSessionEpoch:e,sessionEpoch:r.timelineSessionEpoch,selectedElementId:r.selectedElementId,elements:n})}function XFe({elements:t,elementsRef:e,theme:n,showShortcutHint:r,showPopover:i,rangeSelection:s,setShowPopover:a,setRangeSelection:o,kfContextMenu:l,setKfContextMenu:c,onDeleteKeyframe:u,onDeleteAllKeyframes:f,onMoveKeyframeToPlayhead:h,clipContextMenu:m,setClipContextMenu:y,currentTime:d,onSplitElement:v,pinZoomBeforeEdit:b,onDeleteElement:w,gapContextMenu:O,onDismissGapContextMenu:k,onCloseTrackGap:E,onCloseAllTrackGaps:M,onHoverGapAction:N}){const I=fe(Y=>Y.selectedElementId),_=fe(Y=>Y.timelineSessionEpoch),j=l==null?void 0:l.sessionEpoch,L=m==null?void 0:m.sessionEpoch,B=l?N_({capturedElement:l.element,targetSessionEpoch:j,sessionEpoch:_,selectedElementId:I,elements:t}):null,$=m?N_({capturedElement:m.element,targetSessionEpoch:L,sessionEpoch:_,selectedElementId:I,elements:t}):null,Q=(Y,W)=>UFe(Y,W,e.current);return x.useEffect(()=>{l&&!B&&c(null)},[B,l,c]),x.useEffect(()=>{m&&!$&&y(null)},[m,$,y]),p.jsxs(p.Fragment,{children:[r&&!i&&!s&&p.jsx(GFe,{theme:n}),i&&s&&p.jsx(HFe,{rangeStart:s.start,rangeEnd:s.end,anchorX:s.anchorX,anchorY:s.anchorY,onClose:()=>{a(!1),o(null)}}),l&&B&&p.jsx(Rhe,{state:{...l,element:B},onClose:()=>c(null),onDelete:(...Y)=>{Q(B,j)&&(u==null||u(...Y))},onDeleteAll:(Y,W)=>{const J=Q(B,j);J&&(f==null||f(J,W))},onMoveToPlayhead:h?(Y,...W)=>{const J=Q(B,j);J&&h(J,...W)}:void 0,onEditEase:l.animationId!==void 0&&l.tweenPercentage!==void 0?(Y,W)=>{W.animationId===void 0||W.tweenPercentage===void 0||(fe.getState().setFocusedEaseSegment({animationId:W.animationId,collidingAnimationTargets:W.collidingAnimationTargets,tweenPercentage:W.tweenPercentage,elementId:Y}),H7({action:"open"}))}:void 0,onCopyProperties:(Y,W)=>{const J=fe.getState().keyframeCache.get(Y),ne=J==null?void 0:J.keyframes.find(le=>Math.abs(le.percentage-W.percentage)<.5);return ne?zf(JSON.stringify(ne.properties,null,2)):!1}}),m&&$&&p.jsx(zFe,{x:m.x,y:m.y,element:$,currentTime:d,onClose:()=>y(null),onSplit:(Y,W)=>{const J=Q($,L);J&&(v==null||v(J,W))},onDelete:()=>{const Y=Q($,L);Y&&(b(),w==null||w(Y))}}),O&&p.jsx(ZFe,{x:O.x,y:O.y,gapWidth:O.gapWidth,canCloseGap:O.canCloseGap,canCloseAllGaps:O.canCloseAllGaps,hasAnyGaps:O.hasAnyGaps,onClose:k,onCloseGap:E,onCloseAllGaps:M,onHoverAction:N})]})}function WFe({ppsRef:t,fitPpsRef:e,onMoveElement:n,onMoveElements:r,onResizeElement:i,onResizeElements:s,onFileDrop:a,onAssetDrop:o,onBlockDrop:l,onCompositionDrop:c}){const u=fe(E=>E.pinTimelineZoom),f=x.useCallback(()=>{u(t.current,e.current)},[u,t,e]),h=x.useRef(null),m=x.useMemo(()=>n&&((...E)=>(f(),n(...E))),[n,f]),y=x.useMemo(()=>r&&((...E)=>(f(),r(...E))),[r,f]),d=x.useMemo(()=>i&&((...E)=>(f(),i(...E))),[i,f]),v=x.useMemo(()=>s&&((...E)=>(f(),s(...E))),[s,f]),b=x.useMemo(()=>a&&((...E)=>(f(),a(...E))),[a,f]),w=x.useMemo(()=>o&&((...E)=>(f(),o(...E))),[o,f]),O=x.useMemo(()=>l&&((...E)=>(f(),l(...E))),[l,f]),k=x.useMemo(()=>c&&((...E)=>(f(),c(...E))),[c,f]);return{pinZoomBeforeEdit:f,setRangeSelectionRef:h,pinnedOnMoveElement:m,pinnedOnMoveElements:y,pinnedOnResizeElement:d,pinnedOnResizeElements:v,pinnedOnFileDrop:b,pinnedOnAssetDrop:w,pinnedOnBlockDrop:O,pinnedOnCompositionDrop:k}}const dF=Dc("StudioShellContext",null),pF=Dc("StudioPlaybackContext",null);function zl(){const t=x.useContext(dF);if(!t)throw new Error("useStudioShellContext must be used within StudioShellProvider");return t}function mF(){return x.useContext(dF)}function vy(){const t=x.useContext(pF);if(!t)throw new Error("useStudioPlaybackContext must be used within StudioPlaybackProvider");return t}function qFe(){return x.useContext(pF)}function YFe({value:t,children:e}){const{projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:s,previewIframeRef:a,editHistory:o,handleUndo:l,handleRedo:c,renderQueue:u,compositionDimensions:f,waitForPendingDomEditSaves:h,handlePreviewIframeRef:m}=t,y=x.useMemo(()=>({projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:s,previewIframeRef:a,editHistory:o,handleUndo:l,handleRedo:c,renderQueue:u,compositionDimensions:f,waitForPendingDomEditSaves:h,handlePreviewIframeRef:m}),[n,r,f,o,u,i,s,a,l,c,h,m]);return p.jsx(dF,{value:y,children:e})}function KFe({value:t,children:e}){const{captionEditMode:n,compositionLoading:r,refreshKey:i,setRefreshKey:s,timelineElements:a,isPlaying:o,refreshPreviewDocumentVersion:l}=t,c=x.useMemo(()=>({captionEditMode:n,compositionLoading:r,refreshKey:i,setRefreshKey:s,timelineElements:a,isPlaying:o,refreshPreviewDocumentVersion:l}),[n,r,i,a,o,s,l]);return p.jsx(pF,{value:c,children:e})}function JFe(t){var e;try{const n=(e=t.ownerDocument)==null?void 0:e.defaultView;if(!n)return!0;const r=n.getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;const i=Number.parseFloat(r.opacity);return!(Number.isFinite(i)&&i<=.01&&!t.hasAttribute(WE))}catch{return!0}}function JX(t){if(!t||t==="auto")return 0;const e=parseInt(t,10);return Number.isFinite(e)?e:0}function e3(t){var r;const e=pj(t);if(e!=null)return e;const n=t.style.zIndex;if(n&&n!=="auto")return JX(n);try{const i=(r=t.ownerDocument)==null?void 0:r.defaultView;if(i)return JX(i.getComputedStyle(t).zIndex)}catch{}return 0}function jhe(t){var n;const e=(n=t.ownerDocument)==null?void 0:n.defaultView;return e&&t instanceof e.HTMLElement?!0:t.nodeType===1}const e$e=new Set(["AUDIO","SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function t$e(t){return jhe(t)&&!e$e.has(t.tagName)}function Lhe(t){const e=t.parentElement;if(!e)return{entries:[],targetIndex:-1};const n=[];let r=-1,i=0;for(const s of Array.from(e.children))s!==t&&!t$e(s)||jhe(s)&&(s===t&&(r=n.length),n.push({element:s,zIndex:e3(s),domIndex:i}),i+=1);return{entries:n,targetIndex:r}}function n$e(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function r$e(t,e,n){const r=e.filter(a=>a.element===t||n(a.element));let i;try{i=t.getBoundingClientRect()}catch{return r}if(i.width===0&&i.height===0)return r;const s={left:i.left,top:i.top,right:i.right,bottom:i.bottom};return r.filter(a=>{if(a.element===t)return!0;try{const o=a.element.getBoundingClientRect();return n$e(s,{left:o.left,top:o.top,right:o.right,bottom:o.bottom})}catch{return!1}})}function gF(t){return[...t].sort((e,n)=>e.zIndex-n.zIndex||e.domIndex-n.domIndex)}function i$e(t,e){if(t&&e)return e.zIndex-t.zIndex>=2?t.zIndex+1:null;if(t)return t.zIndex+1;if(e){const n=Math.max(0,e.zIndex-1);return n>=e.zIndex?null:n}return null}function Fhe(t,e,n,r){const i=e.findIndex(l=>l.element===n);if(i===-1)return null;const s=e3(n),a=t.map(l=>l.zIndex);if(!a.some((l,c)=>a.indexOf(l)!==c)){const l=i$e(e[i-1],e[i+1]);if(l!==null)return l===s?null:[{element:n,zIndex:l}]}return s$e(t,e,n,r)}function s$e(t,e,n,r){const i=new Set(e.map(m=>m.element)),s=r.filter(m=>!i.has(m.element)),a=e.length,o=t.map(m=>m.zIndex),l=Math.min(...o),c=Math.max(...o);if(!s.some(m=>m.zIndex>=l&&m.zIndex<=c)){const m=s.filter(w=>w.zIndex<l).map(w=>w.zIndex),y=s.filter(w=>w.zIndex>c).map(w=>w.zIndex),d=m.length>0?Math.max(...m)+1:0,v=y.length>0,b=v?Math.min(...y)-a:Number.POSITIVE_INFINITY;if(d<=b){let w=Math.max(l,d);v&&(w=Math.min(w,b));const O=[];return e.forEach((k,E)=>{k.zIndex!==w+E&&O.push({element:k.element,zIndex:w+E})}),O.length===0?null:O}}const f=a$e(r,e,n),h=[];return f.forEach((m,y)=>{m.zIndex!==y&&h.push({element:m.element,zIndex:y})}),h.length===0?null:h}function a$e(t,e,n){const r=gF(t),i=r.find(f=>f.element===n),s=r.filter(f=>f.element!==n);if(!i)return s;const a=e.findIndex(f=>f.element===n),o=e[a-1],l=e[a+1],c=o?s.findIndex(f=>f.element===o.element):-1,u=l?s.findIndex(f=>f.element===l.element):-1;return c>=0?s.splice(c+1,0,i):u>=0?s.splice(u,0,i):s.unshift(i),s}function $he(t,e,n){const{entries:r}=Lhe(t);if(r.length<2)return null;const s=e==="bring-to-front"||e==="send-to-back"?r:r$e(t,r,JFe);if(s.length<2)return null;const a=gF(s),o=a.findIndex(l=>l.element===t);return o===-1?null:{entries:r,order:a,pos:o}}function Bhe(t,e,n){const r=$he(t,e);if(!r)return null;const{entries:i,order:s,pos:a}=r,o=[...s],[l]=o.splice(a,1);switch(e){case"bring-forward":if(a>=s.length-1)return null;o.splice(a+1,0,l);break;case"send-backward":if(a<=0)return null;o.splice(a-1,0,l);break;case"bring-to-front":if(a>=s.length-1)return null;o.push(l);break;case"send-to-back":if(a<=0)return null;o.unshift(l);break}return Fhe(s,o,t,i)}function o$e(t,e){const{entries:n}=Lhe(t);if(n.length<2)return null;const r=new Map(n.map(a=>[a.element,a])),i=[];for(const a of e){const o=r.get(a);if(!o)return null;i.push(o)}if(i.length<2||!i.some(a=>a.element===t))return null;const s=gF(i);return s.every((a,o)=>a.element===i[o].element)?null:Fhe(s,i,t,n)}function l$e(t,e,n){if(e!=="bring-forward"&&e!=="send-backward")return null;const r=$he(t,e);if(!r)return null;const{order:i,pos:s}=r,a=e==="bring-forward"?i[s+1]:i[s-1];return(a==null?void 0:a.element)??null}function c$e(t,e,n){return Bhe(t,e)!==null}function u$e({expandedElementsRef:t}){const e=yS(),n=mF(),r=(e==null?void 0:e.previewIframeRef)??null,i=e==null?void 0:e.handleDomZIndexReorderCommit,s=(n==null?void 0:n.activeCompPath)??null,a=x.useCallback(u=>{var h;const f=((h=r==null?void 0:r.current)==null?void 0:h.contentDocument)??null;return f?Ds(f,{hfId:u.hfId,id:u.domId??u.id,selector:u.selector,selectorIndex:u.selectorIndex,sourceFile:u.sourceFile??s??"index.html"},s):null},[r,s]),o=x.useCallback(u=>{const f=a(u);return f?e3(f):Number.NaN},[a]),l=x.useCallback((u,f)=>{if(!i)return Promise.resolve();const h=u.flatMap(m=>{const y=t.current.find(v=>(v.key??v.id)===m.key),d=y&&a(y);return!y||!d?[]:[{element:d,zIndex:m.zIndex,id:y.domId??y.id,selector:y.selector,selectorIndex:y.selectorIndex,sourceFile:y.sourceFile??s??"index.html",key:m.key}]});return h.length?i(h,f).then(()=>{}):Promise.resolve()},[i,a,s,t]);return{readClipZIndex:o,applyStackingPatches:l,zSyncEnabled:!!(i&&r)}}function f$e({viewportWidth:t,effectiveDuration:e,zoomMode:n,manualZoomPercent:r,ppsRef:i,fitPpsRef:s,draggedClip:a,resizingClip:o,expandedElements:l,isDragging:c,scrollRef:u,lastScrollLeftRef:f,contentOrigin:h}){const m=h3e(t,e,h),y=bCe(m,n,r);i.current=y;const d=Math.max(0,e*y),v=a!=null&&a.started?(a.previewStart+a.element.duration)*y+CG:0,b=o!=null&&o.started?(o.previewStart+o.previewDuration)*y+CG:0,w=d3e({trackContentWidth:d,viewportWidth:t,contentOrigin:h,pps:y,dragGhostEndPx:v,resizeGhostEndPx:b}),O=y>0?w/y:e,k=x.useRef(n);k.current=n;const E=x.useRef(r);return E.current=r,s.current=m,x.useEffect(()=>{if(n!=="manual"||c.current)return;const M=u.current,N=f.current;if(!M||N<=0)return;const I=requestAnimationFrame(()=>{const _=Math.max(0,M.scrollWidth-M.clientWidth),j=Math.min(N,_);Math.abs(M.scrollLeft-j)>.5&&(M.scrollLeft=j)});return()=>cancelAnimationFrame(I)},[l,n]),x.useEffect(()=>{fe.getState().setTimelineScale(y,m)},[y,m]),{pps:y,fitPps:m,displayContentWidth:w,displayDuration:O,clipStateVersion:l,zoomModeRef:k,manualZoomPercentRef:E}}function h$e(t,e){for(const r of e)t.has(r)||e.delete(r);const n=[];for(const[r,i]of t)e.has(r)||i.some(bce)&&n.push(r);return n}function d$e(t){var i;const e=fe(s=>s.expandClips),n=((i=mF())==null?void 0:i.projectId)??null,r=x.useRef({projectId:n,source:t,clips:new Set});x.useEffect(()=>{if(r.current.projectId!==n){const a=r.current.source!==t;if(r.current={projectId:n,source:t,clips:new Set},!a)return}else r.current.source=t;const s=h$e(t,r.current.clips);if(s.length!==0){for(const a of s)r.current.clips.add(a);e(s)}},[t,e,n])}const p$e=!0,m$e=Object.freeze({scrollLeft:0,scrollTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0,isScrolling:!1});function g$e(t,e){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,isScrolling:e}}function y$e(t,e){const[n,r]=x.useState(m$e),[i,s]=x.useState(!0),a=x.useRef(null),o=x.useRef(0),l=x.useRef(0),c=x.useRef(null),u=x.useRef(!1),f=x.useCallback((d,v=!1)=>{u.current=v;const b=()=>{l.current=0,r(g$e(d,u.current))};if(v)l.current||(l.current=requestAnimationFrame(b));else{l.current&&cancelAnimationFrame(l.current),b();return}c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=!1,l.current&&cancelAnimationFrame(l.current),b()},100)},[]),h=x.useCallback(()=>{const d=t.current;s(d?y3e(d.scrollHeight,d.clientHeight):!0)},[t]),m=x.useCallback(()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{o.current=0,h()})},[h]),y=x.useCallback(d=>{if(a.current&&(a.current.disconnect(),a.current=null),t.current=d,!d){c.current&&clearTimeout(c.current),c.current=null,u.current=!1;return}const v=()=>{f(d,u.current),m()};v(),a.current=new ResizeObserver(v),a.current.observe(d)},[t,m,f]);return wr(()=>()=>{var d;(d=a.current)==null||d.disconnect(),o.current&&cancelAnimationFrame(o.current),l.current&&cancelAnimationFrame(l.current),c.current&&clearTimeout(c.current)}),x.useEffect(()=>{h()},[h,...e]),{viewport:n,showShortcutHint:i,setScrollRef:y,syncScrollViewport:f}}function x$e(t){const e=lS(),{onMoveElement:n,onMoveElements:r,onResizeElement:i,onResizeElements:s,onBlockedEditAttempt:a,onSplitElement:o}=t;return x.useMemo(()=>({...e,onMoveElement:n??e.onMoveElement,onMoveElements:r??e.onMoveElements,onResizeElement:i??e.onResizeElement,onResizeElements:s??e.onResizeElements,onBlockedEditAttempt:a??e.onBlockedEditAttempt,onSplitElement:o??e.onSplitElement}),[e,n,r,i,s,a,o])}const t3=.001,_g=t=>t.key??t.id;function dA(t){return Math.max(0,...t.map(e=>e.expandedParentStart??0))}const Vhe=t=>Math.round(t*1e3)/1e3,oC=t=>t.start+t.duration;function n3(t){return[...t].sort((e,n)=>e.start-n.start||_g(e).localeCompare(_g(n)))}function D_(t,e,n=t3,r=0){const i=n3(t);if(i.some(c=>e>=c.start-n&&e<oC(c)-n))return null;const a=i.filter(c=>c.start>e-n);if(a.length===0)return null;const o=a[0].start,l=Math.max(r,...i.filter(c=>c.start<=e-n).map(c=>oC(c)));return o-l<=n?null:{gapStart:l,gapEnd:o,followingKeys:a.map(_g)}}function Hhe(t,e=t3,n=0){const r=[];let i=n;for(const s of n3(t))s.start-i>e&&r.push({start:i,end:s.start}),i=Math.max(i,oC(s));return r}function Qhe(t,e=t3,n=0){const r=[];let i=n;for(const s of n3(t)){const a=Vhe(i);Math.abs(a-s.start)>e&&r.push({key:_g(s),newStart:a}),i+=s.duration}return r}function b$e(t,e,n=t3,r=0){const i=Hhe(t,n,r),s=Math.max(r,...t.map(oC));return e-s>n&&i.push({start:s,end:e}),i}function zhe(t,e){const n=e.gapEnd-e.gapStart,r=new Set(e.followingKeys);return n3(t).filter(i=>r.has(_g(i))).map(i=>({key:_g(i),newStart:Math.max(e.gapStart,Vhe(i.start-n))}))}const Zhe=t=>t.key??t.id;let v$e=0;function I_(t,e){const n=new Map(t.map(r=>[Zhe(r),r]));return e.every(r=>{const i=n.get(r.key);return i!=null&&sS(i).canMove})}function A$e(t,e){if(e.length===0||!I_(t,e))return null;const n=new Map(t.map(r=>[Zhe(r),r]));return e.map(r=>{const i=n.get(r.key);return{element:i,updates:{start:r.newStart,track:i.track}}})}function Ghe(t,e,n){const r=A$e(t,e);return r?(md(r,n,`track-gap-close:${v$e++}`),!0):!1}function S$e(t,e,n){const r=D_(t,e,void 0,dA(t));return r?Ghe(t,zhe(t,r),n):!1}function w$e(t,e){return Ghe(t,Qhe(t,void 0,dA(t)),e)}function O$e({tracks:t,expandedElementsRef:e,trackOrderRef:n,onMoveElement:r,onMoveElements:i}){const s=fe(w=>w.updateElement),a=fe(w=>w.timelineSessionEpoch),[o,l]=x.useState(null),[c,u]=x.useState(null),f=x.useMemo(()=>{var w;return(o==null?void 0:o.sessionEpoch)===a?((w=t.find(([O])=>O===o.track))==null?void 0:w[1])??[]:null},[o,a,t]),h=x.useMemo(()=>{if(!o||!f)return null;const w=dA(f),O=D_(f,o.time,void 0,w),k=Qhe(f,void 0,w);return{x:o.x,y:o.y,gapWidth:O?O.gapEnd-O.gapStart:null,canCloseGap:O!=null&&I_(f,zhe(f,O)),hasAnyGaps:k.length>0,canCloseAllGaps:k.length>0&&I_(f,k)}},[o,f]),m=x.useMemo(()=>{if(!o||!f||!c)return null;const w=dA(f);if(c==="close-gap"){const k=D_(f,o.time,void 0,w);return k?{track:o.track,intervals:[{start:k.gapStart,end:k.gapEnd}]}:null}const O=Hhe(f,void 0,w);return O.length>0?{track:o.track,intervals:O}:null},[o,f,c]),y=x.useCallback(()=>{!o||!f||o.sessionEpoch!==fe.getState().timelineSessionEpoch||S$e(f,o.time,{elements:e.current,trackOrder:n.current,updateElement:s,onMoveElement:r,onMoveElements:i})},[o,f,e,n,s,r,i]),d=x.useCallback(()=>{!o||!f||o.sessionEpoch!==fe.getState().timelineSessionEpoch||w$e(f,{elements:e.current,trackOrder:n.current,updateElement:s,onMoveElement:r,onMoveElements:i})},[o,f,e,n,s,r,i]),v=x.useCallback(w=>{u(null),l({...w,sessionEpoch:fe.getState().timelineSessionEpoch})},[]),b=x.useCallback(()=>{u(null),l(null)},[]);return x.useEffect(()=>{o&&o.sessionEpoch!==a&&b()},[b,o,a]),{gapMenuModel:h,gapHighlight:m,setHoveredGapAction:u,openGapMenu:v,dismissGapMenu:b,closeTrackGap:y,closeAllTrackGaps:d}}function C$e(t,e){return e.size===0||e.size===1&&e.has(t)}function k$e(t){var c;const{selectedElementId:e,selectedElementIds:n,expandedElements:r,tracks:i,gapHighlight:s}=t;if(!e||!C$e(e,n))return null;const a=r.find(u=>(u.key??u.id)===e);if(!a||a.track===(s==null?void 0:s.track))return null;const o=((c=i.find(([u])=>u===a.track))==null?void 0:c[1])??[],l=b$e(o,t.displayDuration,void 0,dA(o));return l.length>0?{track:a.track,intervals:l,kind:"selected"}:null}function E$e(t){if(t.dragActive)return[];const e=[];t.gapHighlight&&t.gapHighlight.intervals.length>0&&e.push({...t.gapHighlight,kind:"hover"});const n=k$e(t);return n&&e.push(n),e}function T$e(t){const{gapHighlight:e,tracks:n,selectedElementId:r,selectedElementIds:i,expandedElements:s,dragActive:a,displayDuration:o}=t;return x.useMemo(()=>E$e({gapHighlight:e,tracks:n,selectedElementId:r,selectedElementIds:i,expandedElements:s,dragActive:a,displayDuration:o}),[e,n,r,i,s,a,o])}function P$e({active:t,scrollRef:e,contentOrigin:n,pixelsPerSecond:r,onSplitAll:i}){const[s,a]=x.useState(null),o=x.useCallback(u=>{const f=e.current;if(!t||!f)return;const h=f.getBoundingClientRect();a(u.clientX-h.left+f.scrollLeft)},[t,e]),l=x.useCallback(()=>a(null),[]),c=x.useCallback(u=>{const f=e.current;if(!t||!u.shiftKey||u.button!==0||!f)return!1;const h=f.getBoundingClientRect(),m=vE({clientX:u.clientX,rectLeft:h.left,scrollLeft:f.scrollLeft,contentOrigin:n});return i==null||i(Math.max(0,m/r)),!0},[t,n,i,r,e]);return{razorGuideX:s,updateRazorGuide:o,clearRazorGuide:l,splitAllAtPointer:c}}function M$e({x:t}){return p.jsx("div",{className:"absolute top-0 bottom-0 pointer-events-none z-10",style:{left:t,width:1,background:"rgba(239,68,68,0.7)"}})}const N$e=400,D$e=6e4;function eW(t,e){if(t.length===0)return;const n=[...t].sort((i,s)=>i-s),r=Math.min(n.length-1,Math.ceil(n.length*e)-1);return Number(n[Math.max(0,r)].toFixed(2))}function I$e(t,e,n,r){const i=eW(n,.95);if(i===void 0)return null;const s=eW(r,.95);return{total_clip_count:e.totalClipCount,mounted_clip_count:t.querySelectorAll('[data-clip="true"]').length,total_row_count:e.totalRowCount,timeline_dom_node_count:t.querySelectorAll("*").length,viewport_width:t.clientWidth,viewport_height:t.clientHeight,zoom_mode:e.zoomMode,scroll_sample_count:n.length,scroll_frame_latency_p95_ms:i,scroll_frame_latency_max_ms:Number(Math.max(...n).toFixed(2)),...s===void 0?{}:{frame_interval_p95_ms:s}}}function tW(t){t.previousFrameAt=null,t.frameLatencies=[],t.frameIntervals=[]}function _$e(t){const e=x.useRef({frameRequest:0,idleTimer:null,pendingScrollStartedAt:0,previousFrameAt:null,frameLatencies:[],frameIntervals:[],lastEmittedAt:Number.NEGATIVE_INFINITY}),n=r=>{const i=e.current,s=performance.now();i.frameRequest===0&&(i.pendingScrollStartedAt=s,i.frameRequest=requestAnimationFrame(a=>{i.frameRequest=0,i.frameLatencies.push(performance.now()-i.pendingScrollStartedAt),i.previousFrameAt!==null&&i.frameIntervals.push(a-i.previousFrameAt),i.previousFrameAt=a})),i.idleTimer!==null&&clearTimeout(i.idleTimer),i.idleTimer=setTimeout(()=>{if(i.idleTimer=null,i.frameRequest!==0){cancelAnimationFrame(i.frameRequest),i.frameRequest=0,tW(i);return}const a=performance.now();if(a-i.lastEmittedAt>=D$e){const o=I$e(r,t,i.frameLatencies,i.frameIntervals);o&&(YOe(o),i.lastEmittedAt=a)}tW(i)},N$e)};return wr(()=>()=>{const r=e.current;r.frameRequest!==0&&cancelAnimationFrame(r.frameRequest),r.idleTimer!==null&&clearTimeout(r.idleTimer)}),{recordTimelineScroll:n}}function R$e(t){return Array.from(t.values()).some(e=>e.some(bce))}function j$e(t,e){return R$e(t)||e.some(n=>!!n.audioGroup)}function Uhe(t,e){const n=Number.isFinite(t)?t:0;if(e.length===0)return n;const r=Math.max(n,...e.map(i=>i.start+i.duration));return Number.isFinite(r)?r:n}function L$e(t,e){var i;const n=zn(t),r=(i=e==null?void 0:e.groupPreview)==null?void 0:i.find(s=>s.key===n);return r?{...t,...r}:e&&zn(e.element)===n?{...t,start:e.previewStart,duration:e.previewDuration,playbackStart:e.previewPlaybackStart}:t}function F$e(t,e,n,r){const i=x.useMemo(()=>t.find(o=>zn(o)===e)??null,[t,e]),s=x.useRef(i);s.current=i;const a=x.useRef(s.current);x.useEffect(()=>{const o=a.current,l=s.current;a.current=l,o&&!l&&(n(!1),r())})}function $$e(){const[t,e]=x.useState(!1);return wr(()=>{const n=i=>i.key==="Shift"&&e(i.type==="keydown"),r=()=>e(!1);return window.addEventListener("keydown",n),window.addEventListener("keyup",n),window.addEventListener("blur",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",n),window.removeEventListener("blur",r)}}),t}function B$e(t,e,n,r){const i=n==="frame"?Bd:void 0;return{...x.useMemo(()=>w5e(t,e,i,r),[t,i,e,r]),majorTickInterval:_ae(t,e,i)}}const yM=1024*1024,V$e=1440*60*1e3,el=Object.freeze({directScrollSafetyPx:8e6,rowOverscanPerSide:2,timeOverscanViewportRatio:.25,maxMountedRows:64,maxMountedClipRoots:512,maxMountedClipRootsPerRow:128,maxMountedTimelineDescendants:5e3,posterMaxPhysicalWidth:240,posterMaxPhysicalHeight:135,posterDprCap:1.5,richPreviewFrameCount:6,concurrentVideoDecodes:2,concurrentMetadataJobs:4,concurrentCompositionFetches:2,concurrentServerPages:1,thumbnailLoadTimeoutMs:3e4,thumbnailCacheBytes:64*yM,thumbnailCacheEntries:256,thumbnailCacheEntriesPerProject:96,metadataRegistryEntries:512,metadataFailureTtlMs:3e4,waveformCacheBytes:16*yM,waveformCacheEntries:256,compositionDiskCacheBytes:512*yM,compositionDiskCacheMaxAgeMs:14*V$e,interactionP95Ms:50,frameIntervalP95Ms:33.3,constrainedInteractionP95Ms:75,constrainedFrameIntervalP95Ms:75,longTaskLimitMs:50,constrainedLongTaskLimitMs:300,memoryReturnToleranceRatio:.15,posterColdP95Ms:750,posterCachedP95Ms:250,constrainedPosterColdP95Ms:1200,constrainedPosterCachedP95Ms:400,posterCoverageRatio:.9,posterCoverageSettleMs:1500,constrainedPosterCoverageSettleMs:2500,richPreviewP95Ms:750,constrainedRichPreviewP95Ms:1200,supportedFixtureFallbackRatio:.02,scrollSamplesPerRun:21,warmupRuns:3,measuredRuns:5,requiredPassingRuns:4});function H$e(t,e,n,r){if(!(e>0)||!(r>0)||!(t.clientWidth>0))return{start:0,end:0};const i=t.clientWidth*el.timeOverscanViewportRatio,s=t.scrollLeft-n-i,a=t.scrollLeft+t.clientWidth-n+i;return{start:Math.min(r,Math.max(0,s/e)),end:Math.min(r,Math.max(0,a/e))}}function Q$e(t,e,n,r){if(!(e>0)||!(r>0))return{start:0,end:0};const i=Math.max(0,(t.scrollLeft-n)/e),s=Math.min(r,Math.max(i,(t.scrollLeft+t.clientWidth-n)/e));return{start:Math.min(i,r),end:s}}function z$e(t,e,n){const r=t.getRowPositionFromY(n+_a);if(r.row<0||r.row>=t.rowKeys.length)return n;const i=t.rowKeys[r.row];if(i===void 0)return n;const s=e.getRowIndex(i);return s<0?n:Math.max(0,n+e.getRowTop(s)-t.getRowTop(r.row))}function Z$e({tracks:t,viewport:e,pixelsPerSecond:n,contentOrigin:r,duration:i,selectedElementId:s,draggedElementId:a,resizingElementIds:o,focusedElementId:l,focusedEaseElementId:c,clipContextMenuElementId:u,keyframeContextMenuElementId:f}){const h=x.useMemo(()=>V3e(t),[t]),m=x.useMemo(()=>H$e(e,n,r,i),[r,i,n,e]),y=x.useMemo(()=>Q$e(e,n,r,i),[r,i,n,e]),d=x.useMemo(()=>new Set([s,a,...o??[],l,c,u,f].filter(v=>v!==void 0)),[u,a,c,l,f,o,s]);return{clipIndex:h,renderTimeRange:m,visibleTimeRange:y,pinnedClipIdentities:d}}function G$e(){var e;const t=(e=qFe())==null?void 0:e.setRefreshKey;return x.useCallback(()=>t==null?void 0:t(n=>n+1),[t])}const JO=12;function nW(t,e,n,r,i){const s=t+n+JO,a=t+e-JO,o=a-s;return o<=0||r>=s&&i<=a?null:i-r>o||r<s?Math.max(0,r-n-JO):Math.max(0,i-e+JO)}function U$e(t){return{left:t.allowHorizontal?nW(t.scrollLeft,t.viewportWidth,t.stickyLeft,t.clipLeft,t.clipRight):null,top:nW(t.scrollTop,t.viewportHeight,t.stickyTop,t.clipTop,t.clipBottom)}}function rW(t,e,n){return t!==null&&t.projectId===e&&t.sessionEpoch===n}function X$e(t,e){const n=t.querySelector(`[data-timeline-focus-id=${CSS.escape(e)}]`);return n?n.ownerDocument.activeElement===n?!0:(n.setAttribute("data-reveal-highlight","true"),n.focus({preventScroll:!0}),n.ownerDocument.activeElement!==n?(n.removeAttribute("data-reveal-highlight"),!1):(n.addEventListener("blur",()=>n.removeAttribute("data-reveal-highlight"),{once:!0}),!0)):!1}function W$e(t,e,n,r,i,s,a){const o=r.getRowIndex(e.row.physicalTrackKey);if(o<0)return!1;const l=e.target.kind==="row"?e.row.elementId:e.target.elementId,c=l?n.find(d=>(d.key??d.id)===l):void 0,u=e.target.kind==="row"?null:e.target.time,f=c&&e.target.kind==="clip"?c.start:u,h=c&&e.target.kind==="clip"?c.start+c.duration:u,m=r.getRowTop(o),y=U$e({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,viewportWidth:t.clientWidth,viewportHeight:t.clientHeight,clipLeft:s+(f??0)*i,clipRight:s+(h??0)*i,clipTop:m+fa,clipBottom:m+r.getRowHeight(o)-fa,stickyLeft:s,stickyTop:_a,allowHorizontal:a&&f!==null});return y.left!==null&&(t.scrollLeft=y.left),y.top!==null&&(t.scrollTop=y.top),y.left!==null||y.top!==null}function q$e({scrollRef:t,logicalRows:e,elements:n,rowGeometry:r,pixelsPerSecond:i,contentOrigin:s,allowHorizontal:a,viewportVersion:o,projectId:l,sessionEpoch:c,syncScrollViewport:u}){const f=fe(b=>b.timelineFocus),h=x.useRef(e),m=x.useRef(null),y=x.useRef(null),d=x.useMemo(()=>{var b;if(rW(f,l,c)){((b=m.current)==null?void 0:b.nonce)!==f.nonce&&(m.current={nonce:f.nonce,id:f.id});const w=m.current.id;let O=Cl(e,w);if(!O){const k=JLe(h.current,e,w);k&&(m.current={nonce:f.nonce,id:k.id},O=Cl(e,k.id))}return O?{target:O.target,row:O.row}:null}return m.current=null,null},[e,l,f,c]);x.useLayoutEffect(()=>{h.current=e},[e]),x.useEffect(()=>{var w;if(!rW(f,l,c))return;if(!d){fe.getState().clearTimelineFocus(f.nonce);return}if(d.target.id!==f.id){fe.getState().requestTimelineFocus(d.target.id);return}if(((w=y.current)==null?void 0:w.nonce)===f.nonce&&y.current.id===d.target.id)return;const b=t.current;b&&(W$e(b,d,n,r,i,s,a)&&u(b),X$e(b,d.target.id)&&(y.current={nonce:f.nonce,id:d.target.id}))},[a,s,n,i,l,f,d,r,t,c,u,o]);const v=d?d.target.kind==="row"?d.row.elementId??void 0:d.target.elementId:void 0;return{focusedTargetId:(d==null?void 0:d.target.id)??null,focusedRowKey:d==null?void 0:d.row.physicalTrackKey,pinnedElementId:v}}function Y$e({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}){return x.useMemo(()=>qLe({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}),[e,s,a,o,l,c,u,n,r,i,t])}function iW(t,e){if(!e)return null;const n=p0(t).byKey.get(e);return n?{elementId:e,rowKey:n.track}:null}function K$e(t,e,n){const r=new Array(t);return new Proxy(r,{get(i,s,a){if(typeof s=="string"){const o=s.charCodeAt(0);if(o>=48&&o<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<t){let c=i[l];if(!c){const u=e[l*2];c=i[l]={index:l,key:n(l),start:u,size:e[l*2+1],end:u+e[l*2+1],lane:0}}return c}}if(s==="length")return t}return Reflect.get(i,s,a)}})}function Zm(t,e,n){let r=n.initialDeps??[],i,s=!0;function a(){const o=t();return(o.length!==r.length||o.some((c,u)=>r[u]!==c))&&(r=o,i=e(...o),n!=null&&n.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1),i}return a.updateDeps=o=>{r=o},a}function sW(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const J$e=(t,e)=>Math.abs(t-e)<1.01,eBe=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}};let Kx;const xM=()=>{if(Kx!==void 0)return Kx;if(typeof navigator>"u")return Kx=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Kx=!0;const t=navigator.maxTouchPoints;return Kx=navigator.platform==="MacIntel"&&t!==void 0&&t>0},aW=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},tBe=t=>t,Xhe=t=>{const e=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,i=new Array(r);for(let s=0;s<r;s++)i[s]=e+s;return i},nBe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(i(aW(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(aW(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},lC={passive:!0},rBe=typeof window>"u"?!0:"onscrollend"in window,iBe=(t,e,n)=>{const r=t.scrollElement;if(!r)return;const i=t.targetWindow;if(!i)return;const s=t.options.useScrollendEvent&&rBe;let a=0;const o=s?null:eBe(i,()=>e(a,!1),t.options.isScrollingResetDelay),l=f=>()=>{a=n(r),o==null||o(),e(a,f)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,lC),s&&r.addEventListener("scrollend",u,lC),()=>{r.removeEventListener("scroll",c),s&&r.removeEventListener("scrollend",u)}},sBe=(t,e)=>iBe(t,e,n=>{const{horizontal:r,isRtl:i}=t.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),aBe=(t,e,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(t),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const r=n.indexFromElement(t),i=n.options.getItemKey(r),s=n.itemSizeCache.get(i);if(s!==void 0)return s}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},oBe=(t,{adjustments:e=0,behavior:n},r)=>{var i,s;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:t+e,behavior:n})},lBe=oBe;class cBe{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{const o=s.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[c,u]of this.elementsCache)if(u===o){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tBe,rangeExtractor:Xhe,onChange:()=>{},measureElement:aBe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in n){const m=n[h];m!==void 0&&(s[h]=m)}const a=this.options;let o=null,l=null,c=!1;if(a!==void 0&&a.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const h=a.count,m=s.count,y=this.getMeasurements(),d=h>0?((r=y[0])==null?void 0:r.key)??a.getItemKey(0):null,v=h>0?((i=y[h-1])==null?void 0:i.key)??a.getItemKey(h-1):null;if(m!==h||h>0&&m>0&&(s.getItemKey(0)!==d||s.getItemKey(m-1)!==v)){c=!0;const O=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??y[0]:null;O&&(o=[O.key,this.getScrollOffset()-O.start]);const k=s.followOnAppend===!0?"auto":s.followOnAppend||null;k&&m>h&&this.isAtEnd(a.scrollEndThreshold)&&(h===0||s.getItemKey(m-1)!==v)&&(l=k)}}this.options=s,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,f=0;if(o&&this.scrollOffset!==null){const[h,m]=o,y=this.getMeasurements(),{count:d,getItemKey:v}=this.options;let b=0;for(;b<d&&v(b)!==h;)b++;if(b<d){const w=y[b];if(w){const O=w.start+m;O!==this.scrollOffset&&(f=O-this.scrollOffset,this.scrollOffset=O,u=!0)}}}(u||l)&&(this.pendingScrollAnchor=[u?o[0]:null,u?o[1]:0,l,f])},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Zm(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{if(a&&this._intendedScrollOffset===null&&s===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(s-this._intendedScrollOffset)<1.5&&(s=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===s?this.scrollDirection:o<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const s=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!xM()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};s.addEventListener("touchstart",a,lC),s.addEventListener("touchend",o,lC),this.unsubs.push(()=>{s.removeEventListener("touchstart",a),s.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[s,a,o,l]=i;s!==null&&!o&&(xM()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Zm(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,i,s,a,o,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c}),{key:!1}),this.getMeasurements=Zm(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c},u)=>{const f=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const b of this.laneAssignments.keys())b>=n&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),o===1){const b=n*2;let w=this._flatMeasurements;if(!w||w.length<b){const E=new Float64Array(b);w&&h>0&&E.set(w.subarray(0,h*2)),w=E,this._flatMeasurements=w}let O;if(h===0)O=r+i;else{const E=h-1;O=w[E*2]+w[E*2+1]+c}for(let E=h;E<n;E++){const M=s(E),N=f.get(M),I=typeof N=="number"?N:this.options.estimateSize(E);w[E*2]=O,w[E*2+1]=I,O+=I+c}const k=K$e(n,w,s);return this.measurementsCache=k,k}const m=this.measurementsCache.slice(0,h),y=new Array(o).fill(void 0),d=new Float64Array(o);let v=0;for(let b=0;b<h;b++){const w=m[b];w&&(y[w.lane]===void 0&&v++,y[w.lane]=b,d[w.lane]=w.end)}for(let b=h;b<n;b++){const w=s(b),O=this.laneAssignments.get(b);let k,E;const M=l==="estimate"||f.has(w);if(O!==void 0&&this.options.lanes>1){k=O;const j=y[k],L=j!==void 0?m[j]:void 0;E=L?L.end+c:r+i}else if(v===o){let j=0,L=d[0],B=y[0];for(let $=1;$<o;$++){const Q=d[$];(Q<L||Q===L&&y[$]<B)&&(j=$,L=Q,B=y[$])}k=j,E=L+c,M&&this.laneAssignments.set(b,k)}else k=b%this.options.lanes,E=r+i,M&&this.laneAssignments.set(b,k);const N=f.get(w),I=typeof N=="number"?N:this.options.estimateSize(b),_=E+I;m[b]={index:b,start:E,size:I,end:_,key:w,lane:k},y[k]===void 0&&v++,y[k]=b,d[k]=_}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Zm(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>n.length===0||r===0?(this.range=null,null):(this.range=fBe(n,r,i,s,s===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Zm(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-s),o=Math.min(this.options.count-1,i+s);return n>=a&&n<=o}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),s=this.elementsCache.get(i);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,s;if(n<0||n>=this.options.count)return;let a,o,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),o=c[n*2],a=c[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,o=h.start,a=h.size}const u=this.itemSizeCache.get(l)??a,f=r-u;if(f!==0){const h=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=h?this.getTotalSize():0,y=((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:o,size:a,end:o+a,lane:0},f,this):o<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(l)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,h?this.applyScrollAdjustment(this.getTotalSize()-m):y&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=Zm(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,s=this.options.lanes===1&&i!=null,a=Whe(0,r.length-1,s?o=>i[o*2]:o=>sW(r[o]).start,n);return sW(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(a.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const s=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s,l=this.now();this.scrollState={index:n,align:o,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const s=r.length-1,a=this._flatMeasurements;a!=null?i=a[s*2]+a[s*2+1]:i=((n=r[s])==null?void 0:n.end)??0}else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(o=>o===null);){const o=r[a];s[o.lane]===null&&(s[o.lane]=o.end),a--}i=Math.max(...s.filter(o=>o!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(xM()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,s=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&J$e(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=i,c||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Whe=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,s=n(i);if(s<r)t=i+1;else if(s>r)e=i-1;else return i}return t>0?t-1:0};function uBe(t,e,n){let r=0;for(;r<=e;){const i=(r+e)/2|0,s=t[i*2];if(s<n)r=i+1;else if(s>n)e=i-1;else return i}return r>0?r-1:0}function fBe(t,e,n,r,i){const s=t.length-1;if(t.length<=r)return{startIndex:0,endIndex:s};if(r===1&&i!==null){const c=uBe(i,s,n);let u=c;const f=n+e;for(;u<s&&i[u*2]+i[u*2+1]<f;)u++;return{startIndex:c,endIndex:u}}let o=Whe(0,s,c=>t[c].start,n),l=o;if(r===1)for(;l<s&&t[l].end<n+e;)l++;else if(r>1){const c=Array(r).fill(0);for(;l<s&&c.some(f=>f<n+e);){const f=t[l];c[f.lane]=f.end,l++}const u=Array(r).fill(n+e);for(;o>=0&&u.some(f=>f>=n);){const f=t[o];u[f.lane]=f.start,o--}o=Math.max(0,o-o%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const bM=typeof document<"u"?x.useLayoutEffect:x.useEffect;function hBe({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...r}){const i=x.useReducer(c=>c+1,0)[1],s=x.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=e,s.current.mode=n;const a=c=>{const u=s.current;if(!u.enabled||!u.container)return;const f=c.getTotalSize();if(f!==u.lastSize){u.lastSize=f;const b=c.options.horizontal?"width":"height";u.container.style[b]=`${f}px`}const h=!!c.options.horizontal,m=u.mode==="transform",y=h?"left":"top",d=c.options.scrollMargin,v=c.getVirtualItems();for(const b of v){const w=b.start-d,O=c.elementsCache.get(b.key);O&&u.lastPositions.get(O)!==w&&(u.lastPositions.set(O,w),m?O.style.transform=h?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:O.style[y]=`${w}px`)}},o={...r,onChange:(c,u)=>{var f;const h=s.current;let m=!0;if(h.enabled){a(c);const y=c.range,d=h.prevRange;m=!d||d.isScrolling!==c.isScrolling||d.startIndex!==(y==null?void 0:y.startIndex)||d.endIndex!==(y==null?void 0:y.endIndex),m&&(h.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:c.isScrolling}:null)}m&&(t&&u?Fl.flushSync(i):i()),(f=r.onChange)==null||f.call(r,c,u)}},[l]=x.useState(()=>{const c=new cBe(o);return Object.assign(c,{containerRef:u=>{const f=s.current;if(f.container=u,f.lastSize=null,u&&f.enabled){const h=c.getTotalSize();f.lastSize=h;const m=c.options.horizontal?"width":"height";u.style[m]=`${h}px`}}})});return l.setOptions(o),bM(()=>l._didMount(),[]),bM(()=>l._willUpdate()),bM(()=>{a(l)}),l}function dBe(t){return hBe({observeElementRect:nBe,observeElementOffset:sBe,scrollToFn:lBe,...t})}function pBe(t,e){const n=new Set(Xhe(t));for(const r of e)r>=0&&r<t.count&&n.add(r);return[...n].sort((r,i)=>r-i)}function mBe(t,e){const n=Math.min(t,el.rowOverscanPerSide*2+1),r=new Set(Array.from({length:n},(i,s)=>s));for(const i of e)i>=0&&i<t&&r.add(i);return[...r].sort((i,s)=>i-s)}function gBe({enabled:t,scrollRef:e,viewport:n,rowGeometry:r,sessionEpoch:i,pinnedRowKeys:s,focusedRowKey:a}){const o=n.clientWidth>0&&n.clientHeight>0,l=x.useMemo(()=>[...new Set([...s,...a===void 0?[]:[a]].map(b=>r.getRowIndex(b)))],[a,s,r]),c=x.useCallback(b=>r.getRowHeight(b),[r]),u=x.useCallback(b=>r.rowKeys[b]??b,[r]),f=x.useCallback(b=>pBe(b,l),[l]),h=x.useCallback(()=>n.scrollTop,[n.scrollTop]),m=dBe({enabled:o,useFlushSync:!1,count:r.rowKeys.length,getScrollElement:()=>e.current,estimateSize:c,getItemKey:u,overscan:el.rowOverscanPerSide,rangeExtractor:f,scrollMargin:_a+e0,initialRect:{width:n.clientWidth,height:n.clientHeight},initialOffset:h});x.useEffect(()=>{var b;o&&(m.measure(),(b=e.current)==null||b.dispatchEvent(new Event("scroll")))},[t,e,i,o,m]);const y=a===void 0?-1:r.getRowIndex(a),d=y<0?0:r.getRowHeight(y);x.useEffect(()=>{o&&y>=0&&m.resizeItem(y,d)},[t,d,y,i,o,m]);const v=x.useMemo(()=>null,[t,r]);return v||(o?m.getVirtualItems().map(({index:b})=>({index:b,rowKey:r.rowKeys[b]??b})):mBe(r.rowKeys.length,l).map(b=>({index:b,rowKey:r.rowKeys[b]??b})))}function oW(t){var r;if(!(t instanceof Element))return;const e=(r=t.closest("[data-timeline-row-key]"))==null?void 0:r.dataset.timelineRowKey;if(e===void 0)return;const n=Number(e);return Number.isFinite(n)?n:void 0}function yBe({scrollRef:t,viewport:e,rowGeometry:n,sessionEpoch:r,elements:i,selectedElementId:s,focusedRowKey:a,draggedRowKey:o,resizingElementIds:l,clipContextMenuRowKey:c,keyframeContextMenuRowKey:u,lastScrollLeftRef:f,syncScrollViewport:h}){const m=p$e,[y,d]=x.useState(),v=x.useCallback(I=>{d(oW(I.target))},[]),b=x.useCallback(I=>{d(oW(I.relatedTarget))},[]),w=x.useMemo(()=>iW(i,s),[i,s]),O=x.useMemo(()=>(l==null?void 0:l.map(I=>{var _;return(_=iW(i,I))==null?void 0:_.rowKey}).filter(I=>I!==void 0))??[],[i,l]),k=x.useMemo(()=>[o,...O,w==null?void 0:w.rowKey,a,c,u].filter(I=>I!==void 0),[c,o,a,u,O,w]),E=gBe({enabled:m,scrollRef:t,viewport:e,rowGeometry:n,sessionEpoch:r,pinnedRowKeys:k,focusedRowKey:y??a}),M=x.useRef(n),N=x.useRef(r);return x.useLayoutEffect(()=>{const I=t.current,_=M.current;if(N.current!==r)N.current=r,f.current=0,I&&(I.scrollLeft=0,I.scrollTop=0,h(I));else if(I&&_!==n){const j=z$e(_,n,I.scrollTop);j!==I.scrollTop&&(I.scrollTop=j,h(I))}M.current=n},[f,n,t,r,h]),{enabled:m,virtualRows:E,timelineFocusProps:{onFocus:v,onBlur:b}}}function xBe(t){const e=fe(l=>l.expandedClipIds),n=fe(l=>l.collapsedGroupIds),r=fe(l=>l.expandedLaneOwnerIds),i=fe(l=>l.timelineProjectId),s=Y$e({tracks:t.tracks,displayTrackOrder:t.layout.displayTrackOrder,laneCounts:t.laneCounts,selectedElementId:t.selectedElementId,selectedElementIds:t.selectedElementIds,expandedClipIds:e,collapsedGroupIds:n,expandedLaneOwnerIds:r,groups:t.groups,trackGroupOf:t.trackGroupOf,gsapAnimations:t.gsapAnimations}),a=q$e({scrollRef:t.scrollRef,logicalRows:s,elements:t.elements,rowGeometry:t.layout.rowGeometry,pixelsPerSecond:t.pixelsPerSecond,contentOrigin:t.contentOrigin,allowHorizontal:t.allowHorizontal,viewportVersion:t.viewport,projectId:i,sessionEpoch:t.sessionEpoch,syncScrollViewport:t.syncScrollViewport}),o=yBe({scrollRef:t.scrollRef,viewport:t.viewport,rowGeometry:t.layout.rowGeometry,sessionEpoch:t.sessionEpoch,elements:t.elements,selectedElementId:t.selectedElementId,focusedRowKey:a.focusedRowKey,draggedRowKey:t.draggedRowKey,resizingElementIds:t.resizingElementIds,clipContextMenuRowKey:t.clipContextMenuRowKey,keyframeContextMenuRowKey:t.keyframeContextMenuRowKey,lastScrollLeftRef:t.lastScrollLeftRef,syncScrollViewport:t.syncScrollViewport});return{logicalRows:s,...a,rowVirtualizationActive:o.enabled,virtualRows:o.virtualRows,timelineFocusProps:o.timelineFocusProps}}const bBe=x.memo(function({onSeek:e,onDrillDown:n,renderClipContent:r,renderClipOverlay:i,onFileDrop:s,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l,onDeleteElement:c,onMoveElement:u,onMoveElements:f,onResizeElement:h,onResizeElements:m,onBlockedEditAttempt:y,onSplitElement:d,onSelectElement:v,theme:b,sessionEpoch:w=0}={}){var lt;const{onMoveElement:O,onMoveElements:k,onResizeElement:E,onResizeElements:M,onBlockedEditAttempt:N,onSplitElement:I,onRazorSplitAll:_,onDeleteKeyframe:j,onDeleteAllKeyframes:L,onMoveKeyframeToPlayhead:B,onMoveKeyframe:$}=x$e({onMoveElement:u,onMoveElements:f,onResizeElement:h,onResizeElements:m,onBlockedEditAttempt:y,onSplitElement:d}),Q=x.useMemo(()=>({...Cj,...b}),[b]),Y=G$e();Ake();const W=fe(kt=>kt.elements),J=rS(),ne=vke(),le=fe(kt=>kt.duration),ie=fe(kt=>kt.timeDisplayMode),q=fe(kt=>kt.timelineReady),F=fe(kt=>kt.selectedElementId),U=fe(kt=>kt.selectedElementIds),Z=fe(kt=>kt.focusedEaseSegment),K=fe(kt=>kt.gsapAnimations),ee=x.useMemo(()=>j$e(K,J),[K,J]),re=ee?Lo+G2:G2+a3e,z=ee?G2:0,H=fe(kt=>kt.setSelectedElementId),se=fe(kt=>kt.currentTime),{zoomMode:ue,manualZoomPercent:be,setZoomMode:me,setManualZoomPercent:pe}=Tae(),ge=x.useRef(null),Pe=x.useRef(null),ve=x.useRef(null),xe=fe(kt=>kt.activeTool),[we,Ce]=x.useState(null),Me=x.useRef(!1),Ve=$$e(),[tt,Ze]=x.useState(!1),[qe,pt]=x.useState(null),[it,vt]=x.useState(null),Ot=x.useCallback(kt=>{Pe.current=kt},[]),Kt=x.useRef(0),qt=x.useMemo(()=>Uhe(le,W),[le,W]),fn=fe(kt=>kt.keyframeCache);d$e(K);const{tracks:Jt,trackStyles:Je,trackOrder:St,trackOrderRef:At,laneCounts:Ke,rowGeometry:Be,rowGeometryRef:We,groups:Ye,trackGroupOf:Zt}=P7e(J,K,F,U),Te=x.useRef(J);Te.current=J;const De=x.useRef(100),ze=x.useRef(qt);ze.current=qt;const st=x.useRef(100),{pinZoomBeforeEdit:Gt,setRangeSelectionRef:ln,pinnedOnMoveElement:Yt,pinnedOnMoveElements:Mn,pinnedOnResizeElement:Pr,pinnedOnResizeElements:mt,pinnedOnFileDrop:vn,pinnedOnAssetDrop:mn,pinnedOnBlockDrop:En,pinnedOnCompositionDrop:jn}=WFe({ppsRef:De,fitPpsRef:st,onMoveElement:O,onMoveElements:k,onResizeElement:E,onResizeElements:M,onFileDrop:s,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l}),{readClipZIndex:et,applyStackingPatches:qn,zSyncEnabled:Mt}=u$e({expandedElementsRef:Te}),{gapMenuModel:hn,gapHighlight:Ht,setHoveredGapAction:dn,openGapMenu:er,dismissGapMenu:In,closeTrackGap:yr,closeAllTrackGaps:tr}=O$e({tracks:Jt,expandedElementsRef:Te,trackOrderRef:At,onMoveElement:Yt,onMoveElements:Mn}),{draggedClip:gt,setDraggedClip:nr,resizingClip:On,setResizingClip:_n,blockedClipRef:xt,suppressClickRef:Ut}=FFe({scrollRef:ve,ppsRef:De,durationRef:ze,trackOrderRef:At,rowGeometryRef:We,onMoveElement:Yt,onMoveElements:Mn,onResizeElement:Pr,onResizeElements:mt,onBlockedEditAttempt:N,setShowPopover:Ze,setRangeSelectionRef:ln,readZIndex:Mt?et:void 0,onStackingPatches:Mt?qn:void 0,refreshAfterLaneMove:Y,sessionEpoch:w}),Ct=y5e({scrollRef:ve,ppsRef:De,durationRef:ze,trackOrderRef:At,rowGeometryRef:We,contentOrigin:re,onFileDrop:vn,onAssetDrop:mn,onBlockDrop:En,onCompositionDrop:jn,sessionEpoch:w}),ur=D7e(gt,St,Be),Dt=((lt=On==null?void 0:On.groupPreview)==null?void 0:lt.map(kt=>kt.key))??(On?[zn(On.element)]:void 0),{recordTimelineScroll:wt}=_$e({totalClipCount:J.length,totalRowCount:ur.displayTrackOrder.length,zoomMode:ue}),{viewport:gn,showShortcutHint:Lt,setScrollRef:rn,syncScrollViewport:fs}=y$e(ve,[q,J.length,ur.totalH]),{pps:Ln,fitPps:ni,displayContentWidth:cn,displayDuration:Cn,zoomModeRef:rr,manualZoomPercentRef:Ti}=f$e({viewportWidth:gn.clientWidth,effectiveDuration:qt,zoomMode:ue,manualZoomPercent:be,ppsRef:De,fitPpsRef:st,draggedClip:gt,resizingClip:On,expandedElements:J,isDragging:Me,scrollRef:ve,lastScrollLeftRef:Kt,contentOrigin:re}),Kr=xBe({scrollRef:ve,tracks:Jt,layout:ur,laneCounts:Ke,selectedElementId:F,selectedElementIds:U,groups:Ye,trackGroupOf:Zt,gsapAnimations:K,elements:J,pixelsPerSecond:Ln,contentOrigin:re,allowHorizontal:ue==="manual",viewport:gn,sessionEpoch:w,draggedRowKey:gt!=null&>.started?gt.previewTrack:void 0,resizingElementIds:Dt,clipContextMenuRowKey:it==null?void 0:it.element.track,keyframeContextMenuRowKey:qe==null?void 0:qe.element.track,lastScrollLeftRef:Kt,syncScrollViewport:fs}),Bi=fe(kt=>kt.selectedKeyframes),hs=fe(kt=>kt.toggleSelectedKeyframe),{onClickKeyframe:Mr,onSelectSegment:Ha,onShiftClickKeyframe:xi,onContextMenuKeyframe:Sa}=BTe({expandedElements:J,keyframeCache:fn,onSelectElement:v,onSeek:e,setSelectedElementId:H,setKfContextMenu:pt,toggleSelectedKeyframe:hs}),{clipIndex:ft,renderTimeRange:Ae,visibleTimeRange:_e,pinnedClipIdentities:ot}=Z$e({tracks:Jt,viewport:gn,pixelsPerSecond:Ln,contentOrigin:re,duration:Cn,selectedElementId:F??void 0,draggedElementId:gt?zn(gt.element):void 0,resizingElementIds:Dt,focusedElementId:Kr.pinnedElementId,focusedEaseElementId:Z==null?void 0:Z.elementId,clipContextMenuElementId:it?zn(it.element):void 0,keyframeContextMenuElementId:qe?zn(qe.element):void 0});VLe({scrollRef:ve,currentTime:se,clipStateVersion:Ae,elementStateVersion:J});const bt=T$e({gapHighlight:Ht,tracks:Jt,selectedElementId:F,selectedElementIds:U,expandedElements:J,dragActive:(gt==null?void 0:gt.started)===!0||On!=null,displayDuration:Cn}),{seekFromX:en,autoScrollDuringDrag:Tn,dragScrollRaf:$r}=r5e({playheadRef:ge,scrollRef:ve,ppsRef:De,durationRef:ze,isDragging:Me,currentTime:se,zoomMode:ue,zoomModeRef:rr,manualZoomPercentRef:Ti,fitPps:ni,fitPpsRef:st,effectiveDuration:qt,pps:Ln,timelineReady:q,elementsLength:J.length,setZoomMode:me,setManualZoomPercent:pe,onSeek:e,contentOrigin:re}),{razorGuideX:or,updateRazorGuide:bi,clearRazorGuide:ds,splitAllAtPointer:Ul}=P$e({active:xe==="razor",scrollRef:ve,contentOrigin:re,pixelsPerSecond:Ln,onSplitAll:_}),{rangeSelection:Br,setRangeSelection:vs,shiftClickClipRef:Lc,marqueeRect:Iu,isScrubbing:wa,handlePointerDown:Oa,handlePointerMove:Fc,handlePointerUp:_u,handlePointerCancel:Xl}=n5e({scrollRef:ve,ppsRef:De,effectiveDuration:qt,pps:Ln,onSeek:e,seekFromX:en,autoScrollDuringDrag:Tn,dragScrollRaf:$r,isDragging:Me,setShowPopover:Ze,elementsRef:Te,clipIndex:ft,rowGeometryRef:We,onSelectElement:v,contentOrigin:re,sessionEpoch:w});ln.current=vs,F$e(J,F,Ze,()=>vs(null));const{major:Wl,minor:_s,majorTickInterval:Ru}=B$e(Cn,Ln,ie,Kr.rowVirtualizationActive?Ae:void 0),Vr=x.useCallback(kt=>L$e(kt,On),[On]);return!q||J.length===0?p.jsx(x5e,{isDragOver:Ct.isDragOver,onFileDrop:!!s,onDragOver:Ct.handleAssetDragOver,onDragLeave:Ct.handleAssetDragLeave,onDrop:Ct.handleAssetDrop}):p.jsxs("div",{ref:Ot,"aria-label":"Timeline","data-timeline-element-count":J.length,className:`relative border-t select-none h-full overflow-hidden ${Ct.isDragOver?"ring-1 ring-inset ring-studio-accent/60":""} ${xe==="razor"||Ve?"cursor-crosshair":"cursor-default"}`,onMouseMove:bi,onMouseLeave:ds,style:{touchAction:"pan-x pan-y",background:Q.shellBackground,borderColor:Q.shellBorder},children:[p.jsxs("div",{ref:rn,"data-timeline-scroll-viewport":!0,"data-timeline-auto-scroll-left-inset":ee?Lo:0,tabIndex:-1,className:`${ue==="fit"?"overflow-x-hidden":"overflow-x-auto"} overflow-y-auto h-full outline-none`,onScroll:kt=>{Kt.current=kt.currentTarget.scrollLeft,wt(kt.currentTarget),fs(kt.currentTarget,!0)},...Kr.timelineFocusProps,onDragOver:Ct.handleAssetDragOver,onDragLeave:Ct.handleAssetDragLeave,onDrop:Ct.handleAssetDrop,onPointerDown:kt=>{kt.target instanceof Element&&kt.target.closest("button, input, select, a")||Ul(kt)||Oa(kt)},onPointerMove:Fc,onPointerUp:_u,onPointerCancel:Xl,onLostPointerCapture:Xl,children:[p.jsx(vFe,{major:Wl,minor:_s,pps:Ln,contentOrigin:re,contentGutter:z,trackContentWidth:cn,totalH:ur.totalH,effectiveDuration:qt,majorTickInterval:Ru,rangeSelection:Br,marqueeRect:Iu,laneGapStrips:bt,theme:Q,displayTrackOrder:ur.displayTrackOrder,rowHeights:ur.displayRowHeights,rowGeometry:ur.rowGeometry,virtualRows:Kr.virtualRows,logicalRows:Kr.logicalRows,focusedTargetId:Kr.focusedTargetId,rowsVirtualized:Kr.rowVirtualizationActive,clipIndex:ft,renderTimeRange:Ae,visibleTimeRange:_e,pinnedClipIdentities:ot,trackOrder:St,tracks:Jt,trackStyles:Je,groups:Ye,laneCounts:Ke,selectedElementId:F,selectedElementIds:U,hoveredClip:we,draggedClip:gt,resizingClip:On,isScrubbing:wa,blockedClipRef:xt,suppressClickRef:Ut,scrollRef:ve,renderClipContent:Kr.rowVirtualizationActive&&gn.isScrolling?void 0:r,renderClipOverlay:i,playheadRef:ge,onDrillDown:n,onSelectElement:v,setHoveredClip:Ce,setShowPopover:Ze,setRangeSelection:vs,setResizingClip:_n,setDraggedClip:nr,setSelectedElementId:H,shiftClickClipRef:Lc,getPreviewElement:Vr,getTrackStyle:Ofe,keyframeCache:fn,gsapAnimations:K,selectedKeyframes:Bi,currentTime:se,onSeek:e,beatAnalysis:ne,onSelectSegment:Ha,onClickKeyframe:Mr,onShiftClickKeyframe:xi,onMoveKeyframe:$,onContextMenuKeyframe:Sa,onContextMenuClip:(kt,vi)=>{kt.preventDefault(),H(vi.key??vi.id),v==null||v(vi),In(),vt({x:kt.clientX,y:kt.clientY,element:vi,sessionEpoch:fe.getState().timelineSessionEpoch})},onContextMenuLane:(kt,vi,fh)=>{gt!=null&>.started||On||(vt(null),er({x:kt.clientX,y:kt.clientY,track:vi,time:fh}))}}),xe==="razor"&&or!==null&&p.jsx(M$e,{x:or})]}),p.jsx(XFe,{elements:J,elementsRef:Te,theme:Q,showShortcutHint:Lt,showPopover:tt,rangeSelection:Br,setShowPopover:Ze,setRangeSelection:vs,kfContextMenu:qe,setKfContextMenu:pt,onDeleteKeyframe:j,onDeleteAllKeyframes:L,onMoveKeyframeToPlayhead:B,clipContextMenu:it,setClipContextMenu:vt,currentTime:se,onSplitElement:I,pinZoomBeforeEdit:Gt,onDeleteElement:c,gapContextMenu:hn,onDismissGapContextMenu:In,onCloseTrackGap:yr,onCloseAllTrackGaps:tr,onHoverGapAction:dn})]})}),vBe={overscan:0,visible:1,interaction:2},lW=Object.freeze({status:"idle"});function ABe(t){return t==="video"?"video":t==="composition"?"composition":"general"}function SBe(t){return t instanceof Error?t:new Error(String(t))}function OS(t){return Object.entries(t).filter(e=>e[1]!==void 0).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`).join("&")}function __(t){return OS({project:t.projectId,session:t.sessionEpoch,request:t.key,kind:t.kind,rich:t.rich?1:0})}class wBe{constructor(e=el,n=Date.now){Et(this,"entries",new Map);Et(this,"budgets");Et(this,"nextLeaseId",1);Et(this,"nextSequence",1);Et(this,"scrolling",!1);Et(this,"cacheBytes",0);Et(this,"waveformCacheBytes",0);Et(this,"activeByBucket",{video:0,composition:0,general:0});Et(this,"activeByKind",{video:0,image:0,composition:0,waveform:0});Et(this,"now");this.budgets=e,this.now=n}acquire(e,n){const r=__(e);let i=this.entries.get(r);(i==null?void 0:i.state)==="error"&&i.failedAt!==void 0&&this.now()-i.failedAt>=this.budgets.metadataFailureTtlMs&&(this.deleteEntry(r,i),i=this.entries.get(r)),i||(i={request:e,scopedKey:r,state:"queued",leases:new Map,listeners:new Map,controller:null,weight:0,disposed:!1,cached:!1,lastAccess:this.nextSequence++,snapshot:Object.freeze({status:"queued"})},this.entries.set(r,i));const s=this.nextLeaseId++;i.leases.set(s,e.priority),i.listeners.set(s,n),i.lastAccess=this.nextSequence++,this.pump();let a=!1;return{updatePriority:o=>{const l=this.entries.get(r);!l||!l.leases.has(s)||(l.leases.set(s,o),l.lastAccess=this.nextSequence++,this.pump())},release:()=>{var l;if(a)return;a=!0;const o=this.entries.get(r);o&&(o.leases.delete(s),o.listeners.delete(s),o.leases.size===0&&(o.state==="queued"?this.deleteEntry(r,o):o.state==="loading"?((l=o.controller)==null||l.abort(),this.deleteEntry(r,o)):o.state==="ready"&&!o.cached&&this.deleteEntry(r,o)),this.evict())}}}getSnapshot(e){const n=this.entries.get(__(e));return n?n.snapshot:lW}setScrolling(e){this.scrolling!==e&&(this.scrolling=e,e||this.pump())}invalidateProject(e){var n;for(const[r,i]of this.entries)i.request.projectId===e&&(i.leases.size>0||((n=i.controller)==null||n.abort(),this.deleteEntry(r,i)))}getDiagnostics(){let e=0,n=0,r=0,i=0,s=0;for(const a of this.entries.values())a.state==="queued"&&e++,a.state==="loading"&&n++,a.cached&&(a.request.kind==="waveform"?s++:i++),r+=a.leases.size;return{queued:e,active:n,leases:r,cacheEntries:i,cacheBytes:this.cacheBytes,waveformCacheEntries:s,waveformCacheBytes:this.waveformCacheBytes,activeByKind:{...this.activeByKind}}}pump(){const e=Array.from(this.entries.values()).filter(n=>n.state==="queued"&&n.leases.size>0).sort((n,r)=>this.entryPriority(r)-this.entryPriority(n)||n.lastAccess-r.lastAccess);for(const n of e){if(this.scrolling&&n.request.rich)continue;const r=ABe(n.request.kind);this.activeByBucket[r]>=this.bucketLimit(r)||this.start(n,r)}}start(e,n){e.state="loading",e.snapshot=Object.freeze({status:"loading"});const r=new AbortController;e.controller=r,this.activeByBucket[n]++,this.activeByKind[e.request.kind]++,this.notify(e),this.loadWithTimeout(e,r).then(s=>this.acceptResult(e,r,s)).catch(s=>{if(this.entries.get(e.scopedKey)===e){if(r.signal.aborted&&e.leases.size===0){this.deleteEntry(e.scopedKey,e);return}e.state="error",e.error=SBe(s),e.failedAt=this.now(),e.snapshot=Object.freeze({status:"error",error:e.error}),this.notify(e),this.evictFailures()}}).finally(()=>{e.controller===r&&(e.controller=null),this.activeByBucket[n]--,this.activeByKind[e.request.kind]--,this.pump()})}acceptResult(e,n,r){if(n.signal.aborted||this.entries.get(e.scopedKey)!==e){this.safeDispose(r.dispose);return}this.validateResult(r),e.state="ready",e.value=r.value,e.weight=r.weight,e.dispose=r.dispose,this.cacheResult(e),e.snapshot=Object.freeze({status:"ready",value:r.value}),this.notify(e),this.evict(),!e.cached&&e.leases.size===0&&this.deleteEntry(e.scopedKey,e)}validateResult(e){if(!(Number.isFinite(e.weight)&&e.weight>=0))throw this.safeDispose(e.dispose),new RangeError("Thumbnail result weight must be finite and non-negative")}cacheResult(e){const n=e.request.kind==="waveform",r=n?this.budgets.waveformCacheBytes:this.budgets.thumbnailCacheBytes;e.cached=e.weight<=r,e.cached&&(n?this.waveformCacheBytes+=e.weight:this.cacheBytes+=e.weight)}entryPriority(e){let n=-1;for(const r of e.leases.values())n=Math.max(n,vBe[r]);return n}bucketLimit(e){return e==="video"?this.budgets.concurrentVideoDecodes:e==="composition"?this.budgets.concurrentCompositionFetches:this.budgets.concurrentMetadataJobs}evict(){this.evictPartition(!1),this.evictPartition(!0)}evictPartition(e){const n=Array.from(this.entries.values()).filter(s=>s.cached&&s.request.kind==="waveform"===e),r=new Map;for(const s of n)r.set(s.request.projectId,(r.get(s.request.projectId)??0)+1);n.sort((s,a)=>s.lastAccess-a.lastAccess);let i=n.length;for(const s of n){const a=r.get(s.request.projectId)??0;this.isCacheOverBudget(e,i,a)&&(this.uncache(s),i--,r.set(s.request.projectId,a-1),s.leases.size===0&&this.deleteEntry(s.scopedKey,s))}}isCacheOverBudget(e,n,r){const i=e?this.budgets.waveformCacheEntries:this.budgets.thumbnailCacheEntries,s=e?this.budgets.waveformCacheBytes:this.budgets.thumbnailCacheBytes,a=e?this.waveformCacheBytes:this.cacheBytes,o=!e&&r>this.budgets.thumbnailCacheEntriesPerProject;return n>i||a>s||o}uncache(e){e.cached=!1,e.request.kind==="waveform"?this.waveformCacheBytes-=e.weight:this.cacheBytes-=e.weight}notify(e){for(const n of new Set(e.listeners.values()))n()}loadWithTimeout(e,n){let r;try{r=e.request.load(n.signal)}catch(i){r=Promise.reject(i)}return new Promise((i,s)=>{let a=!1;const o=setTimeout(()=>{a||(a=!0,n.abort(),s(new Error(`Thumbnail load timed out after ${this.budgets.thumbnailLoadTimeoutMs}ms`)))},this.budgets.thumbnailLoadTimeoutMs);r.then(l=>{if(a){this.safeDispose(l.dispose);return}a=!0,clearTimeout(o),i(l)},l=>{a||(a=!0,clearTimeout(o),s(l))})})}deleteEntry(e,n){this.entries.get(e)===n&&(this.entries.delete(e),n.snapshot=lW,this.notify(n),n.cached&&(n.cached=!1,n.request.kind==="waveform"?this.waveformCacheBytes-=n.weight:this.cacheBytes-=n.weight),n.disposed||(n.disposed=!0,this.safeDispose(n.dispose)),n.listeners.clear(),n.leases.clear())}evictFailures(){const e=Array.from(this.entries.values()).filter(r=>r.state==="error"&&r.leases.size===0).sort((r,i)=>r.lastAccess-i.lastAccess),n=e.length-this.budgets.thumbnailCacheEntries;for(const r of e.slice(0,Math.max(0,n)))this.deleteEntry(r.scopedKey,r)}safeDispose(e){try{e==null||e()}catch{}}}const OBe=new wBe,cW=Object.freeze({status:"idle"});function r3(t,e=OBe){const n=x.useRef(t);n.current=t;const r=x.useRef(null),i=t?__(t):null,s=t==null?void 0:t.priority,a=x.useCallback(l=>{const c=n.current;if(!c||i===null)return()=>{};const u=e.acquire(c,l);return r.current=u,()=>{r.current===u&&(r.current=null),u.release()}},[i,e]),o=x.useCallback(()=>{const l=n.current;return l&&i!==null?e.getSnapshot(l):cW},[i,e]);return x.useLayoutEffect(()=>{var l;s&&((l=r.current)==null||l.updatePriority(s))},[s]),x.useSyncExternalStore(a,o,()=>cW)}function CBe(t,e,n){const r=Math.max(0,Number.isFinite(t)?t:0),i=Math.max(0,Number.isFinite(e)?e:0),s=Math.max(1,Number.isFinite(n)?Math.floor(n):1);return s===1?[r+i/2]:Array.from({length:s},(a,o)=>r+i*o/(s-1))}async function kBe(t){return t instanceof HTMLCanvasElement?new Promise((e,n)=>{t.toBlob(r=>r?e(r):n(new Error("Video thumbnail encode failed")),"image/jpeg",.72)}):t.convertToBlob({type:"image/jpeg",quality:.72})}function T1(t){if(t.aborted)throw new DOMException("Aborted","AbortError")}function qhe(t){for(const e of t.urls.splice(0))URL.revokeObjectURL(e);for(const e of t.canvases)e.width=0,e.height=0;t.canvases.clear()}function EBe(t,e){const n=Math.max(1,Math.min(e.posterMaxPhysicalWidth,Math.round(e.posterMaxPhysicalHeight*t)));return{width:n,height:Math.max(1,Math.min(e.posterMaxPhysicalHeight,Math.round(n/t)))}}async function TBe(t,e,n,r){for await(const i of t.canvasesAtTimestamps(e)){if(T1(n),!i)continue;r.canvases.add(i.canvas);const s=await kBe(i.canvas);T1(n),r.urls.push(URL.createObjectURL(s))}}function PBe(t,e,n,r){const i=t.urls[0];if(!i)throw new Error("Video source returned no thumbnail frames");return{value:t.urls.length===1?{kind:"image",url:i,aspect:e}:{kind:"filmstrip",urls:[...t.urls],aspect:e},weight:n*r*4*t.urls.length,dispose:()=>qhe(t)}}async function MBe(t,e,n=el){const r=await ly(()=>import("./index-CklNVmi3.js"),[]);T1(e);const i=new r.Input({source:new r.UrlSource(t.source),formats:r.ALL_FORMATS}),s={urls:[],canvases:new Set};try{const a=await i.getPrimaryVideoTrack();if(T1(e),!a)throw new Error("Video source has no decodable video track");const[o,l]=await Promise.all([a.getDisplayWidth(),a.getDisplayHeight()]);if(T1(e),!(o>0&&l>0))throw new Error("Video source has invalid dimensions");const c=await a.getDurationFromMetadata({skipLiveWait:!0});T1(e);const u=Math.max(0,c??t.sourceRangeDuration??0),f=Math.min(Math.max(0,t.sourceStart??0),u),h=t.sourceRangeDuration??Math.max(0,u-f),m=Math.min(Math.max(0,h),Math.max(0,u-f)),y=CBe(f,m,Math.min(t.frameCount,n.richPreviewFrameCount)),d=o/l,v=EBe(d,n),b=new r.CanvasSink(a,{width:v.width,height:v.height,fit:t.fit??"cover",poolSize:1});return await TBe(b,y,e,s),PBe(s,d,v.width,v.height)}catch(a){throw qhe(s),a}finally{i.dispose()}}const Yhe=66;function Khe(t,e,n=!1){return new Promise((r,i)=>{const s=new Image,a=()=>{s.onload=null,s.onerror=null,e.removeEventListener("abort",o)},o=()=>{a(),s.src="",i(new DOMException("Aborted","AbortError"))};if(e.aborted){o();return}s.onload=()=>{a(),r(s.naturalWidth>0&&s.naturalHeight>0?s.naturalWidth/s.naturalHeight:16/9)},s.onerror=()=>{a(),n&&/\.svg($|\?)/i.test(t)?r(16/9):i(new Error("Image thumbnail failed to load"))},e.addEventListener("abort",o,{once:!0}),s.src=t})}function yF(t,e,n=Yhe,r=1){const i=Number.isFinite(e)&&e>0?e:1.7777777777777777,s=Math.max(r,Math.round(n*i)),a=t>0?Math.max(1,Math.ceil(t/s)):1;return{frameW:s,frameCount:a}}function pA(t){return t.split("/").map(encodeURIComponent).join("/")}function Ay(t,e,n){if(!t||/^(?:data:|blob:)/i.test(t))return t;let r=t,i="";if(/^https?:/i.test(t)){let s;try{s=new URL(t)}catch{return t}if(!n||s.origin!==n)return t;const a=new URL(`/api/projects/${e}/preview/`,n).pathname;if(s.pathname.startsWith(a)||s.pathname.startsWith("/api/"))return t;try{r=s.pathname.replace(/^\/+/,"").split("/").map(decodeURIComponent).join("/")}catch{return t}i=`${s.search}${s.hash}`}return`/api/projects/${e}/preview/${pA(r.replace(/^\/+/,""))}${i}`}const NBe=x.memo(function({videoSrc:e,label:n,labelColor:r,duration:i=5,sourceStart:s,sourceRangeDuration:a,projectId:o=e,sessionEpoch:l=0,priority:c="visible",rich:u=!1}){const[f,h]=x.useState(0),m=x.useRef(null),y=x.useMemo(()=>({key:OS({kind:"video",source:e,start:s,duration:a??i,frames:u?6:1}),projectId:o,sessionEpoch:l,kind:"video",priority:c,rich:u,load:M=>MBe({source:e,sourceStart:s,sourceRangeDuration:a??i,frameCount:u?6:1,fit:"cover"},M)}),[i,c,o,u,l,a,s,e]),d=r3(y),v=d.status==="ready"?d.value:null,b=(v==null?void 0:v.kind)==="filmstrip"?v.urls:(v==null?void 0:v.kind)==="image"?[v.url]:[],w=(v==null?void 0:v.kind)==="image"||(v==null?void 0:v.kind)==="filmstrip"?v.aspect:16/9,{frameW:O,frameCount:k}=yF(f,w,Yhe),E=x.useCallback(M=>{var I;if((I=m.current)==null||I.disconnect(),!M)return;const N=M.parentElement??M;h(N.clientWidth),m.current=new ResizeObserver(([_])=>h(_.contentRect.width)),m.current.observe(N)},[]);return wr(()=>()=>{var M;return(M=m.current)==null?void 0:M.disconnect()}),p.jsxs("div",{ref:E,className:"absolute inset-0 overflow-hidden",children:[b.length>0&&p.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:k},(M,N)=>{const I=b[N%b.length];return p.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden bg-neutral-900",style:{width:O},children:p.jsx("img",{src:I,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover"})},N)})}),d.status==="loading"&&b.length===0&&p.jsx("div",{className:"absolute inset-0 animate-pulse motion-reduce:animate-none",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),d.status==="error"&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-neutral-900/60",children:p.jsx("span",{className:"rounded bg-black/50 px-1 text-[8px] text-neutral-500",children:"no preview"})}),n&&p.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 px-1.5 pb-0.5 pt-3",style:{background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)"},children:p.jsx("span",{className:"block truncate text-[9px] font-semibold leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})}),DBe=66,IBe="v3";function xF({previewUrl:t,seekTime:e=2,duration:n=5,selector:r,selectorIndex:i,origin:s,output:a}){const o=t.replace("/preview/comp/","/thumbnail/").replace(/\/preview$/,"/thumbnail/index.html"),l=new URL(o,s);return l.searchParams.set("t",(e+n/2).toFixed(2)),l.searchParams.set("v",IBe),a&&l.searchParams.set("output",a),r&&(l.searchParams.set("selector",r),i!=null&&i>0&&l.searchParams.set("selectorIndex",String(i))),l.toString()}async function _Be(t,e){const n=await fetch(t,{signal:e});if(!n.ok)throw new Error(`Composition thumbnail failed (${n.status})`);const r=await n.blob();if(e.aborted)throw new DOMException("Aborted","AbortError");const i=URL.createObjectURL(r);try{const s=await Khe(i,e);return{value:{kind:"image",url:i,aspect:s},weight:el.posterMaxPhysicalWidth*el.posterMaxPhysicalHeight*4,dispose:()=>URL.revokeObjectURL(i)}}catch(s){throw URL.revokeObjectURL(i),s}}const vM=x.memo(function({previewUrl:e,label:n,labelColor:r,selector:i,selectorIndex:s,seekTime:a=2,duration:o=5,projectId:l=e,sessionEpoch:c=0,priority:u="visible"}){const[f,h]=x.useState(0),m=x.useRef(null),y=xF({previewUrl:e,seekTime:a,duration:o,selector:i,selectorIndex:s,origin:window.location.origin}),d=x.useMemo(()=>({key:OS({kind:"composition",url:y}),projectId:l,sessionEpoch:c,kind:"composition",priority:u,rich:!0,load:E=>_Be(y,E)}),[u,l,c,y]),v=r3(d),b=v.status==="ready"&&v.value.kind==="image"?v.value:null,{frameW:w,frameCount:O}=yF(f,(b==null?void 0:b.aspect)??16/9,DBe,48),k=x.useCallback(E=>{var N;if((N=m.current)==null||N.disconnect(),!E)return;const M=E.parentElement??E;h(M.clientWidth),m.current=new ResizeObserver(([I])=>h(I.contentRect.width)),m.current.observe(M)},[]);return wr(()=>()=>{var E;return(E=m.current)==null?void 0:E.disconnect()}),p.jsxs("div",{ref:k,className:"absolute inset-0 overflow-hidden",children:[b&&p.jsx("div",{className:"absolute inset-0 flex",style:{animation:"hf-thumb-fade 200ms ease-out",mixBlendMode:"lighten"},children:Array.from({length:O},(E,M)=>p.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden",style:{width:w},children:p.jsx("img",{src:b.url,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover",style:{opacity:.7}})},M))}),v.status==="loading"&&p.jsx("div",{className:"absolute inset-0 animate-pulse bg-white/[0.035]"}),n&&p.jsx("div",{className:"absolute inset-y-0 left-3 z-10 flex items-center",children:p.jsx("span",{className:"block max-w-full truncate text-[10px] font-semibold leading-none",style:{color:r,textShadow:b?"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6)":"none"},children:n})})]})});let uW=0;const RBe=800,fW={isEditMode:!1,dismissed:!1,model:null,selectedSegmentIds:new Set,selectedGroupId:null,sourceFilePath:null,syncError:null,retrySave:null,past:[],future:[]};let tv=null,AM=0;function Zc(t,e){if(!t.model)return{};const n=Date.now();return tv===e&&n-AM<RBe?(AM=n,{future:[]}):(tv=e,AM=n,{past:[...t.past,t.model].slice(-50),future:[]})}const An=rE((t,e)=>({...fW,setEditMode:n=>t({isEditMode:n}),setDismissed:n=>t({dismissed:n}),setModel:n=>t({model:n}),setSourceFilePath:n=>t({sourceFilePath:n}),setSyncError:n=>t({syncError:n}),setRetrySave:n=>t({retrySave:n}),undo:()=>{const{model:n,past:r,future:i}=e(),s=r[r.length-1];return!s||!n?null:(tv=null,t({model:s,past:r.slice(0,-1),future:[...i,n]}),s)},redo:()=>{const{model:n,past:r,future:i}=e(),s=i[i.length-1];return!s||!n?null:(tv=null,t({model:s,past:[...r,n].slice(-50),future:i.slice(0,-1)}),s)},selectSegment:(n,r=!1)=>t(i=>{if(r){const s=new Set(i.selectedSegmentIds);return s.has(n)?s.delete(n):s.add(n),{selectedSegmentIds:s,selectedGroupId:null}}return{selectedSegmentIds:new Set([n]),selectedGroupId:null}}),selectGroup:n=>{var i;const r=(i=e().model)==null?void 0:i.groups.get(n);r&&t({selectedSegmentIds:new Set(r.segmentIds),selectedGroupId:n})},selectAll:()=>t(n=>n.model?{selectedSegmentIds:new Set(n.model.segments.keys()),selectedGroupId:null}:{}),clearSelection:()=>{const{selectedSegmentIds:n,selectedGroupId:r}=e();n.size===0&&r===null||t({selectedSegmentIds:new Set,selectedGroupId:null})},updateSegmentStyle:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.segments.get(n);if(!s)return{};const a=new Map(i.model.segments);return a.set(n,{...s,style:{...s.style,...r}}),{...Zc(i,`seg-style:${n}`),model:{...i.model,segments:a}}}),updateSegmentText:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.segments.get(n);if(!s)return{};const a=new Map(i.model.segments);return a.set(n,{...s,text:r}),{...Zc(i,`seg-text:${n}`),model:{...i.model,segments:a}}}),updateSegmentTiming:(n,r,i)=>t(s=>{if(!s.model)return{};const a=s.model.segments.get(n);if(!a)return{};const o=new Map(s.model.segments);return o.set(n,{...a,start:r,end:i}),{...Zc(s,`seg-timing:${n}`),model:{...s.model,segments:o}}}),updateGroupStyle:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=new Map(i.model.groups);return a.set(n,{...s,style:{...s.style,...r}}),{...Zc(i,`group-style:${n}`),model:{...i.model,groups:a}}}),updateGroupContainer:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=new Map(i.model.groups);return a.set(n,{...s,containerStyle:{...s.containerStyle,...r}}),{...Zc(i,`group-container:${n}`),model:{...i.model,groups:a}}}),updateGroupAnimation:(n,r,i)=>t(s=>{if(!s.model)return{};const a=s.model.groups.get(n);if(!a)return{};const o=new Map(s.model.groups),l=a.animation[r],c=l!==null?{...l,...i}:i;return o.set(n,{...a,animation:{...a.animation,[r]:c}}),{...Zc(s,`group-anim:${n}:${r}`),model:{...s.model,groups:o}}}),splitGroup:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=s.segmentIds.indexOf(r);if(a<=0)return{};const o=s.segmentIds.slice(0,a),l=s.segmentIds.slice(a),c=`group-split-${uW++}`,u=new Map(i.model.groups);u.set(n,{...s,segmentIds:o}),u.set(c,{...s,id:c,segmentIds:l});const f=i.model.groupOrder.indexOf(n),h=[...i.model.groupOrder];h.splice(f+1,0,c);const m=new Map(i.model.segments);return l.forEach((y,d)=>{const v=m.get(y);v&&m.set(y,{...v,groupIndex:d})}),{...Zc(i,`split:${n}:${r}:${uW}`),model:{...i.model,groups:u,segments:m,groupOrder:h}}}),mergeGroups:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n),a=i.model.groups.get(r);if(!s||!a)return{};const o=[...s.segmentIds,...a.segmentIds],l=new Map(i.model.groups);l.set(n,{...s,segmentIds:o}),l.delete(r);const c=i.model.groupOrder.filter(h=>h!==r),u=new Map(i.model.segments);a.segmentIds.forEach((h,m)=>{const y=u.get(h);y&&u.set(h,{...y,groupIndex:s.segmentIds.length+m})});const f=i.selectedGroupId===r?null:i.selectedGroupId;return{...Zc(i,`merge:${n}:${r}`),model:{...i.model,groups:l,segments:u,groupOrder:c},selectedGroupId:f}}),updateSelectedStyle:n=>t(r=>{if(!r.model||r.selectedSegmentIds.size===0)return{};const i=new Map(r.model.segments);for(const s of r.selectedSegmentIds){const a=i.get(s);a&&i.set(s,{...a,style:{...a.style,...n}})}return{...Zc(r,`sel-style:${[...r.selectedSegmentIds].join(",")}`),model:{...r.model,segments:i}}}),applyAnimationToAll:n=>t(r=>{if(!r.model)return{};const i=new Map(r.model.groups);for(const[s,a]of i)i.set(s,{...a,animation:n});return{...Zc(r,"apply-anim-all"),model:{...r.model,groups:i}}}),reset:()=>{tv=null,t(n=>({...fW,retrySave:n.retrySave,selectedSegmentIds:new Set,past:[],future:[]}))}})),jBe=new Set(["ArrowLeft","ArrowRight"]),LBe=["button","a[href]","[role='button']","[role='checkbox']","[role='combobox']","[role='menuitem']","[role='radio']","[role='slider']","[role='spinbutton']","[role='switch']","[role='textbox']"].join(",");function FBe(t){if(Hf(t))return!0;if(!t||typeof t!="object")return!1;const e=t;return typeof e.closest!="function"?!1:e.closest.call(t,LBe)!==null}function $Be(t,e={isCaptionEditMode:!1,selectedCaptionSegmentCount:0}){return t.metaKey||t.ctrlKey||t.altKey||FBe(t.target)?!0:jBe.has(t.code)&&e.isCaptionEditMode&&e.selectedCaptionSegmentCount>0}const hW=[1,2,4];let R_=0;function BBe(){R_+=1;let t=!1;return()=>{t||(t=!0,R_-=1)}}function VBe(){return R_>0}function HBe({iframeRef:t,shuttleDirectionRef:e,shuttleSpeedIndexRef:n,iframeShortcutCleanupRef:r,getAdapter:i,play:s,playBackward:a,pause:o,seek:l}){const c=x.useRef(new Set),u=x.useRef(()=>{}),f=x.useRef(()=>{}),h=x.useCallback(w=>{const O=i(),k=(O==null?void 0:O.getTime())??fe.getState().currentTime;l(N6e(k,w,Bd))},[i,l]),m=x.useCallback(w=>{e.current===w?n.current=Math.min(n.current+1,hW.length-1):n.current=0;const O=hW[n.current];fe.getState().setPlaybackRate(O),w==="forward"?s():a(O)},[s,a,e,n]),y=x.useCallback(()=>{fe.getState().isPlaying?o():s()},[s,o]),d=x.useCallback(w=>{var M,N,I;if(w.defaultPrevented)return;const O=An.getState();if($Be(w,{isCaptionEditMode:O.isEditMode,selectedCaptionSegmentCount:O.selectedSegmentIds.size}))return;const k=w.key.toLowerCase();if(c.current.add(k),w.code==="Space"){w.preventDefault(),y();return}if(!((w.code==="ArrowLeft"||w.code==="ArrowRight")&&VBe())){if(w.code==="ArrowLeft"){w.preventDefault(),h(w.shiftKey?-10:-1);return}if(w.code==="ArrowRight"){w.preventDefault(),h(w.shiftKey?10:1);return}if(!w.repeat){if(k==="m"){w.preventDefault();const _=fe.getState();_.setAudioMuted(!_.audioMuted);return}if(k==="l"&&w.shiftKey){w.preventDefault();const _=fe.getState();_.setLoopEnabled(!_.loopEnabled);return}if(k==="k"){w.preventDefault(),o();return}if(k==="j"){if(w.preventDefault(),c.current.has("k")){h(-1);return}m("backward");return}if(k==="l"){if(w.preventDefault(),c.current.has("k")){h(1);return}m("forward");return}if(k==="i"){w.preventDefault();const _=((M=i())==null?void 0:M.getTime())??fe.getState().currentTime;fe.getState().setInPoint(w.shiftKey?null:_);return}if(k==="o"){w.preventDefault();const _=((N=i())==null?void 0:N.getTime())??fe.getState().currentTime;fe.getState().setOutPoint(w.shiftKey?null:_);return}if(k==="a"){w.preventDefault(),l(fe.getState().inPoint??0,{keepPlaying:!0});return}if(k==="e"){w.preventDefault();const{outPoint:_}=fe.getState();l(_??((I=i())==null?void 0:I.getDuration())??fe.getState().duration,{keepPlaying:!0});return}}}},[o,m,h,y,i,l]),v=x.useCallback(w=>{c.current.delete(w.key.toLowerCase())},[]);u.current=d,f.current=v;const b=x.useCallback(()=>{var M,N,I;(M=r.current)==null||M.call(r),r.current=null;let w=null,O=null;try{w=((N=t.current)==null?void 0:N.contentWindow)??null,O=((I=t.current)==null?void 0:I.contentDocument)??null}catch{return}if(!w&&!O)return;const k=_=>u.current(_),E=_=>f.current(_);try{w==null||w.addEventListener("keydown",k,!0),w==null||w.addEventListener("keyup",E,!0)}catch{}O==null||O.addEventListener("keydown",k,!0),O==null||O.addEventListener("keyup",E,!0),r.current=()=>{try{w==null||w.removeEventListener("keydown",k,!0),w==null||w.removeEventListener("keyup",E,!0)}catch{}O==null||O.removeEventListener("keydown",k,!0),O==null||O.removeEventListener("keyup",E,!0)}},[t,r]);return{playbackKeyDownRef:u,playbackKeyUpRef:f,attachIframeShortcutListeners:b,togglePlay:y}}function j_(t){return Number.isFinite(t)&&t>0&&t<7200?t:0}function QBe(t){const e=t.getAttribute(Zo);if(!e)return{};const n=yE(t.ownerDocument,e);return{audioGroup:e,audioGroupLabel:n.label,audioGroupVolume:n.volume,audioGroupHidden:n.hidden,...n.fxChain?{audioGroupFxChain:n.fxChain}:{},...n.automation?{audioGroupAutomation:n.automation}:{}}}function zBe(t){const e=new Map,n=t==null?void 0:t.__clipTree;if(!n)return e;const r=i=>{for(const s of i)s.id&&s.parentId&&e.set(s.id,s.parentId),s.children.length>0&&r(s.children)};return r(n.roots),e}function L_(t,e,n,r,i){for(const s of Array.from(e.children)){if(!s.id){L_(t,s,n,r,i);continue}const a=s.hasAttribute("data-hf-group");i.push({id:s.id,parentId:n,hostId:t,label:a&&s.getAttribute("data-hf-group")||s.id,stackingContextId:Aj(s),...QBe(s)}),r.set(s.id,n),a&&L_(t,s,s.id,r,i)}}function ZBe(t,e,n){const r=[];if(!t)return r;for(const i of e){if(i.kind!=="composition"||!i.id)continue;const s=t.getElementById(i.id);if(!s)continue;const a=s.querySelector("[data-hf-inner-root]")??s;L_(i.id,a,i.id,n,r)}return r}function Jhe(t){try{return(t==null?void 0:t.contentDocument)??null}catch{return null}}function GBe(t,e){const n=new Set;return t.map((r,i)=>{const s=e?uCe(e,r,i,n):null;return s&&n.add(s),aae({clip:r,fallbackIndex:i,doc:e,hostEl:s})})}function UBe(t,e,n){const r=XBe(t,n);return!e||n<=0?r:[...r,...oae(e,n,r)]}function XBe(t,e){return e<=0?[...t]:t.filter(n=>n.start<e).map(n=>({...n,duration:Math.min(n.duration,e-n.start)})).filter(n=>n.duration>0)}function WBe(t){const e=t.pendingSeek??t.requestedSeek??t.storeCurrentTime;return!Number.isFinite(e)||e<=0?0:!Number.isFinite(t.duration)||t.duration<=0?e:Math.min(e,t.duration)}function qBe(t,e){const n=fe.getState().requestedSeekTime,r=WBe({pendingSeek:e.current,requestedSeek:n,storeCurrentTime:fe.getState().currentTime,duration:t.getDuration()});return e.current=null,n!=null&&fe.getState().clearSeekRequest(),t.seek(r>.001?Math.max(0,r-.001):.001),t.seek(r),r}function YBe(t,e){const n=j_(t.getDuration());n>0&&n!==fe.getState().duration&&e(n)}function KBe(t,e,n,r){const i=lae(t,n);if(i.length>0){r(i);return}const s=t.querySelector("[data-composition-id]");if(!s||n<=0)return;const a=kEe({compositionId:s.getAttribute("data-composition-id")||"composition",tagName:s.tagName||"div",rootDuration:n,iframeSrc:(e==null?void 0:e.src)||"",selector:h0(s)});a&&r([a])}function JBe(t,e){return!t.source||!e?!0:t.source===e.contentWindow}function eVe(t,e){if(!JBe(t,e))return!1;const n=t.data;return(n==null?void 0:n.source)!=="hf-preview"||(n==null?void 0:n.type)!=="state"&&(n==null?void 0:n.type)!=="timeline"?!1:Sj(n).status!=="unsupported"}function tVe(t,e,n){!t||!e||(oEe(t,e),lEe(t),n())}function nVe(t,e){const n=t==null?void 0:t.__clipManifest;n&&n.clips.length>0&&e(n)}function rVe(t){const{iframe:e,adapter:n,syncTimelineElements:r}=t;try{const i=Jhe(e),s=(e==null?void 0:e.contentWindow)??null;tVe(i,s,t.attachIframeShortcutListeners),nVe(s,t.processTimelineMessage),t.enrichMissingCompositions(),t.applyPreviewAudioState(),i&&fe.getState().elements.length===0&&KBe(i,e,n.getDuration(),r)}catch{}}function dW(t){t&&t.style.visibility==="hidden"&&(t.style.visibility="")}function iVe(t){return Math.max(j_(t.manifestDurationSeconds),j_(t.authoredRootDurationSeconds))}function sVe({iframeRef:t,probeIntervalRef:e,pendingSeekRef:n,isRefreshingRef:r,getAdapter:i,syncTimelineElements:s,setDuration:a,setCurrentTime:o,setTimelineReady:l,setIsPlaying:c,attachIframeShortcutListeners:u,applyPreviewAudioState:f}){const h=x.useCallback(w=>{var _;if(!w.clips||w.clips.length===0)return;fe.getState().setClipManifest(w.clips);const O=new Set(w.clips.map(j=>j.compositionId).filter(Boolean)),k=w.clips.filter(j=>!j.parentCompositionId||!O.has(j.parentCompositionId)),E=Jhe(t.current);try{const j=zBe(((_=t.current)==null?void 0:_.contentWindow)??null),L=ZBe(E,w.clips,j);fe.getState().setClipParentMap(j),fe.getState().setDomClipChildren(L)}catch{}const M=GBe(k,E),N=iVe({manifestDurationSeconds:w.durationInFrames/aEe(w),authoredRootDurationSeconds:Tse(E)}),I=UBe(M,E,N>0?N:fe.getState().duration);I.length>0&&s(I,N>0?N:void 0)},[t,s]),m=x.useCallback(()=>{try{const w=t.current,O=w==null?void 0:w.contentDocument,k=w==null?void 0:w.contentWindow;if(!O||!k)return;const E=fe.getState().elements,M=fe.getState().duration,{missing:N,updatedEls:I,patched:_}=wEe(O,k,E,M);if(N.length>0||_){const j=new Set(I.map(B=>B.id)),L=N.filter(B=>!j.has(B.id));s([...I,...L])}}catch{}},[t,s]),y=x.useCallback(()=>{const w=i();if(!w||w.getDuration()<=0)return!1;w.pause();const O=qBe(w,n);return dW(t.current),ya.notify(O),YBe(w,a),o(O),r.current||l(!0),r.current=!1,c(!1),rVe({iframe:t.current,adapter:w,processTimelineMessage:h,enrichMissingCompositions:m,applyPreviewAudioState:f,attachIframeShortcutListeners:u,syncTimelineElements:s}),!0},[i,a,o,l,c,h,m,s,u,f,t,r,n]),d=x.useCallback(()=>{if(f(),e.current&&clearInterval(e.current),y())return;const w=t.current;let O=!1;const k=()=>{O||y()&&(O=!0,window.removeEventListener("message",E),e.current&&clearInterval(e.current))},E=M=>{eVe(M,w)&&k()};window.addEventListener("message",E),e.current=setTimeout(()=>{O||k(),window.removeEventListener("message",E),dW(t.current)},5e3)},[y,t,e,f]);return{processTimelineMessage:h,processTimelineMessageRef:{current:h},enrichMissingCompositions:m,enrichMissingCompositionsRef:{current:m},initializeAdapter:y,onIframeLoad:d}}function aVe({rafRef:t,reverseRafRef:e,getAdapter:n,setCurrentTime:r,setIsPlaying:i}){const s=x.useCallback(()=>{cancelAnimationFrame(e.current)},[e]),a=x.useCallback(()=>{const l=()=>{const c=n();if(c){const u=c.getTime(),f=c.getDuration(),h=f>0?Math.min(u,f):u;ya.notify(h);const{inPoint:m,outPoint:y}=fe.getState(),d=y!==null?Math.min(y,f):f,v=m!==null?m:0,b=v<d?d:f,w=v<d?v:0;if(h>=b){if(fe.getState().loopEnabled&&f>0){c.seek(w,{keepPlaying:!0}),ya.notify(w),c.play(),i(!0),t.current=requestAnimationFrame(l);return}c.isPlaying()&&c.pause(),r(h),i(!1),cancelAnimationFrame(t.current);return}}t.current=requestAnimationFrame(l)};t.current=requestAnimationFrame(l)},[t,n,r,i]),o=x.useCallback(()=>{cancelAnimationFrame(t.current)},[t]);return{startRAFLoop:a,stopRAFLoop:o,stopReverseLoop:s}}function Z0(t){let e=null;return(n,r={})=>{if(e===null)try{e=localStorage.getItem(`hf-${t}-debug`)==="1"}catch{e=!1}if(!e)return;const i=typeof r=="function"?r():r;i&&console.log(`[hf-${t}] ${JSON.stringify({stage:n,t:Math.round(performance.now()),...i})}`)}}const o1=Z0("reload");function oVe(t,e){const n=fe.getState(),r=p0(n.elements).musicElement;if(!r||n.audioMuted)return;const i=e-r.start,s=i>=0&&i<=r.duration?(r.playbackStart??0)+i:null;gEe(t,s,r.domId??r.id,n.audioVolume)}const y2=1e3;let ede=!1;const pW=Object.freeze({"dense-short":{duration:120,clipDuration:1.5},"long-overlap":{duration:7200,clipDuration:120},"keyframe-heavy-expanded":{duration:600,clipDuration:8},"composition-heavy":{duration:900,clipDuration:12},"remote-unsupported":{duration:900,clipDuration:12}});function lVe(t){ede=t}function tde(){return ede}function cVe(t){if(t.elementCount!==1e3&&t.elementCount!==5e4)throw new RangeError("Timeline performance fixture elementCount must be 1000 or 50000");if(!Object.hasOwn(pW,t.profile))throw new RangeError(`Unknown timeline performance fixture profile: ${t.profile}`);return pW[t.profile]}function uVe(t,e){if(t<y2)return t;if(e.profile!=="dense-short")return t%y2;const n=Math.ceil((e.elementCount-y2)/127);return(t-y2)%Math.max(1,n)}function fVe(t,e,n,r){const i=Math.max(0,n-r);return e==="dense-short"?t%128*.5:e==="long-overlap"?t*37%Math.max(1,i):t*17%Math.max(1,i)}function hVe(){return{format:"percentage",keyframes:[0,33,66,100].map(t=>({percentage:t,propertyGroup:"position",properties:{x:t},ease:"power2.inOut"}))}}function dVe(t,e,n){return{id:`animation-${t}`,targetSelector:`#${t}`,method:"to",position:e,resolvedStart:e,duration:n,propertyGroup:"position",fromProperties:{x:0},properties:{x:100},ease:"power2.inOut"}}function pVe(t){const e=cVe(t),n=[],r=new Map,i=new Map,s=new Set;for(let a=0;a<t.elementCount;a+=1){const o=`perf-${t.profile}-${t.elementCount}-${a}`,l=fVe(a,t.profile,e.duration,e.clipDuration),c=uVe(a,t),u={id:o,key:o,domId:o,selector:`#${o}`,label:`Fixture ${a+1}`,tag:t.profile==="remote-unsupported"&&a%2===0?"video":"div",start:l,duration:e.clipDuration,track:c,authoredTrack:c};t.profile==="composition-heavy"?u.compositionSrc=`compositions/perf-${a%32}.html`:t.profile==="remote-unsupported"&&(u.src=a%2===0?`https://media.invalid/perf-${a%32}.mp4`:`assets/perf-${a%32}.unsupported`),t.profile==="keyframe-heavy-expanded"&&(r.set(o,hVe()),i.set(o,[dVe(o,l,e.clipDuration)]),s.add(o)),n.push(u)}return{summary:Object.freeze({...t,duration:e.duration,trackCount:y2,keyframedElementCount:r.size,expandedElementCount:s.size}),elements:n,keyframeCache:r,gsapAnimations:i,expandedClipIds:s}}const nv=new Map,F_=new Map,K1=new Map;let cC=0,SM=0,$_=0;const nde=[];let Gm=null;async function mVe(){if(Gm===!1)return null;if(Gm)return Gm;try{return Gm=await ly(()=>import("./index-CklNVmi3.js"),[]),Gm}catch{return Gm=!1,null}}function bF(t){try{return new URL(t,window.location.href).href}catch{return t}}async function gVe(t){const e=await mVe();if(!e)return null;const n=new e.Input({source:new e.UrlSource(t),formats:e.ALL_FORMATS});try{const r=await n.getDurationFromMetadata();if(r==null||!Number.isFinite(r)||r<=0)return null;const i=await n.getPrimaryVideoTrack(),s=await n.getAudioTracks();return{duration:r,width:i==null?void 0:i.displayWidth,height:i==null?void 0:i.displayHeight,hasVideo:i!=null,hasAudio:s.length>0}}catch{return null}finally{n.dispose()}}function vF(t){const e=nv.get(bF(t));return e&&(e.lastAccess=++cC),e==null?void 0:e.result}function rde(t,e){return e?Ay(t,e,window.location.origin):t}function yVe(){const t=nv.size+K1.size-el.metadataRegistryEntries;if(t<=0)return;const e=[...Array.from(nv,([n,r])=>({key:n,at:r.lastAccess,failed:!1})),...Array.from(K1,([n,r])=>({key:n,at:r.lastAccess,failed:!0}))].sort((n,r)=>n.at-r.at);for(const n of e.slice(0,t))n.failed?K1.delete(n.key):nv.delete(n.key)}function xVe(t,e){return t.map(n=>{const r=n.tag.toLowerCase();if(!n.src||n.sourceDuration!=null||r!=="audio"&&r!=="video")return n;const i=vF(rde(n.src,e));return i!=null&&i.duration&&i.duration>0?{...n,sourceDuration:i.duration}:n})}async function bVe(t,e,n){const r=t.flatMap(i=>{if(!i.src||i.sourceDuration!=null||!["video","audio"].includes(i.tag.toLowerCase()))return[];const s=rde(i.src,e);return!vF(s)&&!ide(bF(s))?[{el:i,source:s}]:[]});r.length!==0&&await Promise.allSettled(r.map(async({el:i,source:s})=>{const a=await vVe(s);a&&n(i.key??i.id,a.duration)}))}function ide(t){const e=K1.get(t);return e===void 0?!1:Date.now()-e.failedAt<el.metadataFailureTtlMs?(e.lastAccess=++cC,!0):(K1.delete(t),!1)}async function vVe(t){const e=bF(t),n=vF(e);if(n)return n;if(ide(e))return null;let r=F_.get(e);return r||(r=new Promise(i=>{nde.push({key:e,epoch:$_,resolve:i}),sde()}),F_.set(e,r),r)}function sde(){for(;SM<el.concurrentMetadataJobs;){const t=nde.shift();if(!t)return;if(t.epoch!==$_){t.resolve(null);continue}SM++,gVe(t.key).then(e=>t.epoch!==$_?null:(F_.delete(t.key),e?nv.set(t.key,{result:e,lastAccess:++cC}):K1.set(t.key,{failedAt:Date.now(),lastAccess:++cC}),yVe(),e)).then(t.resolve).finally(()=>{SM--,sde()})}}function AVe(t){return t.keepPlaying&&!t.wasReverseShuttle&&t.storeWasPlaying&&(t.duration<=0||t.nextTime<t.duration)}function SVe(t){return!t.keepPlaying||t.wasReverseShuttle}function wVe(t,e){return!!(t.source&&e&&t.source!==e.contentWindow)}function OVe(t,e){if(tde()||wVe(t,e))return null;const n=t.data;return(n==null?void 0:n.source)!=="hf-preview"?null:xE(n)?n:null}function CVe(t,e){var n;try{if(fe.getState().elements.length===0){const r=(n=e==null?void 0:e.contentWindow)==null?void 0:n.__clipManifest;r&&r.clips.length>0&&t.processTimelineMessageRef.current(r)}Date.now()-t.lastTimelineMessageRef.current>500&&t.enrichMissingCompositionsRef.current()}catch{}}function kVe(t,e,n){if(t.lastTimelineMessageRef.current=Date.now(),t.processTimelineMessageRef.current(n),t.enrichMissingCompositionsRef.current(),!(fe.getState().elements.length>0))try{const r=e==null?void 0:e.contentDocument,i=t.getAdapter();if(!r||!i)return;const s=lae(r,i.getDuration());s.length>0&&t.syncTimelineElements(s)}catch{}}function EVe(t){return e=>{const n=t.iframeRef.current,r=OVe(e,n);if(r){if(r.type==="state")return CVe(t,n);r.type==="timeline"&&Array.isArray(r.clips)&&kVe(t,n,r)}}}function TVe(t,e){return e.length!==t.length?!0:e.some((n,r)=>{const i=t[r];return!i||n.id!==i.id||n.start!==i.start||n.duration!==i.duration||n.track!==i.track||n.sourceDuration!==i.sourceDuration})}function PVe(){const t=x.useRef(null),e=x.useRef(0),n=x.useRef(void 0),r=x.useRef(null),i=x.useRef(!1),s=x.useRef(0),a=x.useRef(null),o=x.useRef(0),l=x.useRef(null),c=x.useRef(0),u=x.useRef(null),f=x.useRef(!1),{setIsPlaying:h,setCurrentTime:m,setDuration:y,setTimelineReady:d,setElements:v}=fe.getState(),b=x.useCallback((U,Z)=>{if(tde())return;const K=fe.getState(),ee=Z??K.duration,re=Ehe(xVe(OEe(K.elements,U,K.duration,ee),K.timelineProjectId));TVe(K.elements,re)&&v(re),Number.isFinite(Z)&&(Z??0)>0&&Z!==K.duration&&y(Z??0),K.timelineReady||d(!0),bVe(re,K.timelineProjectId,(z,H)=>{fe.setState(se=>{const ue=se.elements.findIndex(me=>(me.key??me.id)===z);if(ue===-1||se.elements[ue].sourceDuration!=null)return{};const be=se.elements.slice();return be[ue]={...se.elements[ue],sourceDuration:H},{elements:be}})})},[v,d,y]),w=x.useCallback(()=>{var U,Z;try{const K=t.current,ee=K==null?void 0:K.contentWindow;if(!K||!ee)return null;const re=ee.__player&&typeof ee.__player.play=="function"?ee.__player:null,z=Tse(K.contentDocument),H=v4(re);if(H>0&&z<=H)return DO(u,f),re;let se=null;if(ee.__timeline){const me=oG(ee.__timeline),pe=v4(me);if(pe>0&&z<=pe)return DO(u,f),me;pe>0&&(se??(se=me))}if(ee.__timelines){const me=Object.keys(ee.__timelines);if(me.length>0){const pe=(Z=(U=K==null?void 0:K.contentDocument)==null?void 0:U.querySelector("[data-composition-id]"))==null?void 0:Z.getAttribute("data-composition-id"),ge=pe&&pe in ee.__timelines?pe:me[me.length-1],Pe=oG(ee.__timelines[ge]),ve=v4(Pe);if(ve>0&&z<=ve)return DO(u,f),Pe;ve>0&&(se??(se=Pe))}}const ue=re??se,be=Math.max(fe.getState().duration,z,H);return ue&&be>0&&("renderSeek"in ue||typeof ue.seek=="function")?j6e({cache:u,warned:f,bestAdapter:ue,effectiveDuration:be,docDuration:z,clock:_6e(ee),getPlaybackRate:()=>fe.getState().playbackRate}):ue}catch{return null}},[]),{startRAFLoop:O,stopRAFLoop:k,stopReverseLoop:E}=aVe({rafRef:e,reverseRafRef:s,getAdapter:w,setCurrentTime:m,setIsPlaying:h}),M=x.useCallback(U=>{const Z=t.current;if(Z){hEe(Z,U);try{const K=Z.contentWindow;if(K!=null&&K.__timelines)for(const ee of Object.values(K.__timelines))ee&&typeof ee.timeScale=="function"&&ee.timeScale(U)}catch{}}},[]),N=x.useCallback(()=>{const{audioMuted:U,audioVolume:Z}=fe.getState();fEe(t.current,U,Z)},[]),I=x.useCallback(()=>{k(),E(),Wv();const U=w();U&&(U.getTime()>=U.getDuration()&&U.seek(fe.getState().inPoint??0),M(fe.getState().playbackRate),N(),U.play(),a.current="forward",h(!0),O())},[w,h,O,M,N,k,E]),_=x.useCallback(U=>{k(),E();const Z=w();if(!Z)return;const K=Math.max(0,Z.getDuration()),ee=Z.getTime()<=0&&K>0?K:Z.getTime();Z.pause(),ee!==Z.getTime()&&Z.seek(ee);const re=Math.max(.1,Math.min(4,U));M(re),N();let z=ee,H=performance.now();const se=ue=>{const be=(ue-H)/1e3*re;let me=z-be;const{inPoint:pe,outPoint:ge}=fe.getState(),Pe=ge!==null?Math.min(ge,K):K,ve=pe!==null?pe:0,xe=ve<Pe?Pe:K,we=ve<Pe?ve:0;if(me<=we)if(fe.getState().loopEnabled&&K>0)z=xe,H=ue,me=xe;else{Z.seek(we),ya.notify(we),m(we),h(!1),a.current=null,s.current=0;return}Z.seek(Math.max(0,me)),ya.notify(Math.max(0,me)),h(!0),s.current=requestAnimationFrame(se)};h(!0),a.current="backward",s.current=requestAnimationFrame(se)},[w,m,h,M,N,k,E]),j=x.useCallback(()=>{E();const U=w();U&&(U.pause(),m(U.getTime()),h(!1),a.current=null,o.current=0,k())},[w,m,h,k,E]),L=x.useCallback((U,Z)=>{const K=a.current==="backward";E();const ee=w();if(!ee)return r.current=Math.max(0,U),!1;const re=Math.max(0,ee.getDuration()),z=Math.max(0,re>0?Math.min(re,U):U),H=(Z==null?void 0:Z.keepPlaying)===!0,se=AVe({keepPlaying:H,wasReverseShuttle:K,storeWasPlaying:fe.getState().isPlaying,duration:re,nextTime:z});return ee.seek(z,Z),ya.notify(z),m(z),!se&&!H&&oVe(t.current,z),se?(k(),M(fe.getState().playbackRate),N(),ee.play(),h(!0),a.current="forward",o.current=0,O()):SVe({keepPlaying:H,wasReverseShuttle:K})&&(k(),fe.getState().isPlaying&&h(!1),a.current=null,o.current=0),!0},[w,r,m,h,O,k,E,M,N,a,o]);x.useEffect(()=>fe.subscribe((U,Z)=>{var ee;U.requestedSeekTime!==null&&U.requestedSeekTime!==Z.requestedSeekTime&&(L(U.requestedSeekTime),fe.getState().clearSeekRequest());const K=U.playbackRequest;K&&K.nonce!==((ee=Z.playbackRequest)==null?void 0:ee.nonce)&&(K.playing?I():(j(),K.returnTo!==null&&L(K.returnTo)),fe.getState().clearPlaybackRequest())}),[L,I,j]);const{playbackKeyDownRef:B,playbackKeyUpRef:$,attachIframeShortcutListeners:Q,togglePlay:Y}=HBe({iframeRef:t,shuttleDirectionRef:a,shuttleSpeedIndexRef:o,iframeShortcutCleanupRef:l,getAdapter:w,play:I,playBackward:_,pause:j,seek:L}),{processTimelineMessageRef:W,enrichMissingCompositionsRef:J,onIframeLoad:ne}=sVe({iframeRef:t,probeIntervalRef:n,pendingSeekRef:r,isRefreshingRef:i,getAdapter:w,syncTimelineElements:b,setDuration:y,setCurrentTime:m,setTimelineReady:d,setIsPlaying:h,attachIframeShortcutListeners:Q,applyPreviewAudioState:N}),le=x.useCallback(()=>{if(!(i.current&&r.current!=null)){const Z=w();Z?r.current=Z.getTime():r.current==null&&(r.current=fe.getState().currentTime??0)}i.current=!0,k(),E(),h(!1)},[w,k,h,E]),ie=x.useCallback(()=>{const U=t.current;if(!U)return;o1("refreshPlayer",()=>({stack:new Error("refreshPlayer").stack})),le(),U.style.visibility="hidden";const Z=U.src,K=new URL(Z,window.location.origin);K.searchParams.set("_t",String(Date.now())),eie(K),U.src=K.toString()},[le]),q=x.useRef(w);q.current=w,wr(()=>{const U=re=>B.current(re),Z=re=>$.current(re),K=EVe({iframeRef:t,processTimelineMessageRef:W,enrichMissingCompositionsRef:J,lastTimelineMessageRef:c,getAdapter:w,syncTimelineElements:b}),ee=()=>{var re;if(document.hidden&&fe.getState().isPlaying){const z=(re=q.current)==null?void 0:re.call(q);z&&(z.pause(),h(!1),k())}};return window.addEventListener("keydown",U,!0),window.addEventListener("keyup",Z,!0),window.addEventListener("message",K),document.addEventListener("visibilitychange",ee),()=>{var re;window.removeEventListener("keydown",U,!0),window.removeEventListener("keyup",Z,!0),(re=l.current)==null||re.call(l),l.current=null,window.removeEventListener("message",K),document.removeEventListener("visibilitychange",ee),k(),E(),Wv(),DO(u,f),n.current&&clearInterval(n.current)}});const F=x.useCallback(()=>{k(),E(),n.current&&clearInterval(n.current),fe.getState().reset()},[k,E]);return x.useEffect(()=>fe.subscribe((U,Z)=>{const K=U.playbackRate!==Z.playbackRate,ee=U.audioMuted!==Z.audioMuted,re=U.audioVolume!==Z.audioVolume;!K&&!ee&&!re||(K&&M(U.playbackRate),N())}),[M,N]),{iframeRef:t,play:I,pause:j,togglePlay:Y,seek:L,onIframeLoad:ne,refreshPlayer:ie,saveSeekPosition:le,resetPlayer:F}}const mW='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable="true"], [tabindex]:not([tabindex="-1"])';function CS({open:t,onClose:e,containerRef:n,canClose:r}){const i=x.useRef(null),s=x.useRef(r);s.current=r;const a=x.useRef(e);a.current=e;const o=x.useCallback(()=>{const l=s.current;l&&!l()||a.current()},[]);return x.useEffect(()=>{var h;const l=document.activeElement;i.current=l instanceof HTMLElement?l:null;const c=n.current;(h=(c==null?void 0:c.querySelector(mW))??c)==null||h.focus();const f=m=>{if(m.key==="Escape"){m.stopPropagation(),o();return}if(m.key!=="Tab")return;const y=n.current;if(!y)return;const d=Array.from(y.querySelectorAll(mW));if(d.length===0)return;const v=d[0],b=d[d.length-1],w=document.activeElement;m.shiftKey&&(w===v||!y.contains(w))?(m.preventDefault(),b.focus()):!m.shiftKey&&(w===b||!y.contains(w))&&(m.preventDefault(),v.focus())};return document.addEventListener("keydown",f,!0),()=>{var m;document.removeEventListener("keydown",f,!0),(m=i.current)==null||m.focus(),i.current=null}},[t,n,o]),{requestClose:o}}function gW({findings:t,projectId:e,projectDir:n,title:r="HyperFrame Lint Results",promptIntro:i="Fix these HyperFrames lint issues",onClose:s}){const a=t.filter(v=>v.severity==="error"),o=t.filter(v=>v.severity==="warning"),l=t.length>0,[c,u]=x.useState(!1),[f,h]=x.useState(!1),m=x.useRef(null),{requestClose:y}=CS({open:!0,onClose:s,containerRef:m}),d=async()=>{const v=t.map(k=>{let E=`[${k.severity}] ${k.message}`;return k.file&&(E+=`
|
|
204
|
+
`)})}function She(t,e,n,r,i={priority:"visible",rich:!1}){return p.jsxs(p.Fragment,{children:[r==null?void 0:r(t),!n&&p.jsx(LLe,{element:t}),n&&p.jsx("div",{className:"absolute inset-0 overflow-hidden",style:{borderRadius:"inherit"},children:n(t,e,i)})]})}function whe(t,e){return Number.isFinite(e)&&!t.hidden&&Number.isFinite(t.start)&&Number.isFinite(t.end)&&e>=t.start&&e<=t.end}function Ohe(t,e){return whe({start:t.start,end:t.start+Math.max(0,t.duration),hidden:t.hidden===!0},e)}function HX(t){if(t===void 0||t.trim()==="")return null;const e=Number(t);return Number.isFinite(e)?e:null}function FLe(t){if(!(t instanceof HTMLElement))return null;const e=t.dataset.elId,n=HX(t.dataset.clipStart),r=HX(t.dataset.clipEnd);return!e||n===null||r===null?null:{id:e,start:n,end:r,hidden:t.dataset.clipHidden==="true",element:t}}function $Le(t){return[...t.querySelectorAll('[data-clip="true"]')].map(FLe).filter(e=>e!==null)}function BLe(t,e){return new Set(t.filter(n=>whe(n,e)).map(n=>n.id))}function QX(t,e,n,r=!1){const i=BLe(t,n);for(const s of t){const a=i.has(s.id);(r||e.has(s.id)!==a)&&s.element.toggleAttribute("data-active",a)}e.clear();for(const s of i)e.add(s)}function VLe({scrollRef:t,currentTime:e,clipStateVersion:n,elementStateVersion:r}){const i=x.useRef([]),s=x.useRef(new Set),a=x.useCallback(o=>{const l=t.current;if(!l){i.current=[],s.current.clear();return}i.current=$Le(l),QX(i.current,s.current,o,!0)},[t]);x.useLayoutEffect(()=>{a(e)},[n,e,r,a]),wr(()=>ya.subscribe(o=>{QX(i.current,s.current,o)}))}const HLe=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function QLe(t){return HLe.has(t)}function Y1(t){return t.key??t.id}function zLe(t,e){return[...e].sort((n,r)=>n.start-r.start||n.start+n.duration-(r.start+r.duration)||Y1(n).localeCompare(Y1(r))).map(n=>{const r=Y1(n);return{id:cS(r),kind:"clip",rowId:t,elementId:r,time:n.start+n.duration/2}})}function ZLe(t,e,n,r,i){const s=GL(t,e,n,r),a=s?Y1(s):null,o=s?CL(i.get(Y1(s))??[],s.start,s.duration):[];return{activeClip:s,activeId:a,lanes:o}}function GLe(t){return{percentage:t.percentage,tweenPercentage:t.tweenPercentage,propertyGroup:t.propertyGroup,animationId:t.animationId,collidingAnimationTargets:t.collidingAnimationTargets}}function ULe(t,e,n){var o;const r=Y1(e),i=new Map;for(const l of n){const c=GLe(l),u=Sf(r,c);i.has(u)||i.set(u,{target:c,time:e.start+l.percentage/100*e.duration})}const s=[...i.entries()].sort(([l,c],[u,f])=>c.time-f.time||l.localeCompare(u)),a=[];for(let l=0;l<s.length;l+=1){const[,c]=s[l],u=(o=s[l-1])==null?void 0:o[1];u&&c.time>u.time&&c.target.animationId!==void 0&&a.push({id:Qae(r,c.target),kind:"ease",rowId:t,elementId:r,time:u.time+(c.time-u.time)/2,keyframeTarget:c.target}),a.push({id:Hae(r,c.target),kind:"keyframe",rowId:t,elementId:r,time:c.time,keyframeTarget:c.target})}return a}function XLe(t,e,n){return t===null?!1:e.has(t)||n.has(t)}function WLe(t,e,n,r,i,s,a){const o=W2(n,i.group);return{id:o,kind:"row",physicalTrackKey:t,logicalIndex:e,level:s,parentId:a,elementId:n,expandable:!1,expanded:!1,propertyGroup:i.group,items:ULe(o,r,i.keyframes)}}function qLe({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}){const f=new Map(t),h=new Map(l.map(v=>[v.anchorKey,v])),m=[];function y(v,b,w){const O=f.get(v)??[],k=$5e(v),{activeClip:E,activeId:M,lanes:N}=ZLe(O,n,r,i,u),I=eFe(O,N.length),_=XLe(M,s,o)&&I;if(m.push({id:k,kind:"row",physicalTrackKey:v,logicalIndex:m.length,level:b,parentId:w,elementId:M,expandable:I,expanded:_,items:zLe(k,O)}),!(!_||!E||!M))for(const j of N)m.push(WLe(v,m.length,M,E,j,b===1?2:3,k))}function d(v){const b=B5e(v.id),w=!a.has(v.id);if(m.push({id:b,kind:"row",physicalTrackKey:v.anchorKey,logicalIndex:m.length,level:1,parentId:null,elementId:null,groupId:v.id,expandable:v.memberTracks.length>0,expanded:w,items:[]}),o.has(v.id))for(const O of Vf(v.memberElements))m.push({id:`${b}::${O.key}`,kind:"row",physicalTrackKey:v.anchorKey,logicalIndex:m.length,level:2,parentId:b,elementId:null,expandable:!1,expanded:!1,items:[]});if(w)for(const O of v.memberTracks)y(O,2,b)}for(const v of e){const b=h.get(v);if(b){d(b);continue}c.has(v)||y(v,1,null)}return m}function Cl(t,e){for(let n=0;n<t.length;n+=1){const r=t[n];if(r.id===e)return{row:r,rowIndex:n,itemIndex:-1,target:r};const i=r.items.findIndex(s=>s.id===e);if(i>=0)return{row:r,rowIndex:n,itemIndex:i,target:r.items[i]}}return null}function YLe(t,e){return[...t.items].sort((n,r)=>Math.abs(n.time-e)-Math.abs(r.time-e)||n.time-r.time||n.id.localeCompare(r.id))[0]??t}function KLe(t,e,n,r={}){var d;const i=Cl(t,e);if(!i)return null;const{row:s,rowIndex:a,itemIndex:o,target:l}=i;if(n==="Home"||n==="End"){const v=r.timelineBoundary?n==="Home"?t[0]:t.at(-1):s;return v?r.timelineBoundary||n==="Home"?v:v.items.at(-1)??v:l}if(n==="ArrowLeft")return o<0?s.parentId?((d=Cl(t,s.parentId))==null?void 0:d.target)??s:s:o===0?s:s.items[o-1];if(n==="ArrowRight")return o<0?s.items[0]??s:s.items[o+1]??l;const c=n==="ArrowUp"||n==="PageUp"?-1:1,u=n==="PageUp"||n==="PageDown",f=r.pageSize;if(u&&(f===void 0||!Number.isFinite(f)||f<1))return l;const h=u?Math.floor(f):1,m=Math.max(0,Math.min(t.length-1,a+c*h)),y=t[m];return!y||m===a?l:l.kind==="row"?y:YLe(y,l.time)}function JLe(t,e,n){const r=Cl(e,n);if(r)return r.target;const i=Cl(t,n);if(!i)return null;if(i.itemIndex>=0){for(let a=i.itemIndex-1;a>=0;a-=1){const o=Cl(e,i.row.items[a].id);if(o)return o.target}for(let a=i.itemIndex+1;a<i.row.items.length;a+=1){const o=Cl(e,i.row.items[a].id);if(o)return o.target}}const s=Cl(e,i.row.id);if(s)return s.target;if(i.row.parentId){const a=Cl(e,i.row.parentId);if(a)return a.target}return e[i.rowIndex]??e[i.rowIndex-1]??null}function eFe(t,e){return e>0||Vf(t).length>0}function zX(t){if(!(t.target instanceof Element))return null;const e=t.target.closest("button, input, select, textarea, a[href], [contenteditable], [data-timeline-focus-id]");return e!=null&&e.dataset.timelineFocusId&&t.currentTarget.contains(e)?e:null}function tFe(t,e,n,r){if(!r||t.size===0)return 1;const i=n.getRowIndex(e),s=Math.max(0,i>=0?i:Math.floor(n.getRowFromY(r.scrollTop))),a=i>=0?n.getRowTop(i):r.scrollTop,o=Math.min(n.rowKeys.length-1,Math.floor(n.getRowFromY(a+Math.max(0,r.clientHeight-.001))));let l=0;for(let c=s;c<=o;c+=1)l+=t.get(n.rowKeys[c])??0;return Math.max(1,l)}function nFe(t){const e=t.getBoundingClientRect();t.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.left+e.width/2,clientY:e.top+e.height/2}))}function rFe({logicalRows:t,focusedTargetId:e,rowGeometry:n,scrollRef:r,onToggleRow:i}){var c,u;const s=(e&&((c=Cl(t,e))==null?void 0:c.target.id))??((u=t[0])==null?void 0:u.id)??null,a=x.useMemo(()=>{const f=new Map;for(const h of t)f.set(h.physicalTrackKey,(f.get(h.physicalTrackKey)??0)+1);return f},[t]),o=x.useCallback(f=>{var m;const h=(m=zX(f))==null?void 0:m.dataset.timelineFocusId;h&&h!==e&&fe.getState().requestTimelineFocus(h)},[e]),l=x.useCallback(f=>{const h=zX(f),m=h==null?void 0:h.dataset.timelineFocusId;if(!h||!m)return;const y=Cl(t,m);if(y){if(QLe(f.key)){if(y.target.kind==="row"&&(f.key==="ArrowRight"&&y.target.expandable&&!y.target.expanded||f.key==="ArrowLeft"&&y.target.expandable&&y.target.expanded)){f.preventDefault(),i(y.target);return}const d=KLe(t,m,f.key,{pageSize:tFe(a,y.row.physicalTrackKey,n,r.current),timelineBoundary:f.ctrlKey||f.metaKey});f.preventDefault(),d&&d.id!==m&&fe.getState().requestTimelineFocus(d.id);return}if(f.key==="ContextMenu"||f.key==="F10"&&f.shiftKey){f.preventDefault(),nFe(h);return}f.key!=="Enter"&&f.key!==" "||y.target.kind!=="row"||!y.target.expandable||(f.preventDefault(),i(y.target))}},[a,t,i,n,r]);return{rovingTargetId:s,onFocus:o,onKeyDown:l}}function iFe({pps:t,contentOrigin:e,contentGutter:n,trackContentWidth:r,theme:i,displayTrackOrder:s,rowGeometry:a,virtualRows:o,logicalRows:l,focusedTargetId:c,rowsVirtualized:u,clipIndex:f,renderTimeRange:h,visibleTimeRange:m,pinnedClipIdentities:y,trackOrder:d,tracks:v,trackStyles:b,groups:w,laneCounts:O,selectedElementId:k,selectedElementIds:E,hoveredClip:M,draggedClip:N,draggedElement:I,multiDragPreview:_,blockedClipRef:j,suppressClickRef:L,scrollRef:B,renderClipContent:$,renderClipOverlay:Q,onDrillDown:Y,onSelectElement:W,setHoveredClip:J,setShowPopover:ne,setRangeSelection:le,setResizingClip:ie,setDraggedClip:q,setSelectedElementId:F,shiftClickClipRef:U,getPreviewElement:Z,getTrackStyle:K,keyframeCache:ee,gsapAnimations:re,selectedKeyframes:z,currentTime:H,onSeek:se,onSelectSegment:ue,onClickKeyframe:be,onShiftClickKeyframe:me,onContextMenuKeyframe:pe,onMoveKeyframe:ge,onContextMenuClip:Pe,onContextMenuLane:ve,beatAnalysis:xe,onToggleTrackHidden:we,onTogglePropertyGroupKeyframe:Ce,onResizeElement:Me,onMoveElement:Ve,onRazorSplit:tt,onRazorSplitAll:Ze}){const qe=`timeline-lanes${x.useId().replaceAll(":","")}`,pt=fe(Ye=>Ye.expandedClipIds),{collapsedGroupIds:it,expandedLaneOwnerIds:vt,toggleGroupExpanded:Ot,toggleLaneOwnerExpanded:Kt}=d7e(),qt=AIe(),fn=fe(Ye=>Ye.duration);_Ie({lanes:qt});const{logicalRowsByTrack:Jt,groupByAnchor:Je}=p7e(l,w),St=x.useMemo(()=>new Set(w.flatMap(Ye=>Ye.memberTracks)),[w]),{toggleRowExpanded:At,toggleClipExpanded:Ke}=m7e(),Be=R7e(_,u,h),We=rFe({logicalRows:l,focusedTargetId:c,rowGeometry:a,scrollRef:B,onToggleRow:Ye=>{Ye.elementId&&Ke(Ye.elementId)}});return p.jsx("div",{role:"treegrid","aria-label":"Timeline tracks","aria-rowcount":l.length,"aria-colcount":2,onFocus:We.onFocus,onKeyDown:We.onKeyDown,className:u?"absolute inset-0":void 0,children:o.map(({index:Ye,rowKey:Zt})=>{var tr,gt,nr,On,_n;const Te=s[Ye];if(Te===void 0)return null;const De=Je.get(Te);if(De){const xt=(tr=Jt.get(Te))==null?void 0:tr[0];return xt?p.jsx(h7e,{index:Ye,rowKey:Zt,group:De,logicalRow:xt,top:a.getRowTop(Ye),height:a.getRowHeight(Ye),virtualized:u,contentOrigin:e,theme:i,rovingTargetId:We.rovingTargetId,collapsedGroupIds:it,expandedLaneOwnerIds:vt,toggleGroupExpanded:Ot,toggleLaneOwnerExpanded:Kt,lanes:qt,pps:t,currentTime:H,compositionDuration:fn,beatTimes:xe==null?void 0:xe.beatTimes,contentGutter:n,trackContentWidth:r},Zt):null}const ze=ufe(s,Te),st=Jt.get(Te)??[],Gt=st[0];if(!Gt)return null;const ln=a.getRowHeight(Ye),Yt=((gt=v.find(([xt])=>xt===Te))==null?void 0:gt[1])??[],Mn=u?kae(f,Te,h,y,Be):Yt,Pr=b.get(Te)??K(""),mt=(N==null?void 0:N.started)===!0&&!d.includes(Te)&&Yt.length===0,vn=i.rowBackground,mn=S7e(Yt,xe==null?void 0:xe.beatTimes,{selectedElementId:k,isMusicTrack:fy}),En=Yt.length>0&&Yt.every(xt=>xt.hidden===!0),jn=Yt.length>0&&Yt.some(Ko),et=GL(Yt,O,k,E),qn=(et==null?void 0:et.key)??(et==null?void 0:et.id),Mt=C7e(Yt,pt),hn=Mt?Ui-2*fa:void 0,Ht=Yt.map(Z),dn=`${qe}-track-${Ye}`,er=`${dn}-automation`,In=et&&qn?qt.bind(et,k===qn||E.has(qn)):null,yr=In&&!In.readOnly?xt=>In.onCommit({version:1,lanes:In.lanes.filter(Ut=>Ut.target!==xt)}):void 0;return p.jsxs(Sfe,{index:Ye,rowKey:Zt,logicalRow:Gt,propertyRows:st.slice(1),lanesId:dn,headerLanesId:`${dn} ${er}`,top:a.getRowTop(Ye),height:ln,virtualized:u,background:vn,borderColor:i.rowBorder,rovingTargetId:We.rovingTargetId,children:[p.jsx(o7e,{trackNumber:Te,trackDisplayNumber:ze,trackLabel:((nr=Yt[0])==null?void 0:nr.label)??((On=Yt[0])==null?void 0:On.domId)??((_n=Yt[0])==null?void 0:_n.id)??`Track${UE(ze)}`,lanesId:`${dn} ${er}`,contentOrigin:e,keyframeClip:et,trackElements:Yt,clipCount:Yt.length,isExpanded:Mt,animations:qn?re.get(qn)??[]:[],currentTime:H,isTrackHidden:En,isAudioTrack:jn,isGroupMember:St.has(Te),theme:i,onToggleClipExpanded:()=>{const xt=Yt.map(zn);xt.length>0&&At(xt)},onToggleTrackHidden:we,onTogglePropertyGroupKeyframe:Ce,onRemoveAutomationLane:yr,onSeek:se,rovingTargetId:We.rovingTargetId}),p.jsxs("div",{role:"gridcell","aria-colindex":2,style:{width:r,marginLeft:n,opacity:En?.35:1,transition:"opacity 120ms ease"},className:"relative",onContextMenu:xt=>{if(xt.defaultPrevented||!ve)return;const Ut=xt.currentTarget.getBoundingClientRect(),Ct=(xt.clientX-Ut.left)/t;Ct<0||(xt.preventDefault(),ve(xt,Te,Ct))},children:[p.jsx(j5e,{beatTimes:xe==null?void 0:xe.beatTimes,beatStrengths:xe==null?void 0:xe.beatStrengths,pps:t,highlightTime:N!=null&&N.started&&N.snapType==="beat"?N.snapTime:null,renderTimeRange:u?h:void 0}),mn&&p.jsx(L5e,{beatTimes:xe==null?void 0:xe.beatTimes,beatStrengths:xe==null?void 0:xe.beatStrengths,pps:t,renderTimeRange:u?h:void 0}),mt&&p.jsx("div",{className:"absolute inset-0 flex items-center",style:{paddingLeft:16,color:Pr.label,fontSize:11,letterSpacing:"0.06em",textTransform:"uppercase",opacity:.5},children:"New track"}),Mn.map(xt=>{const Ut=K(xt.tag),Ct=zn(xt),ur=Ct===qn,Dt=ur&&Mt,wt=sS(xt),gn=k===Ct||E.has(Ct),Lt=!!xt.compositionSrc,rn=Ct;if((N==null?void 0:N.started)===!0&&I!=null&&zn(I)===Ct)return null;const Ln=Z(xt),ni=jLe(Ln,m,gn||M===rn||y.has(rn)),cn=_!=null&&kfe(rn,_),Cn=cn?I7e(rn,t,_):0,rr=RLe(xt,Ct,Ln,wt,{pps:t,onResizeElement:Me,onMoveElement:Ve,onRazorSplit:tt,onRazorSplitAll:Ze,blockedClipRef:j,shiftClickClipRef:U,suppressClickRef:L,scrollRef:B,setShowPopover:ne,setRangeSelection:le,setResizingClip:ie,setDraggedClip:q,setSelectedElementId:F,onSelectElement:W}),Ti=p.jsx(zae,{onContextMenu:Mr=>{Mr.preventDefault(),Pe==null||Pe(Mr,xt)},el:Ln,pps:t,clipY:fa,clipHeight:hn,isSelected:gn,isHovered:M===rn,isDragging:!1,isActive:Ohe(Ln,H),hasCustomContent:!!$,capabilities:wt,theme:i,isComposition:Lt,tabIndex:We.rovingTargetId===cS(Ct)?0:-1,onHoverStart:()=>J(rn),onHoverEnd:()=>J(null),onResizeStart:rr.onResizeStart,onPointerDown:rr.onPointerDown,onClick:rr.onClick,onDoubleClick:Mr=>{Mr.stopPropagation(),!L.current&&Lt&&Y&&Y(xt)},children:She(Ln,Ut,$,Q,ni)},rn),Kr=ee==null?void 0:ee.get(Ct),Bi=!Dt&&Kr&&p.jsx(ZTe,{element:Ln,elementId:Ct,keyframesData:Kr,pixelsPerSecond:t,rowHeight:ln,beatsActive:mn,accentColor:Ut.accent,isSelected:gn,currentTime:H,selectedKeyframes:z,rovingTargetId:We.rovingTargetId,onClickKeyframe:be,onShiftClickKeyframe:me,onContextMenuKeyframe:pe,onMoveKeyframe:ge,onSelectSegment:ue,suppressClickRef:L},`${rn}-diamonds`),hs=ur&&p.jsx(yDe,{id:dn,animations:Dt?re.get(Ct)??[]:[],clipStart:pce(Ln),clipDuration:Ln.duration,clipLeftPx:Ln.start*t,clipWidthPx:Math.max(Ln.duration*t,4),accentColor:Ut.accent,isSelected:gn,currentPercentage:Ln.duration>0?(H-Ln.start)/Ln.duration*100:0,elementId:Ct,selectedKeyframes:z,rovingTargetId:We.rovingTargetId,onSelectSegment:Mr=>ue==null?void 0:ue(Ct,Mr),onClickKeyframe:Mr=>be==null?void 0:be(Ln,Mr),onShiftClickKeyframe:Mr=>me==null?void 0:me(Ct,Mr),onContextMenuKeyframe:(Mr,Ha)=>pe==null?void 0:pe(Mr,Ct,Ha),onMoveKeyframe:(Mr,Ha)=>(ge==null?void 0:ge(Ct,Mr,Ha))??Promise.resolve(!1),suppressClickRef:L},`${rn}-property-lanes`);return cn?p.jsxs("div",{className:"absolute inset-0",style:{transform:`translateX(${Cn}px)`,opacity:.85,zIndex:20,pointerEvents:"none"},children:[Ti,Bi,hs]},rn):p.jsxs(x.Fragment,{children:[Ti,Bi,hs]},rn)}),p.jsx("div",{id:er,children:Mt?p.jsx(Mce,{elements:Ht,isSelected:xt=>{const Ut=zn(xt);return k===Ut||E.has(Ut)},lanes:qt,pps:t,laneCount:qn?O.get(qn)??0:0,accentColor:K((et==null?void 0:et.tag)??"").accent,currentTime:H,beatTimes:xe==null?void 0:xe.beatTimes}):null})]})]},Zt)})})}const Che=8,nC={playhead:0,"clip-edge":1,beat:2};function sFe(t){const e=new Map,n=(r,i)=>{if(!Number.isFinite(r)||r<0)return;const s=Math.round(r*1e3)/1e3,a=e.get(s);(!a||nC[i]<nC[a.type])&&e.set(s,{time:s,type:i})};for(const r of t.beatTimes)n(r,"beat");for(const r of t.elements)t.excludeElementKey!=null&&(r.key??r.id)===t.excludeElementKey||(n(r.start,"clip-edge"),n(r.start+r.duration,"clip-edge"));return t.playheadTime!=null&&n(t.playheadTime,"playhead"),Array.from(e.values()).sort((r,i)=>r.time-i.time)}function rC(t,e,n){let r=null,i=n;for(const s of e){const a=Math.abs(s.time-t);(a<i||a===i&&r&&nC[s.type]<nC[r.type])&&(i=a,r=s)}return r?{time:r.time,target:r}:{time:t,target:null}}function aFe(t,e,n,r,i){if(n.length===0)return{start:t,snapTime:null,snapType:null};const s=Che/Math.max(r,1),a=rC(t,n,s),o=rC(t+e,n,s),l=a.target!==null,c=o.target!==null;let u=t,f=null;l&&(!c||Math.abs(a.time-t)<=Math.abs(o.time-(t+e)))?(u=a.time,f=a.target):c&&(u=o.time-e,f=o.target);const h=Math.max(0,i-e),m=Math.round(u*1e3)/1e3,y=Math.max(0,Math.min(h,m));return f&&Math.abs(y-m)>1e-6&&(f=null),{start:y,snapTime:(f==null?void 0:f.time)??null,snapType:(f==null?void 0:f.type)??null}}function oFe(t,e,n,r){if(n<0)return t;const i=e.indexOf(t);return i<0?t:r?i>=n?t:e[n]??t:i<n?t:e[n-1]??t}function ZX(t,e,n){return e<0?!0:n?t>=e:t<=e}function lFe(t,e,n,r){if(e.length===0)return n<0?0:n;const i=t.indexOf(e[0]),s=t.indexOf(e[e.length-1])+1;return r<Math.min(...e)?i:s}function cFe(t){var b;const{order:e,audioTracks:n,elements:r,desiredTrack:i,deliberateInsertRow:s}=t,{start:a,duration:o,dragKey:l,isAudio:c,preferInsertAbove:u}=t,f=e.findIndex(w=>n.has(w));if(s!==null&&ZX(s,f,c))return{track:i,insertRow:s};const h=oFe(i,e,f,c),m=e.filter(w=>n.has(w)===c),y=fFe({elements:r,desiredTrack:h,start:a,duration:o,trackOrder:m,excludeKey:l}),d=(b=r.find(w=>(w.key??w.id)===l))==null?void 0:b.track,v=d!=null&&h!==d&&y.track===d;if(y.needsInsert||v){const w=e.indexOf(h);if(w<0)return{track:h,insertRow:lFe(e,m,f,h)};const O=d==null?-1:e.indexOf(d),E=(v?O>w:u&&ZX(w,f,c))?w:w+1;return{track:h,insertRow:E}}return{track:y.track,insertRow:null}}function uFe(t,e,n=s3e){if(e===0||t<=0)return 0;if(t>=e)return e;const r=Math.floor(t),i=t-r;return i<n?r:i>1-n?r+1:null}function khe(t,e,n,r){return t<r&&n<e}function M4(t,e,n,r,i){return!t.some(s=>(s.key??s.id)!==i&&s.track===e&&khe(n,r,s.start,s.start+s.duration))}function fFe({elements:t,desiredTrack:e,start:n,duration:r,trackOrder:i,excludeKey:s}){const a=n+r,o=i.indexOf(e);if(o===-1)return{track:e,needsInsert:!0};if(M4(t,e,n,a,s))return{track:e,needsInsert:!1};for(let l=o-1;l>=0;l--)if(M4(t,i[l],n,a,s))return{track:i[l],needsInsert:!1};for(let l=o+1;l<i.length;l++)if(M4(t,i[l],n,a,s))return{track:i[l],needsInsert:!1};return{track:e,needsInsert:!0}}function hFe(t,e){if(!t.started||!e)return null;const n=e.getBoundingClientRect();return{left:t.pointerClientX-n.left+e.scrollLeft-t.pointerOffsetX,top:t.pointerClientY-n.top+e.scrollTop-t.pointerOffsetY}}function dFe(t,e,n){return Math.max(n,t&&e>0?t.scrollWidth/e:n)}function pFe(t,e,n,r,i){if(i.size<=1||!i.has(n))return t;const s=r.filter(o=>i.has(o.key??o.id)).map(o=>o.start),a=_7e(t-e.start,s);return e.start+a}function mFe(t,e,n,r,i){const{scroll:s,trackOrder:a,rowHeights:o,elements:l}=i,c=s?c3e(e-s.getBoundingClientRect().top+s.scrollTop,o):{rowFloat:0,fraction:0,rowHeight:yae(0,o)},u=uFe(c.rowFloat,a.length,u3e(c.rowHeight)),f=c.fraction<.5,h=i.audioTracks??new Set(l.filter(Ko).map(m=>m.track));return cFe({order:a,audioTracks:h,elements:l,desiredTrack:r,deliberateInsertRow:u,start:n,duration:t.element.duration,dragKey:t.element.key??t.element.id,isAudio:Ko(t.element),preferInsertAbove:f})}function gFe(t,e,n,r){const{scroll:i,pps:s,duration:a,trackOrder:o,elements:l,selectedKeys:c,buildSnapTargets:u}=r,f=dFe(i,s,a),h=(i==null?void 0:i.scrollTop)??t.originScrollTop,m=(i==null?void 0:i.getBoundingClientRect().top)??0,y=KI(t.originClientY-m+t.originScrollTop,r.rowHeights),d=KI(n-m+h,r.rowHeights),v=D3e({start:t.element.start,track:t.element.track,duration:t.element.duration,originClientX:t.originClientX,originRow:y,originScrollLeft:t.originScrollLeft,currentScrollLeft:(i==null?void 0:i.scrollLeft)??t.originScrollLeft,pixelsPerSecond:s,maxStart:f,trackOrder:o},e,d),b=u(t.element.key??t.element.id,!fy(t.element)),w=aFe(v.start,t.element.duration,b,s,f+t.element.duration),O=t.element.key??t.element.id,k=pFe(w.start,t.element,O,l,c),{track:E,insertRow:M}=mFe(t,n,k,v.track,r);return{...t,started:!0,pointerClientX:e,pointerClientY:n,previewStart:k,previewTrack:E,desiredTrack:v.track,insertRow:M,snapTime:w.snapTime,snapType:w.snapType}}function yFe(t,e,n){const{scroll:r,pps:i,buildSnapTargets:s}=n,a=t.originScrollLeft??(r==null?void 0:r.scrollLeft)??0,o=e+(((r==null?void 0:r.scrollLeft)??a)-a),l=t.element.sourceDuration!=null?Math.max(0,(t.element.sourceDuration-(t.element.playbackStart??0))/Math.max(t.element.playbackRate??1,.1)):Number.POSITIVE_INFINITY,c=t.element.tag.toLowerCase(),u=t.element.kind==="composition"||c==="audio"||c==="video",f=Math.max(t.element.playbackRate??1,.1),h=t.element.start+l;let m=I3e({start:t.element.start,duration:t.element.duration,originClientX:t.originClientX,pixelsPerSecond:i,minStart:0,maxEnd:h,playbackStart:t.edge==="start"&&u?t.element.playbackStart??0:t.element.playbackStart,playbackRate:t.element.playbackRate},t.edge,o);const y=s(t.element.key??t.element.id,!fy(t.element));if(y.length>0){const d=Che/Math.max(i,1);if(t.edge==="end"){const v=m.start+m.duration,b=rC(v,y,d).time,w=Math.round((b-m.start)*1e3)/1e3;b!==v&&b<=h+1e-6&&w>=.05&&(m={...m,duration:w})}else{const v=rC(m.start,y,d).time,b=m.start-v,w=m.playbackStart!=null?m.playbackStart/f:Number.POSITIVE_INFINITY,O=Math.round((m.duration+b)*1e3)/1e3;v!==m.start&&v>=0&&b<=w+1e-6&&O>=.05&&(m={...m,start:v,duration:O,playbackStart:m.playbackStart!=null?Math.round(Math.max(0,m.playbackStart-b*f)*1e3)/1e3:void 0})}}return{originScrollLeft:a,previewStart:m.start,previewDuration:m.duration,previewPlaybackStart:m.playbackStart}}function xFe(t,e,n){const r=N3e(t,e);n({originScrollLeft:e.originScrollLeft,previewStart:(r==null?void 0:r.start)??e.previewStart,previewDuration:(r==null?void 0:r.duration)??e.previewDuration,previewPlaybackStart:(r==null?void 0:r.playbackStart)??e.previewPlaybackStart,groupPreview:t.changes})}const bFe=x.memo(function({drag:e,scrollRef:n,pixelsPerSecond:r,rowHeight:i,selectedElementId:s,currentTime:a,theme:o,getTrackStyle:l,renderClipContent:c,renderClipOverlay:u}){const f=(e==null?void 0:e.started)===!0?HEe({element:e.element,draggedElementId:e.element.key??e.element.id,previewStart:e.previewStart,previewTrack:e.previewTrack}):null,h=e?hFe(e,n.current):null;return p.jsx("div",{"data-timeline-gesture-overlay":!0,className:"absolute inset-0 pointer-events-none",children:f&&h&&p.jsx("div",{"data-timeline-gesture-actor":f.key??f.id,className:"absolute",style:{top:h.top,left:h.left,width:Math.max(f.duration*r,4),height:i,zIndex:40},children:p.jsx(zae,{el:{...f,start:0},pps:r,clipY:0,isSelected:s===(f.key??f.id),isHovered:!1,isDragging:!0,isGestureActor:!0,isActive:Ohe(f,a),hasCustomContent:!!c,capabilities:sS(f),theme:o,isComposition:!!f.compositionSrc,onHoverStart:()=>{},onHoverEnd:()=>{},onResizeStart:()=>{},onClick:()=>{},onDoubleClick:()=>{},children:She(f,l(f.tag),c,u,{priority:"interaction",rich:!0})})})})}),vFe=x.memo(function(e){const{draggedClip:n,scrollRef:r,selectedElementIds:i,displayTrackOrder:s}=e,a=(n==null?void 0:n.started)===!0?s.indexOf(n.previewTrack):-1,o=yae(a,e.rowHeights),l=Math.min(o,Ui)-fa*2,{onResizeElement:c,onMoveElement:u,onToggleTrackHidden:f,onTogglePropertyGroupKeyframe:h,onRazorSplit:m,onRazorSplitAll:y}=lS(),d=fe(O=>O.beatDragging),v=(n==null?void 0:n.element)??null,b=v?zn(v):null,w=(n==null?void 0:n.started)===!0&&v&&b?{dragStarted:!0,draggedKey:b,draggedOriginStart:v.start,draggedPreviewStart:n.previewStart,selectedKeys:i}:null;return p.jsxs("div",{className:"relative",style:{height:e.totalH,width:e.contentOrigin+e.trackContentWidth},children:[p.jsx(C5e,{major:e.major,minor:e.minor,pps:e.pps,trackContentWidth:e.trackContentWidth,totalH:e.totalH,effectiveDuration:e.effectiveDuration,majorTickInterval:e.majorTickInterval,theme:e.theme,beatAnalysis:e.beatAnalysis,contentOrigin:e.contentOrigin,renderTimeRange:e.rowsVirtualized?e.renderTimeRange:void 0}),p.jsx("div",{"aria-hidden":"true",style:{height:e.rowsVirtualized?0:e0}}),p.jsx(iFe,{...e,draggedElement:v,multiDragPreview:w,onToggleTrackHidden:f,onTogglePropertyGroupKeyframe:h,onResizeElement:c,onMoveElement:u,onRazorSplit:m,onRazorSplitAll:y}),p.jsx("div",{"aria-hidden":"true",style:{height:e.rowsVirtualized?0:gae}}),e.laneGapStrips.map(O=>{const k=s.indexOf(O.track);if(k<0)return null;const E=O.kind==="hover";return(e.rowsVirtualized?O.intervals.filter(N=>N.start<e.renderTimeRange.end&&N.end>e.renderTimeRange.start):O.intervals).map(N=>p.jsx("div",{className:"pointer-events-none absolute",style:{top:FP(k,e.rowHeights)+fa,left:e.contentOrigin+N.start*e.pps,width:Math.max((N.end-N.start)*e.pps,2),height:Ui-fa*2,background:E?"rgba(60,230,172,0.18)":"rgba(60,230,172,0.055)",borderRadius:4,zIndex:25}},`gap-${O.kind}-${O.track}-${N.start}`))}),(n==null?void 0:n.started)&&n.insertRow==null&&a>=0&&p.jsx("div",{className:"absolute pointer-events-none",style:{top:FP(a,e.rowHeights)+fa,left:e.contentOrigin+n.previewStart*e.pps,width:Math.max(n.element.duration*e.pps,4),height:l,border:"1px solid rgba(60,230,172,0.55)",background:"rgba(60,230,172,0.12)",borderRadius:4,zIndex:30}}),(n==null?void 0:n.started)&&n.insertRow!=null&&p.jsx("div",{className:"absolute pointer-events-none",style:{top:FP(n.insertRow,e.rowHeights)-.5,left:e.contentOrigin,width:e.trackContentWidth,height:1,background:"#3CE6AC",boxShadow:"0 0 3px rgba(60,230,172,0.5)",zIndex:55}}),(n==null?void 0:n.started)&&n.snapTime!=null&&n.snapType!=="beat"&&p.jsx("div",{className:"absolute pointer-events-none",style:{left:e.contentOrigin+n.snapTime*e.pps,top:_a,bottom:0,width:1,background:n.snapType==="playhead"?"#3CE6AC":"rgba(255,255,255,0.6)",boxShadow:n.snapType==="playhead"?"0 0 6px rgba(60,230,172,0.5)":"0 0 6px rgba(255,255,255,0.4)",zIndex:60}}),p.jsx(bFe,{drag:n,scrollRef:r,pixelsPerSecond:e.pps,rowHeight:l,selectedElementId:e.selectedElementId,currentTime:e.currentTime,theme:e.theme,getTrackStyle:e.getTrackStyle,renderClipContent:e.renderClipContent,renderClipOverlay:e.renderClipOverlay}),e.marqueeRect&&p.jsx("div",{"aria-hidden":"true",className:"absolute pointer-events-none",style:{left:e.marqueeRect.left,top:e.marqueeRect.top,width:e.marqueeRect.width,height:e.marqueeRect.height,background:"rgba(60,230,172,0.10)",border:"1px dashed rgba(60,230,172,0.7)",borderRadius:2,zIndex:70}}),e.rangeSelection&&p.jsx("div",{className:"absolute pointer-events-none",style:{left:e.contentOrigin+Math.min(e.rangeSelection.start,e.rangeSelection.end)*e.pps,width:Math.abs(e.rangeSelection.end-e.rangeSelection.start)*e.pps,top:_a,bottom:0,backgroundColor:"rgba(59, 130, 246, 0.12)",borderLeft:"1px solid rgba(59, 130, 246, 0.4)",borderRight:"1px solid rgba(59, 130, 246, 0.4)",zIndex:50}}),p.jsx("div",{ref:e.playheadRef,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${JI(0,0,e.contentOrigin)}px`,width:C6,zIndex:100,display:d?"none":void 0},children:p.jsx(k5e,{scrubbing:e.isScrubbing})})]})});function bc(t){return Ko(t)?"audio":"visual"}const iC=t=>t.key??t.id,GX=1e-6;function AFe(t,e){return t.start<e.start+e.duration-GX&&e.start<t.start+t.duration-GX}function SFe(t,e){const n=iC(t),r=iC(e);return n<r?-1:n>r?1:0}function wFe(t,e,n){const r=[...t].sort(SFe),i=[];for(const s of r){let a=i.findIndex(o=>o.every(l=>!AFe(l,s)));a===-1&&(a=i.length,i.push([])),i[a].push(s),n.set(iC(s),e+a)}return Math.max(1,i.length)}function UX(t,e,n){const r=new Map;for(const s of t){const a=r.get(s.track);a?a.push(s):r.set(s.track,[s])}let i=0;for(const s of[...r.keys()].sort((a,o)=>a-o))i+=wFe(r.get(s),e+i,n);return i}function Ehe(t){if(t.length===0)return t;const e=new Map,n=[],r=[];for(const o of t)(bc(o)==="audio"?r:n).push(o);let i=0;i+=UX(n,i,e),UX(r,i,e);let s=!1;const a=t.map(o=>{const l=e.get(iC(o));return l==null||l===o.track?o:(s=!0,{...o,track:l,authoredTrack:o.authoredTrack??o.track})});return s?a:t}const XX=1e-6,sC=t=>JSON.stringify([t.sourceFile??null,t.stackingContextId??null]);function cF(t,e){return sC(t)===sC(e)}function OFe(t,e){return t.start<e.start+e.duration-XX&&e.start<t.start+t.duration-XX}function E_(t,e){return t.track<e.track}function Dg(t,e){return t.zIndex!==e.zIndex?t.zIndex>e.zIndex:t.domIndex!=null&&e.domIndex!=null?t.domIndex>e.domIndex:!1}function T_(t,e){return t.length>0?e(t.map(n=>n.zIndex)):null}function CFe(t,e,n,r){const i=e.filter(h=>!h.isAudio);if(i.length===0)return!1;const s=i.filter(h=>E_(t,h)),a=i.filter(h=>E_(h,t));if(s.every(h=>Dg(t,h))&&a.every(h=>Dg(h,t)))return!1;const l=T_(s,h=>Math.max(...h)),c=TFe(t,s,a);if(c!=null)return c!==t.zIndex&&r(t,c),c!==t.zIndex;const u=l!=null?l+1:0,f=Math.max(0,u);return f!==t.zIndex&&r(t,f),PFe(t,n,r),!0}function kFe(t,e,n){if(e-t>=2){const r=Math.floor((t+e)/2);return r>t&&r<e?r:null}return n(e)?e:null}function EFe(t,e){const n=t-1;return n>=0?n:e(t)?t:null}function TFe(t,e,n){const r=T_(e,a=>Math.max(...a)),i=T_(n,a=>Math.min(...a)),s=a=>{const o={...t,zIndex:a};return e.every(l=>Dg(o,l))&&n.every(l=>Dg(l,o))};return r!=null&&i!=null?kFe(r,i,s):r!=null?r+1:i!=null?EFe(i,s):null}function PFe(t,e,n){const r=[t],i=(s,a)=>{Dg(s,a)||(n(s,a.zIndex+1),r.push(s))};for(;r.length>0;){const s=r.shift();for(const a of e(s))E_(a,s)&&!Dg(a,s)&&i(a,s)}}function MFe(t,e){const n=new Set(e);if(n.size===0)return[];const r=t.filter(y=>Number.isFinite(y.zIndex)),i=new Set(r.filter(y=>n.has(y.key)).map(sC)),s=r.filter(y=>i.has(sC(y))),a=new Map(s.map(y=>[y.key,{...y}])),o=s.filter(y=>n.has(y.key)&&!y.isAudio).map(y=>a.get(y.key)).sort((y,d)=>d.track-y.track),l=new Map,c=(y,d)=>{y.zIndex=d,l.set(y.key,d)},u=[...a.values()],f=y=>u.filter(d=>d.key!==y.key&&!d.isAudio&&cF(y,d)&&OFe(y,d));for(const y of o)CFe(y,f(y),f,c);const h=new Set,m=[];for(const y of o)l.has(y.key)&&!h.has(y.key)&&(m.push({key:y.key,zIndex:l.get(y.key)}),h.add(y.key));for(const[y,d]of l)h.has(y)||(m.push({key:y,zIndex:d}),h.add(y));return m}function ev(t){return sS({tag:t.tag,kind:t.kind,duration:t.duration,domId:t.domId,selector:t.selector,compositionSrc:t.compositionSrc,playbackStart:t.playbackStart,playbackStartAttr:t.playbackStartAttr,sourceDuration:t.sourceDuration,timingSource:t.timingSource,timelineLocked:t.timelineLocked}).canMove}function NFe(t,e){const n=e.selectedKeys;if(!n)return null;const r=new Set(n),i=e.elements.includes(t.element)?e.elements:[...e.elements,t.element];for(const u of i){const f=u.expandedHostKey,h=zn(u);f&&r.has(f)&&r.has(h)&&r.delete(h)}const s=t.element.expandedHostKey,a=zn(t.element);if(!s||r.has(a))return r.size===n.size?null:{drag:t,selectedKeys:r};const o=e.elements.find(u=>zn(u)===s);if(!o||!ev(o))return null;const l=t.previewStart-t.element.start,c=u=>u===t.element.track?o.track:u;return{drag:{...t,element:o,previewStart:Math.max(0,Math.round((o.start+l)*1e3)/1e3),previewTrack:c(t.previewTrack)??o.track,desiredTrack:c(t.desiredTrack)},selectedKeys:r}}const P_=new WeakMap;function JE(t,e){let n=P_.get(t);n||(n=new Map,P_.set(t,n));const r=new Map;for(const i of e){const s=(n.get(i)??0)+1;n.set(i,s),r.set(i,s)}return r}function aC(t,e,n){var r;return((r=P_.get(t))==null?void 0:r.get(n))===e.get(n)}function M_(t,e,n){for(const r of n)aC(t,e,r.key)&&t(r.key,r.updates)}let YO=null;function uF(t){const e=YO;let n;if(e)n=e.then(t,t);else try{n=Promise.resolve(t())}catch(i){n=Promise.reject(i)}const r=n.then(()=>{},()=>{});return YO=r,r.then(()=>{YO===r&&(YO=null)}),n}function The(t){return uF(async()=>{const n=await t.commitZ();return n&&!n.durable?!1:t.mirror()})}function Phe(t){return uF(async()=>await t.commitLane()?(await t.commitZ(),!0):!1)}function Ig(t,e){return t.then(n=>{var r;return n&&((r=e.refreshAfterLaneMove)==null||r.call(e)),n})}const WX=t=>t.key??t.id,fF=(t,e)=>(t.sourceFile??null)===(e.sourceFile??null);function hF(t,e,n){const r=WX(n),i=e.filter(o=>WX(o)!==r&&fF(o,n)),s=i.find(o=>o.track===t);if(s)return s.authoredTrack??s.track;let a=null;for(const o of i)(!a||Math.abs(o.track-t)<Math.abs(a.track-t))&&(a=o);return a?Math.round((a.authoredTrack??a.track)+(t-a.track)):t}const Zr=t=>t.key??t.id,DFe=t=>Math.round(t*1e3)/1e3;let Mhe=0;function md(t,e,n,r="timing",i){if(t.length===0)return Promise.resolve(!0);const{updateElement:s,onMoveElement:a,onMoveElements:o}=e;o||console.warn(a?`[Timeline] persistMoveEdits: only single-clip onMoveElement wired — this ${t.length}-clip move degrades to a per-clip persist race (no atomic single-undo)`:`[Timeline] persistMoveEdits: no move persist handler wired — ${t.length} edit(s) applied to the store only, not saved`);const l=t.map(m=>({key:Zr(m.element),start:m.element.start,track:m.element.track,authoredTrack:m.element.authoredTrack})),c=JE(s,t.map(m=>Zr(m.element))),u=m=>{const y=m.persistTrack??(m.updates.track!==m.element.track?m.updates.track:void 0);s(Zr(m.element),y==null?m.updates:{...m.updates,authoredTrack:y})};for(const m of t)u(m);const f=t.map(m=>m.persistTrack==null||m.persistTrack===m.updates.track?m:{element:m.element,updates:{...m.updates,track:m.persistTrack}}),h=o?o(f,n,r,i):Promise.all(f.map(m=>Promise.resolve(a==null?void 0:a(m.element,m.updates))));return Promise.resolve(h).then(()=>{for(const m of t){const y=Zr(m.element);aC(s,c,y)&&u(m)}return!0},m=>{for(const y of l)aC(s,c,y.key)&&s(y.key,{start:y.start,track:y.track,authoredTrack:y.authoredTrack});return console.error("[Timeline] Failed to persist clip edits",m),!1})}function qX(t,e){return t.length===0?0:e<=0?t[0]-.5:e>=t.length?t[t.length-1]+.5:(t[e-1]+t[e])/2}function IFe(t,e){const{elements:n,selectedKeys:r}=e,i=Zr(t.element);if(!r||r.size<=1||!r.has(i))return null;const s=new Set([...r].filter(l=>{const c=n.find(u=>Zr(u)===l);return c?ev(c):!1})),a=t.previewStart-t.element.start;return{keys:s,movedStart:l=>Zr(l)===i?t.previewStart:Math.max(0,DFe(l.start+a))}}function Nhe(t,e){const n=NFe(t,e);if(n){Nhe(n.drag,{...e,selectedKeys:n.selectedKeys});return}const{elements:r,updateElement:i,onMoveElement:s}=e,a=Zr(t.element),o=t.insertRow!=null,l=t.previewTrack!==t.element.track,c=t.desiredTrack??t.previewTrack,u=o||c!==t.element.track,f=IFe(t,e);if(!o&&!l){if(t.previewStart-t.element.start===0)return;if(f){const E=r.filter(M=>f.keys.has(Zr(M))).map(M=>({element:M,updates:{start:f.movedStart(M),track:M.track}})).filter(M=>M.updates.start!==M.element.start);md(E,e);return}const w={start:t.previewStart,track:t.element.track},O={start:t.element.start,track:t.element.track},k=JE(i,[a]);i(a,w),Promise.resolve(s==null?void 0:s(t.element,w)).catch(E=>{aC(i,k,a)&&i(a,O),console.error("[Timeline] Failed to persist clip edit",E)});return}if(o){_Fe(t,e,f);return}const h={element:t.element,updates:{start:t.previewStart,track:t.previewTrack},persistTrack:hF(t.previewTrack,r,t.element)},m=u?`clip-lane-move:${Mhe++}`:void 0,y=[h];if(f)for(const b of r){if(Zr(b)===a||!f.keys.has(Zr(b)))continue;const w=f.movedStart(b);w!==b.start&&y.push({element:b,updates:{start:w,track:b.track}})}const d=r.map(b=>Zr(b)===a?{...b,start:t.previewStart,track:t.previewTrack}:f!=null&&f.keys.has(Zr(b))?{...b,start:f.movedStart(b)}:b),v=f?f.keys:null;if(!u||!e.readZIndex||!e.onStackingPatches){Ig(md(y,e,m,"lane-reorder"),e);return}Ig(Phe({commitLane:()=>md(y,e,m,"lane-reorder"),commitZ:()=>Ihe(d,a,t.element.track,t.previewTrack,v,e,m)}),e).catch(()=>{})}function Dhe(t,e,n,r,i){const{elements:s,trackOrder:a}=i,o=Zr(t);if(t.expandedParentStart!=null)return null;const l=qX(a,n),c=s.map(w=>Zr(w)===o?{...w,start:e,track:l}:r!=null&&r.keys.has(Zr(w))?{...w,start:r.movedStart(w)}:w),u=bc(t),f=w=>fF(w,t)&&bc(w)===u&&w.expandedParentStart==null,h=[...new Set(s.filter(f).map(w=>w.track))].sort((w,O)=>w-O),m=h.filter(w=>w<l).length,y=qX(h,m),d=Ehe(s.filter(f).map(w=>Zr(w)===o?{...w,start:e,track:y}:r!=null&&r.keys.has(Zr(w))?{...w,start:r.movedStart(w)}:w)),v=new Map(s.map(w=>[Zr(w),w]));for(const w of d){const O=v.get(Zr(w));if(O&&f(O)&&!ev(O)&&w.track!==(O.authoredTrack??O.track))return console.warn(`[Timeline] Track insert refused: locked clip ${Zr(O)} would need renumbering`),null}const b=[];if(r)for(const w of s){const O=Zr(w);O!==o&&r.keys.has(O)&&!f(w)&&ev(w)&&b.push({element:w,updates:{start:r.movedStart(w),track:w.track},persistTrack:w.authoredTrack})}for(const w of d){const O=v.get(Zr(w));if(!O||!ev(O))continue;const k=Zr(w)===o||r!=null&&r.keys.has(Zr(w))?(r==null?void 0:r.movedStart(O))??e:O.start;b.push({element:O,updates:{start:k,track:w.track}})}return{candidate:c,edits:b}}function _Fe(t,e,n){const r=Zr(t.element),i=Dhe(t.element,t.previewStart,t.insertRow,n,e);if(!i)return;const{candidate:s,edits:a}=i;if(a.length===0)return;const o=`clip-lane-move:${Mhe++}`;if(!e.readZIndex||!e.onStackingPatches){Ig(md(a,e,o,"track-insert"),e);return}Ig(Phe({commitLane:()=>md(a,e,o,"track-insert"),commitZ:()=>Ihe(s,r,t.element.track,t.insertRow,n?n.keys:null,e,o)}),e).catch(()=>{})}function RFe(t,e,n,r,i){if(e.kind==="move"){const a={element:t,updates:{start:t.start,track:e.displayTrack},persistTrack:e.persistTrack};return Ig(md([a],n,r,"lane-reorder",i),n)}const s=Dhe(t,t.start,e.insertRow,null,n);return!s||s.edits.length===0?Promise.resolve(!1):Ig(md(s.edits,n,r,"track-insert",i),n)}function Ihe(t,e,n,r,i,s,a){const{readZIndex:o,onStackingPatches:l}=s;if(!o||!l||r===n)return Promise.resolve();const c=t.map((h,m)=>({key:Zr(h),start:h.start,duration:h.duration,track:h.track,zIndex:o(h),isAudio:bc(h)==="audio",sourceFile:h.sourceFile,domIndex:m,stackingContextId:h.stackingContextId??null})),u=[e];if(i)for(const h of i)h!==e&&u.push(h);const f=MFe(c,u);return f.length===0?Promise.resolve():Promise.resolve(l(f,a)).then(()=>{})}function jFe(t,e,n){if(!t.hasChanged)return;const r=t.changes,i=JE(e,r.map(a=>a.key));for(const a of r)e(a.key,{start:a.start,duration:a.duration,playbackStart:a.playbackStart});if(!n){M_(e,i,t.members.map(a=>({key:a.key,updates:a})));return}const s=`clip-group-resize:${r.map(a=>a.key).join(":")}`;Promise.resolve(n(r.map(a=>({element:a.element,start:a.start,duration:a.duration,playbackStart:a.playbackStart})),{coalesceKey:s})).catch(a=>{M_(e,i,t.members.map(o=>({key:o.key,updates:o}))),console.error("[Timeline] Failed to persist group clip resize",a)})}function LFe({lifecycleRef:t,sessionEpochRef:e,cancelGestureRef:n,scrollRef:r,draggedClipRef:i,resizingClipRef:s,blockedClipRef:a,groupResizeRef:o,suppressClickRef:l,gestureSelectedKeysRef:c,elementsRef:u,trackOrderRef:f,setDraggedClipState:h,setResizingClipState:m,setShowPopover:y,setRangeSelectionRef:d,applyResizePointerRef:v,syncClipDragAutoScrollRef:b,stopClipDragAutoScrollRef:w,updateDraggedClipPreviewRef:O,publishDraggedClip:k,updateElement:E,onMoveElementRef:M,onMoveElementsRef:N,onResizeElementRef:I,onResizeElementsRef:_,onBlockedEditAttemptRef:j,readZIndexRef:L,onStackingPatchesRef:B,refreshAfterLaneMoveRef:$}){const Q=()=>{requestAnimationFrame(()=>{l.current=!1})},Y=pe=>{const ge=t.current.pointerId;return ge===null||pe.pointerId===ge},W=pe=>{if(pe===null)return;const ge=r.current;try{ge!=null&&ge.hasPointerCapture(pe)&&ge.releasePointerCapture(pe)}catch{}},J=pe=>{var ge;if(pe!==null)try{(ge=r.current)==null||ge.setPointerCapture(pe)}catch{}},ne=pe=>{i.current=null,s.current=null,o.current=null,pe&&(h(null),m(null))},le=({updateReact:pe=!0,suppressClick:ge=!1}={})=>{const Pe=t.current;return Pe.phase!=="active"?!1:(Pe.phase="cancelled",w.current(),ne(pe),W(Pe.pointerId),ge&&(l.current=!0),Pe.kind=null,Pe.pointerId=null,Pe.phase="complete",!0)};n.current=le;const ie=(pe,ge)=>{var ve;const Pe=Math.abs(pe.clientX-ge.originClientX);!ge.started&&Pe<2||(ge.started||J(ge.pointerId),y(!1),(ve=d.current)==null||ve.call(d,null),v.current(ge,pe.clientX),b.current(pe.clientX,pe.clientY))},q=(pe,ge)=>{var xe,we;const Pe=Math.hypot(pe.clientX-ge.originClientX,pe.clientY-ge.originClientY),ve=ge.intent==="move"?4:2;!ge.started&&Pe<ve||ge.started||(ge.started=!0,a.current=ge,J(ge.pointerId),l.current=!0,y(!1),(xe=d.current)==null||xe.call(d,null),(we=j.current)==null||we.call(j,ge.element,ge.intent))},F=(pe,ge)=>{var ve;const Pe=Math.hypot(pe.clientX-ge.originClientX,pe.clientY-ge.originClientY);!ge.started&&Pe<4||(ge.started||J(ge.pointerId),y(!1),(ve=d.current)==null||ve.call(d,null),k(O.current(ge,pe.clientX,pe.clientY)),b.current(pe.clientX,pe.clientY))},U=pe=>{const ge=s.current;if(ge)return Y(pe)?ie(pe,ge):void 0;const Pe=a.current;if(Pe)return Pe.pointerId!==pe.pointerId?void 0:q(pe,Pe);const ve=i.current;ve&&Y(pe)&&F(pe,ve)},Z=(pe,ge)=>{var we;if(!pe.started)return;if(l.current=!0,Q(),ge){jFe(ge,E,_.current);return}if(!(pe.previewStart!==pe.element.start||pe.previewDuration!==pe.element.duration||pe.previewPlaybackStart!==pe.element.playbackStart))return;const ve=pe.element.key??pe.element.id,xe=JE(E,[ve]);E(ve,{start:pe.previewStart,duration:pe.previewDuration,playbackStart:pe.previewPlaybackStart}),Promise.resolve((we=I.current)==null?void 0:we.call(I,pe.element,{start:pe.previewStart,duration:pe.previewDuration,playbackStart:pe.previewPlaybackStart})).catch(Ce=>{M_(E,xe,[{key:ve,updates:{start:pe.element.start,duration:pe.element.duration,playbackStart:pe.element.playbackStart}}]),console.error("[Timeline] Failed to persist clip resize",Ce)})},K=pe=>{a.current=null,pe.started&&Q()},ee=pe=>{pe.started&&(l.current=!0,Q(),Nhe(pe,{elements:u.current,trackOrder:f.current,updateElement:E,onMoveElement:M.current,onMoveElements:N.current,selectedKeys:c.current,readZIndex:L.current,onStackingPatches:B.current,refreshAfterLaneMove:$.current}))},re=()=>{var Pe,ve,xe;const pe=((Pe=o.current)==null?void 0:Pe.members.map(we=>we.element))??[((ve=s.current)==null?void 0:ve.element)??((xe=i.current)==null?void 0:xe.element)],ge=new Set(u.current.map(we=>we.key??we.id));return pe.every(we=>we===void 0||ge.has(we.key??we.id))},z=pe=>{const ge=t.current;if(ge.phase!=="active")return null;if(!Y(pe))return"ignored";if(ge.sessionEpoch!==e.current||!re())return le(),"ignored";ge.phase="committing";const Pe=ge.kind?{kind:ge.kind,drag:i.current,resize:s.current,groupResize:o.current}:"ignored";return w.current(),ne(!0),W(ge.pointerId),Pe==="ignored"&&(ge.phase="complete"),Pe},H=pe=>{try{pe.kind==="resize"&&pe.resize?Z(pe.resize,pe.groupResize):pe.kind==="drag"&&pe.drag&&ee(pe.drag)}finally{const ge=t.current;ge.kind=null,ge.pointerId=null,ge.phase="complete"}},se=pe=>{const ge=z(pe);if(ge==="ignored")return;if(ge){H(ge);return}const Pe=a.current;if(Pe)return Pe.pointerId!==pe.pointerId?void 0:K(Pe);l.current&&Q()},ue=pe=>{t.current.phase==="active"&&Y(pe)&&le({suppressClick:!0})&&Q();const ge=a.current;ge&&ge.pointerId!==pe.pointerId||(a.current=null,l.current&&Q())},be=pe=>{t.current.phase==="active"&&Y(pe)&&le({suppressClick:!0})&&Q()},me=pe=>{const ge=L3e({key:pe.key,drag:i.current,resize:s.current,blocked:a.current});ge.cancel&&(pe.preventDefault(),a.current=null,le({suppressClick:ge.suppressClick}))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",se),window.addEventListener("pointercancel",ue),window.addEventListener("lostpointercapture",be),window.addEventListener("keydown",me),()=>{le({updateReact:!1}),n.current=()=>!1,window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",se),window.removeEventListener("pointercancel",ue),window.removeEventListener("lostpointercapture",be),window.removeEventListener("keydown",me)}}const KO=[];function FFe({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,rowGeometryRef:i,onMoveElement:s,onMoveElements:a,onResizeElement:o,onResizeElements:l,onBlockedEditAttempt:c,setShowPopover:u,setRangeSelectionRef:f,readZIndex:h,onStackingPatches:m,refreshAfterLaneMove:y,sessionEpoch:d=0}){const v=fe(Je=>Je.updateElement),b=fe(Je=>{var St;return((St=Je.beatAnalysis)==null?void 0:St.beatTimes)??KO}),w=fe(Je=>{var St;return((St=Je.beatAnalysis)==null?void 0:St.beatStrengths)??KO}),O=fe(Je=>Je.beatEdits),k=fe(Je=>p0(Je.elements).musicElement),E=(k==null?void 0:k.start)??0,M=(k==null?void 0:k.playbackStart)??0,N=(k==null?void 0:k.duration)??0,I=(k==null?void 0:k.src)??null,_=x.useMemo(()=>{if(b===KO||N===0)return KO;const Je=bj(b,w,O,I),St=M+N,At=E-M;return Je.times.filter(Ke=>Ke>=M&&Ke<=St).map(Ke=>Math.round((Ke+At)*1e3)/1e3)},[b,w,O,I,E,M,N]),j=fe(Je=>Je.elements),L=fe(Je=>Je.timelineSnapEnabled),B=x.useRef({beatTimes:[],enabled:!0});B.current={beatTimes:_,enabled:L};const $=x.useRef(j);$.current=j;const Q=x.useRef(new Map),Y=x.useRef(null),W=x.useCallback((Je,St)=>{if(!B.current.enabled)return[];const At=`${Je??""}|${St?1:0}`,Ke=Q.current.get(At);if(Ke)return Ke;const Be=sFe({elements:$.current,playheadTime:fe.getState().currentTime,beatTimes:St?B.current.beatTimes:[],excludeElementKey:Je});return Q.current.set(At,Be),Be},[]),[J,ne]=x.useState(null),le=x.useRef(null),ie=x.useCallback(Je=>{le.current=Je,ne(Je)},[]),[q,F]=x.useState(null),U=x.useRef(null),Z=x.useCallback(Je=>{U.current=Je,F(Je)},[]),K=x.useRef({kind:null,phase:"complete",pointerId:null,sessionEpoch:d}),ee=x.useRef(d);ee.current=d;const re=x.useRef(new Set),z=x.useRef(()=>!1),H=x.useCallback((Je,St)=>{K.current.phase==="active"&&z.current(),K.current={kind:Je,phase:"active",pointerId:St,sessionEpoch:ee.current},re.current=new Set(fe.getState().selectedElementIds)},[]),se=x.useCallback(Je=>{if(!Je){z.current();return}H("drag",Je.pointerId),ie(Je)},[H,ie]),ue=x.useCallback(Je=>{if(!Je){z.current();return}H("resize",Je.pointerId),Z(Je)},[H,Z]),be=x.useRef(null),me=x.useRef(!1),pe=x.useRef(null),ge=x.useRef(s);ge.current=s;const Pe=x.useRef(a);Pe.current=a;const ve=x.useRef(c);ve.current=c;const xe=x.useRef(o);xe.current=o;const we=x.useRef(l);we.current=l;const Ce=x.useRef(h);Ce.current=h;const Me=x.useRef(m);Me.current=m;const Ve=x.useRef(y);Ve.current=y;const tt=x.useRef(0),Ze=x.useRef(null),qe=x.useCallback((Je,St,At)=>(Y.current||(Y.current=p0($.current).audioTracks),gFe(Je,St,At,{scroll:t.current,pps:e.current,duration:n.current,trackOrder:r.current,rowHeights:i==null?void 0:i.current.rowHeights,elements:$.current,selectedKeys:re.current,buildSnapTargets:W,audioTracks:Y.current})),[t,e,n,r,i,W]),pt=x.useCallback((Je,St)=>{const At=yFe(Je,St,{scroll:t.current,pps:e.current,buildSnapTargets:W}),Ke=Ye=>Z(U.current?{...U.current,started:!0,...Ye}:null),Be=Je.element.key??Je.element.id;let We=pe.current;if(!We||We.grabbedKey!==Be||We.edge!==Je.edge){const Ye=P3e($.current,re.current,Be,Je.edge);We=Ye?{grabbedKey:Be,edge:Je.edge,members:Ye,changes:[],hasChanged:!1}:null,pe.current=We}if(!We){Ke(At);return}xFe(We,At,Ke)},[t,e,W,Z]),it=x.useRef(pt);it.current=pt;const vt=x.useCallback(()=>{Ze.current=null,tt.current&&(cancelAnimationFrame(tt.current),tt.current=0),Q.current.clear(),Y.current=null},[]),Ot=x.useCallback(()=>{tt.current=0;const Je=le.current,St=U.current,At=Ze.current,Ke=t.current;!Je&&!St||!At||!Ke||SE(Ke,At.clientX,At.clientY)&&(Je?ie(qe(Je,At.clientX,At.clientY)):St&&it.current(St,At.clientX),tt.current=requestAnimationFrame(Ot))},[ie,t,qe]),Kt=x.useCallback((Je,St)=>{Ze.current={clientX:Je,clientY:St};const At=aS(t.current,Je,St,tt.current!==0);At==="stop"?(cancelAnimationFrame(tt.current),tt.current=0):At==="start"&&(tt.current=requestAnimationFrame(Ot))},[t,Ot]),qt=x.useRef(qe);qt.current=qe;const fn=x.useRef(Kt);fn.current=Kt;const Jt=x.useRef(vt);return Jt.current=vt,wr(()=>LFe({onStackingPatchesRef:Me,refreshAfterLaneMoveRef:Ve,readZIndexRef:Ce,onBlockedEditAttemptRef:ve,onResizeElementsRef:we,onResizeElementRef:xe,onMoveElementsRef:Pe,onMoveElementRef:ge,updateElement:v,publishDraggedClip:ie,updateDraggedClipPreviewRef:qt,stopClipDragAutoScrollRef:Jt,syncClipDragAutoScrollRef:fn,applyResizePointerRef:it,setRangeSelectionRef:f,setShowPopover:u,setResizingClipState:F,setDraggedClipState:ne,trackOrderRef:r,elementsRef:$,gestureSelectedKeysRef:re,suppressClickRef:me,groupResizeRef:pe,blockedClipRef:be,resizingClipRef:U,draggedClipRef:le,scrollRef:t,cancelGestureRef:z,sessionEpochRef:ee,lifecycleRef:K})),x.useEffect(()=>{z.current()},[d]),{draggedClip:J,setDraggedClip:se,resizingClip:q,setResizingClip:ue,blockedClipRef:be,suppressClickRef:me,stopClipDragAutoScroll:vt}}function YX(t){if(typeof document>"u"||!document.body||!document.execCommand)return!1;const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.border="0",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus({preventScroll:!0}),e.select(),e.setSelectionRange(0,t.length);try{return document.execCommand("copy")}catch{return!1}finally{e.remove()}}function $Fe(){if(typeof navigator>"u")return!1;const t=navigator.userAgent;return/Safari/i.test(t)&&!/Chrome|Chromium|CriOS|FxiOS|Edg|OPR/i.test(t)}async function zf(t){const e=$Fe();if(e&&YX(t))return!0;const n=typeof navigator<"u"?navigator.clipboard:void 0;if(n!=null&&n.writeText)try{return await n.writeText(t),!0}catch{}return!e&&YX(t)}function BFe(t,e){return`hf-edit-draft:${t.toFixed(2)}:${e.toFixed(2)}`}function VFe(t){try{return sessionStorage.getItem(t)??""}catch{return""}}function KX(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function HFe({rangeStart:t,rangeEnd:e,anchorX:n,anchorY:r,onClose:i}){const s=fe(_=>_.elements),a=Math.min(t,e),o=Math.max(t,e),l=BFe(a,o),[c,u]=x.useState(()=>VFe(l)),f=_=>{u(_),KX(l,_)},[h,m]=x.useState(!1),[y,d]=x.useState(!1),[v,b]=x.useState(!1),w=x.useRef(null),O=x.useRef(null),k=x.useMemo(()=>s.filter(_=>{const j=_.start+_.duration;return _.start<o&&j>a}),[s,a,o]);wr(()=>{setTimeout(()=>{var _;return(_=O.current)==null?void 0:_.focus()},50)}),wr(()=>{const _=j=>{j.key==="Escape"&&i()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)}),wr(()=>{const _=j=>{w.current&&!w.current.contains(j.target)&&i()};return setTimeout(()=>window.addEventListener("mousedown",_),100),()=>window.removeEventListener("mousedown",_)});const E=x.useCallback(()=>j3e({rangeStart:a,rangeEnd:o,elements:k,prompt:c}),[a,o,k,c]),M=x.useCallback(async()=>{if(!await zf(E())){b(!0);return}b(!1),KX(l,""),m(!0),setTimeout(()=>{m(!1),i()},800)},[E,i,l]),N=x.useCallback(async()=>{const _=NG(c);if(!_)return;if(!await zf(_)){b(!0);return}b(!1),d(!0),setTimeout(()=>{d(!1)},800)},[c]),I={position:"fixed",left:Math.max(8,Math.min(n-160,window.innerWidth-336)),top:Math.max(8,r-280),zIndex:200};return p.jsx("div",{ref:w,style:I,children:p.jsxs("div",{className:"w-80 bg-neutral-900 border border-neutral-700/60 rounded-xl shadow-2xl shadow-black/40 overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-neutral-800/60",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-studio-accent"}),p.jsxs("span",{className:"text-[11px] font-medium text-neutral-300",children:[as(a)," — ",as(o)]})]}),p.jsxs("span",{className:"text-[10px] text-neutral-600",children:[k.length," element",k.length!==1?"s":""]})]}),k.length>0&&p.jsx("div",{className:"px-4 py-2 border-b border-neutral-800/40 max-h-24 overflow-y-auto",children:k.map(_=>p.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[p.jsxs("span",{className:"text-[10px] font-mono text-studio-accent/80",children:["#",_.id]}),p.jsx("span",{className:"text-[10px] text-neutral-600",children:_.tag})]},_.id))}),p.jsx("div",{className:"p-3",children:p.jsx("textarea",{ref:O,value:c,onChange:_=>f(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),M())},placeholder:"What should change?",rows:2,className:"w-full px-3 py-2 text-xs bg-neutral-800/60 border border-neutral-700/40 rounded-lg text-neutral-200 placeholder:text-neutral-600 resize-none focus:outline-none focus:border-studio-accent/40 transition-colors"})}),v&&p.jsx("p",{className:"px-3 pb-2 text-[10px] text-red-400",role:"alert",children:"Copy failed — check clipboard permissions and try again."}),p.jsxs("div",{className:"grid grid-cols-2 gap-2 px-3 pb-3",children:[p.jsx("button",{onClick:N,disabled:!NG(c),className:`py-1.5 text-[11px] font-medium rounded-lg transition-all border ${y?"bg-green-500/20 text-green-400 border-green-500/30":"bg-neutral-800/70 text-neutral-200 border-neutral-700/50 hover:bg-neutral-800"} disabled:opacity-50 disabled:cursor-not-allowed`,children:y?"Prompt Copied!":"Copy Prompt"}),p.jsxs("button",{onClick:M,className:`py-1.5 text-[11px] font-medium rounded-lg transition-all ${h?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-studio-accent/15 text-studio-accent border border-studio-accent/25 hover:bg-studio-accent/25"}`,children:[h?"Copied!":"Copy to Agent",!h&&p.jsx("span",{className:"text-[9px] text-studio-accent/50 ml-1.5",children:"Cmd+Enter"})]})]})]})})}function _he(t){x.useEffect(()=>{var s;const e=t.current;if(!e)return;const n=document.activeElement,r=()=>Array.from(e.querySelectorAll('[role="menuitem"]')).filter(a=>!a.disabled);(s=r()[0])==null||s.focus();const i=a=>{var u;if(a.key!=="ArrowDown"&&a.key!=="ArrowUp"&&a.key!=="Home"&&a.key!=="End")return;const o=r();if(o.length===0)return;a.preventDefault();const l=o.findIndex(f=>f===document.activeElement);let c;a.key==="ArrowDown"?c=l<0?0:(l+1)%o.length:a.key==="ArrowUp"?c=l<0?o.length-1:(l-1+o.length)%o.length:a.key==="Home"?c=0:c=o.length-1,(u=o[c])==null||u.focus()};return e.addEventListener("keydown",i),()=>{e.removeEventListener("keydown",i),n instanceof HTMLElement&&document.contains(n)&&n.focus()}},[t])}const gM="w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-200 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left",QFe="w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left";function Rhe({state:t,onClose:e,onDelete:n,onDeleteAll:r,onEditEase:i,onCopyProperties:s,onMoveToPlayhead:a}){const o=F0(e),l={percentage:t.percentage,tweenPercentage:t.tweenPercentage,propertyGroup:t.propertyGroup,animationId:t.animationId};_he(o);const[c,u]=x.useState("idle"),f=async()=>{if(!s)return;if(await s(t.elementId,l)===!1){u("failed"),setTimeout(()=>u("idle"),1500);return}u("copied"),setTimeout(e,700)},h=200,y=10+(1+(a?1:0)+(i?1:0)+(s?1:0)+(n?1:0))*30+9,d=t.y+y-window.innerHeight,v=t.x+h>window.innerWidth?t.x-h:t.x,b=Math.max(8,d>0?t.y-d-8:t.y);return Fl.createPortal(p.jsxs("div",{ref:o,role:"menu","aria-label":"Keyframe actions",className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px] overflow-y-auto",style:{left:v,top:b,maxHeight:`calc(100vh - ${b+8}px)`},children:[a&&p.jsx("button",{type:"button",role:"menuitem",className:gM,onClick:()=>{a(t.element,l),e()},children:"Move to Playhead"}),i&&p.jsxs("button",{type:"button",role:"menuitem",className:`${gM} justify-between`,onClick:()=>{i(t.elementId,l),e()},children:[p.jsx("span",{children:"Edit Ease…"}),p.jsx("span",{className:"text-[10px] text-neutral-500",children:t.currentEase??"default"})]}),s&&p.jsx("button",{type:"button",role:"menuitem",className:gM,onClick:()=>{f()},children:c==="copied"?"Copied!":c==="failed"?"Copy failed — check permissions":"Copy Properties"}),n&&p.jsx("button",{type:"button",role:"menuitem",className:QFe,onClick:()=>{n(t.elementId,l),e()},children:"Delete Keyframe"}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60",role:"separator"}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60",role:"separator"}),p.jsx("button",{type:"button",role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-950/40 focus-visible:bg-red-950/40 outline-none cursor-pointer text-left",onClick:()=>{r(t.element,t.animationId),e()},children:"Delete All Keyframes"})]}),document.body)}const zFe=x.memo(function({x:e,y:n,element:r,currentTime:i,onClose:s,onSplit:a,onDelete:o}){const l=F0(s);_he(l);const c=200,f=n+80-window.innerHeight,h=e+c>window.innerWidth?e-c:e,m=f>0?n-f-8:n,y=KE(r)&&["video","audio","img"].includes(r.tag),d=y&&i>r.start&&i<r.start+r.duration,v=y?d?`Split at ${i.toFixed(2)}s`:"Split (move playhead inside clip)":null;return Fl.createPortal(p.jsxs("div",{ref:l,role:"menu","aria-label":"Clip actions",className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:h,top:m},children:[v&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",role:"menuitem",className:`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left outline-none focus-visible:bg-neutral-800 ${d?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!d,onClick:()=>{d&&(a(r,i),s())},children:[p.jsx("span",{children:v}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"S"})]}),p.jsx("div",{className:"my-1 border-t border-neutral-700/60"})]}),p.jsxs("button",{type:"button",role:"menuitem",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 focus-visible:bg-neutral-800 outline-none cursor-pointer text-left",onClick:()=>{o(r),s()},children:[p.jsx("span",{children:"Delete"}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]}),document.body)}),ZFe=x.memo(function({x:e,y:n,gapWidth:r,canCloseGap:i,canCloseAllGaps:s,hasAnyGaps:a,onClose:o,onCloseGap:l,onCloseAllGaps:c,onHoverAction:u}){const f=F0(o),h=200,y=n+68-window.innerHeight,d=e+h>window.innerWidth?e-h:e,v=y>0?n-y-8:n,b=k=>`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left ${k?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,w=i?void 0:r==null?"No gap here":"A clip on this track can't be moved",O=s?void 0:a?"A clip on this track can't be moved":"No gaps on this track";return Fl.createPortal(p.jsxs("div",{ref:f,className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:d,top:v},onPointerLeave:()=>u(null),children:[p.jsxs("button",{type:"button",className:b(i),disabled:!i,title:w,onPointerEnter:()=>u(i?"close-gap":null),onClick:()=>{i&&(l(),o())},children:[p.jsx("span",{children:"Close gap"}),r!=null&&p.jsxs("span",{className:"text-neutral-500 text-[10px] ml-3",children:[r.toFixed(2),"s"]})]}),p.jsx("button",{type:"button",className:b(s),disabled:!s,title:O,onPointerEnter:()=>u(s?"close-all":null),onClick:()=>{s&&(c(),o())},children:p.jsx("span",{children:"Close all gaps"})})]}),document.body)});function GFe({theme:t}){return p.jsx("div",{className:"absolute bottom-2 right-3 pointer-events-none z-20",children:p.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border",style:{background:"rgba(17,23,35,0.84)",borderColor:t.gutterBorder},children:[p.jsx("kbd",{className:"text-[9px] font-mono px-1 py-0.5 rounded",style:{color:t.textSecondary,background:"rgba(255,255,255,0.06)"},children:"Shift"}),p.jsx("span",{className:"text-[9px]",style:{color:t.textSecondary},children:"+ drag/click to edit range"})]})})}function N_({capturedElement:t,targetSessionEpoch:e,sessionEpoch:n,selectedElementId:r,elements:i}){const s=t.key??t.id;return e!==n||r!==s?null:i.find(a=>(a.key??a.id)===s)??null}function UFe(t,e,n){const r=fe.getState();return N_({capturedElement:t,targetSessionEpoch:e,sessionEpoch:r.timelineSessionEpoch,selectedElementId:r.selectedElementId,elements:n})}function XFe({elements:t,elementsRef:e,theme:n,showShortcutHint:r,showPopover:i,rangeSelection:s,setShowPopover:a,setRangeSelection:o,kfContextMenu:l,setKfContextMenu:c,onDeleteKeyframe:u,onDeleteAllKeyframes:f,onMoveKeyframeToPlayhead:h,clipContextMenu:m,setClipContextMenu:y,currentTime:d,onSplitElement:v,pinZoomBeforeEdit:b,onDeleteElement:w,gapContextMenu:O,onDismissGapContextMenu:k,onCloseTrackGap:E,onCloseAllTrackGaps:M,onHoverGapAction:N}){const I=fe(Y=>Y.selectedElementId),_=fe(Y=>Y.timelineSessionEpoch),j=l==null?void 0:l.sessionEpoch,L=m==null?void 0:m.sessionEpoch,B=l?N_({capturedElement:l.element,targetSessionEpoch:j,sessionEpoch:_,selectedElementId:I,elements:t}):null,$=m?N_({capturedElement:m.element,targetSessionEpoch:L,sessionEpoch:_,selectedElementId:I,elements:t}):null,Q=(Y,W)=>UFe(Y,W,e.current);return x.useEffect(()=>{l&&!B&&c(null)},[B,l,c]),x.useEffect(()=>{m&&!$&&y(null)},[m,$,y]),p.jsxs(p.Fragment,{children:[r&&!i&&!s&&p.jsx(GFe,{theme:n}),i&&s&&p.jsx(HFe,{rangeStart:s.start,rangeEnd:s.end,anchorX:s.anchorX,anchorY:s.anchorY,onClose:()=>{a(!1),o(null)}}),l&&B&&p.jsx(Rhe,{state:{...l,element:B},onClose:()=>c(null),onDelete:(...Y)=>{Q(B,j)&&(u==null||u(...Y))},onDeleteAll:(Y,W)=>{const J=Q(B,j);J&&(f==null||f(J,W))},onMoveToPlayhead:h?(Y,...W)=>{const J=Q(B,j);J&&h(J,...W)}:void 0,onEditEase:l.animationId!==void 0&&l.tweenPercentage!==void 0?(Y,W)=>{W.animationId===void 0||W.tweenPercentage===void 0||(fe.getState().setFocusedEaseSegment({animationId:W.animationId,collidingAnimationTargets:W.collidingAnimationTargets,tweenPercentage:W.tweenPercentage,elementId:Y}),H7({action:"open"}))}:void 0,onCopyProperties:(Y,W)=>{const J=fe.getState().keyframeCache.get(Y),ne=J==null?void 0:J.keyframes.find(le=>Math.abs(le.percentage-W.percentage)<.5);return ne?zf(JSON.stringify(ne.properties,null,2)):!1}}),m&&$&&p.jsx(zFe,{x:m.x,y:m.y,element:$,currentTime:d,onClose:()=>y(null),onSplit:(Y,W)=>{const J=Q($,L);J&&(v==null||v(J,W))},onDelete:()=>{const Y=Q($,L);Y&&(b(),w==null||w(Y))}}),O&&p.jsx(ZFe,{x:O.x,y:O.y,gapWidth:O.gapWidth,canCloseGap:O.canCloseGap,canCloseAllGaps:O.canCloseAllGaps,hasAnyGaps:O.hasAnyGaps,onClose:k,onCloseGap:E,onCloseAllGaps:M,onHoverAction:N})]})}function WFe({ppsRef:t,fitPpsRef:e,onMoveElement:n,onMoveElements:r,onResizeElement:i,onResizeElements:s,onFileDrop:a,onAssetDrop:o,onBlockDrop:l,onCompositionDrop:c}){const u=fe(E=>E.pinTimelineZoom),f=x.useCallback(()=>{u(t.current,e.current)},[u,t,e]),h=x.useRef(null),m=x.useMemo(()=>n&&((...E)=>(f(),n(...E))),[n,f]),y=x.useMemo(()=>r&&((...E)=>(f(),r(...E))),[r,f]),d=x.useMemo(()=>i&&((...E)=>(f(),i(...E))),[i,f]),v=x.useMemo(()=>s&&((...E)=>(f(),s(...E))),[s,f]),b=x.useMemo(()=>a&&((...E)=>(f(),a(...E))),[a,f]),w=x.useMemo(()=>o&&((...E)=>(f(),o(...E))),[o,f]),O=x.useMemo(()=>l&&((...E)=>(f(),l(...E))),[l,f]),k=x.useMemo(()=>c&&((...E)=>(f(),c(...E))),[c,f]);return{pinZoomBeforeEdit:f,setRangeSelectionRef:h,pinnedOnMoveElement:m,pinnedOnMoveElements:y,pinnedOnResizeElement:d,pinnedOnResizeElements:v,pinnedOnFileDrop:b,pinnedOnAssetDrop:w,pinnedOnBlockDrop:O,pinnedOnCompositionDrop:k}}const dF=Dc("StudioShellContext",null),pF=Dc("StudioPlaybackContext",null);function zl(){const t=x.useContext(dF);if(!t)throw new Error("useStudioShellContext must be used within StudioShellProvider");return t}function mF(){return x.useContext(dF)}function vy(){const t=x.useContext(pF);if(!t)throw new Error("useStudioPlaybackContext must be used within StudioPlaybackProvider");return t}function qFe(){return x.useContext(pF)}function YFe({value:t,children:e}){const{projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:s,previewIframeRef:a,editHistory:o,handleUndo:l,handleRedo:c,renderQueue:u,compositionDimensions:f,waitForPendingDomEditSaves:h,handlePreviewIframeRef:m}=t,y=x.useMemo(()=>({projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:s,previewIframeRef:a,editHistory:o,handleUndo:l,handleRedo:c,renderQueue:u,compositionDimensions:f,waitForPendingDomEditSaves:h,handlePreviewIframeRef:m}),[n,r,f,o,u,i,s,a,l,c,h,m]);return p.jsx(dF,{value:y,children:e})}function KFe({value:t,children:e}){const{captionEditMode:n,compositionLoading:r,refreshKey:i,setRefreshKey:s,timelineElements:a,isPlaying:o,refreshPreviewDocumentVersion:l}=t,c=x.useMemo(()=>({captionEditMode:n,compositionLoading:r,refreshKey:i,setRefreshKey:s,timelineElements:a,isPlaying:o,refreshPreviewDocumentVersion:l}),[n,r,i,a,o,s,l]);return p.jsx(pF,{value:c,children:e})}function JFe(t){var e;try{const n=(e=t.ownerDocument)==null?void 0:e.defaultView;if(!n)return!0;const r=n.getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;const i=Number.parseFloat(r.opacity);return!(Number.isFinite(i)&&i<=.01&&!t.hasAttribute(WE))}catch{return!0}}function JX(t){if(!t||t==="auto")return 0;const e=parseInt(t,10);return Number.isFinite(e)?e:0}function e3(t){var r;const e=pj(t);if(e!=null)return e;const n=t.style.zIndex;if(n&&n!=="auto")return JX(n);try{const i=(r=t.ownerDocument)==null?void 0:r.defaultView;if(i)return JX(i.getComputedStyle(t).zIndex)}catch{}return 0}function jhe(t){var n;const e=(n=t.ownerDocument)==null?void 0:n.defaultView;return e&&t instanceof e.HTMLElement?!0:t.nodeType===1}const e$e=new Set(["AUDIO","SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function t$e(t){return jhe(t)&&!e$e.has(t.tagName)}function Lhe(t){const e=t.parentElement;if(!e)return{entries:[],targetIndex:-1};const n=[];let r=-1,i=0;for(const s of Array.from(e.children))s!==t&&!t$e(s)||jhe(s)&&(s===t&&(r=n.length),n.push({element:s,zIndex:e3(s),domIndex:i}),i+=1);return{entries:n,targetIndex:r}}function n$e(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function r$e(t,e,n){const r=e.filter(a=>a.element===t||n(a.element));let i;try{i=t.getBoundingClientRect()}catch{return r}if(i.width===0&&i.height===0)return r;const s={left:i.left,top:i.top,right:i.right,bottom:i.bottom};return r.filter(a=>{if(a.element===t)return!0;try{const o=a.element.getBoundingClientRect();return n$e(s,{left:o.left,top:o.top,right:o.right,bottom:o.bottom})}catch{return!1}})}function gF(t){return[...t].sort((e,n)=>e.zIndex-n.zIndex||e.domIndex-n.domIndex)}function i$e(t,e){if(t&&e)return e.zIndex-t.zIndex>=2?t.zIndex+1:null;if(t)return t.zIndex+1;if(e){const n=Math.max(0,e.zIndex-1);return n>=e.zIndex?null:n}return null}function Fhe(t,e,n,r){const i=e.findIndex(l=>l.element===n);if(i===-1)return null;const s=e3(n),a=t.map(l=>l.zIndex);if(!a.some((l,c)=>a.indexOf(l)!==c)){const l=i$e(e[i-1],e[i+1]);if(l!==null)return l===s?null:[{element:n,zIndex:l}]}return s$e(t,e,n,r)}function s$e(t,e,n,r){const i=new Set(e.map(m=>m.element)),s=r.filter(m=>!i.has(m.element)),a=e.length,o=t.map(m=>m.zIndex),l=Math.min(...o),c=Math.max(...o);if(!s.some(m=>m.zIndex>=l&&m.zIndex<=c)){const m=s.filter(w=>w.zIndex<l).map(w=>w.zIndex),y=s.filter(w=>w.zIndex>c).map(w=>w.zIndex),d=m.length>0?Math.max(...m)+1:0,v=y.length>0,b=v?Math.min(...y)-a:Number.POSITIVE_INFINITY;if(d<=b){let w=Math.max(l,d);v&&(w=Math.min(w,b));const O=[];return e.forEach((k,E)=>{k.zIndex!==w+E&&O.push({element:k.element,zIndex:w+E})}),O.length===0?null:O}}const f=a$e(r,e,n),h=[];return f.forEach((m,y)=>{m.zIndex!==y&&h.push({element:m.element,zIndex:y})}),h.length===0?null:h}function a$e(t,e,n){const r=gF(t),i=r.find(f=>f.element===n),s=r.filter(f=>f.element!==n);if(!i)return s;const a=e.findIndex(f=>f.element===n),o=e[a-1],l=e[a+1],c=o?s.findIndex(f=>f.element===o.element):-1,u=l?s.findIndex(f=>f.element===l.element):-1;return c>=0?s.splice(c+1,0,i):u>=0?s.splice(u,0,i):s.unshift(i),s}function $he(t,e,n){const{entries:r}=Lhe(t);if(r.length<2)return null;const s=e==="bring-to-front"||e==="send-to-back"?r:r$e(t,r,JFe);if(s.length<2)return null;const a=gF(s),o=a.findIndex(l=>l.element===t);return o===-1?null:{entries:r,order:a,pos:o}}function Bhe(t,e,n){const r=$he(t,e);if(!r)return null;const{entries:i,order:s,pos:a}=r,o=[...s],[l]=o.splice(a,1);switch(e){case"bring-forward":if(a>=s.length-1)return null;o.splice(a+1,0,l);break;case"send-backward":if(a<=0)return null;o.splice(a-1,0,l);break;case"bring-to-front":if(a>=s.length-1)return null;o.push(l);break;case"send-to-back":if(a<=0)return null;o.unshift(l);break}return Fhe(s,o,t,i)}function o$e(t,e){const{entries:n}=Lhe(t);if(n.length<2)return null;const r=new Map(n.map(a=>[a.element,a])),i=[];for(const a of e){const o=r.get(a);if(!o)return null;i.push(o)}if(i.length<2||!i.some(a=>a.element===t))return null;const s=gF(i);return s.every((a,o)=>a.element===i[o].element)?null:Fhe(s,i,t,n)}function l$e(t,e,n){if(e!=="bring-forward"&&e!=="send-backward")return null;const r=$he(t,e);if(!r)return null;const{order:i,pos:s}=r,a=e==="bring-forward"?i[s+1]:i[s-1];return(a==null?void 0:a.element)??null}function c$e(t,e,n){return Bhe(t,e)!==null}function u$e({expandedElementsRef:t}){const e=yS(),n=mF(),r=(e==null?void 0:e.previewIframeRef)??null,i=e==null?void 0:e.handleDomZIndexReorderCommit,s=(n==null?void 0:n.activeCompPath)??null,a=x.useCallback(u=>{var h;const f=((h=r==null?void 0:r.current)==null?void 0:h.contentDocument)??null;return f?Ds(f,{hfId:u.hfId,id:u.domId??u.id,selector:u.selector,selectorIndex:u.selectorIndex,sourceFile:u.sourceFile??s??"index.html"},s):null},[r,s]),o=x.useCallback(u=>{const f=a(u);return f?e3(f):Number.NaN},[a]),l=x.useCallback((u,f)=>{if(!i)return Promise.resolve();const h=u.flatMap(m=>{const y=t.current.find(v=>(v.key??v.id)===m.key),d=y&&a(y);return!y||!d?[]:[{element:d,zIndex:m.zIndex,id:y.domId??y.id,selector:y.selector,selectorIndex:y.selectorIndex,sourceFile:y.sourceFile??s??"index.html",key:m.key}]});return h.length?i(h,f).then(()=>{}):Promise.resolve()},[i,a,s,t]);return{readClipZIndex:o,applyStackingPatches:l,zSyncEnabled:!!(i&&r)}}function f$e({viewportWidth:t,effectiveDuration:e,zoomMode:n,manualZoomPercent:r,ppsRef:i,fitPpsRef:s,draggedClip:a,resizingClip:o,expandedElements:l,isDragging:c,scrollRef:u,lastScrollLeftRef:f,contentOrigin:h}){const m=h3e(t,e,h),y=bCe(m,n,r);i.current=y;const d=Math.max(0,e*y),v=a!=null&&a.started?(a.previewStart+a.element.duration)*y+CG:0,b=o!=null&&o.started?(o.previewStart+o.previewDuration)*y+CG:0,w=d3e({trackContentWidth:d,viewportWidth:t,contentOrigin:h,pps:y,dragGhostEndPx:v,resizeGhostEndPx:b}),O=y>0?w/y:e,k=x.useRef(n);k.current=n;const E=x.useRef(r);return E.current=r,s.current=m,x.useEffect(()=>{if(n!=="manual"||c.current)return;const M=u.current,N=f.current;if(!M||N<=0)return;const I=requestAnimationFrame(()=>{const _=Math.max(0,M.scrollWidth-M.clientWidth),j=Math.min(N,_);Math.abs(M.scrollLeft-j)>.5&&(M.scrollLeft=j)});return()=>cancelAnimationFrame(I)},[l,n]),x.useEffect(()=>{fe.getState().setTimelineScale(y,m)},[y,m]),{pps:y,fitPps:m,displayContentWidth:w,displayDuration:O,clipStateVersion:l,zoomModeRef:k,manualZoomPercentRef:E}}function h$e(t,e){for(const r of e)t.has(r)||e.delete(r);const n=[];for(const[r,i]of t)e.has(r)||i.some(bce)&&n.push(r);return n}function d$e(t){var i;const e=fe(s=>s.expandClips),n=((i=mF())==null?void 0:i.projectId)??null,r=x.useRef({projectId:n,source:t,clips:new Set});x.useEffect(()=>{if(r.current.projectId!==n){const a=r.current.source!==t;if(r.current={projectId:n,source:t,clips:new Set},!a)return}else r.current.source=t;const s=h$e(t,r.current.clips);if(s.length!==0){for(const a of s)r.current.clips.add(a);e(s)}},[t,e,n])}const p$e=!0,m$e=Object.freeze({scrollLeft:0,scrollTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0,isScrolling:!1});function g$e(t,e){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,isScrolling:e}}function y$e(t,e){const[n,r]=x.useState(m$e),[i,s]=x.useState(!0),a=x.useRef(null),o=x.useRef(0),l=x.useRef(0),c=x.useRef(null),u=x.useRef(!1),f=x.useCallback((d,v=!1)=>{u.current=v;const b=()=>{l.current=0,r(g$e(d,u.current))};if(v)l.current||(l.current=requestAnimationFrame(b));else{l.current&&cancelAnimationFrame(l.current),b();return}c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=!1,l.current&&cancelAnimationFrame(l.current),b()},100)},[]),h=x.useCallback(()=>{const d=t.current;s(d?y3e(d.scrollHeight,d.clientHeight):!0)},[t]),m=x.useCallback(()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{o.current=0,h()})},[h]),y=x.useCallback(d=>{if(a.current&&(a.current.disconnect(),a.current=null),t.current=d,!d){c.current&&clearTimeout(c.current),c.current=null,u.current=!1;return}const v=()=>{f(d,u.current),m()};v(),a.current=new ResizeObserver(v),a.current.observe(d)},[t,m,f]);return wr(()=>()=>{var d;(d=a.current)==null||d.disconnect(),o.current&&cancelAnimationFrame(o.current),l.current&&cancelAnimationFrame(l.current),c.current&&clearTimeout(c.current)}),x.useEffect(()=>{h()},[h,...e]),{viewport:n,showShortcutHint:i,setScrollRef:y,syncScrollViewport:f}}function x$e(t){const e=lS(),{onMoveElement:n,onMoveElements:r,onResizeElement:i,onResizeElements:s,onBlockedEditAttempt:a,onSplitElement:o}=t;return x.useMemo(()=>({...e,onMoveElement:n??e.onMoveElement,onMoveElements:r??e.onMoveElements,onResizeElement:i??e.onResizeElement,onResizeElements:s??e.onResizeElements,onBlockedEditAttempt:a??e.onBlockedEditAttempt,onSplitElement:o??e.onSplitElement}),[e,n,r,i,s,a,o])}const t3=.001,_g=t=>t.key??t.id;function dA(t){return Math.max(0,...t.map(e=>e.expandedParentStart??0))}const Vhe=t=>Math.round(t*1e3)/1e3,oC=t=>t.start+t.duration;function n3(t){return[...t].sort((e,n)=>e.start-n.start||_g(e).localeCompare(_g(n)))}function D_(t,e,n=t3,r=0){const i=n3(t);if(i.some(c=>e>=c.start-n&&e<oC(c)-n))return null;const a=i.filter(c=>c.start>e-n);if(a.length===0)return null;const o=a[0].start,l=Math.max(r,...i.filter(c=>c.start<=e-n).map(c=>oC(c)));return o-l<=n?null:{gapStart:l,gapEnd:o,followingKeys:a.map(_g)}}function Hhe(t,e=t3,n=0){const r=[];let i=n;for(const s of n3(t))s.start-i>e&&r.push({start:i,end:s.start}),i=Math.max(i,oC(s));return r}function Qhe(t,e=t3,n=0){const r=[];let i=n;for(const s of n3(t)){const a=Vhe(i);Math.abs(a-s.start)>e&&r.push({key:_g(s),newStart:a}),i+=s.duration}return r}function b$e(t,e,n=t3,r=0){const i=Hhe(t,n,r),s=Math.max(r,...t.map(oC));return e-s>n&&i.push({start:s,end:e}),i}function zhe(t,e){const n=e.gapEnd-e.gapStart,r=new Set(e.followingKeys);return n3(t).filter(i=>r.has(_g(i))).map(i=>({key:_g(i),newStart:Math.max(e.gapStart,Vhe(i.start-n))}))}const Zhe=t=>t.key??t.id;let v$e=0;function I_(t,e){const n=new Map(t.map(r=>[Zhe(r),r]));return e.every(r=>{const i=n.get(r.key);return i!=null&&sS(i).canMove})}function A$e(t,e){if(e.length===0||!I_(t,e))return null;const n=new Map(t.map(r=>[Zhe(r),r]));return e.map(r=>{const i=n.get(r.key);return{element:i,updates:{start:r.newStart,track:i.track}}})}function Ghe(t,e,n){const r=A$e(t,e);return r?(md(r,n,`track-gap-close:${v$e++}`),!0):!1}function S$e(t,e,n){const r=D_(t,e,void 0,dA(t));return r?Ghe(t,zhe(t,r),n):!1}function w$e(t,e){return Ghe(t,Qhe(t,void 0,dA(t)),e)}function O$e({tracks:t,expandedElementsRef:e,trackOrderRef:n,onMoveElement:r,onMoveElements:i}){const s=fe(w=>w.updateElement),a=fe(w=>w.timelineSessionEpoch),[o,l]=x.useState(null),[c,u]=x.useState(null),f=x.useMemo(()=>{var w;return(o==null?void 0:o.sessionEpoch)===a?((w=t.find(([O])=>O===o.track))==null?void 0:w[1])??[]:null},[o,a,t]),h=x.useMemo(()=>{if(!o||!f)return null;const w=dA(f),O=D_(f,o.time,void 0,w),k=Qhe(f,void 0,w);return{x:o.x,y:o.y,gapWidth:O?O.gapEnd-O.gapStart:null,canCloseGap:O!=null&&I_(f,zhe(f,O)),hasAnyGaps:k.length>0,canCloseAllGaps:k.length>0&&I_(f,k)}},[o,f]),m=x.useMemo(()=>{if(!o||!f||!c)return null;const w=dA(f);if(c==="close-gap"){const k=D_(f,o.time,void 0,w);return k?{track:o.track,intervals:[{start:k.gapStart,end:k.gapEnd}]}:null}const O=Hhe(f,void 0,w);return O.length>0?{track:o.track,intervals:O}:null},[o,f,c]),y=x.useCallback(()=>{!o||!f||o.sessionEpoch!==fe.getState().timelineSessionEpoch||S$e(f,o.time,{elements:e.current,trackOrder:n.current,updateElement:s,onMoveElement:r,onMoveElements:i})},[o,f,e,n,s,r,i]),d=x.useCallback(()=>{!o||!f||o.sessionEpoch!==fe.getState().timelineSessionEpoch||w$e(f,{elements:e.current,trackOrder:n.current,updateElement:s,onMoveElement:r,onMoveElements:i})},[o,f,e,n,s,r,i]),v=x.useCallback(w=>{u(null),l({...w,sessionEpoch:fe.getState().timelineSessionEpoch})},[]),b=x.useCallback(()=>{u(null),l(null)},[]);return x.useEffect(()=>{o&&o.sessionEpoch!==a&&b()},[b,o,a]),{gapMenuModel:h,gapHighlight:m,setHoveredGapAction:u,openGapMenu:v,dismissGapMenu:b,closeTrackGap:y,closeAllTrackGaps:d}}function C$e(t,e){return e.size===0||e.size===1&&e.has(t)}function k$e(t){var c;const{selectedElementId:e,selectedElementIds:n,expandedElements:r,tracks:i,gapHighlight:s}=t;if(!e||!C$e(e,n))return null;const a=r.find(u=>(u.key??u.id)===e);if(!a||a.track===(s==null?void 0:s.track))return null;const o=((c=i.find(([u])=>u===a.track))==null?void 0:c[1])??[],l=b$e(o,t.displayDuration,void 0,dA(o));return l.length>0?{track:a.track,intervals:l,kind:"selected"}:null}function E$e(t){if(t.dragActive)return[];const e=[];t.gapHighlight&&t.gapHighlight.intervals.length>0&&e.push({...t.gapHighlight,kind:"hover"});const n=k$e(t);return n&&e.push(n),e}function T$e(t){const{gapHighlight:e,tracks:n,selectedElementId:r,selectedElementIds:i,expandedElements:s,dragActive:a,displayDuration:o}=t;return x.useMemo(()=>E$e({gapHighlight:e,tracks:n,selectedElementId:r,selectedElementIds:i,expandedElements:s,dragActive:a,displayDuration:o}),[e,n,r,i,s,a,o])}function P$e({active:t,scrollRef:e,contentOrigin:n,pixelsPerSecond:r,onSplitAll:i}){const[s,a]=x.useState(null),o=x.useCallback(u=>{const f=e.current;if(!t||!f)return;const h=f.getBoundingClientRect();a(u.clientX-h.left+f.scrollLeft)},[t,e]),l=x.useCallback(()=>a(null),[]),c=x.useCallback(u=>{const f=e.current;if(!t||!u.shiftKey||u.button!==0||!f)return!1;const h=f.getBoundingClientRect(),m=vE({clientX:u.clientX,rectLeft:h.left,scrollLeft:f.scrollLeft,contentOrigin:n});return i==null||i(Math.max(0,m/r)),!0},[t,n,i,r,e]);return{razorGuideX:s,updateRazorGuide:o,clearRazorGuide:l,splitAllAtPointer:c}}function M$e({x:t}){return p.jsx("div",{className:"absolute top-0 bottom-0 pointer-events-none z-10",style:{left:t,width:1,background:"rgba(239,68,68,0.7)"}})}const N$e=400,D$e=6e4;function eW(t,e){if(t.length===0)return;const n=[...t].sort((i,s)=>i-s),r=Math.min(n.length-1,Math.ceil(n.length*e)-1);return Number(n[Math.max(0,r)].toFixed(2))}function I$e(t,e,n,r){const i=eW(n,.95);if(i===void 0)return null;const s=eW(r,.95);return{total_clip_count:e.totalClipCount,mounted_clip_count:t.querySelectorAll('[data-clip="true"]').length,total_row_count:e.totalRowCount,timeline_dom_node_count:t.querySelectorAll("*").length,viewport_width:t.clientWidth,viewport_height:t.clientHeight,zoom_mode:e.zoomMode,scroll_sample_count:n.length,scroll_frame_latency_p95_ms:i,scroll_frame_latency_max_ms:Number(Math.max(...n).toFixed(2)),...s===void 0?{}:{frame_interval_p95_ms:s}}}function tW(t){t.previousFrameAt=null,t.frameLatencies=[],t.frameIntervals=[]}function _$e(t){const e=x.useRef({frameRequest:0,idleTimer:null,pendingScrollStartedAt:0,previousFrameAt:null,frameLatencies:[],frameIntervals:[],lastEmittedAt:Number.NEGATIVE_INFINITY}),n=r=>{const i=e.current,s=performance.now();i.frameRequest===0&&(i.pendingScrollStartedAt=s,i.frameRequest=requestAnimationFrame(a=>{i.frameRequest=0,i.frameLatencies.push(performance.now()-i.pendingScrollStartedAt),i.previousFrameAt!==null&&i.frameIntervals.push(a-i.previousFrameAt),i.previousFrameAt=a})),i.idleTimer!==null&&clearTimeout(i.idleTimer),i.idleTimer=setTimeout(()=>{if(i.idleTimer=null,i.frameRequest!==0){cancelAnimationFrame(i.frameRequest),i.frameRequest=0,tW(i);return}const a=performance.now();if(a-i.lastEmittedAt>=D$e){const o=I$e(r,t,i.frameLatencies,i.frameIntervals);o&&(YOe(o),i.lastEmittedAt=a)}tW(i)},N$e)};return wr(()=>()=>{const r=e.current;r.frameRequest!==0&&cancelAnimationFrame(r.frameRequest),r.idleTimer!==null&&clearTimeout(r.idleTimer)}),{recordTimelineScroll:n}}function R$e(t){return Array.from(t.values()).some(e=>e.some(bce))}function j$e(t,e){return R$e(t)||e.some(n=>!!n.audioGroup)}function Uhe(t,e){const n=Number.isFinite(t)?t:0;if(e.length===0)return n;const r=Math.max(n,...e.map(i=>i.start+i.duration));return Number.isFinite(r)?r:n}function L$e(t,e){var i;const n=zn(t),r=(i=e==null?void 0:e.groupPreview)==null?void 0:i.find(s=>s.key===n);return r?{...t,...r}:e&&zn(e.element)===n?{...t,start:e.previewStart,duration:e.previewDuration,playbackStart:e.previewPlaybackStart}:t}function F$e(t,e,n,r){const i=x.useMemo(()=>t.find(o=>zn(o)===e)??null,[t,e]),s=x.useRef(i);s.current=i;const a=x.useRef(s.current);x.useEffect(()=>{const o=a.current,l=s.current;a.current=l,o&&!l&&(n(!1),r())})}function $$e(){const[t,e]=x.useState(!1);return wr(()=>{const n=i=>i.key==="Shift"&&e(i.type==="keydown"),r=()=>e(!1);return window.addEventListener("keydown",n),window.addEventListener("keyup",n),window.addEventListener("blur",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",n),window.removeEventListener("blur",r)}}),t}function B$e(t,e,n,r){const i=n==="frame"?Bd:void 0;return{...x.useMemo(()=>w5e(t,e,i,r),[t,i,e,r]),majorTickInterval:_ae(t,e,i)}}const yM=1024*1024,V$e=1440*60*1e3,el=Object.freeze({directScrollSafetyPx:8e6,rowOverscanPerSide:2,timeOverscanViewportRatio:.25,maxMountedRows:64,maxMountedClipRoots:512,maxMountedClipRootsPerRow:128,maxMountedTimelineDescendants:5e3,posterMaxPhysicalWidth:240,posterMaxPhysicalHeight:135,posterDprCap:1.5,richPreviewFrameCount:6,concurrentVideoDecodes:2,concurrentMetadataJobs:4,concurrentCompositionFetches:2,concurrentServerPages:1,thumbnailLoadTimeoutMs:3e4,thumbnailCacheBytes:64*yM,thumbnailCacheEntries:256,thumbnailCacheEntriesPerProject:96,metadataRegistryEntries:512,metadataFailureTtlMs:3e4,waveformCacheBytes:16*yM,waveformCacheEntries:256,compositionDiskCacheBytes:512*yM,compositionDiskCacheMaxAgeMs:14*V$e,interactionP95Ms:50,frameIntervalP95Ms:33.3,constrainedInteractionP95Ms:75,constrainedFrameIntervalP95Ms:75,longTaskLimitMs:50,constrainedLongTaskLimitMs:300,memoryReturnToleranceRatio:.15,posterColdP95Ms:750,posterCachedP95Ms:250,constrainedPosterColdP95Ms:1200,constrainedPosterCachedP95Ms:400,posterCoverageRatio:.9,posterCoverageSettleMs:1500,constrainedPosterCoverageSettleMs:2500,richPreviewP95Ms:750,constrainedRichPreviewP95Ms:1200,supportedFixtureFallbackRatio:.02,scrollSamplesPerRun:21,warmupRuns:3,measuredRuns:5,requiredPassingRuns:4});function H$e(t,e,n,r){if(!(e>0)||!(r>0)||!(t.clientWidth>0))return{start:0,end:0};const i=t.clientWidth*el.timeOverscanViewportRatio,s=t.scrollLeft-n-i,a=t.scrollLeft+t.clientWidth-n+i;return{start:Math.min(r,Math.max(0,s/e)),end:Math.min(r,Math.max(0,a/e))}}function Q$e(t,e,n,r){if(!(e>0)||!(r>0))return{start:0,end:0};const i=Math.max(0,(t.scrollLeft-n)/e),s=Math.min(r,Math.max(i,(t.scrollLeft+t.clientWidth-n)/e));return{start:Math.min(i,r),end:s}}function z$e(t,e,n){const r=t.getRowPositionFromY(n+_a);if(r.row<0||r.row>=t.rowKeys.length)return n;const i=t.rowKeys[r.row];if(i===void 0)return n;const s=e.getRowIndex(i);return s<0?n:Math.max(0,n+e.getRowTop(s)-t.getRowTop(r.row))}function Z$e({tracks:t,viewport:e,pixelsPerSecond:n,contentOrigin:r,duration:i,selectedElementId:s,draggedElementId:a,resizingElementIds:o,focusedElementId:l,focusedEaseElementId:c,clipContextMenuElementId:u,keyframeContextMenuElementId:f}){const h=x.useMemo(()=>V3e(t),[t]),m=x.useMemo(()=>H$e(e,n,r,i),[r,i,n,e]),y=x.useMemo(()=>Q$e(e,n,r,i),[r,i,n,e]),d=x.useMemo(()=>new Set([s,a,...o??[],l,c,u,f].filter(v=>v!==void 0)),[u,a,c,l,f,o,s]);return{clipIndex:h,renderTimeRange:m,visibleTimeRange:y,pinnedClipIdentities:d}}function G$e(){var e;const t=(e=qFe())==null?void 0:e.setRefreshKey;return x.useCallback(()=>t==null?void 0:t(n=>n+1),[t])}const JO=12;function nW(t,e,n,r,i){const s=t+n+JO,a=t+e-JO,o=a-s;return o<=0||r>=s&&i<=a?null:i-r>o||r<s?Math.max(0,r-n-JO):Math.max(0,i-e+JO)}function U$e(t){return{left:t.allowHorizontal?nW(t.scrollLeft,t.viewportWidth,t.stickyLeft,t.clipLeft,t.clipRight):null,top:nW(t.scrollTop,t.viewportHeight,t.stickyTop,t.clipTop,t.clipBottom)}}function rW(t,e,n){return t!==null&&t.projectId===e&&t.sessionEpoch===n}function X$e(t,e){const n=t.querySelector(`[data-timeline-focus-id=${CSS.escape(e)}]`);return n?n.ownerDocument.activeElement===n?!0:(n.setAttribute("data-reveal-highlight","true"),n.focus({preventScroll:!0}),n.ownerDocument.activeElement!==n?(n.removeAttribute("data-reveal-highlight"),!1):(n.addEventListener("blur",()=>n.removeAttribute("data-reveal-highlight"),{once:!0}),!0)):!1}function W$e(t,e,n,r,i,s,a){const o=r.getRowIndex(e.row.physicalTrackKey);if(o<0)return!1;const l=e.target.kind==="row"?e.row.elementId:e.target.elementId,c=l?n.find(d=>(d.key??d.id)===l):void 0,u=e.target.kind==="row"?null:e.target.time,f=c&&e.target.kind==="clip"?c.start:u,h=c&&e.target.kind==="clip"?c.start+c.duration:u,m=r.getRowTop(o),y=U$e({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,viewportWidth:t.clientWidth,viewportHeight:t.clientHeight,clipLeft:s+(f??0)*i,clipRight:s+(h??0)*i,clipTop:m+fa,clipBottom:m+r.getRowHeight(o)-fa,stickyLeft:s,stickyTop:_a,allowHorizontal:a&&f!==null});return y.left!==null&&(t.scrollLeft=y.left),y.top!==null&&(t.scrollTop=y.top),y.left!==null||y.top!==null}function q$e({scrollRef:t,logicalRows:e,elements:n,rowGeometry:r,pixelsPerSecond:i,contentOrigin:s,allowHorizontal:a,viewportVersion:o,projectId:l,sessionEpoch:c,syncScrollViewport:u}){const f=fe(b=>b.timelineFocus),h=x.useRef(e),m=x.useRef(null),y=x.useRef(null),d=x.useMemo(()=>{var b;if(rW(f,l,c)){((b=m.current)==null?void 0:b.nonce)!==f.nonce&&(m.current={nonce:f.nonce,id:f.id});const w=m.current.id;let O=Cl(e,w);if(!O){const k=JLe(h.current,e,w);k&&(m.current={nonce:f.nonce,id:k.id},O=Cl(e,k.id))}return O?{target:O.target,row:O.row}:null}return m.current=null,null},[e,l,f,c]);x.useLayoutEffect(()=>{h.current=e},[e]),x.useEffect(()=>{var w;if(!rW(f,l,c))return;if(!d){fe.getState().clearTimelineFocus(f.nonce);return}if(d.target.id!==f.id){fe.getState().requestTimelineFocus(d.target.id);return}if(((w=y.current)==null?void 0:w.nonce)===f.nonce&&y.current.id===d.target.id)return;const b=t.current;b&&(W$e(b,d,n,r,i,s,a)&&u(b),X$e(b,d.target.id)&&(y.current={nonce:f.nonce,id:d.target.id}))},[a,s,n,i,l,f,d,r,t,c,u,o]);const v=d?d.target.kind==="row"?d.row.elementId??void 0:d.target.elementId:void 0;return{focusedTargetId:(d==null?void 0:d.target.id)??null,focusedRowKey:d==null?void 0:d.row.physicalTrackKey,pinnedElementId:v}}function Y$e({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}){return x.useMemo(()=>qLe({tracks:t,displayTrackOrder:e,laneCounts:n,selectedElementId:r,selectedElementIds:i,expandedClipIds:s,collapsedGroupIds:a,expandedLaneOwnerIds:o,groups:l,trackGroupOf:c,gsapAnimations:u}),[e,s,a,o,l,c,u,n,r,i,t])}function iW(t,e){if(!e)return null;const n=p0(t).byKey.get(e);return n?{elementId:e,rowKey:n.track}:null}function K$e(t,e,n){const r=new Array(t);return new Proxy(r,{get(i,s,a){if(typeof s=="string"){const o=s.charCodeAt(0);if(o>=48&&o<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<t){let c=i[l];if(!c){const u=e[l*2];c=i[l]={index:l,key:n(l),start:u,size:e[l*2+1],end:u+e[l*2+1],lane:0}}return c}}if(s==="length")return t}return Reflect.get(i,s,a)}})}function Zm(t,e,n){let r=n.initialDeps??[],i,s=!0;function a(){const o=t();return(o.length!==r.length||o.some((c,u)=>r[u]!==c))&&(r=o,i=e(...o),n!=null&&n.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1),i}return a.updateDeps=o=>{r=o},a}function sW(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const J$e=(t,e)=>Math.abs(t-e)<1.01,eBe=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}};let Kx;const xM=()=>{if(Kx!==void 0)return Kx;if(typeof navigator>"u")return Kx=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Kx=!0;const t=navigator.maxTouchPoints;return Kx=navigator.platform==="MacIntel"&&t!==void 0&&t>0},aW=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},tBe=t=>t,Xhe=t=>{const e=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,i=new Array(r);for(let s=0;s<r;s++)i[s]=e+s;return i},nBe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(i(aW(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(aW(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},lC={passive:!0},rBe=typeof window>"u"?!0:"onscrollend"in window,iBe=(t,e,n)=>{const r=t.scrollElement;if(!r)return;const i=t.targetWindow;if(!i)return;const s=t.options.useScrollendEvent&&rBe;let a=0;const o=s?null:eBe(i,()=>e(a,!1),t.options.isScrollingResetDelay),l=f=>()=>{a=n(r),o==null||o(),e(a,f)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,lC),s&&r.addEventListener("scrollend",u,lC),()=>{r.removeEventListener("scroll",c),s&&r.removeEventListener("scrollend",u)}},sBe=(t,e)=>iBe(t,e,n=>{const{horizontal:r,isRtl:i}=t.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),aBe=(t,e,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(t),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const r=n.indexFromElement(t),i=n.options.getItemKey(r),s=n.itemSizeCache.get(i);if(s!==void 0)return s}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},oBe=(t,{adjustments:e=0,behavior:n},r)=>{var i,s;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:t+e,behavior:n})},lBe=oBe;class cBe{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{const o=s.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[c,u]of this.elementsCache)if(u===o){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tBe,rangeExtractor:Xhe,onChange:()=>{},measureElement:aBe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in n){const m=n[h];m!==void 0&&(s[h]=m)}const a=this.options;let o=null,l=null,c=!1;if(a!==void 0&&a.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const h=a.count,m=s.count,y=this.getMeasurements(),d=h>0?((r=y[0])==null?void 0:r.key)??a.getItemKey(0):null,v=h>0?((i=y[h-1])==null?void 0:i.key)??a.getItemKey(h-1):null;if(m!==h||h>0&&m>0&&(s.getItemKey(0)!==d||s.getItemKey(m-1)!==v)){c=!0;const O=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??y[0]:null;O&&(o=[O.key,this.getScrollOffset()-O.start]);const k=s.followOnAppend===!0?"auto":s.followOnAppend||null;k&&m>h&&this.isAtEnd(a.scrollEndThreshold)&&(h===0||s.getItemKey(m-1)!==v)&&(l=k)}}this.options=s,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,f=0;if(o&&this.scrollOffset!==null){const[h,m]=o,y=this.getMeasurements(),{count:d,getItemKey:v}=this.options;let b=0;for(;b<d&&v(b)!==h;)b++;if(b<d){const w=y[b];if(w){const O=w.start+m;O!==this.scrollOffset&&(f=O-this.scrollOffset,this.scrollOffset=O,u=!0)}}}(u||l)&&(this.pendingScrollAnchor=[u?o[0]:null,u?o[1]:0,l,f])},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Zm(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{if(a&&this._intendedScrollOffset===null&&s===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(s-this._intendedScrollOffset)<1.5&&(s=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===s?this.scrollDirection:o<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const s=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!xM()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};s.addEventListener("touchstart",a,lC),s.addEventListener("touchend",o,lC),this.unsubs.push(()=>{s.removeEventListener("touchstart",a),s.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[s,a,o,l]=i;s!==null&&!o&&(xM()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Zm(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,i,s,a,o,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c}),{key:!1}),this.getMeasurements=Zm(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c},u)=>{const f=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const b of this.laneAssignments.keys())b>=n&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),o===1){const b=n*2;let w=this._flatMeasurements;if(!w||w.length<b){const E=new Float64Array(b);w&&h>0&&E.set(w.subarray(0,h*2)),w=E,this._flatMeasurements=w}let O;if(h===0)O=r+i;else{const E=h-1;O=w[E*2]+w[E*2+1]+c}for(let E=h;E<n;E++){const M=s(E),N=f.get(M),I=typeof N=="number"?N:this.options.estimateSize(E);w[E*2]=O,w[E*2+1]=I,O+=I+c}const k=K$e(n,w,s);return this.measurementsCache=k,k}const m=this.measurementsCache.slice(0,h),y=new Array(o).fill(void 0),d=new Float64Array(o);let v=0;for(let b=0;b<h;b++){const w=m[b];w&&(y[w.lane]===void 0&&v++,y[w.lane]=b,d[w.lane]=w.end)}for(let b=h;b<n;b++){const w=s(b),O=this.laneAssignments.get(b);let k,E;const M=l==="estimate"||f.has(w);if(O!==void 0&&this.options.lanes>1){k=O;const j=y[k],L=j!==void 0?m[j]:void 0;E=L?L.end+c:r+i}else if(v===o){let j=0,L=d[0],B=y[0];for(let $=1;$<o;$++){const Q=d[$];(Q<L||Q===L&&y[$]<B)&&(j=$,L=Q,B=y[$])}k=j,E=L+c,M&&this.laneAssignments.set(b,k)}else k=b%this.options.lanes,E=r+i,M&&this.laneAssignments.set(b,k);const N=f.get(w),I=typeof N=="number"?N:this.options.estimateSize(b),_=E+I;m[b]={index:b,start:E,size:I,end:_,key:w,lane:k},y[k]===void 0&&v++,y[k]=b,d[k]=_}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Zm(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>n.length===0||r===0?(this.range=null,null):(this.range=fBe(n,r,i,s,s===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Zm(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-s),o=Math.min(this.options.count-1,i+s);return n>=a&&n<=o}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),s=this.elementsCache.get(i);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,s;if(n<0||n>=this.options.count)return;let a,o,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),o=c[n*2],a=c[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,o=h.start,a=h.size}const u=this.itemSizeCache.get(l)??a,f=r-u;if(f!==0){const h=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=h?this.getTotalSize():0,y=((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:o,size:a,end:o+a,lane:0},f,this):o<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(l)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,h?this.applyScrollAdjustment(this.getTotalSize()-m):y&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=Zm(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,s=this.options.lanes===1&&i!=null,a=Whe(0,r.length-1,s?o=>i[o*2]:o=>sW(r[o]).start,n);return sW(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(a.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const s=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s,l=this.now();this.scrollState={index:n,align:o,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const s=r.length-1,a=this._flatMeasurements;a!=null?i=a[s*2]+a[s*2+1]:i=((n=r[s])==null?void 0:n.end)??0}else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(o=>o===null);){const o=r[a];s[o.lane]===null&&(s[o.lane]=o.end),a--}i=Math.max(...s.filter(o=>o!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(xM()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,s=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&J$e(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=i,c||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Whe=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,s=n(i);if(s<r)t=i+1;else if(s>r)e=i-1;else return i}return t>0?t-1:0};function uBe(t,e,n){let r=0;for(;r<=e;){const i=(r+e)/2|0,s=t[i*2];if(s<n)r=i+1;else if(s>n)e=i-1;else return i}return r>0?r-1:0}function fBe(t,e,n,r,i){const s=t.length-1;if(t.length<=r)return{startIndex:0,endIndex:s};if(r===1&&i!==null){const c=uBe(i,s,n);let u=c;const f=n+e;for(;u<s&&i[u*2]+i[u*2+1]<f;)u++;return{startIndex:c,endIndex:u}}let o=Whe(0,s,c=>t[c].start,n),l=o;if(r===1)for(;l<s&&t[l].end<n+e;)l++;else if(r>1){const c=Array(r).fill(0);for(;l<s&&c.some(f=>f<n+e);){const f=t[l];c[f.lane]=f.end,l++}const u=Array(r).fill(n+e);for(;o>=0&&u.some(f=>f>=n);){const f=t[o];u[f.lane]=f.start,o--}o=Math.max(0,o-o%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const bM=typeof document<"u"?x.useLayoutEffect:x.useEffect;function hBe({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...r}){const i=x.useReducer(c=>c+1,0)[1],s=x.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=e,s.current.mode=n;const a=c=>{const u=s.current;if(!u.enabled||!u.container)return;const f=c.getTotalSize();if(f!==u.lastSize){u.lastSize=f;const b=c.options.horizontal?"width":"height";u.container.style[b]=`${f}px`}const h=!!c.options.horizontal,m=u.mode==="transform",y=h?"left":"top",d=c.options.scrollMargin,v=c.getVirtualItems();for(const b of v){const w=b.start-d,O=c.elementsCache.get(b.key);O&&u.lastPositions.get(O)!==w&&(u.lastPositions.set(O,w),m?O.style.transform=h?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:O.style[y]=`${w}px`)}},o={...r,onChange:(c,u)=>{var f;const h=s.current;let m=!0;if(h.enabled){a(c);const y=c.range,d=h.prevRange;m=!d||d.isScrolling!==c.isScrolling||d.startIndex!==(y==null?void 0:y.startIndex)||d.endIndex!==(y==null?void 0:y.endIndex),m&&(h.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:c.isScrolling}:null)}m&&(t&&u?Fl.flushSync(i):i()),(f=r.onChange)==null||f.call(r,c,u)}},[l]=x.useState(()=>{const c=new cBe(o);return Object.assign(c,{containerRef:u=>{const f=s.current;if(f.container=u,f.lastSize=null,u&&f.enabled){const h=c.getTotalSize();f.lastSize=h;const m=c.options.horizontal?"width":"height";u.style[m]=`${h}px`}}})});return l.setOptions(o),bM(()=>l._didMount(),[]),bM(()=>l._willUpdate()),bM(()=>{a(l)}),l}function dBe(t){return hBe({observeElementRect:nBe,observeElementOffset:sBe,scrollToFn:lBe,...t})}function pBe(t,e){const n=new Set(Xhe(t));for(const r of e)r>=0&&r<t.count&&n.add(r);return[...n].sort((r,i)=>r-i)}function mBe(t,e){const n=Math.min(t,el.rowOverscanPerSide*2+1),r=new Set(Array.from({length:n},(i,s)=>s));for(const i of e)i>=0&&i<t&&r.add(i);return[...r].sort((i,s)=>i-s)}function gBe({enabled:t,scrollRef:e,viewport:n,rowGeometry:r,sessionEpoch:i,pinnedRowKeys:s,focusedRowKey:a}){const o=n.clientWidth>0&&n.clientHeight>0,l=x.useMemo(()=>[...new Set([...s,...a===void 0?[]:[a]].map(b=>r.getRowIndex(b)))],[a,s,r]),c=x.useCallback(b=>r.getRowHeight(b),[r]),u=x.useCallback(b=>r.rowKeys[b]??b,[r]),f=x.useCallback(b=>pBe(b,l),[l]),h=x.useCallback(()=>n.scrollTop,[n.scrollTop]),m=dBe({enabled:o,useFlushSync:!1,count:r.rowKeys.length,getScrollElement:()=>e.current,estimateSize:c,getItemKey:u,overscan:el.rowOverscanPerSide,rangeExtractor:f,scrollMargin:_a+e0,initialRect:{width:n.clientWidth,height:n.clientHeight},initialOffset:h});x.useEffect(()=>{var b;o&&(m.measure(),(b=e.current)==null||b.dispatchEvent(new Event("scroll")))},[t,e,i,o,m]);const y=a===void 0?-1:r.getRowIndex(a),d=y<0?0:r.getRowHeight(y);x.useEffect(()=>{o&&y>=0&&m.resizeItem(y,d)},[t,d,y,i,o,m]);const v=x.useMemo(()=>null,[t,r]);return v||(o?m.getVirtualItems().map(({index:b})=>({index:b,rowKey:r.rowKeys[b]??b})):mBe(r.rowKeys.length,l).map(b=>({index:b,rowKey:r.rowKeys[b]??b})))}function oW(t){var r;if(!(t instanceof Element))return;const e=(r=t.closest("[data-timeline-row-key]"))==null?void 0:r.dataset.timelineRowKey;if(e===void 0)return;const n=Number(e);return Number.isFinite(n)?n:void 0}function yBe({scrollRef:t,viewport:e,rowGeometry:n,sessionEpoch:r,elements:i,selectedElementId:s,focusedRowKey:a,draggedRowKey:o,resizingElementIds:l,clipContextMenuRowKey:c,keyframeContextMenuRowKey:u,lastScrollLeftRef:f,syncScrollViewport:h}){const m=p$e,[y,d]=x.useState(),v=x.useCallback(I=>{d(oW(I.target))},[]),b=x.useCallback(I=>{d(oW(I.relatedTarget))},[]),w=x.useMemo(()=>iW(i,s),[i,s]),O=x.useMemo(()=>(l==null?void 0:l.map(I=>{var _;return(_=iW(i,I))==null?void 0:_.rowKey}).filter(I=>I!==void 0))??[],[i,l]),k=x.useMemo(()=>[o,...O,w==null?void 0:w.rowKey,a,c,u].filter(I=>I!==void 0),[c,o,a,u,O,w]),E=gBe({enabled:m,scrollRef:t,viewport:e,rowGeometry:n,sessionEpoch:r,pinnedRowKeys:k,focusedRowKey:y??a}),M=x.useRef(n),N=x.useRef(r);return x.useLayoutEffect(()=>{const I=t.current,_=M.current;if(N.current!==r)N.current=r,f.current=0,I&&(I.scrollLeft=0,I.scrollTop=0,h(I));else if(I&&_!==n){const j=z$e(_,n,I.scrollTop);j!==I.scrollTop&&(I.scrollTop=j,h(I))}M.current=n},[f,n,t,r,h]),{enabled:m,virtualRows:E,timelineFocusProps:{onFocus:v,onBlur:b}}}function xBe(t){const e=fe(l=>l.expandedClipIds),n=fe(l=>l.collapsedGroupIds),r=fe(l=>l.expandedLaneOwnerIds),i=fe(l=>l.timelineProjectId),s=Y$e({tracks:t.tracks,displayTrackOrder:t.layout.displayTrackOrder,laneCounts:t.laneCounts,selectedElementId:t.selectedElementId,selectedElementIds:t.selectedElementIds,expandedClipIds:e,collapsedGroupIds:n,expandedLaneOwnerIds:r,groups:t.groups,trackGroupOf:t.trackGroupOf,gsapAnimations:t.gsapAnimations}),a=q$e({scrollRef:t.scrollRef,logicalRows:s,elements:t.elements,rowGeometry:t.layout.rowGeometry,pixelsPerSecond:t.pixelsPerSecond,contentOrigin:t.contentOrigin,allowHorizontal:t.allowHorizontal,viewportVersion:t.viewport,projectId:i,sessionEpoch:t.sessionEpoch,syncScrollViewport:t.syncScrollViewport}),o=yBe({scrollRef:t.scrollRef,viewport:t.viewport,rowGeometry:t.layout.rowGeometry,sessionEpoch:t.sessionEpoch,elements:t.elements,selectedElementId:t.selectedElementId,focusedRowKey:a.focusedRowKey,draggedRowKey:t.draggedRowKey,resizingElementIds:t.resizingElementIds,clipContextMenuRowKey:t.clipContextMenuRowKey,keyframeContextMenuRowKey:t.keyframeContextMenuRowKey,lastScrollLeftRef:t.lastScrollLeftRef,syncScrollViewport:t.syncScrollViewport});return{logicalRows:s,...a,rowVirtualizationActive:o.enabled,virtualRows:o.virtualRows,timelineFocusProps:o.timelineFocusProps}}const bBe=x.memo(function({onSeek:e,onDrillDown:n,renderClipContent:r,renderClipOverlay:i,onFileDrop:s,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l,onDeleteElement:c,onMoveElement:u,onMoveElements:f,onResizeElement:h,onResizeElements:m,onBlockedEditAttempt:y,onSplitElement:d,onSelectElement:v,theme:b,sessionEpoch:w=0}={}){var lt;const{onMoveElement:O,onMoveElements:k,onResizeElement:E,onResizeElements:M,onBlockedEditAttempt:N,onSplitElement:I,onRazorSplitAll:_,onDeleteKeyframe:j,onDeleteAllKeyframes:L,onMoveKeyframeToPlayhead:B,onMoveKeyframe:$}=x$e({onMoveElement:u,onMoveElements:f,onResizeElement:h,onResizeElements:m,onBlockedEditAttempt:y,onSplitElement:d}),Q=x.useMemo(()=>({...Cj,...b}),[b]),Y=G$e();Ake();const W=fe(kt=>kt.elements),J=rS(),ne=vke(),le=fe(kt=>kt.duration),ie=fe(kt=>kt.timeDisplayMode),q=fe(kt=>kt.timelineReady),F=fe(kt=>kt.selectedElementId),U=fe(kt=>kt.selectedElementIds),Z=fe(kt=>kt.focusedEaseSegment),K=fe(kt=>kt.gsapAnimations),ee=x.useMemo(()=>j$e(K,J),[K,J]),re=ee?Lo+G2:G2+a3e,z=ee?G2:0,H=fe(kt=>kt.setSelectedElementId),se=fe(kt=>kt.currentTime),{zoomMode:ue,manualZoomPercent:be,setZoomMode:me,setManualZoomPercent:pe}=Tae(),ge=x.useRef(null),Pe=x.useRef(null),ve=x.useRef(null),xe=fe(kt=>kt.activeTool),[we,Ce]=x.useState(null),Me=x.useRef(!1),Ve=$$e(),[tt,Ze]=x.useState(!1),[qe,pt]=x.useState(null),[it,vt]=x.useState(null),Ot=x.useCallback(kt=>{Pe.current=kt},[]),Kt=x.useRef(0),qt=x.useMemo(()=>Uhe(le,W),[le,W]),fn=fe(kt=>kt.keyframeCache);d$e(K);const{tracks:Jt,trackStyles:Je,trackOrder:St,trackOrderRef:At,laneCounts:Ke,rowGeometry:Be,rowGeometryRef:We,groups:Ye,trackGroupOf:Zt}=P7e(J,K,F,U),Te=x.useRef(J);Te.current=J;const De=x.useRef(100),ze=x.useRef(qt);ze.current=qt;const st=x.useRef(100),{pinZoomBeforeEdit:Gt,setRangeSelectionRef:ln,pinnedOnMoveElement:Yt,pinnedOnMoveElements:Mn,pinnedOnResizeElement:Pr,pinnedOnResizeElements:mt,pinnedOnFileDrop:vn,pinnedOnAssetDrop:mn,pinnedOnBlockDrop:En,pinnedOnCompositionDrop:jn}=WFe({ppsRef:De,fitPpsRef:st,onMoveElement:O,onMoveElements:k,onResizeElement:E,onResizeElements:M,onFileDrop:s,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l}),{readClipZIndex:et,applyStackingPatches:qn,zSyncEnabled:Mt}=u$e({expandedElementsRef:Te}),{gapMenuModel:hn,gapHighlight:Ht,setHoveredGapAction:dn,openGapMenu:er,dismissGapMenu:In,closeTrackGap:yr,closeAllTrackGaps:tr}=O$e({tracks:Jt,expandedElementsRef:Te,trackOrderRef:At,onMoveElement:Yt,onMoveElements:Mn}),{draggedClip:gt,setDraggedClip:nr,resizingClip:On,setResizingClip:_n,blockedClipRef:xt,suppressClickRef:Ut}=FFe({scrollRef:ve,ppsRef:De,durationRef:ze,trackOrderRef:At,rowGeometryRef:We,onMoveElement:Yt,onMoveElements:Mn,onResizeElement:Pr,onResizeElements:mt,onBlockedEditAttempt:N,setShowPopover:Ze,setRangeSelectionRef:ln,readZIndex:Mt?et:void 0,onStackingPatches:Mt?qn:void 0,refreshAfterLaneMove:Y,sessionEpoch:w}),Ct=y5e({scrollRef:ve,ppsRef:De,durationRef:ze,trackOrderRef:At,rowGeometryRef:We,contentOrigin:re,onFileDrop:vn,onAssetDrop:mn,onBlockDrop:En,onCompositionDrop:jn,sessionEpoch:w}),ur=D7e(gt,St,Be),Dt=((lt=On==null?void 0:On.groupPreview)==null?void 0:lt.map(kt=>kt.key))??(On?[zn(On.element)]:void 0),{recordTimelineScroll:wt}=_$e({totalClipCount:J.length,totalRowCount:ur.displayTrackOrder.length,zoomMode:ue}),{viewport:gn,showShortcutHint:Lt,setScrollRef:rn,syncScrollViewport:fs}=y$e(ve,[q,J.length,ur.totalH]),{pps:Ln,fitPps:ni,displayContentWidth:cn,displayDuration:Cn,zoomModeRef:rr,manualZoomPercentRef:Ti}=f$e({viewportWidth:gn.clientWidth,effectiveDuration:qt,zoomMode:ue,manualZoomPercent:be,ppsRef:De,fitPpsRef:st,draggedClip:gt,resizingClip:On,expandedElements:J,isDragging:Me,scrollRef:ve,lastScrollLeftRef:Kt,contentOrigin:re}),Kr=xBe({scrollRef:ve,tracks:Jt,layout:ur,laneCounts:Ke,selectedElementId:F,selectedElementIds:U,groups:Ye,trackGroupOf:Zt,gsapAnimations:K,elements:J,pixelsPerSecond:Ln,contentOrigin:re,allowHorizontal:ue==="manual",viewport:gn,sessionEpoch:w,draggedRowKey:gt!=null&>.started?gt.previewTrack:void 0,resizingElementIds:Dt,clipContextMenuRowKey:it==null?void 0:it.element.track,keyframeContextMenuRowKey:qe==null?void 0:qe.element.track,lastScrollLeftRef:Kt,syncScrollViewport:fs}),Bi=fe(kt=>kt.selectedKeyframes),hs=fe(kt=>kt.toggleSelectedKeyframe),{onClickKeyframe:Mr,onSelectSegment:Ha,onShiftClickKeyframe:xi,onContextMenuKeyframe:Sa}=BTe({expandedElements:J,keyframeCache:fn,onSelectElement:v,onSeek:e,setSelectedElementId:H,setKfContextMenu:pt,toggleSelectedKeyframe:hs}),{clipIndex:ft,renderTimeRange:Ae,visibleTimeRange:_e,pinnedClipIdentities:ot}=Z$e({tracks:Jt,viewport:gn,pixelsPerSecond:Ln,contentOrigin:re,duration:Cn,selectedElementId:F??void 0,draggedElementId:gt?zn(gt.element):void 0,resizingElementIds:Dt,focusedElementId:Kr.pinnedElementId,focusedEaseElementId:Z==null?void 0:Z.elementId,clipContextMenuElementId:it?zn(it.element):void 0,keyframeContextMenuElementId:qe?zn(qe.element):void 0});VLe({scrollRef:ve,currentTime:se,clipStateVersion:Ae,elementStateVersion:J});const bt=T$e({gapHighlight:Ht,tracks:Jt,selectedElementId:F,selectedElementIds:U,expandedElements:J,dragActive:(gt==null?void 0:gt.started)===!0||On!=null,displayDuration:Cn}),{seekFromX:en,autoScrollDuringDrag:Tn,dragScrollRaf:$r}=r5e({playheadRef:ge,scrollRef:ve,ppsRef:De,durationRef:ze,isDragging:Me,currentTime:se,zoomMode:ue,zoomModeRef:rr,manualZoomPercentRef:Ti,fitPps:ni,fitPpsRef:st,effectiveDuration:qt,pps:Ln,timelineReady:q,elementsLength:J.length,setZoomMode:me,setManualZoomPercent:pe,onSeek:e,contentOrigin:re}),{razorGuideX:or,updateRazorGuide:bi,clearRazorGuide:ds,splitAllAtPointer:Ul}=P$e({active:xe==="razor",scrollRef:ve,contentOrigin:re,pixelsPerSecond:Ln,onSplitAll:_}),{rangeSelection:Br,setRangeSelection:vs,shiftClickClipRef:Lc,marqueeRect:Iu,isScrubbing:wa,handlePointerDown:Oa,handlePointerMove:Fc,handlePointerUp:_u,handlePointerCancel:Xl}=n5e({scrollRef:ve,ppsRef:De,effectiveDuration:qt,pps:Ln,onSeek:e,seekFromX:en,autoScrollDuringDrag:Tn,dragScrollRaf:$r,isDragging:Me,setShowPopover:Ze,elementsRef:Te,clipIndex:ft,rowGeometryRef:We,onSelectElement:v,contentOrigin:re,sessionEpoch:w});ln.current=vs,F$e(J,F,Ze,()=>vs(null));const{major:Wl,minor:_s,majorTickInterval:Ru}=B$e(Cn,Ln,ie,Kr.rowVirtualizationActive?Ae:void 0),Vr=x.useCallback(kt=>L$e(kt,On),[On]);return!q||J.length===0?p.jsx(x5e,{isDragOver:Ct.isDragOver,onFileDrop:!!s,onDragOver:Ct.handleAssetDragOver,onDragLeave:Ct.handleAssetDragLeave,onDrop:Ct.handleAssetDrop}):p.jsxs("div",{ref:Ot,"aria-label":"Timeline","data-timeline-element-count":J.length,className:`relative border-t select-none h-full overflow-hidden ${Ct.isDragOver?"ring-1 ring-inset ring-studio-accent/60":""} ${xe==="razor"||Ve?"cursor-crosshair":"cursor-default"}`,onMouseMove:bi,onMouseLeave:ds,style:{touchAction:"pan-x pan-y",background:Q.shellBackground,borderColor:Q.shellBorder},children:[p.jsxs("div",{ref:rn,"data-timeline-scroll-viewport":!0,"data-timeline-auto-scroll-left-inset":ee?Lo:0,tabIndex:-1,className:`${ue==="fit"?"overflow-x-hidden":"overflow-x-auto"} overflow-y-auto h-full outline-none`,onScroll:kt=>{Kt.current=kt.currentTarget.scrollLeft,wt(kt.currentTarget),fs(kt.currentTarget,!0)},...Kr.timelineFocusProps,onDragOver:Ct.handleAssetDragOver,onDragLeave:Ct.handleAssetDragLeave,onDrop:Ct.handleAssetDrop,onPointerDown:kt=>{kt.target instanceof Element&&kt.target.closest("button, input, select, a")||Ul(kt)||Oa(kt)},onPointerMove:Fc,onPointerUp:_u,onPointerCancel:Xl,onLostPointerCapture:Xl,children:[p.jsx(vFe,{major:Wl,minor:_s,pps:Ln,contentOrigin:re,contentGutter:z,trackContentWidth:cn,totalH:ur.totalH,effectiveDuration:qt,majorTickInterval:Ru,rangeSelection:Br,marqueeRect:Iu,laneGapStrips:bt,theme:Q,displayTrackOrder:ur.displayTrackOrder,rowHeights:ur.displayRowHeights,rowGeometry:ur.rowGeometry,virtualRows:Kr.virtualRows,logicalRows:Kr.logicalRows,focusedTargetId:Kr.focusedTargetId,rowsVirtualized:Kr.rowVirtualizationActive,clipIndex:ft,renderTimeRange:Ae,visibleTimeRange:_e,pinnedClipIdentities:ot,trackOrder:St,tracks:Jt,trackStyles:Je,groups:Ye,laneCounts:Ke,selectedElementId:F,selectedElementIds:U,hoveredClip:we,draggedClip:gt,resizingClip:On,isScrubbing:wa,blockedClipRef:xt,suppressClickRef:Ut,scrollRef:ve,renderClipContent:Kr.rowVirtualizationActive&&gn.isScrolling?void 0:r,renderClipOverlay:i,playheadRef:ge,onDrillDown:n,onSelectElement:v,setHoveredClip:Ce,setShowPopover:Ze,setRangeSelection:vs,setResizingClip:_n,setDraggedClip:nr,setSelectedElementId:H,shiftClickClipRef:Lc,getPreviewElement:Vr,getTrackStyle:Ofe,keyframeCache:fn,gsapAnimations:K,selectedKeyframes:Bi,currentTime:se,onSeek:e,beatAnalysis:ne,onSelectSegment:Ha,onClickKeyframe:Mr,onShiftClickKeyframe:xi,onMoveKeyframe:$,onContextMenuKeyframe:Sa,onContextMenuClip:(kt,vi)=>{kt.preventDefault(),H(vi.key??vi.id),v==null||v(vi),In(),vt({x:kt.clientX,y:kt.clientY,element:vi,sessionEpoch:fe.getState().timelineSessionEpoch})},onContextMenuLane:(kt,vi,fh)=>{gt!=null&>.started||On||(vt(null),er({x:kt.clientX,y:kt.clientY,track:vi,time:fh}))}}),xe==="razor"&&or!==null&&p.jsx(M$e,{x:or})]}),p.jsx(XFe,{elements:J,elementsRef:Te,theme:Q,showShortcutHint:Lt,showPopover:tt,rangeSelection:Br,setShowPopover:Ze,setRangeSelection:vs,kfContextMenu:qe,setKfContextMenu:pt,onDeleteKeyframe:j,onDeleteAllKeyframes:L,onMoveKeyframeToPlayhead:B,clipContextMenu:it,setClipContextMenu:vt,currentTime:se,onSplitElement:I,pinZoomBeforeEdit:Gt,onDeleteElement:c,gapContextMenu:hn,onDismissGapContextMenu:In,onCloseTrackGap:yr,onCloseAllTrackGaps:tr,onHoverGapAction:dn})]})}),vBe={overscan:0,visible:1,interaction:2},lW=Object.freeze({status:"idle"});function ABe(t){return t==="video"?"video":t==="composition"?"composition":"general"}function SBe(t){return t instanceof Error?t:new Error(String(t))}function OS(t){return Object.entries(t).filter(e=>e[1]!==void 0).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`).join("&")}function __(t){return OS({project:t.projectId,session:t.sessionEpoch,request:t.key,kind:t.kind,rich:t.rich?1:0})}class wBe{constructor(e=el,n=Date.now){Et(this,"entries",new Map);Et(this,"budgets");Et(this,"nextLeaseId",1);Et(this,"nextSequence",1);Et(this,"scrolling",!1);Et(this,"cacheBytes",0);Et(this,"waveformCacheBytes",0);Et(this,"activeByBucket",{video:0,composition:0,general:0});Et(this,"activeByKind",{video:0,image:0,composition:0,waveform:0});Et(this,"now");this.budgets=e,this.now=n}acquire(e,n){const r=__(e);let i=this.entries.get(r);(i==null?void 0:i.state)==="error"&&i.failedAt!==void 0&&this.now()-i.failedAt>=this.budgets.metadataFailureTtlMs&&(this.deleteEntry(r,i),i=this.entries.get(r)),i||(i={request:e,scopedKey:r,state:"queued",leases:new Map,listeners:new Map,controller:null,weight:0,disposed:!1,cached:!1,lastAccess:this.nextSequence++,snapshot:Object.freeze({status:"queued"})},this.entries.set(r,i));const s=this.nextLeaseId++;i.leases.set(s,e.priority),i.listeners.set(s,n),i.lastAccess=this.nextSequence++,this.pump();let a=!1;return{updatePriority:o=>{const l=this.entries.get(r);!l||!l.leases.has(s)||(l.leases.set(s,o),l.lastAccess=this.nextSequence++,this.pump())},release:()=>{var l;if(a)return;a=!0;const o=this.entries.get(r);o&&(o.leases.delete(s),o.listeners.delete(s),o.leases.size===0&&(o.state==="queued"?this.deleteEntry(r,o):o.state==="loading"?((l=o.controller)==null||l.abort(),this.deleteEntry(r,o)):o.state==="ready"&&!o.cached&&this.deleteEntry(r,o)),this.evict())}}}getSnapshot(e){const n=this.entries.get(__(e));return n?n.snapshot:lW}setScrolling(e){this.scrolling!==e&&(this.scrolling=e,e||this.pump())}invalidateProject(e){var n;for(const[r,i]of this.entries)i.request.projectId===e&&(i.leases.size>0||((n=i.controller)==null||n.abort(),this.deleteEntry(r,i)))}getDiagnostics(){let e=0,n=0,r=0,i=0,s=0;for(const a of this.entries.values())a.state==="queued"&&e++,a.state==="loading"&&n++,a.cached&&(a.request.kind==="waveform"?s++:i++),r+=a.leases.size;return{queued:e,active:n,leases:r,cacheEntries:i,cacheBytes:this.cacheBytes,waveformCacheEntries:s,waveformCacheBytes:this.waveformCacheBytes,activeByKind:{...this.activeByKind}}}pump(){const e=Array.from(this.entries.values()).filter(n=>n.state==="queued"&&n.leases.size>0).sort((n,r)=>this.entryPriority(r)-this.entryPriority(n)||n.lastAccess-r.lastAccess);for(const n of e){if(this.scrolling&&n.request.rich)continue;const r=ABe(n.request.kind);this.activeByBucket[r]>=this.bucketLimit(r)||this.start(n,r)}}start(e,n){e.state="loading",e.snapshot=Object.freeze({status:"loading"});const r=new AbortController;e.controller=r,this.activeByBucket[n]++,this.activeByKind[e.request.kind]++,this.notify(e),this.loadWithTimeout(e,r).then(s=>this.acceptResult(e,r,s)).catch(s=>{if(this.entries.get(e.scopedKey)===e){if(r.signal.aborted&&e.leases.size===0){this.deleteEntry(e.scopedKey,e);return}e.state="error",e.error=SBe(s),e.failedAt=this.now(),e.snapshot=Object.freeze({status:"error",error:e.error}),this.notify(e),this.evictFailures()}}).finally(()=>{e.controller===r&&(e.controller=null),this.activeByBucket[n]--,this.activeByKind[e.request.kind]--,this.pump()})}acceptResult(e,n,r){if(n.signal.aborted||this.entries.get(e.scopedKey)!==e){this.safeDispose(r.dispose);return}this.validateResult(r),e.state="ready",e.value=r.value,e.weight=r.weight,e.dispose=r.dispose,this.cacheResult(e),e.snapshot=Object.freeze({status:"ready",value:r.value}),this.notify(e),this.evict(),!e.cached&&e.leases.size===0&&this.deleteEntry(e.scopedKey,e)}validateResult(e){if(!(Number.isFinite(e.weight)&&e.weight>=0))throw this.safeDispose(e.dispose),new RangeError("Thumbnail result weight must be finite and non-negative")}cacheResult(e){const n=e.request.kind==="waveform",r=n?this.budgets.waveformCacheBytes:this.budgets.thumbnailCacheBytes;e.cached=e.weight<=r,e.cached&&(n?this.waveformCacheBytes+=e.weight:this.cacheBytes+=e.weight)}entryPriority(e){let n=-1;for(const r of e.leases.values())n=Math.max(n,vBe[r]);return n}bucketLimit(e){return e==="video"?this.budgets.concurrentVideoDecodes:e==="composition"?this.budgets.concurrentCompositionFetches:this.budgets.concurrentMetadataJobs}evict(){this.evictPartition(!1),this.evictPartition(!0)}evictPartition(e){const n=Array.from(this.entries.values()).filter(s=>s.cached&&s.request.kind==="waveform"===e),r=new Map;for(const s of n)r.set(s.request.projectId,(r.get(s.request.projectId)??0)+1);n.sort((s,a)=>s.lastAccess-a.lastAccess);let i=n.length;for(const s of n){const a=r.get(s.request.projectId)??0;this.isCacheOverBudget(e,i,a)&&(this.uncache(s),i--,r.set(s.request.projectId,a-1),s.leases.size===0&&this.deleteEntry(s.scopedKey,s))}}isCacheOverBudget(e,n,r){const i=e?this.budgets.waveformCacheEntries:this.budgets.thumbnailCacheEntries,s=e?this.budgets.waveformCacheBytes:this.budgets.thumbnailCacheBytes,a=e?this.waveformCacheBytes:this.cacheBytes,o=!e&&r>this.budgets.thumbnailCacheEntriesPerProject;return n>i||a>s||o}uncache(e){e.cached=!1,e.request.kind==="waveform"?this.waveformCacheBytes-=e.weight:this.cacheBytes-=e.weight}notify(e){for(const n of new Set(e.listeners.values()))n()}loadWithTimeout(e,n){let r;try{r=e.request.load(n.signal)}catch(i){r=Promise.reject(i)}return new Promise((i,s)=>{let a=!1;const o=setTimeout(()=>{a||(a=!0,n.abort(),s(new Error(`Thumbnail load timed out after ${this.budgets.thumbnailLoadTimeoutMs}ms`)))},this.budgets.thumbnailLoadTimeoutMs);r.then(l=>{if(a){this.safeDispose(l.dispose);return}a=!0,clearTimeout(o),i(l)},l=>{a||(a=!0,clearTimeout(o),s(l))})})}deleteEntry(e,n){this.entries.get(e)===n&&(this.entries.delete(e),n.snapshot=lW,this.notify(n),n.cached&&(n.cached=!1,n.request.kind==="waveform"?this.waveformCacheBytes-=n.weight:this.cacheBytes-=n.weight),n.disposed||(n.disposed=!0,this.safeDispose(n.dispose)),n.listeners.clear(),n.leases.clear())}evictFailures(){const e=Array.from(this.entries.values()).filter(r=>r.state==="error"&&r.leases.size===0).sort((r,i)=>r.lastAccess-i.lastAccess),n=e.length-this.budgets.thumbnailCacheEntries;for(const r of e.slice(0,Math.max(0,n)))this.deleteEntry(r.scopedKey,r)}safeDispose(e){try{e==null||e()}catch{}}}const OBe=new wBe,cW=Object.freeze({status:"idle"});function r3(t,e=OBe){const n=x.useRef(t);n.current=t;const r=x.useRef(null),i=t?__(t):null,s=t==null?void 0:t.priority,a=x.useCallback(l=>{const c=n.current;if(!c||i===null)return()=>{};const u=e.acquire(c,l);return r.current=u,()=>{r.current===u&&(r.current=null),u.release()}},[i,e]),o=x.useCallback(()=>{const l=n.current;return l&&i!==null?e.getSnapshot(l):cW},[i,e]);return x.useLayoutEffect(()=>{var l;s&&((l=r.current)==null||l.updatePriority(s))},[s]),x.useSyncExternalStore(a,o,()=>cW)}function CBe(t,e,n){const r=Math.max(0,Number.isFinite(t)?t:0),i=Math.max(0,Number.isFinite(e)?e:0),s=Math.max(1,Number.isFinite(n)?Math.floor(n):1);return s===1?[r+i/2]:Array.from({length:s},(a,o)=>r+i*o/(s-1))}async function kBe(t){return t instanceof HTMLCanvasElement?new Promise((e,n)=>{t.toBlob(r=>r?e(r):n(new Error("Video thumbnail encode failed")),"image/jpeg",.72)}):t.convertToBlob({type:"image/jpeg",quality:.72})}function T1(t){if(t.aborted)throw new DOMException("Aborted","AbortError")}function qhe(t){for(const e of t.urls.splice(0))URL.revokeObjectURL(e);for(const e of t.canvases)e.width=0,e.height=0;t.canvases.clear()}function EBe(t,e){const n=Math.max(1,Math.min(e.posterMaxPhysicalWidth,Math.round(e.posterMaxPhysicalHeight*t)));return{width:n,height:Math.max(1,Math.min(e.posterMaxPhysicalHeight,Math.round(n/t)))}}async function TBe(t,e,n,r){for await(const i of t.canvasesAtTimestamps(e)){if(T1(n),!i)continue;r.canvases.add(i.canvas);const s=await kBe(i.canvas);T1(n),r.urls.push(URL.createObjectURL(s))}}function PBe(t,e,n,r){const i=t.urls[0];if(!i)throw new Error("Video source returned no thumbnail frames");return{value:t.urls.length===1?{kind:"image",url:i,aspect:e}:{kind:"filmstrip",urls:[...t.urls],aspect:e},weight:n*r*4*t.urls.length,dispose:()=>qhe(t)}}async function MBe(t,e,n=el){const r=await ly(()=>import("./index-B4qse6wy.js"),[]);T1(e);const i=new r.Input({source:new r.UrlSource(t.source),formats:r.ALL_FORMATS}),s={urls:[],canvases:new Set};try{const a=await i.getPrimaryVideoTrack();if(T1(e),!a)throw new Error("Video source has no decodable video track");const[o,l]=await Promise.all([a.getDisplayWidth(),a.getDisplayHeight()]);if(T1(e),!(o>0&&l>0))throw new Error("Video source has invalid dimensions");const c=await a.getDurationFromMetadata({skipLiveWait:!0});T1(e);const u=Math.max(0,c??t.sourceRangeDuration??0),f=Math.min(Math.max(0,t.sourceStart??0),u),h=t.sourceRangeDuration??Math.max(0,u-f),m=Math.min(Math.max(0,h),Math.max(0,u-f)),y=CBe(f,m,Math.min(t.frameCount,n.richPreviewFrameCount)),d=o/l,v=EBe(d,n),b=new r.CanvasSink(a,{width:v.width,height:v.height,fit:t.fit??"cover",poolSize:1});return await TBe(b,y,e,s),PBe(s,d,v.width,v.height)}catch(a){throw qhe(s),a}finally{i.dispose()}}const Yhe=66;function Khe(t,e,n=!1){return new Promise((r,i)=>{const s=new Image,a=()=>{s.onload=null,s.onerror=null,e.removeEventListener("abort",o)},o=()=>{a(),s.src="",i(new DOMException("Aborted","AbortError"))};if(e.aborted){o();return}s.onload=()=>{a(),r(s.naturalWidth>0&&s.naturalHeight>0?s.naturalWidth/s.naturalHeight:16/9)},s.onerror=()=>{a(),n&&/\.svg($|\?)/i.test(t)?r(16/9):i(new Error("Image thumbnail failed to load"))},e.addEventListener("abort",o,{once:!0}),s.src=t})}function yF(t,e,n=Yhe,r=1){const i=Number.isFinite(e)&&e>0?e:1.7777777777777777,s=Math.max(r,Math.round(n*i)),a=t>0?Math.max(1,Math.ceil(t/s)):1;return{frameW:s,frameCount:a}}function pA(t){return t.split("/").map(encodeURIComponent).join("/")}function Ay(t,e,n){if(!t||/^(?:data:|blob:)/i.test(t))return t;let r=t,i="";if(/^https?:/i.test(t)){let s;try{s=new URL(t)}catch{return t}if(!n||s.origin!==n)return t;const a=new URL(`/api/projects/${e}/preview/`,n).pathname;if(s.pathname.startsWith(a)||s.pathname.startsWith("/api/"))return t;try{r=s.pathname.replace(/^\/+/,"").split("/").map(decodeURIComponent).join("/")}catch{return t}i=`${s.search}${s.hash}`}return`/api/projects/${e}/preview/${pA(r.replace(/^\/+/,""))}${i}`}const NBe=x.memo(function({videoSrc:e,label:n,labelColor:r,duration:i=5,sourceStart:s,sourceRangeDuration:a,projectId:o=e,sessionEpoch:l=0,priority:c="visible",rich:u=!1}){const[f,h]=x.useState(0),m=x.useRef(null),y=x.useMemo(()=>({key:OS({kind:"video",source:e,start:s,duration:a??i,frames:u?6:1}),projectId:o,sessionEpoch:l,kind:"video",priority:c,rich:u,load:M=>MBe({source:e,sourceStart:s,sourceRangeDuration:a??i,frameCount:u?6:1,fit:"cover"},M)}),[i,c,o,u,l,a,s,e]),d=r3(y),v=d.status==="ready"?d.value:null,b=(v==null?void 0:v.kind)==="filmstrip"?v.urls:(v==null?void 0:v.kind)==="image"?[v.url]:[],w=(v==null?void 0:v.kind)==="image"||(v==null?void 0:v.kind)==="filmstrip"?v.aspect:16/9,{frameW:O,frameCount:k}=yF(f,w,Yhe),E=x.useCallback(M=>{var I;if((I=m.current)==null||I.disconnect(),!M)return;const N=M.parentElement??M;h(N.clientWidth),m.current=new ResizeObserver(([_])=>h(_.contentRect.width)),m.current.observe(N)},[]);return wr(()=>()=>{var M;return(M=m.current)==null?void 0:M.disconnect()}),p.jsxs("div",{ref:E,className:"absolute inset-0 overflow-hidden",children:[b.length>0&&p.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:k},(M,N)=>{const I=b[N%b.length];return p.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden bg-neutral-900",style:{width:O},children:p.jsx("img",{src:I,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover"})},N)})}),d.status==="loading"&&b.length===0&&p.jsx("div",{className:"absolute inset-0 animate-pulse motion-reduce:animate-none",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),d.status==="error"&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-neutral-900/60",children:p.jsx("span",{className:"rounded bg-black/50 px-1 text-[8px] text-neutral-500",children:"no preview"})}),n&&p.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 px-1.5 pb-0.5 pt-3",style:{background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)"},children:p.jsx("span",{className:"block truncate text-[9px] font-semibold leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})}),DBe=66,IBe="v3";function xF({previewUrl:t,seekTime:e=2,duration:n=5,selector:r,selectorIndex:i,origin:s,output:a}){const o=t.replace("/preview/comp/","/thumbnail/").replace(/\/preview$/,"/thumbnail/index.html"),l=new URL(o,s);return l.searchParams.set("t",(e+n/2).toFixed(2)),l.searchParams.set("v",IBe),a&&l.searchParams.set("output",a),r&&(l.searchParams.set("selector",r),i!=null&&i>0&&l.searchParams.set("selectorIndex",String(i))),l.toString()}async function _Be(t,e){const n=await fetch(t,{signal:e});if(!n.ok)throw new Error(`Composition thumbnail failed (${n.status})`);const r=await n.blob();if(e.aborted)throw new DOMException("Aborted","AbortError");const i=URL.createObjectURL(r);try{const s=await Khe(i,e);return{value:{kind:"image",url:i,aspect:s},weight:el.posterMaxPhysicalWidth*el.posterMaxPhysicalHeight*4,dispose:()=>URL.revokeObjectURL(i)}}catch(s){throw URL.revokeObjectURL(i),s}}const vM=x.memo(function({previewUrl:e,label:n,labelColor:r,selector:i,selectorIndex:s,seekTime:a=2,duration:o=5,projectId:l=e,sessionEpoch:c=0,priority:u="visible"}){const[f,h]=x.useState(0),m=x.useRef(null),y=xF({previewUrl:e,seekTime:a,duration:o,selector:i,selectorIndex:s,origin:window.location.origin}),d=x.useMemo(()=>({key:OS({kind:"composition",url:y}),projectId:l,sessionEpoch:c,kind:"composition",priority:u,rich:!0,load:E=>_Be(y,E)}),[u,l,c,y]),v=r3(d),b=v.status==="ready"&&v.value.kind==="image"?v.value:null,{frameW:w,frameCount:O}=yF(f,(b==null?void 0:b.aspect)??16/9,DBe,48),k=x.useCallback(E=>{var N;if((N=m.current)==null||N.disconnect(),!E)return;const M=E.parentElement??E;h(M.clientWidth),m.current=new ResizeObserver(([I])=>h(I.contentRect.width)),m.current.observe(M)},[]);return wr(()=>()=>{var E;return(E=m.current)==null?void 0:E.disconnect()}),p.jsxs("div",{ref:k,className:"absolute inset-0 overflow-hidden",children:[b&&p.jsx("div",{className:"absolute inset-0 flex",style:{animation:"hf-thumb-fade 200ms ease-out",mixBlendMode:"lighten"},children:Array.from({length:O},(E,M)=>p.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden",style:{width:w},children:p.jsx("img",{src:b.url,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover",style:{opacity:.7}})},M))}),v.status==="loading"&&p.jsx("div",{className:"absolute inset-0 animate-pulse bg-white/[0.035]"}),n&&p.jsx("div",{className:"absolute inset-y-0 left-3 z-10 flex items-center",children:p.jsx("span",{className:"block max-w-full truncate text-[10px] font-semibold leading-none",style:{color:r,textShadow:b?"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6)":"none"},children:n})})]})});let uW=0;const RBe=800,fW={isEditMode:!1,dismissed:!1,model:null,selectedSegmentIds:new Set,selectedGroupId:null,sourceFilePath:null,syncError:null,retrySave:null,past:[],future:[]};let tv=null,AM=0;function Zc(t,e){if(!t.model)return{};const n=Date.now();return tv===e&&n-AM<RBe?(AM=n,{future:[]}):(tv=e,AM=n,{past:[...t.past,t.model].slice(-50),future:[]})}const An=rE((t,e)=>({...fW,setEditMode:n=>t({isEditMode:n}),setDismissed:n=>t({dismissed:n}),setModel:n=>t({model:n}),setSourceFilePath:n=>t({sourceFilePath:n}),setSyncError:n=>t({syncError:n}),setRetrySave:n=>t({retrySave:n}),undo:()=>{const{model:n,past:r,future:i}=e(),s=r[r.length-1];return!s||!n?null:(tv=null,t({model:s,past:r.slice(0,-1),future:[...i,n]}),s)},redo:()=>{const{model:n,past:r,future:i}=e(),s=i[i.length-1];return!s||!n?null:(tv=null,t({model:s,past:[...r,n].slice(-50),future:i.slice(0,-1)}),s)},selectSegment:(n,r=!1)=>t(i=>{if(r){const s=new Set(i.selectedSegmentIds);return s.has(n)?s.delete(n):s.add(n),{selectedSegmentIds:s,selectedGroupId:null}}return{selectedSegmentIds:new Set([n]),selectedGroupId:null}}),selectGroup:n=>{var i;const r=(i=e().model)==null?void 0:i.groups.get(n);r&&t({selectedSegmentIds:new Set(r.segmentIds),selectedGroupId:n})},selectAll:()=>t(n=>n.model?{selectedSegmentIds:new Set(n.model.segments.keys()),selectedGroupId:null}:{}),clearSelection:()=>{const{selectedSegmentIds:n,selectedGroupId:r}=e();n.size===0&&r===null||t({selectedSegmentIds:new Set,selectedGroupId:null})},updateSegmentStyle:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.segments.get(n);if(!s)return{};const a=new Map(i.model.segments);return a.set(n,{...s,style:{...s.style,...r}}),{...Zc(i,`seg-style:${n}`),model:{...i.model,segments:a}}}),updateSegmentText:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.segments.get(n);if(!s)return{};const a=new Map(i.model.segments);return a.set(n,{...s,text:r}),{...Zc(i,`seg-text:${n}`),model:{...i.model,segments:a}}}),updateSegmentTiming:(n,r,i)=>t(s=>{if(!s.model)return{};const a=s.model.segments.get(n);if(!a)return{};const o=new Map(s.model.segments);return o.set(n,{...a,start:r,end:i}),{...Zc(s,`seg-timing:${n}`),model:{...s.model,segments:o}}}),updateGroupStyle:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=new Map(i.model.groups);return a.set(n,{...s,style:{...s.style,...r}}),{...Zc(i,`group-style:${n}`),model:{...i.model,groups:a}}}),updateGroupContainer:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=new Map(i.model.groups);return a.set(n,{...s,containerStyle:{...s.containerStyle,...r}}),{...Zc(i,`group-container:${n}`),model:{...i.model,groups:a}}}),updateGroupAnimation:(n,r,i)=>t(s=>{if(!s.model)return{};const a=s.model.groups.get(n);if(!a)return{};const o=new Map(s.model.groups),l=a.animation[r],c=l!==null?{...l,...i}:i;return o.set(n,{...a,animation:{...a.animation,[r]:c}}),{...Zc(s,`group-anim:${n}:${r}`),model:{...s.model,groups:o}}}),splitGroup:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n);if(!s)return{};const a=s.segmentIds.indexOf(r);if(a<=0)return{};const o=s.segmentIds.slice(0,a),l=s.segmentIds.slice(a),c=`group-split-${uW++}`,u=new Map(i.model.groups);u.set(n,{...s,segmentIds:o}),u.set(c,{...s,id:c,segmentIds:l});const f=i.model.groupOrder.indexOf(n),h=[...i.model.groupOrder];h.splice(f+1,0,c);const m=new Map(i.model.segments);return l.forEach((y,d)=>{const v=m.get(y);v&&m.set(y,{...v,groupIndex:d})}),{...Zc(i,`split:${n}:${r}:${uW}`),model:{...i.model,groups:u,segments:m,groupOrder:h}}}),mergeGroups:(n,r)=>t(i=>{if(!i.model)return{};const s=i.model.groups.get(n),a=i.model.groups.get(r);if(!s||!a)return{};const o=[...s.segmentIds,...a.segmentIds],l=new Map(i.model.groups);l.set(n,{...s,segmentIds:o}),l.delete(r);const c=i.model.groupOrder.filter(h=>h!==r),u=new Map(i.model.segments);a.segmentIds.forEach((h,m)=>{const y=u.get(h);y&&u.set(h,{...y,groupIndex:s.segmentIds.length+m})});const f=i.selectedGroupId===r?null:i.selectedGroupId;return{...Zc(i,`merge:${n}:${r}`),model:{...i.model,groups:l,segments:u,groupOrder:c},selectedGroupId:f}}),updateSelectedStyle:n=>t(r=>{if(!r.model||r.selectedSegmentIds.size===0)return{};const i=new Map(r.model.segments);for(const s of r.selectedSegmentIds){const a=i.get(s);a&&i.set(s,{...a,style:{...a.style,...n}})}return{...Zc(r,`sel-style:${[...r.selectedSegmentIds].join(",")}`),model:{...r.model,segments:i}}}),applyAnimationToAll:n=>t(r=>{if(!r.model)return{};const i=new Map(r.model.groups);for(const[s,a]of i)i.set(s,{...a,animation:n});return{...Zc(r,"apply-anim-all"),model:{...r.model,groups:i}}}),reset:()=>{tv=null,t(n=>({...fW,retrySave:n.retrySave,selectedSegmentIds:new Set,past:[],future:[]}))}})),jBe=new Set(["ArrowLeft","ArrowRight"]),LBe=["button","a[href]","[role='button']","[role='checkbox']","[role='combobox']","[role='menuitem']","[role='radio']","[role='slider']","[role='spinbutton']","[role='switch']","[role='textbox']"].join(",");function FBe(t){if(Hf(t))return!0;if(!t||typeof t!="object")return!1;const e=t;return typeof e.closest!="function"?!1:e.closest.call(t,LBe)!==null}function $Be(t,e={isCaptionEditMode:!1,selectedCaptionSegmentCount:0}){return t.metaKey||t.ctrlKey||t.altKey||FBe(t.target)?!0:jBe.has(t.code)&&e.isCaptionEditMode&&e.selectedCaptionSegmentCount>0}const hW=[1,2,4];let R_=0;function BBe(){R_+=1;let t=!1;return()=>{t||(t=!0,R_-=1)}}function VBe(){return R_>0}function HBe({iframeRef:t,shuttleDirectionRef:e,shuttleSpeedIndexRef:n,iframeShortcutCleanupRef:r,getAdapter:i,play:s,playBackward:a,pause:o,seek:l}){const c=x.useRef(new Set),u=x.useRef(()=>{}),f=x.useRef(()=>{}),h=x.useCallback(w=>{const O=i(),k=(O==null?void 0:O.getTime())??fe.getState().currentTime;l(N6e(k,w,Bd))},[i,l]),m=x.useCallback(w=>{e.current===w?n.current=Math.min(n.current+1,hW.length-1):n.current=0;const O=hW[n.current];fe.getState().setPlaybackRate(O),w==="forward"?s():a(O)},[s,a,e,n]),y=x.useCallback(()=>{fe.getState().isPlaying?o():s()},[s,o]),d=x.useCallback(w=>{var M,N,I;if(w.defaultPrevented)return;const O=An.getState();if($Be(w,{isCaptionEditMode:O.isEditMode,selectedCaptionSegmentCount:O.selectedSegmentIds.size}))return;const k=w.key.toLowerCase();if(c.current.add(k),w.code==="Space"){w.preventDefault(),y();return}if(!((w.code==="ArrowLeft"||w.code==="ArrowRight")&&VBe())){if(w.code==="ArrowLeft"){w.preventDefault(),h(w.shiftKey?-10:-1);return}if(w.code==="ArrowRight"){w.preventDefault(),h(w.shiftKey?10:1);return}if(!w.repeat){if(k==="m"){w.preventDefault();const _=fe.getState();_.setAudioMuted(!_.audioMuted);return}if(k==="l"&&w.shiftKey){w.preventDefault();const _=fe.getState();_.setLoopEnabled(!_.loopEnabled);return}if(k==="k"){w.preventDefault(),o();return}if(k==="j"){if(w.preventDefault(),c.current.has("k")){h(-1);return}m("backward");return}if(k==="l"){if(w.preventDefault(),c.current.has("k")){h(1);return}m("forward");return}if(k==="i"){w.preventDefault();const _=((M=i())==null?void 0:M.getTime())??fe.getState().currentTime;fe.getState().setInPoint(w.shiftKey?null:_);return}if(k==="o"){w.preventDefault();const _=((N=i())==null?void 0:N.getTime())??fe.getState().currentTime;fe.getState().setOutPoint(w.shiftKey?null:_);return}if(k==="a"){w.preventDefault(),l(fe.getState().inPoint??0,{keepPlaying:!0});return}if(k==="e"){w.preventDefault();const{outPoint:_}=fe.getState();l(_??((I=i())==null?void 0:I.getDuration())??fe.getState().duration,{keepPlaying:!0});return}}}},[o,m,h,y,i,l]),v=x.useCallback(w=>{c.current.delete(w.key.toLowerCase())},[]);u.current=d,f.current=v;const b=x.useCallback(()=>{var M,N,I;(M=r.current)==null||M.call(r),r.current=null;let w=null,O=null;try{w=((N=t.current)==null?void 0:N.contentWindow)??null,O=((I=t.current)==null?void 0:I.contentDocument)??null}catch{return}if(!w&&!O)return;const k=_=>u.current(_),E=_=>f.current(_);try{w==null||w.addEventListener("keydown",k,!0),w==null||w.addEventListener("keyup",E,!0)}catch{}O==null||O.addEventListener("keydown",k,!0),O==null||O.addEventListener("keyup",E,!0),r.current=()=>{try{w==null||w.removeEventListener("keydown",k,!0),w==null||w.removeEventListener("keyup",E,!0)}catch{}O==null||O.removeEventListener("keydown",k,!0),O==null||O.removeEventListener("keyup",E,!0)}},[t,r]);return{playbackKeyDownRef:u,playbackKeyUpRef:f,attachIframeShortcutListeners:b,togglePlay:y}}function j_(t){return Number.isFinite(t)&&t>0&&t<7200?t:0}function QBe(t){const e=t.getAttribute(Zo);if(!e)return{};const n=yE(t.ownerDocument,e);return{audioGroup:e,audioGroupLabel:n.label,audioGroupVolume:n.volume,audioGroupHidden:n.hidden,...n.fxChain?{audioGroupFxChain:n.fxChain}:{},...n.automation?{audioGroupAutomation:n.automation}:{}}}function zBe(t){const e=new Map,n=t==null?void 0:t.__clipTree;if(!n)return e;const r=i=>{for(const s of i)s.id&&s.parentId&&e.set(s.id,s.parentId),s.children.length>0&&r(s.children)};return r(n.roots),e}function L_(t,e,n,r,i){for(const s of Array.from(e.children)){if(!s.id){L_(t,s,n,r,i);continue}const a=s.hasAttribute("data-hf-group");i.push({id:s.id,parentId:n,hostId:t,label:a&&s.getAttribute("data-hf-group")||s.id,stackingContextId:Aj(s),...QBe(s)}),r.set(s.id,n),a&&L_(t,s,s.id,r,i)}}function ZBe(t,e,n){const r=[];if(!t)return r;for(const i of e){if(i.kind!=="composition"||!i.id)continue;const s=t.getElementById(i.id);if(!s)continue;const a=s.querySelector("[data-hf-inner-root]")??s;L_(i.id,a,i.id,n,r)}return r}function Jhe(t){try{return(t==null?void 0:t.contentDocument)??null}catch{return null}}function GBe(t,e){const n=new Set;return t.map((r,i)=>{const s=e?uCe(e,r,i,n):null;return s&&n.add(s),aae({clip:r,fallbackIndex:i,doc:e,hostEl:s})})}function UBe(t,e,n){const r=XBe(t,n);return!e||n<=0?r:[...r,...oae(e,n,r)]}function XBe(t,e){return e<=0?[...t]:t.filter(n=>n.start<e).map(n=>({...n,duration:Math.min(n.duration,e-n.start)})).filter(n=>n.duration>0)}function WBe(t){const e=t.pendingSeek??t.requestedSeek??t.storeCurrentTime;return!Number.isFinite(e)||e<=0?0:!Number.isFinite(t.duration)||t.duration<=0?e:Math.min(e,t.duration)}function qBe(t,e){const n=fe.getState().requestedSeekTime,r=WBe({pendingSeek:e.current,requestedSeek:n,storeCurrentTime:fe.getState().currentTime,duration:t.getDuration()});return e.current=null,n!=null&&fe.getState().clearSeekRequest(),t.seek(r>.001?Math.max(0,r-.001):.001),t.seek(r),r}function YBe(t,e){const n=j_(t.getDuration());n>0&&n!==fe.getState().duration&&e(n)}function KBe(t,e,n,r){const i=lae(t,n);if(i.length>0){r(i);return}const s=t.querySelector("[data-composition-id]");if(!s||n<=0)return;const a=kEe({compositionId:s.getAttribute("data-composition-id")||"composition",tagName:s.tagName||"div",rootDuration:n,iframeSrc:(e==null?void 0:e.src)||"",selector:h0(s)});a&&r([a])}function JBe(t,e){return!t.source||!e?!0:t.source===e.contentWindow}function eVe(t,e){if(!JBe(t,e))return!1;const n=t.data;return(n==null?void 0:n.source)!=="hf-preview"||(n==null?void 0:n.type)!=="state"&&(n==null?void 0:n.type)!=="timeline"?!1:Sj(n).status!=="unsupported"}function tVe(t,e,n){!t||!e||(oEe(t,e),lEe(t),n())}function nVe(t,e){const n=t==null?void 0:t.__clipManifest;n&&n.clips.length>0&&e(n)}function rVe(t){const{iframe:e,adapter:n,syncTimelineElements:r}=t;try{const i=Jhe(e),s=(e==null?void 0:e.contentWindow)??null;tVe(i,s,t.attachIframeShortcutListeners),nVe(s,t.processTimelineMessage),t.enrichMissingCompositions(),t.applyPreviewAudioState(),i&&fe.getState().elements.length===0&&KBe(i,e,n.getDuration(),r)}catch{}}function dW(t){t&&t.style.visibility==="hidden"&&(t.style.visibility="")}function iVe(t){return Math.max(j_(t.manifestDurationSeconds),j_(t.authoredRootDurationSeconds))}function sVe({iframeRef:t,probeIntervalRef:e,pendingSeekRef:n,isRefreshingRef:r,getAdapter:i,syncTimelineElements:s,setDuration:a,setCurrentTime:o,setTimelineReady:l,setIsPlaying:c,attachIframeShortcutListeners:u,applyPreviewAudioState:f}){const h=x.useCallback(w=>{var _;if(!w.clips||w.clips.length===0)return;fe.getState().setClipManifest(w.clips);const O=new Set(w.clips.map(j=>j.compositionId).filter(Boolean)),k=w.clips.filter(j=>!j.parentCompositionId||!O.has(j.parentCompositionId)),E=Jhe(t.current);try{const j=zBe(((_=t.current)==null?void 0:_.contentWindow)??null),L=ZBe(E,w.clips,j);fe.getState().setClipParentMap(j),fe.getState().setDomClipChildren(L)}catch{}const M=GBe(k,E),N=iVe({manifestDurationSeconds:w.durationInFrames/aEe(w),authoredRootDurationSeconds:Tse(E)}),I=UBe(M,E,N>0?N:fe.getState().duration);I.length>0&&s(I,N>0?N:void 0)},[t,s]),m=x.useCallback(()=>{try{const w=t.current,O=w==null?void 0:w.contentDocument,k=w==null?void 0:w.contentWindow;if(!O||!k)return;const E=fe.getState().elements,M=fe.getState().duration,{missing:N,updatedEls:I,patched:_}=wEe(O,k,E,M);if(N.length>0||_){const j=new Set(I.map(B=>B.id)),L=N.filter(B=>!j.has(B.id));s([...I,...L])}}catch{}},[t,s]),y=x.useCallback(()=>{const w=i();if(!w||w.getDuration()<=0)return!1;w.pause();const O=qBe(w,n);return dW(t.current),ya.notify(O),YBe(w,a),o(O),r.current||l(!0),r.current=!1,c(!1),rVe({iframe:t.current,adapter:w,processTimelineMessage:h,enrichMissingCompositions:m,applyPreviewAudioState:f,attachIframeShortcutListeners:u,syncTimelineElements:s}),!0},[i,a,o,l,c,h,m,s,u,f,t,r,n]),d=x.useCallback(()=>{if(f(),e.current&&clearInterval(e.current),y())return;const w=t.current;let O=!1;const k=()=>{O||y()&&(O=!0,window.removeEventListener("message",E),e.current&&clearInterval(e.current))},E=M=>{eVe(M,w)&&k()};window.addEventListener("message",E),e.current=setTimeout(()=>{O||k(),window.removeEventListener("message",E),dW(t.current)},5e3)},[y,t,e,f]);return{processTimelineMessage:h,processTimelineMessageRef:{current:h},enrichMissingCompositions:m,enrichMissingCompositionsRef:{current:m},initializeAdapter:y,onIframeLoad:d}}function aVe({rafRef:t,reverseRafRef:e,getAdapter:n,setCurrentTime:r,setIsPlaying:i}){const s=x.useCallback(()=>{cancelAnimationFrame(e.current)},[e]),a=x.useCallback(()=>{const l=()=>{const c=n();if(c){const u=c.getTime(),f=c.getDuration(),h=f>0?Math.min(u,f):u;ya.notify(h);const{inPoint:m,outPoint:y}=fe.getState(),d=y!==null?Math.min(y,f):f,v=m!==null?m:0,b=v<d?d:f,w=v<d?v:0;if(h>=b){if(fe.getState().loopEnabled&&f>0){c.seek(w,{keepPlaying:!0}),ya.notify(w),c.play(),i(!0),t.current=requestAnimationFrame(l);return}c.isPlaying()&&c.pause(),r(h),i(!1),cancelAnimationFrame(t.current);return}}t.current=requestAnimationFrame(l)};t.current=requestAnimationFrame(l)},[t,n,r,i]),o=x.useCallback(()=>{cancelAnimationFrame(t.current)},[t]);return{startRAFLoop:a,stopRAFLoop:o,stopReverseLoop:s}}function Z0(t){let e=null;return(n,r={})=>{if(e===null)try{e=localStorage.getItem(`hf-${t}-debug`)==="1"}catch{e=!1}if(!e)return;const i=typeof r=="function"?r():r;i&&console.log(`[hf-${t}] ${JSON.stringify({stage:n,t:Math.round(performance.now()),...i})}`)}}const o1=Z0("reload");function oVe(t,e){const n=fe.getState(),r=p0(n.elements).musicElement;if(!r||n.audioMuted)return;const i=e-r.start,s=i>=0&&i<=r.duration?(r.playbackStart??0)+i:null;gEe(t,s,r.domId??r.id,n.audioVolume)}const y2=1e3;let ede=!1;const pW=Object.freeze({"dense-short":{duration:120,clipDuration:1.5},"long-overlap":{duration:7200,clipDuration:120},"keyframe-heavy-expanded":{duration:600,clipDuration:8},"composition-heavy":{duration:900,clipDuration:12},"remote-unsupported":{duration:900,clipDuration:12}});function lVe(t){ede=t}function tde(){return ede}function cVe(t){if(t.elementCount!==1e3&&t.elementCount!==5e4)throw new RangeError("Timeline performance fixture elementCount must be 1000 or 50000");if(!Object.hasOwn(pW,t.profile))throw new RangeError(`Unknown timeline performance fixture profile: ${t.profile}`);return pW[t.profile]}function uVe(t,e){if(t<y2)return t;if(e.profile!=="dense-short")return t%y2;const n=Math.ceil((e.elementCount-y2)/127);return(t-y2)%Math.max(1,n)}function fVe(t,e,n,r){const i=Math.max(0,n-r);return e==="dense-short"?t%128*.5:e==="long-overlap"?t*37%Math.max(1,i):t*17%Math.max(1,i)}function hVe(){return{format:"percentage",keyframes:[0,33,66,100].map(t=>({percentage:t,propertyGroup:"position",properties:{x:t},ease:"power2.inOut"}))}}function dVe(t,e,n){return{id:`animation-${t}`,targetSelector:`#${t}`,method:"to",position:e,resolvedStart:e,duration:n,propertyGroup:"position",fromProperties:{x:0},properties:{x:100},ease:"power2.inOut"}}function pVe(t){const e=cVe(t),n=[],r=new Map,i=new Map,s=new Set;for(let a=0;a<t.elementCount;a+=1){const o=`perf-${t.profile}-${t.elementCount}-${a}`,l=fVe(a,t.profile,e.duration,e.clipDuration),c=uVe(a,t),u={id:o,key:o,domId:o,selector:`#${o}`,label:`Fixture ${a+1}`,tag:t.profile==="remote-unsupported"&&a%2===0?"video":"div",start:l,duration:e.clipDuration,track:c,authoredTrack:c};t.profile==="composition-heavy"?u.compositionSrc=`compositions/perf-${a%32}.html`:t.profile==="remote-unsupported"&&(u.src=a%2===0?`https://media.invalid/perf-${a%32}.mp4`:`assets/perf-${a%32}.unsupported`),t.profile==="keyframe-heavy-expanded"&&(r.set(o,hVe()),i.set(o,[dVe(o,l,e.clipDuration)]),s.add(o)),n.push(u)}return{summary:Object.freeze({...t,duration:e.duration,trackCount:y2,keyframedElementCount:r.size,expandedElementCount:s.size}),elements:n,keyframeCache:r,gsapAnimations:i,expandedClipIds:s}}const nv=new Map,F_=new Map,K1=new Map;let cC=0,SM=0,$_=0;const nde=[];let Gm=null;async function mVe(){if(Gm===!1)return null;if(Gm)return Gm;try{return Gm=await ly(()=>import("./index-B4qse6wy.js"),[]),Gm}catch{return Gm=!1,null}}function bF(t){try{return new URL(t,window.location.href).href}catch{return t}}async function gVe(t){const e=await mVe();if(!e)return null;const n=new e.Input({source:new e.UrlSource(t),formats:e.ALL_FORMATS});try{const r=await n.getDurationFromMetadata();if(r==null||!Number.isFinite(r)||r<=0)return null;const i=await n.getPrimaryVideoTrack(),s=await n.getAudioTracks();return{duration:r,width:i==null?void 0:i.displayWidth,height:i==null?void 0:i.displayHeight,hasVideo:i!=null,hasAudio:s.length>0}}catch{return null}finally{n.dispose()}}function vF(t){const e=nv.get(bF(t));return e&&(e.lastAccess=++cC),e==null?void 0:e.result}function rde(t,e){return e?Ay(t,e,window.location.origin):t}function yVe(){const t=nv.size+K1.size-el.metadataRegistryEntries;if(t<=0)return;const e=[...Array.from(nv,([n,r])=>({key:n,at:r.lastAccess,failed:!1})),...Array.from(K1,([n,r])=>({key:n,at:r.lastAccess,failed:!0}))].sort((n,r)=>n.at-r.at);for(const n of e.slice(0,t))n.failed?K1.delete(n.key):nv.delete(n.key)}function xVe(t,e){return t.map(n=>{const r=n.tag.toLowerCase();if(!n.src||n.sourceDuration!=null||r!=="audio"&&r!=="video")return n;const i=vF(rde(n.src,e));return i!=null&&i.duration&&i.duration>0?{...n,sourceDuration:i.duration}:n})}async function bVe(t,e,n){const r=t.flatMap(i=>{if(!i.src||i.sourceDuration!=null||!["video","audio"].includes(i.tag.toLowerCase()))return[];const s=rde(i.src,e);return!vF(s)&&!ide(bF(s))?[{el:i,source:s}]:[]});r.length!==0&&await Promise.allSettled(r.map(async({el:i,source:s})=>{const a=await vVe(s);a&&n(i.key??i.id,a.duration)}))}function ide(t){const e=K1.get(t);return e===void 0?!1:Date.now()-e.failedAt<el.metadataFailureTtlMs?(e.lastAccess=++cC,!0):(K1.delete(t),!1)}async function vVe(t){const e=bF(t),n=vF(e);if(n)return n;if(ide(e))return null;let r=F_.get(e);return r||(r=new Promise(i=>{nde.push({key:e,epoch:$_,resolve:i}),sde()}),F_.set(e,r),r)}function sde(){for(;SM<el.concurrentMetadataJobs;){const t=nde.shift();if(!t)return;if(t.epoch!==$_){t.resolve(null);continue}SM++,gVe(t.key).then(e=>t.epoch!==$_?null:(F_.delete(t.key),e?nv.set(t.key,{result:e,lastAccess:++cC}):K1.set(t.key,{failedAt:Date.now(),lastAccess:++cC}),yVe(),e)).then(t.resolve).finally(()=>{SM--,sde()})}}function AVe(t){return t.keepPlaying&&!t.wasReverseShuttle&&t.storeWasPlaying&&(t.duration<=0||t.nextTime<t.duration)}function SVe(t){return!t.keepPlaying||t.wasReverseShuttle}function wVe(t,e){return!!(t.source&&e&&t.source!==e.contentWindow)}function OVe(t,e){if(tde()||wVe(t,e))return null;const n=t.data;return(n==null?void 0:n.source)!=="hf-preview"?null:xE(n)?n:null}function CVe(t,e){var n;try{if(fe.getState().elements.length===0){const r=(n=e==null?void 0:e.contentWindow)==null?void 0:n.__clipManifest;r&&r.clips.length>0&&t.processTimelineMessageRef.current(r)}Date.now()-t.lastTimelineMessageRef.current>500&&t.enrichMissingCompositionsRef.current()}catch{}}function kVe(t,e,n){if(t.lastTimelineMessageRef.current=Date.now(),t.processTimelineMessageRef.current(n),t.enrichMissingCompositionsRef.current(),!(fe.getState().elements.length>0))try{const r=e==null?void 0:e.contentDocument,i=t.getAdapter();if(!r||!i)return;const s=lae(r,i.getDuration());s.length>0&&t.syncTimelineElements(s)}catch{}}function EVe(t){return e=>{const n=t.iframeRef.current,r=OVe(e,n);if(r){if(r.type==="state")return CVe(t,n);r.type==="timeline"&&Array.isArray(r.clips)&&kVe(t,n,r)}}}function TVe(t,e){return e.length!==t.length?!0:e.some((n,r)=>{const i=t[r];return!i||n.id!==i.id||n.start!==i.start||n.duration!==i.duration||n.track!==i.track||n.sourceDuration!==i.sourceDuration})}function PVe(){const t=x.useRef(null),e=x.useRef(0),n=x.useRef(void 0),r=x.useRef(null),i=x.useRef(!1),s=x.useRef(0),a=x.useRef(null),o=x.useRef(0),l=x.useRef(null),c=x.useRef(0),u=x.useRef(null),f=x.useRef(!1),{setIsPlaying:h,setCurrentTime:m,setDuration:y,setTimelineReady:d,setElements:v}=fe.getState(),b=x.useCallback((U,Z)=>{if(tde())return;const K=fe.getState(),ee=Z??K.duration,re=Ehe(xVe(OEe(K.elements,U,K.duration,ee),K.timelineProjectId));TVe(K.elements,re)&&v(re),Number.isFinite(Z)&&(Z??0)>0&&Z!==K.duration&&y(Z??0),K.timelineReady||d(!0),bVe(re,K.timelineProjectId,(z,H)=>{fe.setState(se=>{const ue=se.elements.findIndex(me=>(me.key??me.id)===z);if(ue===-1||se.elements[ue].sourceDuration!=null)return{};const be=se.elements.slice();return be[ue]={...se.elements[ue],sourceDuration:H},{elements:be}})})},[v,d,y]),w=x.useCallback(()=>{var U,Z;try{const K=t.current,ee=K==null?void 0:K.contentWindow;if(!K||!ee)return null;const re=ee.__player&&typeof ee.__player.play=="function"?ee.__player:null,z=Tse(K.contentDocument),H=v4(re);if(H>0&&z<=H)return DO(u,f),re;let se=null;if(ee.__timeline){const me=oG(ee.__timeline),pe=v4(me);if(pe>0&&z<=pe)return DO(u,f),me;pe>0&&(se??(se=me))}if(ee.__timelines){const me=Object.keys(ee.__timelines);if(me.length>0){const pe=(Z=(U=K==null?void 0:K.contentDocument)==null?void 0:U.querySelector("[data-composition-id]"))==null?void 0:Z.getAttribute("data-composition-id"),ge=pe&&pe in ee.__timelines?pe:me[me.length-1],Pe=oG(ee.__timelines[ge]),ve=v4(Pe);if(ve>0&&z<=ve)return DO(u,f),Pe;ve>0&&(se??(se=Pe))}}const ue=re??se,be=Math.max(fe.getState().duration,z,H);return ue&&be>0&&("renderSeek"in ue||typeof ue.seek=="function")?j6e({cache:u,warned:f,bestAdapter:ue,effectiveDuration:be,docDuration:z,clock:_6e(ee),getPlaybackRate:()=>fe.getState().playbackRate}):ue}catch{return null}},[]),{startRAFLoop:O,stopRAFLoop:k,stopReverseLoop:E}=aVe({rafRef:e,reverseRafRef:s,getAdapter:w,setCurrentTime:m,setIsPlaying:h}),M=x.useCallback(U=>{const Z=t.current;if(Z){hEe(Z,U);try{const K=Z.contentWindow;if(K!=null&&K.__timelines)for(const ee of Object.values(K.__timelines))ee&&typeof ee.timeScale=="function"&&ee.timeScale(U)}catch{}}},[]),N=x.useCallback(()=>{const{audioMuted:U,audioVolume:Z}=fe.getState();fEe(t.current,U,Z)},[]),I=x.useCallback(()=>{k(),E(),Wv();const U=w();U&&(U.getTime()>=U.getDuration()&&U.seek(fe.getState().inPoint??0),M(fe.getState().playbackRate),N(),U.play(),a.current="forward",h(!0),O())},[w,h,O,M,N,k,E]),_=x.useCallback(U=>{k(),E();const Z=w();if(!Z)return;const K=Math.max(0,Z.getDuration()),ee=Z.getTime()<=0&&K>0?K:Z.getTime();Z.pause(),ee!==Z.getTime()&&Z.seek(ee);const re=Math.max(.1,Math.min(4,U));M(re),N();let z=ee,H=performance.now();const se=ue=>{const be=(ue-H)/1e3*re;let me=z-be;const{inPoint:pe,outPoint:ge}=fe.getState(),Pe=ge!==null?Math.min(ge,K):K,ve=pe!==null?pe:0,xe=ve<Pe?Pe:K,we=ve<Pe?ve:0;if(me<=we)if(fe.getState().loopEnabled&&K>0)z=xe,H=ue,me=xe;else{Z.seek(we),ya.notify(we),m(we),h(!1),a.current=null,s.current=0;return}Z.seek(Math.max(0,me)),ya.notify(Math.max(0,me)),h(!0),s.current=requestAnimationFrame(se)};h(!0),a.current="backward",s.current=requestAnimationFrame(se)},[w,m,h,M,N,k,E]),j=x.useCallback(()=>{E();const U=w();U&&(U.pause(),m(U.getTime()),h(!1),a.current=null,o.current=0,k())},[w,m,h,k,E]),L=x.useCallback((U,Z)=>{const K=a.current==="backward";E();const ee=w();if(!ee)return r.current=Math.max(0,U),!1;const re=Math.max(0,ee.getDuration()),z=Math.max(0,re>0?Math.min(re,U):U),H=(Z==null?void 0:Z.keepPlaying)===!0,se=AVe({keepPlaying:H,wasReverseShuttle:K,storeWasPlaying:fe.getState().isPlaying,duration:re,nextTime:z});return ee.seek(z,Z),ya.notify(z),m(z),!se&&!H&&oVe(t.current,z),se?(k(),M(fe.getState().playbackRate),N(),ee.play(),h(!0),a.current="forward",o.current=0,O()):SVe({keepPlaying:H,wasReverseShuttle:K})&&(k(),fe.getState().isPlaying&&h(!1),a.current=null,o.current=0),!0},[w,r,m,h,O,k,E,M,N,a,o]);x.useEffect(()=>fe.subscribe((U,Z)=>{var ee;U.requestedSeekTime!==null&&U.requestedSeekTime!==Z.requestedSeekTime&&(L(U.requestedSeekTime),fe.getState().clearSeekRequest());const K=U.playbackRequest;K&&K.nonce!==((ee=Z.playbackRequest)==null?void 0:ee.nonce)&&(K.playing?I():(j(),K.returnTo!==null&&L(K.returnTo)),fe.getState().clearPlaybackRequest())}),[L,I,j]);const{playbackKeyDownRef:B,playbackKeyUpRef:$,attachIframeShortcutListeners:Q,togglePlay:Y}=HBe({iframeRef:t,shuttleDirectionRef:a,shuttleSpeedIndexRef:o,iframeShortcutCleanupRef:l,getAdapter:w,play:I,playBackward:_,pause:j,seek:L}),{processTimelineMessageRef:W,enrichMissingCompositionsRef:J,onIframeLoad:ne}=sVe({iframeRef:t,probeIntervalRef:n,pendingSeekRef:r,isRefreshingRef:i,getAdapter:w,syncTimelineElements:b,setDuration:y,setCurrentTime:m,setTimelineReady:d,setIsPlaying:h,attachIframeShortcutListeners:Q,applyPreviewAudioState:N}),le=x.useCallback(()=>{if(!(i.current&&r.current!=null)){const Z=w();Z?r.current=Z.getTime():r.current==null&&(r.current=fe.getState().currentTime??0)}i.current=!0,k(),E(),h(!1)},[w,k,h,E]),ie=x.useCallback(()=>{const U=t.current;if(!U)return;o1("refreshPlayer",()=>({stack:new Error("refreshPlayer").stack})),le(),U.style.visibility="hidden";const Z=U.src,K=new URL(Z,window.location.origin);K.searchParams.set("_t",String(Date.now())),eie(K),U.src=K.toString()},[le]),q=x.useRef(w);q.current=w,wr(()=>{const U=re=>B.current(re),Z=re=>$.current(re),K=EVe({iframeRef:t,processTimelineMessageRef:W,enrichMissingCompositionsRef:J,lastTimelineMessageRef:c,getAdapter:w,syncTimelineElements:b}),ee=()=>{var re;if(document.hidden&&fe.getState().isPlaying){const z=(re=q.current)==null?void 0:re.call(q);z&&(z.pause(),h(!1),k())}};return window.addEventListener("keydown",U,!0),window.addEventListener("keyup",Z,!0),window.addEventListener("message",K),document.addEventListener("visibilitychange",ee),()=>{var re;window.removeEventListener("keydown",U,!0),window.removeEventListener("keyup",Z,!0),(re=l.current)==null||re.call(l),l.current=null,window.removeEventListener("message",K),document.removeEventListener("visibilitychange",ee),k(),E(),Wv(),DO(u,f),n.current&&clearInterval(n.current)}});const F=x.useCallback(()=>{k(),E(),n.current&&clearInterval(n.current),fe.getState().reset()},[k,E]);return x.useEffect(()=>fe.subscribe((U,Z)=>{const K=U.playbackRate!==Z.playbackRate,ee=U.audioMuted!==Z.audioMuted,re=U.audioVolume!==Z.audioVolume;!K&&!ee&&!re||(K&&M(U.playbackRate),N())}),[M,N]),{iframeRef:t,play:I,pause:j,togglePlay:Y,seek:L,onIframeLoad:ne,refreshPlayer:ie,saveSeekPosition:le,resetPlayer:F}}const mW='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable="true"], [tabindex]:not([tabindex="-1"])';function CS({open:t,onClose:e,containerRef:n,canClose:r}){const i=x.useRef(null),s=x.useRef(r);s.current=r;const a=x.useRef(e);a.current=e;const o=x.useCallback(()=>{const l=s.current;l&&!l()||a.current()},[]);return x.useEffect(()=>{var h;const l=document.activeElement;i.current=l instanceof HTMLElement?l:null;const c=n.current;(h=(c==null?void 0:c.querySelector(mW))??c)==null||h.focus();const f=m=>{if(m.key==="Escape"){m.stopPropagation(),o();return}if(m.key!=="Tab")return;const y=n.current;if(!y)return;const d=Array.from(y.querySelectorAll(mW));if(d.length===0)return;const v=d[0],b=d[d.length-1],w=document.activeElement;m.shiftKey&&(w===v||!y.contains(w))?(m.preventDefault(),b.focus()):!m.shiftKey&&(w===b||!y.contains(w))&&(m.preventDefault(),v.focus())};return document.addEventListener("keydown",f,!0),()=>{var m;document.removeEventListener("keydown",f,!0),(m=i.current)==null||m.focus(),i.current=null}},[t,n,o]),{requestClose:o}}function gW({findings:t,projectId:e,projectDir:n,title:r="HyperFrame Lint Results",promptIntro:i="Fix these HyperFrames lint issues",onClose:s}){const a=t.filter(v=>v.severity==="error"),o=t.filter(v=>v.severity==="warning"),l=t.length>0,[c,u]=x.useState(!1),[f,h]=x.useState(!1),m=x.useRef(null),{requestClose:y}=CS({open:!0,onClose:s,containerRef:m}),d=async()=>{const v=t.map(k=>{let E=`[${k.severity}] ${k.message}`;return k.file&&(E+=`
|
|
205
205
|
File: ${k.file}`),k.fixHint&&(E+=`
|
|
206
206
|
Fix: ${k.fixHint}`),E}),b=n?`Project path: ${n}
|
|
207
207
|
|
|
@@ -335,7 +335,7 @@ ${t}`}class iet extends Error{constructor(e){super(`Couldn't find this element i
|
|
|
335
335
|
|
|
336
336
|
`),"","## Current composition state","",l].join(`
|
|
337
337
|
`)}function L1t({name:t,title:e,description:n,blockType:r,duration:i,category:s,tags:a,posterUrl:o,videoUrl:l,onAdd:c,onShowPrompt:u,onPreview:f}){var _;const[h,m]=x.useState(!1),[y,d]=x.useState("idle"),v=x.useRef(null),b=q2e(s),w=(a==null?void 0:a.includes("html-in-canvas"))||(a==null?void 0:a.includes("webgl")),O=x.useCallback(()=>{v.current=setTimeout(()=>{m(!0),f==null||f({videoUrl:l,posterUrl:o,title:e})},300)},[f,l,o,e]),k=x.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),m(!1),f==null||f(null)},[f]);x.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const E=x.useCallback(async j=>{if(j.stopPropagation(),!(y!=="idle"||!c)){d("adding");try{await c(),d("added")}catch{d("failed")}setTimeout(()=>d("idle"),1500)}},[c,y]),{activeCompPath:M,compositionDimensions:N}=zl(),I=x.useCallback(j=>{j.stopPropagation();const L=fe.getState(),B={currentTime:L.currentTime,activeCompPath:M,elements:L.elements.map(Q=>({id:Q.id,start:Q.start,duration:Q.duration,track:Q.track,label:Q.label,compositionSrc:Q.compositionSrc})),compositionDimensions:N??void 0},$=j1t(e,t,n,s,r,B);u==null||u({title:e,prompt:$})},[e,t,n,s,r,M,N,u]);return p.jsxs("div",{className:"group/card rounded-md overflow-hidden cursor-pointer transition-colors bg-neutral-900 hover:bg-neutral-800",draggable:!0,onDragStart:j=>{j.dataTransfer.effectAllowed="copy",j.dataTransfer.setData(X1,JSON.stringify({name:t})),j.dataTransfer.setData("text/plain",t),k()},onPointerEnter:O,onPointerLeave:k,children:[p.jsxs("div",{className:"aspect-video w-full overflow-hidden relative",children:[h&&l?p.jsx("video",{src:l,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover"}):o?p.jsx("img",{src:o,alt:e,loading:"lazy",className:"w-full h-full object-cover"}):l?p.jsx("video",{src:l,muted:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}):p.jsx("div",{className:`w-full h-full flex items-center justify-center ${b.bg}`,children:p.jsx("span",{className:`text-[9px] font-medium ${b.text}`,children:s.toUpperCase()})}),p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-1.5 bg-black/60 opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 transition-opacity",children:[c&&p.jsxs("button",{type:"button",onClick:E,title:"Add to composition at current time",className:`flex items-center gap-1 px-3 py-1.5 rounded-md text-[10px] font-semibold transition-colors active:scale-[0.97] ${y==="failed"?"bg-red-500 text-white":"bg-white text-black hover:bg-neutral-200"}`,children:[p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:p.jsx("path",{d:"M12 5v14M5 12h14"})}),y==="adding"?"Adding…":y==="added"?"Added!":y==="failed"?"Failed":"Add"]}),p.jsxs("button",{type:"button",onClick:I,title:"Generate a prompt to paste into your AI agent",className:`flex items-center gap-1.5 px-3 ${c?"py-1":"py-1.5"} rounded-md transition-colors active:scale-[0.97] ${c?"bg-white/15 text-white/90 hover:bg-white/25 text-[9px]":"bg-white text-black hover:bg-neutral-200 text-[10px] font-semibold"}`,children:[p.jsxs("svg",{width:c?9:11,height:c?9:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),p.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Ask agent"]})]}),p.jsxs("div",{className:"absolute top-1 right-1 flex items-center gap-0.5 pointer-events-none",children:[w&&p.jsx("span",{className:"px-1 py-px rounded text-[7px] font-semibold text-purple-300 bg-purple-900/70",children:"WebGL"}),i!=null&&p.jsxs("span",{className:"px-1 py-px rounded text-[8px] font-medium text-white/80 bg-black/50",children:[i,"s"]})]})]}),p.jsxs("div",{className:"px-1.5 py-1.5",children:[p.jsx("div",{className:"text-[10px] font-medium text-neutral-200 truncate leading-tight",children:e}),p.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[p.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${b.dot}`}),p.jsx("span",{className:`text-[8px] ${b.text}`,children:(_=Ok.find(j=>j.id===s))==null?void 0:_.label})]})]})]})}const Bs=14,Vs="duotone";function K2e({path:t}){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"",n="flex-shrink-0";return e==="html"?p.jsx(gRe,{size:Bs,weight:Vs,color:"#E44D26",className:n}):e==="css"?p.jsx(mRe,{size:Bs,weight:Vs,color:"#264DE4",className:n}):e==="js"||e==="mjs"||e==="cjs"?p.jsx(xRe,{size:Bs,weight:Vs,color:"#F0DB4F",className:n}):e==="jsx"?p.jsx(bRe,{size:Bs,weight:Vs,color:"#61DAFB",className:n}):e==="ts"||e==="mts"?p.jsx(wRe,{size:Bs,weight:Vs,color:"#3178C6",className:n}):e==="tsx"?p.jsx(ORe,{size:Bs,weight:Vs,color:"#3178C6",className:n}):e==="json"?p.jsx(pRe,{size:Bs,weight:Vs,color:"#4ADE80",className:n}):e==="svg"?p.jsx(SRe,{size:Bs,weight:Vs,color:"#F97316",className:n}):e==="md"||e==="mdx"?p.jsx(vRe,{size:Bs,weight:Vs,color:"#9CA3AF",className:n}):e==="txt"?p.jsx(CRe,{size:Bs,weight:Vs,color:"#9CA3AF",className:n}):e==="png"?p.jsx(ARe,{size:Bs,weight:Vs,color:"#22C55E",className:n}):e==="jpg"||e==="jpeg"?p.jsx(yRe,{size:Bs,weight:Vs,color:"#22C55E",className:n}):e==="webp"||e==="gif"||e==="ico"?p.jsx(Due,{size:Bs,weight:Vs,color:"#22C55E",className:n}):e==="mp4"||e==="webm"||e==="mov"?p.jsx(kRe,{size:Bs,weight:Vs,color:"#A855F7",className:n}):e==="mp3"||e==="wav"||e==="ogg"||e==="m4a"?p.jsx(URe,{size:Bs,weight:Vs,color:"#3CE6AC",className:n}):e==="woff"||e==="woff2"||e==="ttf"||e==="otf"?p.jsx(ZRe,{size:Bs,weight:Vs,color:"#6B7280",className:n}):p.jsx(dRe,{size:Bs,weight:Vs,color:"#6B7280",className:n})}function F1t(t){const e={name:"",fullPath:"",children:new Map,isFile:!1};for(const n of t){const r=n.split("/");let i=e;for(let s=0;s<r.length;s++){const a=r[s],o=s===r.length-1,l=r.slice(0,s+1).join("/");i.children.has(a)||i.children.set(a,{name:a,fullPath:l,children:new Map,isFile:o}),i=i.children.get(a),o&&(i.isFile=!0)}}return e}function J2e(t){return Array.from(t.values()).sort((e,n)=>e.name==="index.html"?-1:n.name==="index.html"?1:!e.isFile&&n.isFile?-1:e.isFile&&!n.isFile?1:e.name.localeCompare(n.name))}function nV(t,e){if(!e)return!1;if(t.fullPath===e)return!0;for(const n of t.children.values())if(nV(n,e))return!0;return!1}const $1t=14;function B1t({state:t,onClose:e,onNewFile:n,onNewFolder:r,onRename:i,onDuplicate:s,onDelete:a}){const o=x.useRef(null),l=x.useRef(null);x.useEffect(()=>{var v;l.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const m=(v=o.current)==null?void 0:v.querySelector("button");m instanceof HTMLElement&&m.focus();const y=b=>{o.current&&!o.current.contains(b.target)&&e()},d=b=>{b.key==="Escape"&&e()};return document.addEventListener("mousedown",y),document.addEventListener("keydown",d),()=>{var b;document.removeEventListener("mousedown",y),document.removeEventListener("keydown",d),(b=l.current)==null||b.focus()}},[e]);const c=m=>{var w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp"&&m.key!=="Home"&&m.key!=="End")return;const y=o.current;if(!y)return;m.preventDefault();const d=Array.from(y.querySelectorAll("button"));if(d.length===0)return;const v=d.indexOf(document.activeElement);let b=0;m.key==="ArrowDown"?b=v<0?0:(v+1)%d.length:m.key==="ArrowUp"?b=v<0?d.length-1:(v-1+d.length)%d.length:m.key==="End"&&(b=d.length-1),(w=d[b])==null||w.focus()},u=Math.min(t.x,window.innerWidth-180),f=Math.min(t.y,window.innerHeight-200),h=t.targetIsFolder?t.targetPath:t.targetPath.includes("/")?t.targetPath.slice(0,t.targetPath.lastIndexOf("/")):"";return p.jsxs("div",{ref:o,role:"menu",onKeyDown:c,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[160px]",style:{left:u,top:f},children:[t.targetIsFolder&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 focus-visible:bg-neutral-800 active:bg-neutral-700 outline-none cursor-pointer text-left",onClick:()=>{n(t.targetPath),e()},children:[p.jsx(yX,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 focus-visible:bg-neutral-800 active:bg-neutral-700 outline-none cursor-pointer text-left",onClick:()=>{r(t.targetPath),e()},children:[p.jsx(Tue,{size:12,weight:"duotone",className:"text-neutral-500"}),"New Folder"]}),p.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),!t.targetIsFolder&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 focus-visible:bg-neutral-800 active:bg-neutral-700 outline-none cursor-pointer text-left",onClick:()=>{n(h),e()},children:[p.jsx(yX,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),p.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 focus-visible:bg-neutral-800 active:bg-neutral-700 outline-none cursor-pointer text-left",onClick:()=>{i(t.targetPath),e()},children:[p.jsx(BRe,{size:12,weight:"duotone",className:"text-neutral-500"}),"Rename"]}),!t.targetIsFolder&&p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 focus-visible:bg-neutral-800 active:bg-neutral-700 outline-none cursor-pointer text-left",onClick:()=>{s(t.targetPath),e()},children:[p.jsx(aue,{size:12,weight:"duotone",className:"text-neutral-500"}),"Duplicate"]}),p.jsx("div",{className:"border-t border-neutral-700 my-1"}),p.jsxs("button",{role:"menuitem",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-900/30 focus-visible:bg-red-900/30 active:bg-red-900/50 outline-none cursor-pointer text-left",onClick:()=>{a(t.targetPath),e()},children:[p.jsx(Kue,{size:12,weight:"duotone"}),"Delete"]})]})}function Ck({defaultValue:t,depth:e,isFolder:n,onCommit:r,onCancel:i}){const s=x.useRef(null),a=x.useRef(!1),[o,l]=x.useState(t),[c,u]=x.useState(null),f=d=>/[/\\]/.test(d)?"Name can't contain / or \\":d.includes("..")?"Name can't contain ..":null;x.useEffect(()=>{const d=s.current;if(d)if(d.focus(),t&&t.includes(".")){const v=t.lastIndexOf(".");d.setSelectionRange(0,v)}else d.select()},[t]);const h=d=>{a.current||(a.current=!0,r(d))},m=d=>{if(d.key==="Enter"){d.preventDefault();const v=o.trim();if(!v){i();return}const b=f(v);if(b){u(b);return}h(v)}else d.key==="Escape"&&(d.preventDefault(),i())},y=()=>{const d=o.trim();d&&d!==t&&!f(d)?h(d):i()};return p.jsxs("div",{className:"flex items-center gap-2 py-0.5 min-h-7",style:{paddingLeft:`${8+e*12+(n?0:14)}px`},children:[n?p.jsx(TRe,{size:$1t,weight:"duotone",color:"#6B7280",className:"flex-shrink-0"}):p.jsx(K2e,{path:o}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("input",{ref:s,value:o,onChange:d=>{l(d.target.value),c&&u(null)},onKeyDown:m,onBlur:y,"aria-invalid":c?!0:void 0,className:`w-full min-w-0 bg-neutral-800 text-neutral-200 text-xs px-1.5 py-0.5 rounded border outline-none ${c?"border-red-500/70":"border-neutral-600 focus:border-[#3CE6AC]"}`,spellCheck:!1}),c&&p.jsx("div",{className:"mt-0.5 text-[10px] text-red-400",role:"alert",children:c})]})]})}function V1t({name:t,isFolder:e,onConfirm:n,onCancel:r}){const i=x.useRef(null);return x.useEffect(()=>{const s=o=>{o.key==="Escape"&&r()},a=o=>{i.current&&!i.current.contains(o.target)&&r()};return document.addEventListener("keydown",s),document.addEventListener("mousedown",a),()=>{document.removeEventListener("keydown",s),document.removeEventListener("mousedown",a)}},[r]),p.jsxs("div",{ref:i,className:"mx-1 my-0.5 p-2 bg-neutral-800 border border-neutral-700 rounded-md text-xs",children:[p.jsx("p",{className:"text-neutral-300 mb-2",children:e?p.jsxs(p.Fragment,{children:["Delete folder ",p.jsx("span",{className:"font-medium text-neutral-100",children:t})," and everything inside it?"]}):p.jsxs(p.Fragment,{children:["Delete ",p.jsx("span",{className:"font-medium text-neutral-100",children:t}),"?"]})}),p.jsxs("div",{className:"flex gap-1.5",children:[p.jsx("button",{onClick:r,className:"flex-1 px-2 py-1 rounded bg-neutral-700 text-neutral-300 hover:bg-neutral-600 transition-colors",children:"Cancel"}),p.jsx("button",{onClick:n,className:"flex-1 px-2 py-1 rounded bg-red-900/60 text-red-300 hover:bg-red-800/60 transition-colors",children:"Delete"})]})]})}const c7=x.memo(function({node:e,depth:n,activeFile:r,onSelectFile:i,onContextMenu:s,inlineInput:a,onDragStart:o,lintInfo:l}){const c=e.fullPath===r;return(a==null?void 0:a.mode)==="rename"&&a.originalPath===e.fullPath?p.jsx(Ck,{defaultValue:a.originalName??e.name,depth:n,isFolder:!1,onCommit:f=>{var h;(h=a==null?void 0:a.onCommit)==null||h.call(a,f)},onCancel:()=>{var f;(f=a==null?void 0:a.onCancel)==null||f.call(a)}}):p.jsxs("button",{draggable:!0,onDragStart:f=>o(f,e.fullPath),onClick:()=>i(e.fullPath),onContextMenu:f=>{f.preventDefault(),s(f,e.fullPath,!1)},className:`w-full flex items-center gap-2 py-1 min-h-7 text-left transition-all text-xs ${c?"bg-neutral-800/60 text-neutral-200":"text-neutral-500 hover:bg-neutral-800/30 hover:text-neutral-300"}`,style:{paddingLeft:`${8+n*12+14}px`},children:[p.jsx(K2e,{path:e.name}),p.jsx("span",{className:"truncate flex-1",children:e.name}),l&&l.count>0&&p.jsx("span",{className:"flex-shrink-0 min-w-[16px] rounded-full bg-amber-500/20 px-1 text-[8px] font-bold text-amber-400 text-center mr-1",title:l.messages.join(`
|
|
338
|
-
`),children:l.count})]})}),H1t=x.memo(function t({node:e,depth:n,activeFile:r,onSelectFile:i,defaultOpen:s,onContextMenu:a,inlineInput:o,onDragStart:l,onDragOver:c,onDrop:u,onDragLeave:f,dragOverFolder:h,lintFindingsByFile:m}){const[y,d]=x.useState(s),v=x.useCallback(()=>d(E=>!E),[]),b=x.useMemo(()=>J2e(e.children),[e.children]),w=y?sfe:afe,O=h===e.fullPath;return(o==null?void 0:o.mode)==="rename"&&o.originalPath===e.fullPath?p.jsx(Ck,{defaultValue:o.originalName??e.name,depth:n,isFolder:!0,onCommit:E=>{var M;(M=o==null?void 0:o.onCommit)==null||M.call(o,E)},onCancel:()=>{var E;(E=o==null?void 0:o.onCancel)==null||E.call(o)}}):p.jsxs(p.Fragment,{children:[p.jsxs("button",{draggable:!0,onDragStart:E=>l(E,e.fullPath),onClick:v,onContextMenu:E=>{E.preventDefault(),a(E,e.fullPath,!0)},onDragOver:E=>{E.preventDefault(),E.stopPropagation(),c(E,e.fullPath)},onDrop:E=>{E.preventDefault(),E.stopPropagation(),u(E,e.fullPath)},onDragLeave:f,className:`w-full flex items-center gap-1.5 px-2.5 py-1 min-h-7 text-left text-xs text-neutral-400 hover:bg-neutral-800/30 hover:text-neutral-300 transition-colors ${O?"bg-[#3CE6AC]/10 outline outline-1 outline-[#3CE6AC]/40":""}`,style:{paddingLeft:`${8+n*12}px`},children:[p.jsx(w,{size:10,className:"flex-shrink-0 text-neutral-600"}),p.jsx("span",{className:"truncate font-medium",children:e.name})]}),y&&p.jsxs(p.Fragment,{children:[o&&(o.mode==="new-file"||o.mode==="new-folder")&&o.parentPath===e.fullPath&&p.jsx(Ck,{defaultValue:"",depth:n+1,isFolder:o.mode==="new-folder",onCommit:E=>{var M;(M=o==null?void 0:o.onCommit)==null||M.call(o,E)},onCancel:()=>{var E;(E=o==null?void 0:o.onCancel)==null||E.call(o)}}),b.map(E=>E.isFile&&E.children.size===0?p.jsx(c7,{node:E,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:a,inlineInput:o,onDragStart:l,lintInfo:m==null?void 0:m.get(E.fullPath)},E.fullPath):E.children.size>0?p.jsx(t,{node:E,depth:n+1,activeFile:r,onSelectFile:i,defaultOpen:nV(E,r),onContextMenu:a,inlineInput:o,onDragStart:l,onDragOver:c,onDrop:u,onDragLeave:f,dragOverFolder:h,lintFindingsByFile:m},E.fullPath):p.jsx(c7,{node:E,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:a,inlineInput:o,onDragStart:l,lintInfo:m==null?void 0:m.get(E.fullPath)},E.fullPath))]})]})}),Q1t=x.memo(function({files:e,activeFile:n,onSelectFile:r,onCreateFile:i,onCreateFolder:s,onDeleteFile:a,onRenameFile:o,onDuplicateFile:l,onMoveFile:c,onImportFiles:u,lintFindingsByFile:f}){const h=x.useMemo(()=>F1t(e),[e]),m=x.useMemo(()=>J2e(h.children),[h]),[y,d]=x.useState(null),[v,b]=x.useState(null),[w,O]=x.useState(null),[k,E]=x.useState(null),M=x.useRef(null),N=!!(i||s||a||o||l),I=x.useCallback((F,U,Z)=>{N&&(F.preventDefault(),d({x:F.clientX,y:F.clientY,targetPath:U,targetIsFolder:Z}))},[N]),_=x.useCallback(()=>d(null),[]),j=x.useCallback(F=>{b({parentPath:F,mode:"new-file",onCommit:U=>{const Z=F?`${F}/${U}`:U;i==null||i(Z),b(null)},onCancel:()=>b(null)})},[i]),L=x.useCallback(F=>{b({parentPath:F,mode:"new-folder",onCommit:U=>{const Z=F?`${F}/${U}`:U;s==null||s(Z),b(null)},onCancel:()=>b(null)})},[s]),B=x.useCallback(F=>{const U=F.includes("/")?F.slice(F.lastIndexOf("/")+1):F,Z=F.includes("/")?F.slice(0,F.lastIndexOf("/")):"";b({parentPath:Z,mode:"rename",originalPath:F,originalName:U,onCommit:K=>{if(K!==U){const ee=Z?`${Z}/${K}`:K;o==null||o(F,ee)}b(null)},onCancel:()=>b(null)})},[o]),$=x.useCallback(F=>{l==null||l(F)},[l]),Q=x.useCallback(F=>{O({path:F,isFolder:(y==null?void 0:y.targetIsFolder)??!1,x:(y==null?void 0:y.x)??window.innerWidth/2,y:(y==null?void 0:y.y)??window.innerHeight/2})},[y]),Y=x.useCallback(()=>{w&&(a==null||a(w.path),O(null))},[w,a]),W=x.useCallback(()=>{O(null)},[]),J=x.useCallback((F,U)=>{M.current=U,F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",U)},[]),ne=x.useCallback((F,U)=>{E(U)},[]),le=x.useCallback((F,U)=>{if(F.dataTransfer.files.length>0&&!M.current){F.preventDefault(),u==null||u(F.dataTransfer.files,U||void 0),E(null);return}const Z=M.current;if(!Z||!c){E(null);return}const K=Z.includes("/")?Z.slice(Z.lastIndexOf("/")+1):Z,ee=U?`${U}/${K}`:K;ee!==Z&&!U.startsWith(Z+"/")&&c(Z,ee),E(null),M.current=null},[c,u]),ie=x.useCallback(()=>{E(null)},[]),q=x.useCallback(F=>{N&&F.target===F.currentTarget&&(F.preventDefault(),d({x:F.clientX,y:F.clientY,targetPath:"",targetIsFolder:!0}))},[N]);return p.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[N&&p.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-b border-neutral-800/50 flex-shrink-0",children:[p.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-neutral-600 uppercase",children:"Files"}),p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx("button",{onClick:()=>j(""),className:"p-1.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 active:scale-[0.97] transition-colors",title:"New File","aria-label":"New File",children:p.jsx(zue,{size:12,weight:"bold"})}),p.jsx("button",{onClick:()=>L(""),className:"p-1.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 active:scale-[0.97] transition-colors",title:"New Folder","aria-label":"New Folder",children:p.jsx(Tue,{size:12,weight:"duotone"})})]})]}),p.jsxs("div",{className:`flex-1 overflow-y-auto py-1 transition-colors ${k===""?"bg-[#3CE6AC]/5 outline outline-1 outline-[#3CE6AC]/30 -outline-offset-1":""}`,onContextMenu:q,onDragOver:F=>{F.preventDefault(),F.target===F.currentTarget&&E("")},onDragLeave:F=>{F.target===F.currentTarget&&E(null)},onDrop:F=>{F.preventDefault(),le(F,"")},children:[v&&(v.mode==="new-file"||v.mode==="new-folder")&&v.parentPath===""&&p.jsx(Ck,{defaultValue:"",depth:0,isFolder:v.mode==="new-folder",onCommit:F=>{var U;return(U=v.onCommit)==null?void 0:U.call(v,F)},onCancel:()=>{var F;return(F=v.onCancel)==null?void 0:F.call(v)}}),m.length===0&&!v&&p.jsxs("div",{className:"px-3 py-4 text-center text-[11px] text-neutral-600",children:["No files yet",N?" — use + above to create one":"","."]}),m.map(F=>F.isFile&&F.children.size===0?p.jsx(c7,{node:F,depth:0,activeFile:n,onSelectFile:r,onContextMenu:I,inlineInput:v,onDragStart:J,lintInfo:f==null?void 0:f.get(F.fullPath)},F.fullPath):p.jsx(H1t,{node:F,depth:0,activeFile:n,onSelectFile:r,defaultOpen:nV(F,n),onContextMenu:I,inlineInput:v,onDragStart:J,onDragOver:ne,onDrop:le,onDragLeave:ie,dragOverFolder:k,lintFindingsByFile:f},F.fullPath))]}),w&&p.jsx("div",{className:"fixed z-50 w-56",style:{left:Math.min(w.x,window.innerWidth-240),top:Math.min(w.y,window.innerHeight-120)},children:p.jsx(V1t,{name:w.path.includes("/")?w.path.slice(w.path.lastIndexOf("/")+1):w.path,isFolder:w.isFolder,onConfirm:Y,onCancel:W})}),y&&p.jsx(B1t,{state:y,onClose:_,onNewFile:j,onNewFolder:L,onRename:B,onDuplicate:$,onDelete:Q})]})}),eve="hf-studio-sidebar-tab",Ate=[{id:"code",label:"Code",tooltip:"Source code editor"},{id:"compositions",label:"Comps",tooltip:"Compositions and sub-compositions"},{id:"assets",label:"Assets",tooltip:"Videos, images, audio, fonts"},{id:"blocks",label:"Catalog",tooltip:"Browse blocks and components"}];function z1t(){var e;let t=null;try{t=((e=qA())==null?void 0:e.getItem(eve))??null}catch{}return t==="assets"?"assets":t==="code"?"code":t==="blocks"?"blocks":"compositions"}const Z1t=x.memo(x.forwardRef(function({width:e=240,projectId:n,compositions:r,assets:i,activeComposition:s,onSelectComposition:a,onImportFiles:o,fileTree:l,editingFile:c,onSelectFile:u,onCreateFile:f,onCreateFolder:h,onDeleteFile:m,onRenameFile:y,onDuplicateFile:d,onMoveFile:v,codeChildren:b,onRenderComposition:w,isRendering:O,onLint:k,linting:E,lintFindingCount:M,lintFindingsByFile:N,onToggleCollapse:I,onAddBlock:_,onPreviewBlock:j,takeoverContent:L,onAddAssetToTimeline:B,onAddCompositionToTimeline:$},Q){const[Y,W]=x.useState(z1t),J=x.useRef(Y);J.current=Y;const ne=x.useRef(null),le=x.useCallback(F=>{var U;W(F);try{(U=qA())==null||U.setItem(eve,F)}catch{}Pt("tab_switch",{panel:"left_sidebar",tab:F})},[]),ie=x.useCallback(()=>J.current,[]);x.useImperativeHandle(Q,()=>({selectTab:le,getTab:ie}),[le,ie]);const q=x.useCallback(F=>{var ee,re;if(F.key!=="ArrowLeft"&&F.key!=="ArrowRight")return;F.preventDefault();const U=Ate.map(z=>z.id),Z=U.indexOf(J.current),K=U[(Z+(F.key==="ArrowRight"?1:-1)+U.length)%U.length];le(K),(re=(ee=ne.current)==null?void 0:ee.querySelector(`[data-tab-id="${K}"]`))==null||re.focus()},[le]);return p.jsx("div",{className:"flex flex-col h-full overflow-hidden rounded-lg border border-neutral-800/50 bg-neutral-950",style:{width:e},children:L?p.jsx("div",{className:"flex min-h-0 flex-1",children:L}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"border-b border-neutral-800/50 px-3 py-3 flex-shrink-0",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{ref:ne,role:"tablist","aria-label":"Sidebar panels",onKeyDown:q,className:"grid min-w-0 flex-1 gap-0.5 rounded-[18px] bg-neutral-900 p-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",style:{gridTemplateColumns:"1fr 1fr 1fr 1fr"},children:Ate.map(F=>p.jsx(br,{label:F.tooltip,side:"bottom",children:p.jsx("button",{type:"button",role:"tab","data-tab-id":F.id,"aria-selected":Y===F.id,"aria-controls":`sidebar-panel-${F.id}`,tabIndex:Y===F.id?0:-1,onClick:()=>le(F.id),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all active:scale-[0.97] ${Y===F.id?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:F.label})},F.id))}),I&&p.jsx("button",{type:"button",onClick:I,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Hide sidebar","aria-label":"Hide sidebar",children:p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"m14 7-5 5 5 5"}),p.jsx("path",{d:"M19 4v16"})]})})]})}),Y==="compositions"&&p.jsx("div",{id:"sidebar-panel-compositions",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(i1t,{projectId:n,compositions:r,activeComposition:s,onSelect:a,onAddToTimeline:$,onRenderComposition:w,isRendering:O,lintFindingsByFile:N})}),Y==="assets"&&p.jsx("div",{id:"sidebar-panel-assets",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(P1t,{projectId:n,assets:i,onImport:o,onDelete:m,onRename:y,onAddAssetToTimeline:B})}),Y==="code"&&p.jsxs("div",{id:"sidebar-panel-code",role:"tabpanel",className:"flex flex-1 min-h-0",children:[((l==null?void 0:l.length)??0)>0&&p.jsx("div",{className:"w-[160px] flex-shrink-0 border-r border-neutral-800 overflow-y-auto",children:p.jsx(Q1t,{files:l??[],activeFile:(c==null?void 0:c.path)??null,onSelectFile:u??(()=>{}),onCreateFile:f,onCreateFolder:h,onDeleteFile:m,onRenameFile:y,onDuplicateFile:d,onMoveFile:v,onImportFiles:o,lintFindingsByFile:N})}),p.jsx("div",{className:"flex-1 overflow-hidden min-w-0",children:b??p.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to edit"})})]}),Y==="blocks"&&p.jsx("div",{id:"sidebar-panel-blocks",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(_1t,{onAddBlock:_,onPreviewBlock:j})}),k&&p.jsx("div",{className:"border-t border-neutral-800 p-2 flex-shrink-0",children:p.jsxs("button",{onClick:k,disabled:E,className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md text-[11px] font-medium text-neutral-500 enabled:hover:text-amber-300 enabled:hover:bg-neutral-800 enabled:active:scale-[0.98] transition-colors disabled:opacity-40",children:[p.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("path",{d:"M9 11l3 3L22 4"}),p.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),E?"Linting…":"Lint",!E&&M!=null&&M>0&&p.jsx("span",{className:"ml-1 min-w-[16px] rounded-full bg-amber-500/20 px-1 text-[9px] font-bold text-amber-400",children:M})]})})]})})}));function G1t({name:t,filePath:e}){return p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600","aria-hidden":"true",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12",strokeLinecap:"round"}),p.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16",strokeLinecap:"round"})]}),p.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:t}),p.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),p.jsx("span",{className:"text-[10px] text-neutral-500",children:"Couldn't load this file — it may be missing or corrupt"})]})}function U1t({projectId:t,filePath:e}){const n=`/api/projects/${t}/preview/${e}`,r=e.split("/").pop()??e,[i,s]=x.useState(null),a=i===e,o=()=>s(e);return a?p.jsx(G1t,{name:r,filePath:e}):m0.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[p.jsx("img",{src:n,alt:r,onError:o,className:"max-w-full max-h-[70%] object-contain rounded border border-neutral-800"}),p.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):oS.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[p.jsx("video",{src:n,controls:!0,onError:o,className:"max-w-full max-h-[70%] rounded border border-neutral-800"}),p.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):Nj.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-3",children:[p.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[p.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),p.jsx("audio",{src:n,controls:!0,onError:o,className:"w-full max-w-[280px]"}),p.jsx("span",{className:"text-[11px] text-neutral-500 font-mono",children:e})]}):p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[p.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:r}),p.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),p.jsx("span",{className:"text-[10px] text-neutral-600",children:"Binary file — preview not available"})]})}const tve="hf-studio-render-settings";function nve(){try{const t=localStorage.getItem(tve);if(t){const e=JSON.parse(t);return{format:["mp4","webm","mov"].includes(e.format)?e.format:"mp4",quality:["draft","standard","high"].includes(e.quality)?e.quality:"standard",fps:[24,30,60].includes(e.fps)?e.fps:30}}}catch{}return{format:"mp4",quality:"standard",fps:30}}function kD(t,e,n){try{localStorage.setItem(tve,JSON.stringify({format:t,quality:e,fps:n}))}catch{}}function X1t({leftSidebarRef:t,onSelectComposition:e,onAddBlock:n,onPreviewBlock:r,onLint:i,linting:s,lintFindingCount:a,lintFindingsByFile:o,onAddAssetToTimeline:l,onAddCompositionToTimeline:c}){const{effectiveLeftCollapsed:u,leftWidth:f,adjustPanelWidth:h,toggleLeftSidebar:m,handlePanelResizeStart:y,handlePanelResizeMove:d,handlePanelResizeEnd:v,setRightPanelTab:b,setRightCollapsed:w}=Y$(),{projectId:O,renderQueue:k,waitForPendingDomEditSaves:E}=zl(),{compositions:M,assets:N,editingFile:I,fileTree:_,revealSourceOffset:j,handleFileSelect:L,handleCreateFile:B,handleCreateFolder:$,handleDeleteFile:Q,handleRenameFile:Y,handleDuplicateFile:W,handleMoveFile:J,handleImportFiles:ne,handleContentChange:le}=$0(),ie=x.useCallback(async q=>{if(k.ffmpegMissing){b("renders"),w(!1);return}await E();const{format:F,quality:U,fps:Z}=nve();await k.startRender({composition:q,format:F,quality:U,fps:Z})},[k,E,b,w]);return u?p.jsx("div",{className:"mr-0.5 flex w-10 flex-shrink-0 flex-col items-center rounded-lg border border-neutral-800/50 bg-neutral-950 pt-1",children:p.jsx("button",{type:"button",onClick:m,className:"flex h-8 w-8 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Show sidebar","aria-label":"Show sidebar",children:p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M5 4v16"}),p.jsx("path",{d:"m10 7 5 5-5 5"})]})})}):p.jsxs(p.Fragment,{children:[p.jsx(Z1t,{ref:t,width:f,projectId:O,compositions:M,assets:N,activeComposition:(I==null?void 0:I.path)??null,onSelectComposition:e,fileTree:_,editingFile:I,onSelectFile:L,onCreateFile:B,onCreateFolder:$,onDeleteFile:Q,onRenameFile:Y,onDuplicateFile:W,onMoveFile:J,onImportFiles:async(q,F)=>{await ne(q,F)},codeChildren:I?Pae(I.path)?p.jsx(U1t,{projectId:O,filePath:I.path}):I.content==null?p.jsxs("div",{className:"flex h-full items-center justify-center text-[11px] text-neutral-600",children:["Loading ",I.path,"…"]}):p.jsx(B2e,{content:I.content,filePath:I.path,onChange:le,revealOffset:j}):void 0,onRenderComposition:ie,isRendering:k.isRendering,onLint:i,linting:s,lintFindingCount:a,lintFindingsByFile:o,onToggleCollapse:m,onAddBlock:n,onPreviewBlock:r,onAddAssetToTimeline:l,onAddCompositionToTimeline:c}),p.jsxs("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",tabIndex:0,className:"group relative w-[3px] flex-shrink-0 cursor-col-resize outline-none focus-visible:bg-studio-accent/20",style:{touchAction:"none"},onPointerDown:q=>y("left",q),onPointerMove:d,onPointerUp:v,onPointerCancel:v,onKeyDown:q=>{if(q.key!=="ArrowLeft"&&q.key!=="ArrowRight")return;q.preventDefault();const F=q.key==="ArrowLeft"?-16:16;h("left",F)},children:[p.jsx("div",{className:"absolute inset-y-0 -left-[2px] w-[13px]"}),p.jsx("div",{className:"absolute top-1/2 left-0 h-[52px] w-[3px] -translate-y-1/2 bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})]})]})}const W1t=25,q1t=400,Y1t='[data-preview-pan-surface="true"]',kk=48,rve={zoomPercent:100,panX:0,panY:0},K1t=.007,Ste=10;function Gh(t){return Math.round(t*1e4)/1e4}function Df(t){return Number.isFinite(t)?Math.min(q1t,Math.max(W1t,t)):100}function J1t(t){return t===1}function ED(t,e){return t instanceof Element?e!=null&&e.contains(t)?!0:!!t.closest(Y1t):!1}function egt(t,e){if(!Number.isFinite(t))return Df(e);const r=-(Math.abs(t)>Ste?Ste*Math.sign(t):t)*K1t,i=Df(e);return Df(i*Math.exp(r))}function u7(t){const e=Df(t.zoomPercent)/100,n=t.contentWidth??t.viewportWidth,r=t.contentHeight??t.viewportHeight,i=Math.max(0,(n*e-t.viewportWidth)/2)+kk,s=Math.max(0,(r*e-t.viewportHeight)/2)+kk;return{panX:Math.min(i,Math.max(-i,t.panX)),panY:Math.min(s,Math.max(-s,t.panY))}}function tgt(t,e,n,r,i,s,a){const o=Df(n)/100,l=Math.abs(s*o-r)/2+kk,c=Math.abs(a*o-i)/2+kk;return{panX:Math.min(l,Math.max(-l,t)),panY:Math.min(c,Math.max(-c,e))}}function ngt(t){const e=Df(t.state.zoomPercent),n=egt(t.deltaY,e),r=e/100,i=n/100;let s=t.state.panX,a=t.state.panY;if(t.cursorX!==void 0&&t.cursorY!==void 0){const u=i/r;s=t.cursorX*(1-u)+s*u,a=t.cursorY*(1-u)+a*u}const o=t.contentWidth??t.viewportWidth,l=t.contentHeight??t.viewportHeight,c=tgt(s,a,n,t.viewportWidth,t.viewportHeight,o,l);return{zoomPercent:n,...c}}function rgt(t){const e=u7({panX:t.state.panX-t.deltaX,panY:t.state.panY-t.deltaY,zoomPercent:t.state.zoomPercent,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,contentWidth:t.contentWidth,contentHeight:t.contentHeight});return{zoomPercent:Df(t.state.zoomPercent),...e}}function igt({projectId:t,directUrl:e}){return e??t}const sgt=1200,agt=200,wte=16;function TD(t){return Math.abs(t.zoomPercent-100)<.5&&Math.abs(t.panX)<.1&&Math.abs(t.panY)<.1}function ogt(){const t=to().previewZoom;return t?{zoomPercent:Df(t.zoomPercent),panX:t.panX,panY:t.panY}:rve}function lgt(t){try{const e=t==null?void 0:t.contentDocument,n=(e==null?void 0:e.querySelector("[data-composition-id][data-width][data-height]"))??(e==null?void 0:e.querySelector("[data-width][data-height]"));if(!n)return null;const r=Number.parseInt(n.getAttribute("data-width")??"",10),i=Number.parseInt(n.getAttribute("data-height")??"",10);return!Number.isFinite(r)||r<=0||!Number.isFinite(i)||i<=0?null:{width:r,height:i}}catch{return null}}function Ote(t,e,n,r){const i=Math.max(0,t-wte),s=Math.max(0,e-wte),a=n&&n.width>0&&n.height>0?n.width/n.height:r?9/16:16/9;if(i===0||s===0)return{width:0,height:0};let o=i,l=o/a;return l>s&&(l=s,o=l*a),{width:Gh(o),height:Gh(l)}}const cgt=x.memo(function({projectId:e,iframeRef:n,onIframeLoad:r,onCompositionLoadingChange:i,portrait:s,directUrl:a,suppressLoadingOverlay:o,onStageRef:l,onCompositionSizeChange:c}){const u=igt({projectId:e,directUrl:a}),f=x.useRef(null),h=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{l==null||l(h)},[l]);const[y,d]=x.useState(null),[v,b]=x.useState(()=>Ote(0,0,null,s)),w=x.useRef(ogt()),[O,k]=x.useState(()=>w.current),E=x.useRef(null),M=x.useRef(null),N=x.useRef(null),I=x.useRef(!1),_=x.useRef(null);x.useEffect(()=>()=>{N.current&&clearTimeout(N.current),M.current&&clearTimeout(M.current)},[]),x.useEffect(()=>{const ie=f.current;if(!ie)return;const q=()=>{const U=ie.getBoundingClientRect();b(Ote(U.width,U.height,y,s))};q();const F=new ResizeObserver(q);return F.observe(ie),()=>F.disconnect()},[y,s]);const j=x.useRef(c);j.current=c;const L=x.useCallback(()=>{const ie=lgt(m.current);d(q=>(q==null?void 0:q.width)===(ie==null?void 0:ie.width)&&(q==null?void 0:q.height)===(ie==null?void 0:ie.height)?q:ie)},[]);x.useEffect(()=>{var ie;(ie=j.current)==null||ie.call(j,y)},[y]);const B=x.useCallback(ie=>{m.current=ie,n.current=ie},[n]),$=x.useRef(v);$.current=v;const Q=x.useCallback(ie=>{const q=h.current;if(!q)return;const F=Gh(ie.zoomPercent/100),U=Gh(ie.panX),Z=Gh(ie.panY);q.style.transform=`translate3d(${U}px, ${Z}px, 0) scale(${F})`},[]),Y=x.useCallback((ie,q)=>{const F={zoomPercent:Df(ie.zoomPercent),panX:Number.isFinite(ie.panX)?ie.panX:0,panY:Number.isFinite(ie.panY)?ie.panY:0};if(w.current=F,q){const U=E.current;U&&(I.current||(I.current=!0,U.style.opacity="1"),U.textContent=TD(F)?"Fit":`${Math.round(F.zoomPercent)}%`)}Q(F),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{I.current=!1;const U=w.current;if(Ol({previewZoom:U}),k(Z=>Z.zoomPercent===U.zoomPercent&&Z.panX===U.panX&&Z.panY===U.panY?Z:U),q){const Z=E.current;Z&&(Z.textContent=TD(U)?"Fit":`${Math.round(U.zoomPercent)}%`,M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{E.current&&(E.current.style.opacity="0")},sgt))}},agt)},[Q]),W=x.useCallback(ie=>Y(ie,!0),[Y]),J=x.useCallback(ie=>Y(ie,!1),[Y]),ne=x.useCallback(()=>{const ie=w.current;if(Math.abs(ie.zoomPercent-100)>.5||Math.abs(ie.panX)>.1||Math.abs(ie.panY)>.1){const q=f.current,F=q==null?void 0:q.getBoundingClientRect(),U=$.current;if(F&&F.width>0&&F.height>0&&U.width>0&&U.height>0){const Z=u7({panX:ie.panX,panY:ie.panY,zoomPercent:ie.zoomPercent,viewportWidth:F.width,viewportHeight:F.height,contentWidth:U.width,contentHeight:U.height});w.current={...ie,...Z}}Q(w.current)}},[Q]);x.useEffect(()=>{const ie=f.current;if(!ie)return;const q=F=>{const U=ie.getBoundingClientRect();if(F.clientX<U.left||F.clientX>U.right||F.clientY<U.top||F.clientY>U.bottom)return;if(F.ctrlKey||F.metaKey){F.preventDefault(),F.stopPropagation();const re=$.current,z=F.clientX-(U.left+U.width/2),H=F.clientY-(U.top+U.height/2),se=ngt({state:w.current,deltaY:F.deltaY,viewportWidth:U.width,viewportHeight:U.height,contentWidth:re.width,contentHeight:re.height,cursorX:z,cursorY:H});W(se);return}if(!ED(F.target,h.current))return;F.preventDefault(),F.stopPropagation();const K=$.current,ee=rgt({state:w.current,deltaX:F.deltaX,deltaY:F.deltaY,viewportWidth:U.width,viewportHeight:U.height,contentWidth:K.width,contentHeight:K.height});J(ee)};return document.addEventListener("wheel",q,{passive:!1,capture:!0}),()=>document.removeEventListener("wheel",q,{capture:!0})},[W,J]),x.useEffect(()=>{const ie=(K,ee)=>{const re=f.current;if(!re)return null;const z=re.getBoundingClientRect();return K<z.left||K>z.right||ee<z.top||ee>z.bottom?null:z},q=K=>{ie(K.clientX,K.clientY)&&ED(K.target,h.current)&&J1t(K.button)&&(K.preventDefault(),_.current={pointerId:K.pointerId,startX:K.clientX,startY:K.clientY,originX:w.current.panX,originY:w.current.panY})},F=K=>{const ee=_.current,re=f.current;if(!ee||!re||ee.pointerId!==K.pointerId)return;K.preventDefault();const z=re.getBoundingClientRect(),H=$.current,se=u7({panX:ee.originX+K.clientX-ee.startX,panY:ee.originY+K.clientY-ee.startY,zoomPercent:w.current.zoomPercent,viewportWidth:z.width,viewportHeight:z.height,contentWidth:H.width,contentHeight:H.height});J({...w.current,...se})},U=K=>{var ee;((ee=_.current)==null?void 0:ee.pointerId)===K.pointerId&&(_.current=null)},Z=K=>{K.button===1&&ie(K.clientX,K.clientY)&&ED(K.target,h.current)&&K.preventDefault()};return document.addEventListener("pointerdown",q,{capture:!0}),document.addEventListener("pointermove",F,{capture:!0}),document.addEventListener("pointerup",U,{capture:!0}),document.addEventListener("pointercancel",U,{capture:!0}),document.addEventListener("auxclick",Z,{capture:!0}),()=>{document.removeEventListener("pointerdown",q,{capture:!0}),document.removeEventListener("pointermove",F,{capture:!0}),document.removeEventListener("pointerup",U,{capture:!0}),document.removeEventListener("pointercancel",U,{capture:!0}),document.removeEventListener("auxclick",Z,{capture:!0})}},[J]);const le=w.current;return p.jsx("div",{className:"flex flex-col h-full min-h-0",children:p.jsxs("div",{ref:f,className:"relative flex-1 flex items-center justify-center p-2 overflow-hidden min-h-0 outline-none focus:ring-1 focus:ring-studio-accent/40 bg-neutral-950",tabIndex:0,"aria-label":"Composition preview",children:[p.jsx("div",{className:"absolute inset-2 flex items-center justify-center pointer-events-none",children:p.jsxs("div",{ref:h,className:"relative shrink-0 pointer-events-auto",style:{width:`${v.width}px`,height:`${v.height}px`,transform:`translate3d(${Gh(le.panX)}px, ${Gh(le.panY)}px, 0) scale(${Gh(le.zoomPercent/100)})`,transformOrigin:"center center"},"data-testid":"preview-zoom-stage",children:[(a==null?void 0:a.includes("/components/"))&&p.jsx(wI,{projectId:e,onLoad:()=>{},portrait:s,suppressLoadingOverlay:!0,style:{position:"absolute",inset:0,zIndex:0}},`backdrop-${e}`),p.jsx(wI,{ref:B,projectId:a?void 0:e,directUrl:a,onLoad:()=>{L(),r(),ne()},onCompositionLoadingChange:i,portrait:s,suppressLoadingOverlay:o,style:a!=null&&a.includes("/components/")?{position:"absolute",inset:0,zIndex:1}:void 0},u)]})}),p.jsx("div",{ref:E,className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 rounded-lg px-4 py-2 text-sm font-mono tabular-nums text-white/90 bg-black/60 backdrop-blur-sm shadow-lg",style:{opacity:0,transition:"opacity 200ms ease-in"},"aria-live":"polite"}),!TD(O)&&p.jsxs("button",{type:"button",className:"absolute bottom-3 right-3 z-50 rounded-md px-2.5 py-1 text-xs font-medium text-white/80 bg-black/50 backdrop-blur-sm hover:bg-black/70 hover:text-white transition-colors",onClick:()=>W(rve),"aria-label":"Reset zoom to fit","data-testid":"preview-reset-zoom",children:[Math.round(O.zoomPercent),"% — Reset"]})]})})});function ugt({stack:t,onNavigate:e}){return t.length<=1?null:p.jsxs("nav",{"aria-label":"Composition navigation",className:"flex items-center gap-1 px-2 h-8 border-b border-neutral-800/50 bg-neutral-900/50 flex-shrink-0",children:[p.jsx("button",{type:"button",onClick:()=>{var n;Pt("navigation",{action:"back",target:(n=t[t.length-2])==null?void 0:n.label}),e(t.length-2)},className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs text-neutral-400 hover:text-white hover:bg-neutral-800 active:scale-[0.98] transition-colors",title:"Back (Esc, or double-click empty timeline)","aria-label":"Back to parent composition",children:p.jsx(oRe,{size:12,weight:"bold"})}),t.map((n,r)=>{const i=r===t.length-1;return p.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&p.jsx(FL,{size:10,className:"text-neutral-600 flex-shrink-0"}),i?p.jsx("span",{className:"text-xs text-neutral-200 font-medium",children:n.label}):p.jsx("button",{type:"button",onClick:()=>{Pt("navigation",{action:"breadcrumb",target:n.label}),e(r)},className:"text-xs text-neutral-500 hover:text-neutral-200 transition-colors",children:n.label})]},n.id)})]})}function fgt(t){try{const e=JSON.parse(t);return e.name?e:null}catch{return null}}function hgt(t,e,n,r,i){if(n.width===0||n.height===0)return null;const s=(t-n.left)/n.width,a=(e-n.top)/n.height,o=(r==null?void 0:r.width)??(i?1080:1920),l=(r==null?void 0:r.height)??(i?1920:1080);return{left:Math.max(0,Math.min(s*o,o)),top:Math.max(0,Math.min(a*l,l))}}function dgt(t,e){var i,s;const n=((i=e.dimensions)==null?void 0:i.width)??0,r=((s=e.dimensions)==null?void 0:s.height)??0;return{left:Math.max(0,t.left-n/2),top:Math.max(0,t.top-r/2)}}function pgt({portrait:t,compositionSize:e,stageRef:n,onBlockDrop:r}){const[i,s]=x.useState(!1),a=x.useRef(0),o=x.useCallback(f=>{r&&f.dataTransfer.types.includes(X1)&&(a.current+=1,s(!0))},[r]),l=x.useCallback(f=>{r&&f.dataTransfer.types.includes(X1)&&(f.preventDefault(),f.dataTransfer.dropEffect="copy")},[r]),c=x.useCallback(()=>{a.current=Math.max(0,a.current-1),a.current===0&&s(!1)},[]),u=x.useCallback(f=>{if(a.current=0,s(!1),!r)return;const h=f.dataTransfer.getData(X1);if(!h)return;f.preventDefault();const m=fgt(h),y=n.current;if(!m||!y)return;const d=hgt(f.clientX,f.clientY,y.getBoundingClientRect(),e,t);d&&r(m.name,dgt(d,m))},[r,n,e,t]);return{isDragOver:i,handleDragEnter:o,handleDragOver:l,handleDragLeave:c,handleDrop:u}}function mgt({projectId:t,activeCompositionPath:e,onCompositionChange:n}){const[r,i]=x.useState([{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`}]),s=x.useRef(n);s.current=n;const a=x.useCallback(m=>{i(y=>{var b;const d=typeof m=="function"?m(y):m,v=(b=d[d.length-1])==null?void 0:b.id;return queueMicrotask(()=>{var w;return(w=s.current)==null?void 0:w.call(s,v==="master"?null:v)}),d})},[]),o=x.useRef(0),[l,c]=x.useState(new Map),u=x.useRef(l);u.current=l;const f=x.useCallback(m=>{m===0&&o.current>0&&fe.getState().setCurrentTime(o.current),fe.getState().setElements([]),a(y=>y.slice(0,m+1))},[]),h=x.useCallback(m=>{if(!m.compositionSrc)return;o.current=fe.getState().currentTime;const y=m.id;let d=u.current.get(y);if(!d){const v=m.compositionSrc,b=v.match(/compositions\/.*\.html/);d=b?b[0]:v}fe.getState().setElements([]),a(v=>{var k;if(v[v.length-1].id===d&&v.length>1)return v.slice(0,-1);const w=((k=d.split("/").pop())==null?void 0:k.replace(/\.html$/,""))||d,O=`/api/projects/${t}/preview/comp/${pA(d)}`;return[...v,{id:d,label:w,previewUrl:O}]})},[t]);return x.useEffect(()=>{const m={id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`};if(e==="index.html")fe.getState().setElements([]),a([m]);else if(e&&e.startsWith("compositions/")){const y=e.replace(/^compositions\//,"").replace(/\.html$/,""),d=`/api/projects/${t}/preview/comp/${pA(e)}`;fe.getState().setElements([]),a(v=>{var b;return((b=v[v.length-1])==null?void 0:b.id)===e?v:[m,{id:e,label:y,previewUrl:d}]})}else e||(fe.getState().setElements([]),a([m]))},[e,t,a]),{compositionStack:r,updateCompositionStack:a,handleNavigateComposition:f,handleDrillDown:h,masterSeekRef:o,compIdToSrc:l,setCompIdToSrc:c}}const ggt=360;const ive=Dc("NLEContext",null);function rV(){const t=x.useContext(ive);if(!t)throw new Error("useNLEContext must be used within an NLEProvider");return t}function ygt({projectId:t,refreshKey:e,activeCompositionPath:n,onIframeRef:r,onCompositionChange:i,onCompIdToSrcChange:s,onCompositionLoadingChange:a,children:o}){const{iframeRef:l,togglePlay:c,seek:u,onIframeLoad:f,refreshPlayer:h}=PVe();x.useEffect(()=>{fe.getState().beginTimelineSession(t),xd.getState().clearPreviewAsset()},[t]);const[m,y]=x.useState(null),d=x.useRef(e);x.useEffect(()=>{e!==d.current&&(d.current=e,h())},[e,h]);const v=x.useCallback(()=>{f(),zje(l.current),r==null||r(l.current)},[f,l,r]),{compositionStack:b,updateCompositionStack:w,handleNavigateComposition:O,handleDrillDown:k,compIdToSrc:E,setCompIdToSrc:M}=mgt({projectId:t,activeCompositionPath:n,onCompositionChange:i}),N=l,I=x.useCallback(U=>{var ee;if(!U.compositionSrc)return;fe.getState().setSelectedElementId(null);const Z=U.id;let K=E.get(Z);if(!K)try{const re=(ee=N.current)==null?void 0:ee.contentDocument;if(re){const z=re.querySelector(`[data-composition-id="${CSS.escape(Z)}"][data-composition-src]`);z&&(K=z.getAttribute("data-composition-src")||void 0)}}catch{}k({id:Z,compositionSrc:K??U.compositionSrc})},[E,k,N]),_=x.useRef(E);_.current=E;const j=x.useRef(s);j.current=s,x.useEffect(()=>{var ee;const U=new AbortController;let Z=!0;const K=new Map;return M(K),$X(K),(ee=j.current)==null||ee.call(j,K),fetch(`/api/projects/${t}/files/index.html`,{signal:U.signal}).then(re=>{if(!re.ok)throw new Error(`HTTP ${re.status}`);return re.json()}).then(re=>{var be;if(!Z)return;const z=re.content||"",H=new Map,se=/data-composition-id=["']([^"']+)["'][^>]*data-composition-src=["']([^"']+)["']|data-composition-src=["']([^"']+)["'][^>]*data-composition-id=["']([^"']+)["']/g;let ue;for(;(ue=se.exec(z))!==null;){const me=ue[1]||ue[4],pe=ue[2]||ue[3];me&&pe&&H.set(me,pe)}M(H),$X(H),(be=j.current)==null||be.call(j,H)}).catch(re=>{!Z||U.signal.aborted||console.warn("[studio] Couldn't load composition source map from index.html:",re)}),()=>{Z=!1,U.abort()}},[t,M]),x.useEffect(()=>{if(E.size===0)return;const U=ee=>{const re=_.current;if(re.size===0)return null;let z=!1;const H=ee.map(se=>{if(se.compositionSrc)return se;const ue=re.get(se.id)??re.get(se.id.replace(/-(host|comp|layer)$/,""));return ue?(z=!0,{...se,compositionSrc:ue}):se});return z?H:null},Z=U(fe.getState().elements);Z&&fe.getState().setElements(Z);let K=!1;return fe.subscribe((ee,re)=>{if(K||ee.elements===re.elements||ee.elements.length===0||ee.elements.every(H=>H.compositionSrc))return;K=!0;const z=U(ee.elements);z&&ee.setElements(z),K=!1})},[E]);const[L,B]=x.useState(()=>{const U=to().timelineHeight;return U!==void 0&&U>=P1?U:ggt}),$=x.useCallback(U=>{Ol({timelineHeight:Math.round(U)})},[]),Q=x.useRef(null);x.useEffect(()=>{const U=Q.current;if(!U||typeof ResizeObserver>"u")return;const Z=()=>{const ee=U.getBoundingClientRect().height;ee&&B(re=>z_(ee,re))};Z();const K=new ResizeObserver(Z);return K.observe(U),()=>K.disconnect()},[]);const Y=x.useRef(!1),[W,J]=x.useState(!0),ne=x.useCallback(U=>{U||(Y.current=!0),!(U&&Y.current)&&J(U)},[]),le=W,ie=fe(U=>U.timelineSessionEpoch);x.useEffect(()=>{a==null||a(W)},[W,a]);const q=x.useRef(r);q.current=r,x.useEffect(()=>{var U;(U=q.current)==null||U.call(q,l.current)},[b.length,e,l]);const F={projectId:t,iframeRef:l,togglePlay:c,seek:u,refreshPlayer:h,onIframeLoad:v,compositionStack:b,updateCompositionStack:w,handleNavigateComposition:O,handleDrillDown:I,compIdToSrc:E,timelineH:L,setTimelineH:B,persistTimelineH:$,containerRef:Q,compositionLoading:W,setCompositionLoading:ne,timelineDisabled:le,timelineSessionEpoch:ie,hasLoadedOnceRef:Y,previewCompositionSize:m,setPreviewCompositionSize:y};return p.jsx(ive.Provider,{value:F,children:o})}const xgt=1e-6;function Cte(t,e){return e.isPlaying||e.requestedSeekTime!==null?!0:Math.abs(e.currentTime-t)>xgt}function bgt(t){return t.split("/").pop()??t}function vgt(t){return oS.test(t)?"video":m0.test(t)?"image":"audio"}function Agt({kind:t,serveUrl:e,name:n}){return t==="image"?p.jsx("img",{src:e,alt:n,className:"max-w-full max-h-[40vh] rounded object-contain"}):t==="video"?p.jsx("video",{src:e,controls:!0,autoPlay:!0,muted:!0,playsInline:!0,className:"max-w-full max-h-[40vh] rounded"}):p.jsxs("div",{className:"flex flex-col items-center gap-3 px-6 py-4",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-500",children:[p.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),p.jsx("audio",{src:e,controls:!0,className:"w-64"})]})}function Sgt(){const t=xd(a=>a.previewAsset),e=xd(a=>a.previewProjectId),n=xd(a=>a.clearPreviewAsset),r=x.useCallback(a=>{a.key==="Escape"&&n()},[n]);if(x.useEffect(()=>{if(t)return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,r]),x.useEffect(()=>{if(!t)return;const a=fe.getState(),o=a.currentTime;if(Cte(o,a)){n();return}return fe.subscribe(l=>{Cte(o,l)&&n()})},[t,n]),!t||!e)return null;const i=Ay(t,e),s=bgt(t);return p.jsx("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center bg-black/20",onClick:n,role:"dialog","aria-label":`Preview: ${s}`,children:p.jsxs("div",{className:"relative flex flex-col items-center gap-2 max-w-[58%] rounded-lg border border-neutral-800 bg-neutral-950/95 p-2 pt-8 shadow-2xl",onClick:a=>a.stopPropagation(),children:[p.jsx("button",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-neutral-800 hover:bg-neutral-700 text-neutral-300 hover:text-white flex items-center justify-center transition-colors z-10",onClick:a=>{a.stopPropagation(),n()},"aria-label":"Close preview",children:p.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5",fill:"none",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),p.jsx(Agt,{kind:vgt(t),serveUrl:i,name:s}),p.jsx("span",{className:"text-[12px] text-neutral-400 truncate max-w-full px-2 text-center",children:s})]})})}function wgt(t){return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)}function Ogt(){return document.fullscreenElement}function Cgt(t,e,n){const r=(e==null?void 0:e.parentElement)??e;if(!r)return;const i=r.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&(n==null||n(null))}function kgt({portrait:t,previewOverlay:e,onSelectTimelineElement:n,onPreviewBlockDrop:r}){const{projectId:i,iframeRef:s,togglePlay:a,seek:o,onIframeLoad:l,compositionStack:c,handleNavigateComposition:u,setCompositionLoading:f,timelineDisabled:h,hasLoadedOnceRef:m,previewCompositionSize:y,setPreviewCompositionSize:d}=rV(),v=x.useRef(null),b=x.useCallback($=>{v.current=$.current},[]),{isDragOver:w,handleDragEnter:O,handleDragOver:k,handleDragLeave:E,handleDrop:M}=pgt({portrait:t,compositionSize:y,stageRef:v,onBlockDrop:r}),N=x.useRef(null),I=x.useSyncExternalStore(wgt,Ogt),_=I===N.current&&I!=null,j=x.useCallback(()=>{N.current&&(document.fullscreenElement?document.exitFullscreen():N.current.requestFullscreen())},[]),L=c[c.length-1],B=c.length>1?L.previewUrl:void 0;return p.jsxs("div",{ref:N,className:`flex-1 min-h-0 flex flex-col overflow-hidden bg-neutral-950 ${_?"":"rounded-lg border border-neutral-800/50"}`,"data-studio-fullscreen-target":"",children:[p.jsxs("div",{className:"flex-1 min-h-0 relative overflow-hidden","data-preview-pan-surface":"true",onPointerDown:$=>Cgt($,s.current,n),onDragEnter:O,onDragOver:k,onDragLeave:E,onDrop:M,children:[p.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[p.jsx(cgt,{projectId:i,iframeRef:s,onIframeLoad:l,onCompositionLoadingChange:f,portrait:t,directUrl:B,suppressLoadingOverlay:m.current,onStageRef:b,onCompositionSizeChange:d}),w&&p.jsx("div",{className:"absolute inset-2 z-40 rounded-lg border-2 border-dashed border-studio-accent/50 bg-studio-accent/[0.04] pointer-events-none"}),p.jsx(Sgt,{})]}),!_&&e]}),p.jsxs("div",{className:"flex-shrink-0",children:[!_&&c.length>1&&p.jsx(ugt,{stack:c,onNavigate:u}),p.jsx(ZCe,{onTogglePlay:a,onSeek:o,disabled:h,isFullscreen:_,onToggleFullscreen:j})]})]})}function Egt({timelineH:t,setTimelineH:e,persistTimelineH:n,containerRef:r,disabled:i}){var f;const s=x.useRef(!1),a=x.useRef(t);a.current=t;const o=x.useCallback(h=>{i||(h.preventDefault(),s.current=!0,h.target.setPointerCapture(h.pointerId))},[i]),l=x.useCallback(h=>{if(i||!s.current||!r.current)return;const m=r.current.getBoundingClientRect(),y=h.clientY-m.top;e(z_(m.height,m.height-y))},[i,r,e]),c=x.useCallback(()=>{s.current&&n(a.current),s.current=!1},[n]),u=x.useCallback(h=>{var d;if(i||h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const m=((d=r.current)==null?void 0:d.getBoundingClientRect().height)??0,y=h.key==="ArrowUp"?16:-16;e(v=>{const b=z_(m,v+y);return n(b),b})},[i,r,e,n]);return p.jsxs("div",{role:"separator","aria-orientation":"horizontal","aria-label":"Resize timeline (arrow keys)","aria-valuenow":Math.round(t),"aria-valuemin":P1,"aria-valuemax":Math.round((((f=r.current)==null?void 0:f.getBoundingClientRect().height)??600)-fde),tabIndex:0,className:"group relative h-[3px] flex-shrink-0 cursor-row-resize z-10 outline-none focus-visible:bg-studio-accent/20",style:{touchAction:"none"},onPointerDown:o,onPointerMove:l,onPointerUp:c,onPointerCancel:c,onKeyDown:u,children:[p.jsx("div",{className:"absolute inset-x-0 -top-[4px] h-[10px]"}),p.jsx("div",{className:"h-[3px] w-full bg-transparent transition-colors group-hover:bg-white/12 group-active:bg-white/18 group-focus-visible:bg-studio-accent/60"})]})}function sve(t,e,n,r,i){return r(t.map(({element:s,updates:a})=>{const o=s.expandedParentStart;return o===void 0?{element:s,updates:a}:{element:{...s,id:s.domId??s.id,start:s.start-o},updates:{...a,start:Math.max(0,a.start-o)}}}),e,n,i)}function Tgt(t,e,n){return n(t.map(r=>{const i=r.element.expandedParentStart;return i===void 0?r:{...r,element:{...r.element,id:r.element.domId??r.element.id,start:r.element.start-i},start:Math.max(0,r.start-i)}}),e)}function Pgt({timelineToolbar:t,timelineFooter:e,renderClipContent:n,onFileDrop:r,onDeleteElement:i,onAssetDrop:s,onBlockDrop:a,onCompositionDrop:o,onBlockedEditAttempt:l,onSelectTimelineElement:c}){const{seek:u,handleDrillDown:f,compositionStack:h,updateCompositionStack:m,timelineH:y,setTimelineH:d,persistTimelineH:v,containerRef:b,timelineDisabled:w,timelineSessionEpoch:O}=rV(),{onMoveElement:k,onMoveElements:E,onResizeElement:M,onResizeElements:N,onSplitElement:I}=E5e(),_=x.useCallback((W,J)=>({...W,id:W.domId??W.id,start:W.start-J}),[]),j=x.useCallback((W,J)=>{const ne=W.expandedParentStart;if(ne===void 0)return k==null?void 0:k(W,J);Fm({action:"move"}),k==null||k(_(W,ne),{...J,start:Math.max(0,J.start-ne)})},[k,_]),L=x.useCallback((W,J,ne,le)=>{if(W.some(({element:ie})=>ie.expandedParentStart!==void 0)&&Fm({action:"move"}),!!E)return sve(W,J,ne,E,le)},[E]),B=x.useCallback((W,J)=>{const ne=W.expandedParentStart;if(ne===void 0)return M==null?void 0:M(W,J);Fm({action:"resize"}),M==null||M(_(W,ne),{...J,start:Math.max(0,J.start-ne)})},[M,_]),$=x.useCallback((W,J)=>{if(N)return W.some(({element:ne})=>ne.expandedParentStart!==void 0)&&Fm({action:"resize"}),Tgt(W,J,N)},[N]),Q=x.useCallback(W=>{const J=W.expandedParentStart;return J===void 0?i==null?void 0:i(W):(Fm({action:"delete"}),i==null?void 0:i(_(W,J)))},[i,_]),Y=x.useCallback((W,J)=>{const ne=W.expandedParentStart;return ne===void 0?I==null?void 0:I(W,J):(Fm({action:"split"}),I==null?void 0:I(_(W,ne),Math.max(0,J-ne)))},[I,_]);return p.jsxs(p.Fragment,{children:[p.jsx(Egt,{timelineH:y,setTimelineH:d,persistTimelineH:v,containerRef:b,disabled:w}),p.jsxs("div",{className:"relative flex flex-col flex-shrink-0 px-px pb-px",style:{height:y},"aria-disabled":w||void 0,children:[p.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden rounded-lg border border-neutral-800/50 bg-neutral-950",onDoubleClick:W=>{W.target.closest("[data-clip]")||w||h.length>1&&m(J=>J.slice(0,-1))},children:[p.jsx("div",{className:"flex-shrink-0",children:t}),p.jsx(bBe,{sessionEpoch:O,onSeek:u,onDrillDown:f,renderClipContent:n,onFileDrop:r,onDeleteElement:Q,onAssetDrop:s,onBlockDrop:a,onCompositionDrop:o,onMoveElement:j,onMoveElements:L,onResizeElement:B,onResizeElements:$,onBlockedEditAttempt:l,onSplitElement:Y,onSelectElement:c})]}),e&&p.jsx("div",{className:"flex-shrink-0",children:e}),w&&p.jsx("div",{className:"absolute inset-0 z-30 cursor-not-allowed bg-black/18 flex items-center justify-center","data-testid":"timeline-loading-disabled-overlay",role:"status",onPointerDown:W=>W.preventDefault(),onDragOver:W=>W.preventDefault(),onDrop:W=>W.preventDefault(),children:p.jsx("span",{className:"rounded-md bg-neutral-900/90 px-2.5 py-1 text-[11px] text-neutral-400",children:"Loading composition…"})})]})]})}const Mgt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Ngt(t,e){return t.metaKey||t.ctrlKey||t.altKey||e!=null&&Hf(e)?!1:Mgt.has(t.key)}const xb=8,Wa=24,PD=20;function kte(t,e,n){const r=lit(e,n);Object.keys(r).length>0&&An.getState().updateSegmentStyle(t,r)}const Dgt=x.memo(function({iframeRef:e}){const n=An(E=>E.isEditMode),r=An(E=>E.model),i=An(E=>E.selectedSegmentIds),s=An(E=>E.selectSegment),a=An(E=>E.clearSelection),[o,l]=x.useState([]),c=x.useRef(null),u=x.useRef(r);u.current=r;const f=x.useRef(null),h=x.useRef(null);wr(()=>{if(!n)return;const E=sit(e);let M=[],N=null;const I=()=>{N=null;const le=e.current,ie=u.current,q=c.current;if(!le||!ie||!q)return;const F=iit(le,ie,q);F.length===M.length&&F.every((U,Z)=>Math.abs(U.x-M[Z].x)<.5&&Math.abs(U.y-M[Z].y)<.5)||(M=F,l(F))},_=()=>{N===null&&(N=requestAnimationFrame(I))},j=fe.subscribe(_),L=le=>{const ie=le.data;(ie==null?void 0:ie.source)==="hf-preview"&&_()};window.addEventListener("message",L),window.addEventListener("resize",_);const B=new ResizeObserver(_);e.current&&B.observe(e.current),c.current&&B.observe(c.current);let $=null;const Q=()=>{const le=fe.getState().isPlaying;le&&$===null?$=setInterval(_,66):!le&&$!==null&&(clearInterval($),$=null)},Y=fe.subscribe(Q);Q(),I();const W=()=>{var le;try{return((le=e.current)==null?void 0:le.contentWindow)??null}catch{return null}},J=()=>{const le=h.current;if(!le)return!1;const ie=W();return ie&&f1(le.wordEl,ie,le.origTX,le.origTY,le.origScale,le.origRotation),h.current=null,!0};f.current=J;const ne=le=>{const ie=An.getState(),{selectedSegmentIds:q,model:F}=ie;if(le.key==="Escape"){if(J()){le.preventDefault(),_();return}q.size>0&&(le.preventDefault(),ie.clearSelection());return}if((le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="a"&&!le.shiftKey&&!le.altKey&&!Hf(le.target)){le.preventDefault(),ie.selectAll();return}if(q.size===0||!F)return;const U=le.key;if(!Ngt(le,le.target))return;le.preventDefault();const Z=le.shiftKey?10:1,K=U==="ArrowLeft"?-Z:U==="ArrowRight"?Z:0,ee=U==="ArrowUp"?-Z:U==="ArrowDown"?Z:0,re=e.current,z=re==null?void 0:re.contentWindow;if(!(!re||!z)){for(const H of q)for(let se=0;se<F.groupOrder.length;se++){const ue=F.groups.get(F.groupOrder[se]);if(!ue)continue;const be=ue.segmentIds.indexOf(H);if(be<0)continue;const me=A2(re,se,be);if(!me)continue;const pe=I1(me),ge=S2(pe,z);f1(me,z,ge.x+K,ge.y+ee,ge.scale,ge.rotation),kte(H,me,z);break}_()}};return window.addEventListener("keydown",ne),()=>{E(),j(),Y(),$!==null&&clearInterval($),N!==null&&cancelAnimationFrame(N),B.disconnect(),window.removeEventListener("message",L),window.removeEventListener("resize",_),window.removeEventListener("keydown",ne),f.current=null}});const m=x.useCallback(()=>{const E=e.current;if(!E)return 1;const M=E.getBoundingClientRect(),N=parseFloat(E.style.width)||M.width;return M.width/N},[e]),y=x.useCallback((E,M,N,I)=>{I.stopPropagation(),I.currentTarget.setPointerCapture(I.pointerId);const _=e.current;if(!_)return;const j=A2(_,E,M),L=_.contentWindow;if(!j||!L)return;const B=S2(I1(j),L);h.current={type:"move",wordEl:j,segmentId:N,startMX:I.clientX,startMY:I.clientY,origTX:B.x,origTY:B.y,origScale:B.scale,origRotation:B.rotation}},[e]),d=x.useCallback((E,M,N,I)=>{var W;I.stopPropagation(),I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId);const _=e.current;if(!_)return;const j=A2(_,E,M),L=_.contentWindow;if(!j||!L)return;const B=j.getBoundingClientRect(),$=m(),Q=B.left*$+(((W=e.current)==null?void 0:W.getBoundingClientRect().left)??0)+B.width*$/2,Y=S2(I1(j),L);h.current={type:"scale",wordEl:j,segmentId:N,startMX:I.clientX,startDxFromCenter:I.clientX-Q,origTX:Y.x,origTY:Y.y,origScale:Y.scale,origRotation:Y.rotation}},[e,m]),v=x.useCallback((E,M)=>{M.stopPropagation(),M.preventDefault(),M.currentTarget.setPointerCapture(M.pointerId);const N=e.current;if(!N)return;const I=A2(N,E.groupIndex,E.wordIndex),_=N.contentWindow;if(!I||!_)return;const j=S2(I1(I),_);h.current={type:"rotate",wordEl:I,segmentId:E.segmentId,startMX:M.clientX,origTX:j.x,origTY:j.y,origRotation:j.rotation,origScale:j.scale}},[e]),b=x.useCallback(()=>{var E;try{return((E=e.current)==null?void 0:E.contentWindow)??null}catch{return null}},[e]),w=x.useCallback(E=>{const M=h.current;if(!M)return;const N=b();if(N){if(M.type==="move"){const I=m(),_=(E.clientX-M.startMX)/I,j=(E.clientY-M.startMY)/I;f1(M.wordEl,N,M.origTX+_,M.origTY+j,M.origScale,M.origRotation)}else if(M.type==="scale"){const I=M.startMX-M.startDxFromCenter,_=Math.abs(M.startDxFromCenter),j=Math.abs(E.clientX-I),L=_>5?j/_:1,B=Math.max(.1,M.origScale*L);f1(M.wordEl,N,M.origTX,M.origTY,B,M.origRotation)}else if(M.type==="rotate"){const _=(E.clientX-M.startMX)/200*90;f1(M.wordEl,N,M.origTX,M.origTY,M.origScale,M.origRotation+_)}}},[m,b]),O=x.useCallback(()=>{const E=h.current;if(E){const M=b();M&&kte(E.segmentId,E.wordEl,M),h.current=null}},[b]),k=x.useCallback(E=>{E.target===E.currentTarget&&a()},[a]);return n?p.jsxs("div",{ref:c,className:"absolute inset-0 z-50",style:{pointerEvents:"auto"},onClick:k,onPointerMove:w,onPointerUp:O,onLostPointerCapture:O,children:[o.length===0&&r&&r.segments.size>0&&p.jsx("div",{className:"absolute inset-x-0 top-3 flex justify-center pointer-events-none",children:p.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/60 border border-neutral-700 text-2xs text-neutral-300",children:"No captions visible at this frame — scrub to a caption, or select one in the track below"})}),o.map(E=>{const M=i.has(E.segmentId);return p.jsx("div",{className:["absolute",M?"ring-2 ring-studio-accent":"hover:ring-1 hover:ring-white/30"].join(" "),style:{left:E.x,top:E.y,width:E.width,height:E.height,cursor:M?"move":"pointer",touchAction:"none",borderRadius:2},onClick:N=>{N.stopPropagation(),s(E.segmentId,N.shiftKey)},onPointerDown:N=>{M&&y(E.groupIndex,E.wordIndex,E.segmentId,N)},children:M&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"absolute",left:"50%",top:-PD-xb/2-Wa/2,marginLeft:-Wa/2,width:Wa,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",touchAction:"none"},onPointerDown:N=>v(E,N),children:p.jsx("div",{style:{width:xb,height:xb,borderRadius:"50%",backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)"}})}),p.jsx("div",{style:{position:"absolute",left:"50%",top:-PD,width:1,height:PD,marginLeft:-.5,backgroundColor:"var(--hf-accent, #3CE6AC)",opacity:.5,pointerEvents:"none"}}),[{corner:{right:-Wa/2,bottom:-Wa/2},cursor:"nwse-resize"},{corner:{left:-Wa/2,top:-Wa/2},cursor:"nwse-resize"},{corner:{right:-Wa/2,top:-Wa/2},cursor:"nesw-resize"},{corner:{left:-Wa/2,bottom:-Wa/2},cursor:"nesw-resize"}].map(({corner:N,cursor:I},_)=>p.jsx("div",{style:{position:"absolute",...N,width:Wa,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",cursor:I,touchAction:"none"},onPointerDown:j=>d(E.groupIndex,E.wordIndex,E.segmentId,j),children:p.jsx("div",{style:{width:xb,height:xb,backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",borderRadius:2}})},_))]})},E.segmentId)})]}):null}),Igt="data-composition-id";function _gt(t){if(!t||t==="none")return 0;const e=t.trim().split(/\s+/),n=e.at(-1);if(!(n!=null&&n.endsWith("deg")))return 0;if(e.length===4){const[i,s,a]=e;if(Number(i)!==0||Number(s)!==0||Math.abs(Number(a))!==1)return 0;const o=Number.parseFloat(n);return Number.isFinite(o)?o*Math.sign(Number(a)):0}if(e.length!==1)return 0;const r=Number.parseFloat(n);return Number.isFinite(r)?r:0}function ave(t,e,n){let r=e.identity();for(let i=t;i;i=i.parentElement){const s=n(i);if(!s)return null;const a=s.transform;let o=a&&a!=="none"?e.fromTransform(a):e.identity();if(!o)return null;const l=_gt(s.rotate);if(l!==0&&(o=e.compose(e.fromRotate(l),o)),r=e.compose(o,r),i.hasAttribute(Igt))break}return r}function K3(t){const e=ba(t);return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function ove(t){return`${K3(Math.max(0,t))}px`}function Ete(t){const e=t.trim();if(e==="0")return 0;const n=/^(-?\d+(?:\.\d+)?)px$/i.exec(e);if(!n)return null;const r=Number.parseFloat(n[1]);return Number.isFinite(r)?Math.max(0,r):null}function Rgt(t){if(t.length<1||t.length>4)return null;const[e,n=e,r=e,i=n]=t;return e===void 0||n===void 0||r===void 0||i===void 0?null:{top:e,right:n,bottom:r,left:i}}function iV(t){const e=t==null?void 0:t.trim();return!e||e==="none"?"none":/^inset\(/i.test(e)?"inset":/^circle\(/i.test(e)?"circle":"custom"}function J3(t){var c,u;const e=/^inset\(([^()]*)\)$/i.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=e[1].trim().replace(/\s+/g," ").split(/ round /i),r=(c=n[0])==null?void 0:c.trim();if(!r||n.length>2)return null;const i=r.split(/\s+/).map(Ete);if(i.some(f=>f==null))return null;const s=[];for(const f of i){if(f==null)return null;s.push(f)}const a=Rgt(s);if(!a)return null;const o=(u=n[1])==null?void 0:u.trim(),l=o?Ete(o):0;return l==null?null:{...a,radius:l}}function lve(t){const e=J3(t);if(!e)return 0;const{top:n,right:r,bottom:i,left:s}=e;return n===r&&n===i&&n===s?n:0}function cve(t,e,n){return t==="custom"?(n==null?void 0:n.trim())||"none":t==="circle"?"circle(50% at 50% 50%)":t==="inset"?`inset(0 round ${K3(Math.max(0,e))}px)`:"none"}function sV(t,e=0){const n=[t.top,t.right,t.bottom,t.left].map(ove),[r,i,s,a]=n,o=r===i&&r===s&&r===a?r:`${r} ${i} ${s} ${a}`,l=Math.max(0,e);return l>0?`inset(${o} round ${K3(l)}px)`:`inset(${o})`}function uve(t,e){return`inset(${ove(t)} round ${K3(Math.max(0,e))}px)`}function fve(t,e,n,r){const i=n>0?n:1,s=r>0?r:1,a=t.left+e.left*i,o=t.top+e.top*s;return{left:a,top:o,width:Math.max(0,t.width-(e.left+e.right)*i),height:Math.max(0,t.height-(e.top+e.bottom)*s)}}function Ek(t){var r;const n=t.style.getPropertyValue("clip-path").trim()||((r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t).clipPath.trim())||"";return!n||n==="none"?{top:0,right:0,bottom:0,left:0,radius:0}:J3(n)}function Y8(t,e){return Number.isFinite(t)?Math.min(Math.max(0,t),Math.max(0,e)):0}function jgt(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1,r={...t.startInsets};return t.edge==="left"?r.left=Y8(t.startInsets.left+t.deltaX/e,t.width-r.right):t.edge==="right"?r.right=Y8(t.startInsets.right-t.deltaX/e,t.width-r.left):t.edge==="top"?r.top=Y8(t.startInsets.top+t.deltaY/n,t.height-r.bottom):r.bottom=Y8(t.startInsets.bottom-t.deltaY/n,t.height-r.top),r}function Lgt(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1,r=t.startInsets.left+t.startInsets.right,i=t.startInsets.top+t.startInsets.bottom,s=Math.min(Math.max(0,t.startInsets.left+t.deltaX/e),r),a=Math.min(Math.max(0,t.startInsets.top+t.deltaY/n),i);return{left:s,right:r-s,top:a,bottom:i-a}}function Qy(t,e){const n=Ek(e);return!n||n.top<=0&&n.right<=0&&n.bottom<=0&&n.left<=0?t:fve(t,n,t.editScaleX,t.editScaleY)}const Fgt={a:1,b:0,c:0,d:1},M2=1e-6;function $gt(t){const e=/^matrix\(([^)]+)\)$/.exec(t);if(e){const[s,a,o,l]=e[1].split(",").map(c=>Number.parseFloat(c));return[s,a,o,l].every(Number.isFinite)?{a:s,b:a,c:o,d:l}:null}const n=/^matrix3d\(([^)]+)\)$/.exec(t);if(!n)return null;const r=n[1].split(",").map(s=>Number.parseFloat(s));return r.length!==16||!r.every(Number.isFinite)||![r[3],r[7],r[11]].every(s=>Math.abs(s)<M2)?null:{a:r[0],b:r[1],c:r[4],d:r[5]}}const Bgt={identity:()=>Fgt,fromTransform:$gt,fromRotate:t=>{const e=t*Math.PI/180;return{a:Math.cos(e),b:Math.sin(e),c:-Math.sin(e),d:Math.cos(e)}},compose:(t,e)=>({a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d})};function Vgt(t){return Math.abs(t.a-1)<M2&&Math.abs(t.b)<M2&&Math.abs(t.c)<M2&&Math.abs(t.d-1)<M2}function Hgt(t){const e=ave(t,Bgt,n=>{var r;try{return((r=n.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(n))??null}catch{return null}});return e&&!Vgt(e)?e:null}function Qgt(t,e){const n=e.editScaleX>0?e.editScaleX:1,r=e.editScaleY>0?e.editScaleY:1,i={angleDeg:0,left:e.left,top:e.top,width:e.width,height:e.height,scaleX:n,scaleY:r},s=Hgt(t);if(!s)return i;const{a,b:o,c:l,d:c}=s,u=Math.hypot(a,o),f=a*c-o*l,h=u!==0?Math.abs(f)/u:1;if(u<=0||h<=0)return i;const m=Math.atan2(o,a)*180/Math.PI,y=u*n,d=h*r,v=t.offsetWidth*y,b=t.offsetHeight*d;if(!(v>0)||!(b>0))return i;const w=e.left+e.width/2,O=e.top+e.height/2;return{angleDeg:m,left:w-v/2,top:O-b/2,width:v,height:b,scaleX:y,scaleY:d}}function zgt(t,e,n){if(n===0)return{deltaX:t,deltaY:e};const r=-n*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return{deltaX:t*i-e*s,deltaY:t*s+e*i}}function aV(t){return fhe(t)}function Tk(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function Zgt(t){let e=t;for(;e;){if(e.hasAttribute("data-composition-file")||e.hasAttribute("data-composition-src"))return e;e=e.parentElement}return null}function Ggt(t){const e=t.rootScaleX>0?t.rootScaleX:1,n=t.rootScaleY>0?t.rootScaleY:1,r=t.sourceRectWidth&&t.sourceRectWidth>0&&t.sourceWidth&&t.sourceWidth>0?t.sourceRectWidth*e/t.sourceWidth:e,i=t.sourceRectHeight&&t.sourceRectHeight>0&&t.sourceHeight&&t.sourceHeight>0?t.sourceRectHeight*n/t.sourceHeight:n;return{scaleX:r>0?r:e,scaleY:i>0?i:n}}function oV(t,e,n){const r=Pk(t,e,n);return r?{...r,...Qy(r,n)}:null}function hve(t,e){const n=t.DOMMatrix;if(!n)return null;const r=t.getComputedStyle(e),i={identity:()=>new n,fromTransform:s=>new n(s),fromRotate:s=>new n().rotateSelf(s),compose:(s,a)=>s.multiply(a)};try{const s=ave(e,i,a=>a===e?r:t.getComputedStyle(a));return s?{matrix:s,cs:r}:null}catch{return null}}function Ugt(t){const e=Number.isFinite(t.a)?t.a:1,n=Number.isFinite(t.b)?t.b:0,r=Number.isFinite(t.c)?t.c:0,i=Number.isFinite(t.d)?t.d:1,s=Math.atan2(n,e)*180/Math.PI,a=e*i-n*r,o=Math.atan2(-r,i)*180/Math.PI,l=a<0&&Math.abs(o)<Math.abs(s)?o:s;return Number.isFinite(l)?l:0}const Xgt=1e-4;function Wgt(t){return(t==null?void 0:t.querySelector("[data-composition-id]"))??(t==null?void 0:t.documentElement)??null}function qgt(t){if(!t)return null;const e=t.getBoundingClientRect(),n=Tk(t.getAttribute("data-width"))??e.width,r=Tk(t.getAttribute("data-height"))??e.height;return!n||!r?null:{width:n,height:r}}function lV(t,e,n){const r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=qgt(Wgt(n));return s?{iframeRect:r,overlayRect:i,rootScaleX:r.width/s.width,rootScaleY:r.height/s.height}:null}function Pk(t,e,n,r){const i=r??lV(t,e,e.contentDocument);if(!i)return null;const{iframeRect:s,overlayRect:a,rootScaleX:o,rootScaleY:l}=i,c=n.getBoundingClientRect(),u=Zgt(n),f=u==null?void 0:u.getBoundingClientRect(),h=Ggt({rootScaleX:o,rootScaleY:l,sourceRectWidth:f==null?void 0:f.width,sourceRectHeight:f==null?void 0:f.height,sourceWidth:Tk((u==null?void 0:u.getAttribute("data-width"))??null),sourceHeight:Tk((u==null?void 0:u.getAttribute("data-height"))??null)});return{left:s.left-a.left+c.left*o,top:s.top-a.top+c.top*l,width:c.width*o,height:c.height*l,editScaleX:h.scaleX,editScaleY:h.scaleY}}function Mk(t,e){return Math.hypot(e.x-t.x,e.y-t.y)}function dve(t){return{x:(t.nw.x+t.ne.x+t.se.x+t.sw.x)/4,y:(t.nw.y+t.ne.y+t.se.y+t.sw.y)/4}}function cV(t,e,n,r,i){const s=e.contentWindow,a=e.contentDocument;if(!s||!a)return null;const o=s.DOMPoint;if(!o)return null;const l=r??lV(t,e,a);if(!l)return null;const{iframeRect:c,overlayRect:u,rootScaleX:f,rootScaleY:h}=l,m=i??hve(s,n);if(!m)return null;const{matrix:y,cs:d}=m,v=n.offsetWidth,b=n.offsetHeight,w=d.transformOrigin.split(" ").map($=>Number.parseFloat($)),O=Number.isFinite(w[0])?w[0]:v/2,k=Number.isFinite(w[1])?w[1]:b/2,E=($,Q)=>{const Y=y.transformPoint(new o($-O,Q-k));return{x:Y.x,y:Y.y}},M={nw:E(0,0),ne:E(v,0),se:E(v,b),sw:E(0,b)},N=[M.nw.x,M.ne.x,M.se.x,M.sw.x],I=[M.nw.y,M.ne.y,M.se.y,M.sw.y],_=n.getBoundingClientRect(),j=_.left-Math.min(...N),L=_.top-Math.min(...I),B=$=>({x:c.left-u.left+($.x+j)*f,y:c.top-u.top+($.y+L)*h});return{nw:B(M.nw),ne:B(M.ne),se:B(M.se),sw:B(M.sw)}}function uV(t,e,n){const r=lV(t,e,e.contentDocument);if(!r)return null;const i=Pk(t,e,n,r);if(!i)return null;const s=e.contentWindow,a=s?hve(s,n):null,o=a?Ugt(a.matrix):0;if(Math.abs(o)<Xgt)return i;const l=cV(t,e,n,r,a);if(!l)return i;const c=Mk(l.nw,l.ne),u=Mk(l.nw,l.sw),f=(l.nw.x+l.se.x)/2,h=(l.nw.y+l.se.y)/2;return!Number.isFinite(c)||!Number.isFinite(u)||c<=0||u<=0?i:{left:f-c/2,top:h-u/2,width:c,height:u,editScaleX:i.editScaleX,editScaleY:i.editScaleY,angle:o}}function Ygt(t,e,n){const r=uV(t,e,n);return r?{...r,...Qy(r,n)}:null}const K8=.5,Kgt=.1;function Nk(t,e){return t===e?!0:!t||!e?!1:Math.abs(t.left-e.left)<K8&&Math.abs(t.top-e.top)<K8&&Math.abs(t.width-e.width)<K8&&Math.abs(t.height-e.height)<K8&&Math.abs(t.editScaleX-e.editScaleX)<.001&&Math.abs(t.editScaleY-e.editScaleY)<.001&&Math.abs((t.angle??0)-(e.angle??0))<Kgt}function Jgt(t,e){return t===e?!0:t.length!==e.length?!1:t.every((n,r)=>{const i=e[r];return!!(i&&n.key===i.key&&n.element===i.element&&n.selection===i.selection&&Nk(n.rect,i.rect))})}function fV(t){const e=t[0];if(!e)return null;let n=e.left,r=e.top,i=e.left+e.width,s=e.top+e.height;for(const a of t.slice(1))n=Math.min(n,a.left),r=Math.min(r,a.top),i=Math.max(i,a.left+a.width),s=Math.max(s,a.top+a.height);return{left:n,top:r,width:i-n,height:s-r,editScaleX:1,editScaleY:1}}function pve(t,e,n){const r=Pk(t,e,n);if(!r||!n.hasAttribute("data-hf-group"))return r;const i=[];for(const a of Array.from(n.children)){const o=Pk(t,e,a);o&&i.push(o)}const s=i.length>0?fV(i):null;return s?{...s,editScaleX:r.editScaleX,editScaleY:r.editScaleY}:r}function f7(t,e,n){return n.hasAttribute("data-hf-group")?pve(t,e,n):uV(t,e,n)}function mve(t){return t.filter(e=>!t.some(n=>n!==e&&n.element.contains(e.element)))}function lf(t){return[t.sourceFile??"",t.hfId??"",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function Tte(t,e,n,r){const i=lf(e),s=r.current;if((s==null?void 0:s.key)===i&&s.element.isConnected&&s.element.ownerDocument===t)return s.element;const a=Ds(t,e,n);return r.current=a?{key:i,element:a}:null,a}const eyt=4;function Pte(t,e,n){const r=t.contentDocument;if(!r)return[];const i=r.querySelector("[data-composition-id]")??r.body,s=A3(i,{activeCompositionPath:n}),a=r.querySelector("[data-composition-id]")??r.documentElement,o=Number.parseFloat((a==null?void 0:a.getAttribute("data-width"))??""),l=Number.parseFloat((a==null?void 0:a.getAttribute("data-height"))??""),c={width:o>0?o:a.getBoundingClientRect().width||1,height:l>0?l:a.getBoundingClientRect().height||1},u=[];for(const f of s){const h=f.element;if(!by(h)||Hme(h.getBoundingClientRect(),c))continue;const m=oV(e,t,h);m&&u.push({element:h,rect:{left:m.left,top:m.top,width:m.width,height:m.height}})}return u}function gve(t,e){return e.filter(n=>Cae(t,n.rect))}async function tyt(t,e,n){const r=!n||n==="index.html",i=[];for(const{element:s}of gve(t,e)){const a=await v3(s,{activeCompositionPath:n,isMasterView:r,skipSourceProbe:!0});a&&i.push(a)}return i}function nyt(t){const e=x.useRef(null),[n,r]=x.useState(null),[i,s]=x.useState([]),a=x.useRef(null),o=x.useCallback(async(f,h)=>{const m=t.iframeRef.current,y=t.overlayRef.current;if(!m||!y||!t.onMarqueeSelectRef.current)return;const d=t.activeCompositionPathRef.current??"index.html",v=a.current??Pte(m,y,d),b=await tyt(f,v,d);t.onMarqueeSelectRef.current(b,h)},[t.iframeRef,t.overlayRef,t.onMarqueeSelectRef,t.activeCompositionPathRef]),l=x.useCallback(f=>{var m;const h=e.current;if(h){const y=(m=t.overlayRef.current)==null?void 0:m.getBoundingClientRect();if(!y)return;if(h.currentX=f.clientX-y.left,h.currentY=f.clientY-y.top,!h.pastThreshold){const w=h.currentX-h.startX,O=h.currentY-h.startY;if(Math.hypot(w,O)<eyt)return;h.pastThreshold=!0,a.current=null}const d={left:Math.min(h.startX,h.currentX),top:Math.min(h.startY,h.currentY),width:Math.abs(h.currentX-h.startX),height:Math.abs(h.currentY-h.startY)};r(d);const v=t.iframeRef.current,b=t.overlayRef.current;if(v&&b){const w=t.activeCompositionPathRef.current??"index.html";a.current??(a.current=Pte(v,b,w)),s(gve(d,a.current).map(O=>O.rect))}return}t.gestures.onPointerMove(f)},[t.gestures,t.overlayRef,t.iframeRef,t.activeCompositionPathRef]),c=x.useCallback(f=>{var m,y;const h=e.current;if(h){e.current=null;try{f.currentTarget.releasePointerCapture(h.pointerId)}catch{}h.pastThreshold?o({left:Math.min(h.startX,h.currentX),top:Math.min(h.startY,h.currentY),width:Math.abs(h.currentX-h.startX),height:Math.abs(h.currentY-h.startY)},f.shiftKey):(y=(m=t.onMarqueeSelectRef).current)==null||y.call(m,[],!1),r(null),s([]),a.current=null;return}t.gestures.onPointerUp(f)},[t.gestures,o,t.onMarqueeSelectRef]),u=x.useCallback(()=>{if(e.current){e.current=null,r(null),s([]),a.current=null;return}t.gestures.clearPointerState(t.selectionRef)},[t.gestures,t.selectionRef]);return{marqueeRef:e,marqueeRect:n,candidateRects:i,onPointerMove:l,onPointerUp:c,onPointerCancel:u}}function ryt({candidateRects:t,marqueeRect:e}){return p.jsxs(p.Fragment,{children:[t.map((n,r)=>p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-sm border border-studio-accent bg-studio-accent/5",style:{left:n.left,top:n.top,width:n.width,height:n.height}},r)),e&&p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute border border-dashed border-studio-accent bg-studio-accent/10",style:{left:e.left,top:e.top,width:e.width,height:e.height}})]})}const iyt=600;function syt({overlayRef:t,iframeRef:e}){const[n,r]=x.useState(null),i=x.useRef(null);x.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const s=x.useCallback(a=>{const o=t.current,l=e.current;if(!o||!l)return;const c=oV(o,l,a);!c||c.width<=0||c.height<=0||(i.current&&clearTimeout(i.current),r(c),i.current=setTimeout(()=>{i.current=null,r(null)},iyt))},[t,e]);return{zOrderFlashRect:n,handleZOrderCrossed:s}}function ayt({rect:t}){return t?p.jsx("div",{"aria-hidden":"true","data-dom-edit-z-flash":"true",className:"pointer-events-none absolute rounded-md border-2 border-studio-accent shadow-[0_0_0_2px_rgba(60,230,172,0.35)] animate-pulse",style:{left:t.left,top:t.top,width:t.width,height:t.height}}):null}function oyt({selection:t,selectionRef:e,hoverSelectionRef:n,onCanvasPointerMoveRef:r,onSelectionChangeRef:i}){const[s,a]=x.useState(null),o=x.useCallback(()=>a(null),[]);x.useEffect(()=>{s&&(!t||t.element!==s.sel.element)&&a(null)},[t,s]);const l=x.useCallback(async c=>{c.preventDefault();const u=e.current;let f=u;if(u){const h=n.current;h&&h.element!==u.element&&(i.current(h,{revealPanel:!0}),f=h)}else{const h=c,m=await r.current(h);if(!m)return;i.current(m,{revealPanel:!0}),f=m}f&&a({x:c.clientX,y:c.clientY,sel:f})},[e,n,r,i]);return{contextMenu:s,closeContextMenu:o,handleContextMenu:l}}const J8=4,lyt=.05,Mte=15,cyt=.5;function uyt(t){t==null||t.focus({preventScroll:!0})}function fyt(t,e){return!t||!e?!1:t===e||t.contains(e)}function hyt(t){var n,r,i;const e=fyt((n=t.cached)==null?void 0:n.element,t.elementAtPoint);return pc("shift-pointerdown",{candidate:t.cached?t.cached.selector??null:null,pointTarget:((r=t.elementAtPoint)==null?void 0:r.id)??((i=t.elementAtPoint)==null?void 0:i.tagName)??null,cacheIsAboutThisPoint:e}),e?t.cached:null}function dyt(t){return{dx:(t.originWidth-t.overlayWidth)/2,dy:(t.originHeight-t.overlayHeight)/2}}function Nte(t,e,n,r){return Math.atan2(r-e,n-t)*180/Math.PI}function pyt(t){return((t+180)%360+360)%360-180}function myt(t){return Math.round(t*10)/10}function Dte(t){const e=Nte(t.centerX,t.centerY,t.startX,t.startY),n=Nte(t.centerX,t.centerY,t.currentX,t.currentY),r=pyt(n-e),i=t.actualAngle+r;return{angle:t.snap?Math.round(i/Mte)*Mte:myt(i)}}function gyt(t,e){return Math.abs(e-t)>=lyt}function yyt(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Nk(t[n],e[n]))return!1;return!0}function xyt({iframeRef:t,overlayRef:e,selectionRef:n,activeCompositionPathRef:r,groupSelectionsRef:i,hoverSelectionRef:s,rafPausedRef:a}){const[o,l]=x.useState(null),[c,u]=x.useState(null),[f,h]=x.useState([]),[m,y]=x.useState([]),d=x.useRef(null),v=x.useRef(null),b=x.useRef([]),w=x.useRef(null),O=x.useRef(null),k=x.useRef(new Map),E=x.useRef([]),M=j=>{Nk(d.current,j)||(d.current=j,l(j))},N=j=>{Nk(v.current,j)||(v.current=j,u(j))},I=j=>{Jgt(b.current,j)||(b.current=j,h(j))},_=(j,L)=>{const B=lf(L),$=k.current.get(B);if($!=null&&$.isConnected&&$.ownerDocument===j)return $;const Q=Ds(j,L,r.current);return Q?k.current.set(B,Q):k.current.delete(B),Q};return wr(()=>{let j=0;const L=()=>{M(null),N(null),I([])},B=()=>{if(j=requestAnimationFrame(B),a.current){E.current.length>0&&(E.current=[],y([]));return}const $=n.current,Q=t.current,Y=e.current;if(!Q||!Y){w.current=null,O.current=null,k.current.clear(),L();return}const W=Q.contentDocument;if(!W){w.current=null,O.current=null,k.current.clear(),L();return}if($){const F=Tte(W,$,r.current,w);if(F&&aV(F)){const U=f7(Y,Q,F);M(U);const Z=F.querySelectorAll("*");if(Z.length>0&&Z.length<=60){const K=[];for(let ee=0;ee<Z.length;ee++){const re=Z[ee];if(!re.getBoundingClientRect)continue;const z=Ygt(Y,Q,re);z&&z.width>2&&z.height>2&&K.push(z)}yyt(E.current,K)||(E.current=K,y(K))}else E.current.length>0&&(E.current=[],y([]))}else M(null),E.current.length>0&&(E.current=[],y([]))}else w.current=null,M(null),E.current.length>0&&(E.current=[],y([]));const J=i.current;if(J.length>0){const F=[],U=new Set;for(const Z of J){const K=lf(Z);if(U.has(K))continue;U.add(K);const ee=_(W,Z),re=ee?pve(Y,Q,ee):null,z=re&&ee?{...re,...Qy(re,ee)}:re;ee&&z&&F.push({key:K,selection:Z,element:ee,rect:z})}for(const Z of k.current.keys())U.has(Z)||k.current.delete(Z);I(F)}else k.current.clear(),I([]);const ne=s.current,le=!!($&&ne&&lf($)===lf(ne)),ie=!!(ne&&J.some(F=>lf(F)===lf(ne)));if(!ne||le||ie){O.current=null,N(null);return}const q=Tte(W,ne,r.current,O);if(!q){N(null);return}N(f7(Y,Q,q))};return j=requestAnimationFrame(B),()=>cancelAnimationFrame(j)}),{overlayRect:o,overlayRectRef:d,setOverlayRect:M,hoverRect:c,hoverRectRef:v,setHoverRect:N,groupOverlayItems:f,groupOverlayItemsRef:b,setGroupOverlayItems:I,childRects:m}}function byt(t,e){const n=t.angle??0;if(!n){const y=Math.max(0,e.left-t.left),d=Math.max(0,e.top-t.top),v=Math.min(t.width,e.left+e.width-t.left),b=Math.min(t.height,e.top+e.height-t.top);return y>=v||d>=b?void 0:`polygon(evenodd, 0 0, ${t.width}px 0, ${t.width}px ${t.height}px, 0 ${t.height}px, 0 0, ${y}px ${d}px, ${v}px ${d}px, ${v}px ${b}px, ${y}px ${b}px, ${y}px ${d}px)`}const r=-n*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=t.left+t.width/2,o=t.top+t.height/2,l=(y,d)=>{const v=y-a,b=d-o;return`${t.width/2+v*i-b*s}px ${t.height/2+v*s+b*i}px`},c=e.left,u=e.top,f=c+e.width,h=u+e.height,m=[l(c,u),l(f,u),l(f,h),l(c,h),l(c,u)].join(", ");return`polygon(evenodd, 0 0, ${t.width}px 0, ${t.width}px ${t.height}px, 0 ${t.height}px, 0 0, ${m})`}function vyt({rects:t,elements:e,compRect:n,selection:r,groupSelections:i,activeCompositionPathRef:s,onSelectionChangeRef:a}){return p.jsx(p.Fragment,{children:t.filter(o=>{const l=e.current.get(o.key);return l?(r==null?void 0:r.element)===l?!1:!i.some(c=>c.element===l):!0}).map(o=>{const l={left:o.left,top:o.top,width:o.width,height:o.height,transform:o.angle?`rotate(${o.angle}deg)`:void 0,transformOrigin:"center"},c=byt(o,n),u=async()=>{const h=e.current.get(o.key);if(!h)return;const{resolveDomEditSelection:m}=await ly(async()=>{const{resolveDomEditSelection:v}=await Promise.resolve().then(()=>EJe);return{resolveDomEditSelection:v}},void 0),y=s.current??"index.html",d=await m(h,{activeCompositionPath:y,isMasterView:!y||y==="index.html",skipSourceProbe:!0});d&&a.current(d,{revealPanel:!0})},f=h=>{h.stopPropagation(),u()};return p.jsx("div",{className:"pointer-events-none absolute",style:l,children:p.jsx("div",{role:"button",tabIndex:0,"aria-label":`Select off-canvas element ${o.key}`,className:"pointer-events-auto absolute inset-0 border-2 border-dashed border-studio-accent/10 rounded-md cursor-pointer hover:border-studio-accent hover:bg-studio-accent/10 transition-colors",style:c?{clipPath:c}:void 0,title:`Off-canvas: ${o.key} — click to select`,onClick:f,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),u())}})},`offcanvas-${o.key}`)})})}function Ayt({rects:t}){return p.jsx(p.Fragment,{children:t.map((e,n)=>p.jsx("div",{className:"pointer-events-none absolute border border-dashed border-white/20 rounded-sm",style:{left:e.left,top:e.top,width:e.width,height:e.height,transform:e.angle?`rotate(${e.angle}deg)`:void 0}},n))})}function e5(t){const e=t.ownerDocument.defaultView,n=e==null?void 0:e.gsap;return n!=null&&n.set&&n.getProperty?n:null}function hV(t,e,n){const r=e5(t);if(!r)return!1;t.style.setProperty("translate","none");const{newX:i,newY:s}=Ry(t,e,n);return r.set(t,{x:i,y:s}),!0}function MD(t,e){const n=e5(t);return n?(t.style.setProperty("rotate","none"),n.set(t,{rotation:e}),!0):!1}function Syt(t){const e=e5(t);return e&&Number(e.getProperty(t,"rotation"))||0}const wyt=100,Ite=.01,Oyt=1e-6;function _te(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)}function Rte(t){return Math.hypot(t.x,t.y)}function jte(t){return Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.width)&&Number.isFinite(t.height)}function Cyt(t){const e=t.document.documentElement,n=t.innerWidth||e.clientWidth||1,r=t.innerHeight||e.clientHeight||1;return{width:n>0?n:1,height:r>0?r:1}}function kyt(t){try{const e=t.frameElement;if(!e)return null;const n=e.ownerDocument.defaultView,r=n==null?void 0:n.HTMLElement;return r&&e instanceof r?e:null}catch{return null}}function ND(t){const e=t.getBoundingClientRect();if(!jte(e)||e.width<=0&&e.height<=0)return null;let n={x:e.left+e.width/2,y:e.top+e.height/2},r=t.ownerDocument.defaultView;for(;r;){const i=kyt(r);if(!i)break;const s=i.getBoundingClientRect();if(!jte(s)||s.width<=0||s.height<=0)return null;const a=Cyt(r);n={x:s.left+n.x*(s.width/a.width),y:s.top+n.y*(s.height/a.height)},r=i.ownerDocument.defaultView}return n}function Eyt(t){const e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<Oyt?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e}}function Tyt(t,e){return{x:t.a*e.x+t.c*e.y,y:t.b*e.x+t.d*e.y}}function Pyt(t){var i;const e=(i=t.ownerDocument.defaultView)==null?void 0:i.getComputedStyle(t).transform;if(!e||!e.startsWith("matrix3d("))return 1;const n=e.slice(9,-1).split(","),r=Number.parseFloat(n[15]??"");return Number.isFinite(r)&&r>0?r:1}function Myt(t,e,n={}){const r=n.probeSize??wyt;if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:"Invalid movement probe size."};const i=J1(t);try{rv(t,e);const s=ND(t);if(!s)return{ok:!1,reason:"Element has no measurable box."};rv(t,{x:e.x+r,y:e.y});const a=ND(t);if(!a)return{ok:!1,reason:"Element X movement could not be measured."};rv(t,{x:e.x,y:e.y+r});const o=ND(t);if(!o)return{ok:!1,reason:"Element Y movement could not be measured."};const l={x:(a.x-s.x)/r,y:(a.y-s.y)/r},c={x:(o.x-s.x)/r,y:(o.y-s.y)/r};if(!_te(l)||!_te(c)||Rte(l)<Ite||Rte(c)<Ite)return{ok:!1,reason:"Element movement response is too small to measure."};const u={a:l.x,b:l.y,c:c.x,d:c.y},f=Eyt(u);return f?{ok:!0,matrix:f}:{ok:!1,reason:"Element movement response is not invertible."}}finally{lc(t,i)}}function Nyt(t){const e=Tyt(t.screenToOffset,{x:t.dx,y:t.dy});return{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y}}function Dk(t){var c,u,f,h,m;const e=ZHe(t.element);t.element.setAttribute("data-hf-drag-initial-offset-x",String(e.x)),t.element.setAttribute("data-hf-drag-initial-offset-y",String(e.y));const n=t.element.ownerDocument.defaultView,r=((u=(c=n==null?void 0:n.gsap)==null?void 0:c.getProperty)==null?void 0:u.call(c,t.element,"x"))||0,i=((h=(f=n==null?void 0:n.gsap)==null?void 0:f.getProperty)==null?void 0:h.call(f,t.element,"y"))||0;if(t.element.setAttribute("data-hf-drag-gsap-base-x",String(r)),t.element.setAttribute("data-hf-drag-gsap-base-y",String(i)),n!=null&&n.__timelines){const y=[];for(const[d,v]of Object.entries(n.__timelines))try{v!=null&&v.pause&&!((m=v.paused)!=null&&m.call(v))&&(v.pause(),y.push(d))}catch{}y.length>0&&t.element.setAttribute("data-hf-drag-paused-timelines",y.join(","))}const s=J1(t.element),a=X_(t.element),o=Myt(t.element,e,{scaleX:t.rect.editScaleX,scaleY:t.rect.editScaleY}),l={x:r,y:i};if(!o.ok){const y=t.rect.editScaleX||1,d=t.rect.editScaleY||1,v=Pyt(t.element);return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,baseGsap:l,initialPathOffset:s,gestureToken:a,screenToOffset:{a:v/y,b:0,c:0,d:v/d},originRect:t.rect}}}return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,baseGsap:l,initialPathOffset:s,gestureToken:a,screenToOffset:o.matrix,originRect:t.rect}}}function yve(t,e,n){return Nyt({initialOffset:t.initialOffset,screenToOffset:t.screenToOffset,dx:e,dy:n})}function dV(t,e,n){const r=yve(t,e,n);return hV(t.element,r,t.baseGsap)||rv(t.element,r),r}function Dyt(t){t.element.setAttribute("data-hf-drag-gsap-base-x",String(t.baseGsap.x)),t.element.setAttribute("data-hf-drag-gsap-base-y",String(t.baseGsap.y)),t.element.setAttribute("data-hf-drag-initial-offset-x",String(t.initialOffset.x)),t.element.setAttribute("data-hf-drag-initial-offset-y",String(t.initialOffset.y))}function xve(t,e){return Dyt(t),hV(t.element,e,t.baseGsap)||fC(t.element,e),e}function DD(t,e,n){return xve(t,yve(t,e,n))}function Iyt(t,e){const n={x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y};return hV(t.element,n,t.baseGsap)||rv(t.element,n),n}function _yt(t,e){return xve(t,{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y})}function Ryt(t){lc(t.element,t.initialPathOffset),tu(t.element,t.gestureToken)}function Cv(t){for(const e of t)Ryt(e),Ik(e.element)}function i6(t){for(const e of t)tu(e.element,e.gestureToken),e.element.removeAttribute("data-hf-drag-initial-offset-x"),e.element.removeAttribute("data-hf-drag-initial-offset-y"),e.element.removeAttribute("data-hf-drag-gsap-base-x"),e.element.removeAttribute("data-hf-drag-gsap-base-y"),e.element.style.getPropertyValue("translate")==="none"&&e.element.style.removeProperty("translate"),e5(e.element)&&Ode(e.element),Ik(e.element)}function Ik(t){var i,s,a,o,l,c,u;const e=t.getAttribute("data-hf-drag-paused-timelines");if(t.removeAttribute("data-hf-drag-paused-timelines"),!e)return;const n=t.ownerDocument.defaultView;if(!n)return;for(const f of e.split(","))try{(a=(s=(i=n.__timelines)==null?void 0:i[f])==null?void 0:s.paused)==null||a.call(s,!1)}catch{}const r=((l=(o=n.__player)==null?void 0:o.getTime)==null?void 0:l.call(o))??0;(u=(c=n.__player)==null?void 0:c.seek)==null||u.call(c,r)}const ID=1,jyt=3;function Lyt(t){const e=Math.hypot(t.pointerStart.x-t.centerStart.x,t.pointerStart.y-t.centerStart.y);return!Number.isFinite(e)||e<jyt?1:Math.hypot(t.pointer.x-t.centerStart.x,t.pointer.y-t.centerStart.y)/e}function Fyt(t){const e=Math.max(t.baseWidth,ID),n=Math.max(t.baseHeight,ID),r=Lyt({pointer:t.pointer,pointerStart:t.pointerStart,centerStart:t.centerStart}),i=ID/Math.min(e,n),s=Math.max(i,r);return{width:e*s,height:n*s}}const $yt=["ns-resize","nesw-resize","ew-resize","nwse-resize","ns-resize","nesw-resize","ew-resize","nwse-resize"],Byt={nw:315,ne:45,se:135,sw:225};function Vyt(t,e){const r=((Byt[t]+e)%360+360)%360,i=Math.round(r/45)%8;return $yt[i]}function Hyt(t,e,n){const r=t??{dx:0,dy:0};return{dx:r.dx+(e.x-n.x),dy:r.dy+(e.y-n.y)}}function Qyt(t,e,n){const r=t.resizeFixedCenterStart;if(e&&r)return Hyt(t.lastResizeAnchor,r,dve(e));const i=n();return dyt({originWidth:t.originWidth,originHeight:t.originHeight,overlayWidth:i?i.width:t.originWidth,overlayHeight:i?i.height:t.originHeight})}function zyt(t,e,n,r,i,s){const a=r&&i?cV(r,i,n):null,o=Qyt(t,a,s);return t.lastResizeAnchor=o,dV(e,o.dx,o.dy),s()??{left:t.originLeft+o.dx,top:t.originTop+o.dy,width:a?Mk(a.nw,a.ne):t.originWidth,height:a?Mk(a.nw,a.sw):t.originHeight,editScaleX:t.editScaleX,editScaleY:t.editScaleY,angle:t.actualRotation}}function Zyt(t,e,n,r,i){return t.pathOffsetMember?zyt(t,t.pathOffsetMember,e,n,r,i):i()??{left:t.originLeft,top:t.originTop,width:t.originWidth,height:t.originHeight,editScaleX:t.editScaleX,editScaleY:t.editScaleY,angle:t.actualRotation}}const bve=6,Gyt=4;function vve(t,e){return Math.hypot(t,e)>=Gyt}const Lte=1;function sw(t){return t.left+t.width}function aw(t){return t.top+t.height}function t5(t){return t.left+t.width/2}function n5(t){return t.top+t.height/2}function Uyt(t){return t.map(({rect:e,id:n})=>({left:e.left,top:e.top,right:sw(e),bottom:aw(e),centerX:t5(e),centerY:n5(e),id:n}))}function Xyt(t){return{left:t.left,top:t.top,right:sw(t),bottom:aw(t),centerX:t5(t),centerY:n5(t),id:"composition"}}function Wyt(t,e,n){const r=[],i=[];if(e<=0||n<=0)return{x:r,y:i};const s=e*n;let a=t.left+s;const o=t.left+t.width;let l=0;for(;a<o;)r.push({position:a,source:"grid",id:`grid-x-${l}`}),a+=s,l++;let c=t.top+s;const u=t.top+t.height;for(l=0;c<u;)i.push({position:c,source:"grid",id:`grid-y-${l}`}),c+=s,l++;return{x:r,y:i}}function Fte(t,e,n,r,i){const s=[];for(const a of e){const o=n(a);for(const l of t)for(const c of o){const u=c-l,f=Math.abs(u);f<=i&&s.push({adjustment:u,distance:f,guidePosition:c,source:a.id==="composition"?"composition":"element",targetId:a.id})}}if(r)for(const a of r)for(const o of t){const l=a.position-o,c=Math.abs(l);c<=i&&s.push({adjustment:l,distance:c,guidePosition:a.position,source:"grid",targetId:a.id})}return s}function $te(t){if(t.length===0)return null;const e=t.filter(h=>h.source==="element"||h.source==="composition"),n=t.filter(h=>h.source==="grid");let r;const i=e.length?Math.min(...e.map(h=>h.distance)):1/0,s=n.length?Math.min(...n.map(h=>h.distance)):1/0;i<=s?r=e:r=n;const a=Math.min(...r.map(h=>h.distance)),o=r.filter(h=>h.distance===a),l=o.some(h=>h.adjustment>0),c=o.some(h=>h.adjustment<0);if(l&&c)return null;const u=o[0].adjustment,f=r.filter(h=>h.adjustment===u);return{adjustment:u,matches:f}}function qyt(t,e,n,r){const i=[];if(t==="x"){i.push(e.top,aw(e));for(const s of n){const a=r.get(s);a&&i.push(a.top,a.bottom)}}else{i.push(e.left,sw(e));for(const s of n){const a=r.get(s);a&&i.push(a.left,a.right)}}return{from:Math.min(...i),to:Math.max(...i)}}function Yyt(t,e,n,r){const i=[];for(const[s,a]of[["x",t],["y",e]]){if(!a)continue;const o=new Set;for(const l of a.matches){if(o.has(l.guidePosition))continue;o.add(l.guidePosition);const c=a.matches.filter(f=>f.guidePosition===l.guidePosition).map(f=>f.targetId),u=qyt(s,n,c,r);i.push({axis:s,position:l.guidePosition,from:u.from,to:u.to})}}return i}const Kyt=(t,e)=>({dx:t,dy:e,guides:[],spacingGuides:[]});function Ave(t){var f,h;if(t.disabled||t.disabledForTravel||t.threshold<=0)return Kyt(t.proposedDx,t.proposedDy);const e=t.movingRect,n={left:e.left+t.proposedDx,top:e.top+t.proposedDy,width:e.width,height:e.height},r=Fte([n.left,t5(n),sw(n)],t.targets,m=>[m.left,m.centerX,m.right],(f=t.gridEdges)==null?void 0:f.x,t.threshold),i=Fte([n.top,n5(n),aw(n)],t.targets,m=>[m.top,m.centerY,m.bottom],(h=t.gridEdges)==null?void 0:h.y,t.threshold),s=$te(r),a=$te(i),o=t.proposedDx+((s==null?void 0:s.adjustment)??0),l=t.proposedDy+((a==null?void 0:a.adjustment)??0),c={left:e.left+o,top:e.top+l,width:e.width,height:e.height},u=new Map(t.targets.map(m=>[m.id,m]));return{dx:o,dy:l,guides:Yyt(s,a,c,u),spacingGuides:[]}}function Jyt(t,e){return t.axis==="x"?{left:t.position,top:e.top,width:1,height:e.height}:{left:e.left,top:t.position,width:e.width,height:1}}function Sve(t){const e=[],n=t.movingRect,r={left:n.left,top:n.top,right:sw(n),bottom:aw(n),centerX:t5(n),centerY:n5(n),id:"\0__snap_moving__"},i=[...t.targets,r],s=[...i].sort((o,l)=>o.centerX-l.centerX);for(let o=0;o<s.length-2;o++){const l=s[o],c=s[o+1],u=s[o+2],f=c.left-l.right,h=u.left-c.right;if(!(f<0||h<0||!(l.id==="\0__snap_moving__"||c.id==="\0__snap_moving__"||u.id==="\0__snap_moving__"))&&Math.abs(f-h)<=Lte){const y=Math.min(l.top,c.top,u.top),d=Math.max(l.bottom,c.bottom,u.bottom);e.push({axis:"x",position:l.right,size:f,from:y,to:d}),e.push({axis:"x",position:c.right,size:h,from:y,to:d})}}const a=[...i].sort((o,l)=>o.centerY-l.centerY);for(let o=0;o<a.length-2;o++){const l=a[o],c=a[o+1],u=a[o+2],f=c.top-l.bottom,h=u.top-c.bottom;if(!(f<0||h<0||!(l.id==="\0__snap_moving__"||c.id==="\0__snap_moving__"||u.id==="\0__snap_moving__"))&&Math.abs(f-h)<=Lte){const y=Math.min(l.left,c.left,u.left),d=Math.max(l.right,c.right,u.right);e.push({axis:"y",position:l.bottom,size:f,from:y,to:d}),e.push({axis:"y",position:c.bottom,size:h,from:y,to:d})}}return e}function Bte(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}const ext=new Set(["script","style","link","meta","base","template","br","wbr"]);function txt(t){return t.nodeType===1}function nxt(t,e,n){const r=[],i=s=>{if(!(r.length>=n))for(const a of Array.from(s.children))txt(a)&&(ext.has(a.tagName.toLowerCase())||a.hasAttribute("data-composition-id")||e.has(a)||aV(a)&&(r.push(a),i(a)))};return i(t),r}function wve(t){const e=to(),n=e.snapEnabled??!0,r=t.iframe.contentDocument;if(!r)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const i=r.querySelector("[data-composition-id]")??r.documentElement,s=i==null?void 0:i.getBoundingClientRect(),a=Bte((i==null?void 0:i.getAttribute("data-width"))??null),o=Bte((i==null?void 0:i.getAttribute("data-height"))??null),l=a??(s==null?void 0:s.width),c=o??(s==null?void 0:s.height);if(!l||!c||!s)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const u=t.iframe.getBoundingClientRect(),f=t.overlayEl.getBoundingClientRect(),h=u.width/l;u.height/c;const m={left:u.left-f.left,top:u.top-f.top,width:u.width,height:u.height},y=Xyt(m),v=nxt(i,t.excludeElements,80),b=[];for(let M=0;M<v.length;M++){const N=oV(t.overlayEl,t.iframe,v[M]);N&&b.push({rect:N,id:`snap-target-${M}`})}const w=Uyt(b);let O=null;const k=e.gridSpacing??50;return(e.snapToGrid??!1)&&k>0&&(O=Wyt(m,k,h)),{targets:w,compositionTarget:y,gridEdges:O,snapEnabled:n}}function Ove(t){const e=new Set,n=t.selection;if(n!=null&&n.element&&e.add(n.element),t.groupSelections)for(const r of t.groupSelections)r.element&&e.add(r.element);return e}const bf=Z0("drag");let s6=0;function rxt(t){bf("move",()=>(s6+=1,s6%8===1?{n:s6,...t}:null))}function ixt(){s6=0}function cd(t){const e={};for(const{key:n,element:r}of t){const i=r.getBoundingClientRect();e[n]=`${Math.round(i.left)},${Math.round(i.top)}`}return e}function sxt(t,e){var a,o;const n=new Map;for(const l of Object.keys(e)){const c=(a=t[l])==null?void 0:a.split(",").map(Number),u=(o=e[l])==null?void 0:o.split(",").map(Number);!c||!u||c.length!==2||u.length!==2||n.set(l,`${Math.round(u[0]-c[0])},${Math.round(u[1]-c[1])}`)}const r=new Map;for(const l of n.values())r.set(l,(r.get(l)??0)+1);let i="",s=0;for(const[l,c]of r)c>s&&([i,s]=[l,c]);return[...n].filter(([,l])=>l!==i).map(([l,c])=>`${l.split("|")[2]??l} moved ${c}, group moved ${i}`)}function axt(t,e){bf(t,()=>{var i;const n=cd(e),r=(i=e[0])==null?void 0:i.element.ownerDocument.defaultView;return r&&(r.setTimeout(()=>bf(`${t}+120ms`,()=>({at:cd(e)})),120),r.setTimeout(()=>bf(`${t}+400ms`,()=>({at:cd(e)})),400),r.setTimeout(()=>bf(`${t}+900ms`,()=>({at:cd(e)})),900)),{at:n}})}function oxt(t,e){var c,u,f;const n=e.groupOverlayItemsRef.current;if(n.length<=1)return!1;const r=(c=n.find(h=>!h.selection.capabilities.canApplyManualOffset))==null?void 0:c.selection;if(r)return t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(r),!1;(f=(u=e.onManualDragStartRef).current)==null||f.call(u);const i=mve(n),s=[];for(const h of i){const m=Dk({key:h.key,selection:h.selection,element:h.element,rect:h.rect});if(!m.ok)return Cv(s),t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(m.selection),!1;s.push(m.member)}ixt(),bf("group-start",{members:Object.fromEntries(s.map(h=>[h.key,{map:`${h.screenToOffset.a.toFixed(3)},${h.screenToOffset.d.toFixed(3)}`,base:`${Math.round(h.baseGsap.x)},${Math.round(h.baseGsap.y)}`,offset:`${Math.round(h.initialOffset.x)},${Math.round(h.initialOffset.y)}`}])),at:cd(s)});const a=e.overlayRef.current,o=e.iframeRef.current,l=a&&o?wve({overlayEl:a,iframe:o,excludeElements:Ove({groupSelections:n.map(h=>h.selection)})}):void 0;return t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId),e.rafPausedRef.current=!0,e.groupGestureRef.current={startX:t.clientX,startY:t.clientY,originItems:n,members:s,snapContext:l},!0}function lxt(t,e,n,r){var $,Q,Y;const i=(r==null?void 0:r.selection)??n.selectionRef.current,s=(r==null?void 0:r.rect)??n.overlayRectRef.current,a=n.boxRef.current,o=n.overlayRef.current;if(!i||!s||t!=="drag"&&!a)return!1;const l=t==="rotate"?"rotation":t==="drag"?"path-offset":"box-size";if(t==="drag"&&!i.capabilities.canApplyManualOffset||t==="resize"&&!i.capabilities.canApplyManualSize||t==="rotate"&&!i.capabilities.canApplyManualRotation||t==="resize"&&(!Number.isFinite(s.width)||!Number.isFinite(s.height)))return!1;const c=o3(i.element),u={angle:Syt(i.element)+gde(i.element).angle},f=i.element.offsetWidth,h=i.element.offsetHeight,m=c.width>0?c.width:f>0?f:s.width/s.editScaleX,y=c.height>0?c.height:h>0?h:s.height/s.editScaleY,d=s.width/(s.editScaleX*m),v=s.height/(s.editScaleY*y),b=Number.isFinite(d)&&d>0?d:1,w=Number.isFinite(v)&&v>0?v:1;let O;if(t==="resize"){const W=i.element.getBoundingClientRect();O={anchorX:W.x,anchorY:W.y,baseGsapX:WY(i.element,"x")??0,baseGsapY:WY(i.element,"y")??0,pinX:0,pinY:0}}let k=J1(i.element),E,M;if(t==="drag"){(Q=($=n.onManualDragStartRef).current)==null||Q.call($),n.rafPausedRef.current=!0;const W=Dk({key:lf(i),selection:i,element:i.element,rect:s});if(!W.ok)return n.onBlockedMoveRef.current(W.selection),!1;M=W.member,k=W.member.initialPathOffset,E=W.member.gestureToken}else if(t==="resize"&&i.capabilities.canApplyManualOffset){const J=Dk({key:lf(i),selection:i,element:i.element,rect:s});J.ok?(M=J.member,k=J.member.initialPathOffset,E=J.member.gestureToken):E=X_(i.element)}else E=X_(i.element);const N=o==null?void 0:o.getBoundingClientRect(),I=((N==null?void 0:N.left)??0)+s.left+s.width/2,_=((N==null?void 0:N.top)??0)+s.top+s.height/2,j=n.iframeRef.current;let L;if(t==="resize"&&M&&o&&j){const W=cV(o,j,i.element);W&&(L=dve(W))}const B=(t==="drag"||t==="resize")&&o&&j?wve({overlayEl:o,iframe:j,excludeElements:Ove({selection:i})}):void 0;return e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),n.rafPausedRef.current=!0,n.gestureRef.current={kind:t,mode:l,selection:i,startX:e.clientX,startY:e.clientY,centerX:I,centerY:_,initialPathOffset:k,initialRotation:J_(i.element),initialBoxSize:K_(i.element),pathOffsetMember:M,originLeft:s.left,originTop:s.top,originWidth:s.width,originHeight:s.height,actualWidth:m,actualHeight:y,actualRotation:u.angle,editScaleX:s.editScaleX,editScaleY:s.editScaleY,contentScaleX:b,contentScaleY:w,resizeAnchor:O,manualEditDragToken:E,snapContext:B,resizeHandle:t==="resize"?(r==null?void 0:r.resizeHandle)??"se":void 0,resizeFixedCenterStart:L},t==="resize"&&(ort(),aa("start",{handle:(r==null?void 0:r.resizeHandle)??"se",pointer:{x:e.clientX,y:e.clientY},center:{x:I,y:_},origin:{left:s.left,top:s.top,w:s.width,h:s.height},actual:{w:m,h:y},editScale:{x:s.editScaleX,y:s.editScaleY},contentScale:{x:b,y:w},rotation:u.angle,hasOffsetMember:!!M,fixedCenterStart:L??null,initialBoxSize:((Y=n.gestureRef.current)==null?void 0:Y.initialBoxSize)??null,initialInlineStyle:i.element.getAttribute("style")})),!0}function cxt(t,e){let n={},r=null;const i=(a,o,l)=>{const c=a.snapContext;if(!(c!=null&&c.snapEnabled)||c.targets.length===0)return l;if(!vve(l.dx,l.dy))return t.snapGuidesRef.current=null,l;const u=fV(a.originItems.map(d=>d.rect));if(!u)return l;const f=c.compositionTarget?[...c.targets,c.compositionTarget]:c.targets,h=Ave({movingRect:u,proposedDx:l.dx,proposedDy:l.dy,targets:f,gridEdges:c.gridEdges??void 0,threshold:bve,disabled:o.altKey}),m={...u,left:u.left+h.dx,top:u.top+h.dy},y=o.altKey?[]:Sve({movingRect:m,targets:f});return t.snapGuidesRef.current={guides:h.guides,spacingGuides:y},{dx:h.dx,dy:h.dy}};return(a,o)=>{a!==r&&(r=a,n={});const{dx:l,dy:c}=i(a,o,{dx:o.clientX-a.startX,dy:o.clientY-a.startY});a.lastSnappedDx=l,a.lastSnappedDy=c,e(a.originItems.map(v=>({...v,rect:{...v.rect,left:v.rect.left+l,top:v.rect.top+c}})));const u={};for(const v of a.members){const b=dV(v,l,c);u[v.key]=`${Math.round(b.x)},${Math.round(b.y)}`}const f=cd(a.members),h=Math.round(o.clientX-a.startX),m=Math.round(o.clientY-a.startY),y={pointer:`${h},${m}`,applied:`${Math.round(l)},${Math.round(c)}`,at:f},d=sxt(n,f);d.length>0&&bf("drift",{...y,drift:d}),n=f,rxt({...y,offsets:u})}}function Vte(t,e){e instanceof DF||console.error(t,e)}function uxt(t){const e=f=>{t.setOverlayRect(f)},n=f=>{e({left:f.originLeft,top:f.originTop,width:f.originWidth,height:f.originHeight,editScaleX:f.editScaleX,editScaleY:f.editScaleY,angle:f.actualRotation})},r=f=>{t.setGroupOverlayItems(f)},i=f=>{Cv(f.members),r(f.originItems)},s=f=>oxt(f,t),a=(f,h,m)=>lxt(f,h,t,m),o=cxt(t,r);return{startGesture:a,startGroupDrag:s,onPointerMove:f=>{const h=t.gestureRef.current,m=t.groupGestureRef.current,y=(h==null?void 0:h.selection)??t.selectionRef.current,d=t.boxRef.current,v=t.blockedMoveRef.current;if(!v&&!h&&!m&&t.onCanvasPointerMoveRef.current(f,{preferClipAncestor:!1}),v&&y){const O=f.clientX-v.startX,k=f.clientY-v.startY;!v.notified&&Math.hypot(O,k)>=J8&&(v.notified=!0,t.suppressNextBoxClickRef.current=!0,t.onBlockedMoveRef.current(y));return}if(m){o(m,f);return}if(!h||!y)return;let b=f.clientX-h.startX,w=f.clientY-h.startY;if(h.kind==="rotate"){const O=Dte({centerX:h.centerX,centerY:h.centerY,startX:h.startX,startY:h.startY,currentX:f.clientX,currentY:f.clientY,actualAngle:h.actualRotation,snap:f.shiftKey});MD(y.element,O.angle)||tQe(y.element,O);return}if(h.kind==="drag"){const O=h.snapContext;if(!(Math.abs(h.actualRotation)>=cyt)&&(O!=null&&O.snapEnabled)&&O.targets.length>0){const N=Qy({left:h.originLeft,top:h.originTop,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY},h.selection.element),I=O.compositionTarget?[...O.targets,O.compositionTarget]:O.targets,_=Ave({movingRect:N,proposedDx:b,proposedDy:w,disabledForTravel:!vve(b,w),targets:I,gridEdges:O.gridEdges??void 0,threshold:bve,disabled:f.altKey});b=_.dx,w=_.dy;const j={left:N.left+b,top:N.top+w,width:N.width,height:N.height},L=f.altKey?[]:Sve({movingRect:j,targets:I});t.snapGuidesRef.current={guides:_.guides,spacingGuides:L}}h.lastSnappedDx=b,h.lastSnappedDy=w;const E=h.originLeft+b,M=h.originTop+w;e({left:E,top:M,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY,angle:h.actualRotation}),d&&(d.style.left=`${E}px`,d.style.top=`${M}px`),h.pathOffsetMember&&dV(h.pathOffsetMember,b,w)}else{if(!d)return;const O=Fyt({baseWidth:h.actualWidth,baseHeight:h.actualHeight,pointer:{x:f.clientX,y:f.clientY},pointerStart:{x:h.startX,y:h.startY},centerStart:{x:h.centerX,y:h.centerY}});KHe(y.element,O);const k=t.overlayRef.current,E=t.iframeRef.current,M=()=>k&&E?uV(k,E,y.element):null,N=Zyt(h,y.element,k,E,M);art({pointer:{x:f.clientX,y:f.clientY},nextSize:O,anchor:h.lastResizeAnchor??null,draftRect:N,liveInlineStyle:y.element.getAttribute("style")}),d.style.left=`${N.left}px`,d.style.top=`${N.top}px`,d.style.width=`${N.width}px`,d.style.height=`${N.height}px`,e(N)}},onPointerUp:f=>{t.snapGuidesRef.current=null;const h=t.gestureRef.current,m=t.groupGestureRef.current,y=(h==null?void 0:h.selection)??t.selectionRef.current,d=t.boxRef.current;if(t.blockedMoveRef.current=null,m){t.groupGestureRef.current=null,t.rafPausedRef.current=!1;const b=f.clientX-m.startX,w=f.clientY-m.startY;if(t.suppressNextBoxClickRef.current=!0,Math.hypot(b,w)<J8){i(m);return}const O=m.lastSnappedDx??b,k=m.lastSnappedDy??w;r(m.originItems.map(M=>({...M,rect:{...M.rect,left:M.rect.left+O,top:M.rect.top+k}})));const E=m.members.map(M=>({selection:M.selection,next:DD(M,O,k)}));bf("drop",{pointer:`${Math.round(b)},${Math.round(w)}`,applied:`${Math.round(O)},${Math.round(k)}`,committed:Object.fromEntries(E.map((M,N)=>{var I;return[((I=m.members[N])==null?void 0:I.key)??String(N),`${Math.round(M.next.x)},${Math.round(M.next.y)}`]})),at:cd(m.members)}),Promise.resolve(t.onGroupPathOffsetCommitRef.current(E)).catch(()=>{for(const M of m.members)M.gestureToken&&x2(M.element,M.gestureToken)&&lc(M.element,M.initialPathOffset)}).finally(()=>{bf("committed",{at:cd(m.members)}),i6(m.members),axt("settle",m.members)});return}if(!h||!y){t.gestureRef.current=null,t.rafPausedRef.current=!1;return}t.gestureRef.current=null,t.rafPausedRef.current=!1;const v=Math.hypot(f.clientX-h.startX,f.clientY-h.startY);if(h.kind==="drag"&&v<J8){lc(y.element,h.initialPathOffset),tu(y.element,h.manualEditDragToken),Ik(y.element),d&&(d.style.left=`${h.originLeft}px`,d.style.top=`${h.originTop}px`),n(h),t.suppressNextBoxClickRef.current=!0,t.onCanvasMouseDown(f,{preferClipAncestor:!1,hoverSelection:t.hoverSelectionRef.current});return}if(h.kind==="resize"&&v<J8){sv(y.element,h.initialBoxSize),h.pathOffsetMember?Cv([h.pathOffsetMember]):tu(y.element,h.manualEditDragToken),d&&(d.style.width=`${h.originWidth}px`,d.style.height=`${h.originHeight}px`),n(h),t.suppressNextBoxClickRef.current=!0;return}if(h.kind==="rotate"){const b=Dte({centerX:h.centerX,centerY:h.centerY,startX:h.startX,startY:h.startY,currentX:f.clientX,currentY:f.clientY,actualAngle:h.actualRotation,snap:f.shiftKey}),w=()=>{MD(y.element,h.actualRotation)||hC(y.element,h.initialRotation)};if(!gyt(h.actualRotation,b.angle)){w(),tu(y.element,h.manualEditDragToken);return}MD(y.element,b.angle)||TF(y.element,b),Promise.resolve(t.onRotationCommitRef.current(y,b)).catch(O=>{Vte("rotate commit failed",O),h.manualEditDragToken&&x2(y.element,h.manualEditDragToken)&&w()}).finally(()=>tu(y.element,h.manualEditDragToken))}else if(h.kind==="drag"){t.suppressNextBoxClickRef.current=!0;const b=h.lastSnappedDx??f.clientX-h.startX,w=h.lastSnappedDy??f.clientY-h.startY;if(!h.pathOffsetMember)return;const O=DD(h.pathOffsetMember,b,w),k=h.originLeft+b,E=h.originTop+w;e({left:k,top:E,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY,angle:h.actualRotation}),d&&(d.style.left=`${k}px`,d.style.top=`${E}px`),Promise.resolve(t.onPathOffsetCommitRef.current(y,O,{altKey:f.altKey})).catch(()=>{var M;(M=h.pathOffsetMember)!=null&&M.gestureToken&&x2(y.element,h.pathOffsetMember.gestureToken)&&lc(y.element,h.initialPathOffset)}).finally(()=>{h.pathOffsetMember&&i6([h.pathOffsetMember])})}else{t.suppressNextBoxClickRef.current=!0;const b=o3(y.element);kF(y.element,b);const w=h.pathOffsetMember,O=h.lastResizeAnchor,k=w&&O&&(O.dx!==0||O.dy!==0)?DD(w,O.dx,O.dy):null;aa("release",{finalSize:b,anchor:O??null,finalOffset:k??null,hasMember:!!w,inlineStyle:y.element.getAttribute("style")});const E=()=>{!h.manualEditDragToken||!x2(y.element,h.manualEditDragToken)||(sv(y.element,h.initialBoxSize),k&&lc(y.element,h.initialPathOffset))};Promise.resolve(t.onBoxSizeCommitRef.current(y,b,k??void 0,E)).catch(M=>{Vte("resize commit failed",M)}).finally(()=>{w?i6([w]):tu(y.element,h.manualEditDragToken)}),RR(y.element,"post-release")}},clearPointerState:f=>{t.snapGuidesRef.current=null;const h=t.groupGestureRef.current;h&&i(h);const m=t.gestureRef.current,y=(m==null?void 0:m.selection)??f.current;(m==null?void 0:m.mode)==="path-offset"&&y&&(lc(y.element,m.initialPathOffset),tu(y.element,m.manualEditDragToken),Ik(y.element),n(m)),(m==null?void 0:m.mode)==="box-size"&&y&&(sv(y.element,m.initialBoxSize),m.pathOffsetMember?Cv([m.pathOffsetMember]):tu(y.element,m.manualEditDragToken),n(m)),(m==null?void 0:m.mode)==="rotation"&&y&&(hC(y.element,m.initialRotation),tu(y.element,m.manualEditDragToken)),t.blockedMoveRef.current=null,t.groupGestureRef.current=null,t.gestureRef.current=null,t.rafPausedRef.current=!1}}}const fxt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),hxt=1,dxt=10,pxt=400;function mxt(t){if(t.metaKey||t.ctrlKey||t.altKey||!fxt.has(t.key))return null;const e=t.shiftKey?dxt:hxt;return{dx:t.key==="ArrowLeft"?-e:t.key==="ArrowRight"?e:0,dy:t.key==="ArrowUp"?-e:t.key==="ArrowDown"?e:0}}function Cve(t){return t.length>0&&t.every(e=>e.capabilities.canApplyManualOffset)}function kve(t){return t?[t.id??"",t.hfId??"",t.selector??"",t.selectorIndex??"",t.label].join("\0"):""}function gxt(t){return t.map(kve).join(" ")}function yxt(t){return Cve(t.map(e=>e.selection))?mve(t):null}function xxt(t,e){return!t||!e||!t.capabilities.canApplyManualOffset||!t.element.isConnected?null:[{key:t.id??t.selector??t.label,selection:t,element:t.element,rect:e}]}function bxt(t,e){return!t.allowCanvasMovement||e.defaultPrevented||t.gestureRef.current||t.groupGestureRef.current||t.blockedMoveRef.current?!0:Hf(e.target)}function vxt(t){const e=x.useRef(null),n=x.useRef(t);n.current=t;const r=()=>{const f=e.current;if(!f)return;e.current=null,f.timer&&clearTimeout(f.timer);const h=f.members.map(d=>({selection:d.selection,next:_yt(d,f.accum)})),m=n.current,y=f.isGroup?m.onGroupPathOffsetCommitRef.current(h):m.onPathOffsetCommitRef.current(h[0].selection,h[0].next);Promise.resolve(y).catch(()=>{for(const d of f.members)x2(d.element,d.gestureToken)&&lc(d.element,d.initialPathOffset)}).finally(()=>i6(f.members))},i=x.useRef(r);i.current=r;const s=()=>{var v,b;const f=n.current,h=f.groupOverlayItemsRef.current,m=h.length>1,y=m?yxt(h):xxt(f.selectionRef.current,f.overlayRectRef.current);if(!y)return null;const d=[];for(const w of y){const O=Dk(w);if(!O.ok)return Cv(d),null;d.push(O.member)}return d.length===0?null:((b=(v=f.onManualDragStartRef).current)==null||b.call(v),{members:d,isGroup:m,accum:{x:0,y:0},timer:null})},a=f=>{const h=n.current;if(bxt(h,f))return;const m=mxt(f);if(!m)return;const y=e.current??s();if(y){e.current=y,f.preventDefault(),y.accum={x:y.accum.x+m.dx,y:y.accum.y+m.dy};for(const d of y.members)Iyt(d,y.accum);y.timer&&clearTimeout(y.timer),y.timer=setTimeout(()=>i.current(),pxt)}},o=x.useRef(a);o.current=a,wr(()=>{const f=h=>o.current(h);return window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0),i.current()}});const l=kve(t.selection),c=gxt(t.groupSelections);return x.useEffect(()=>()=>i.current(),[l,c]),x.useEffect(()=>{const f=t.groupSelections.length>1?t.groupSelections:t.selection?[t.selection]:[];if(!(!t.allowCanvasMovement||!Cve(f)))return BBe()},[t.selection,t.groupSelections,t.allowCanvasMovement]),{flushNudge:x.useCallback(()=>i.current(),[])}}const Hte=6,Qte=4,zte="rgba(255, 68, 204, 0.85)",e4="rgba(255, 68, 204, 0.6)",Axt="rgba(255, 68, 204, 0.15)",Sxt=x.memo(function({snapGuidesRef:e,compositionLeft:n,compositionTop:r,compositionWidth:i,compositionHeight:s}){const a=x.useRef([]),o=x.useRef([]),l=x.useRef([]),c=x.useRef({left:n,top:r,width:i,height:s});return c.current={left:n,top:r,width:i,height:s},wr(()=>{let u=0;const f=()=>{u=requestAnimationFrame(f);const h=e.current,m=(h==null?void 0:h.guides)??[],y=(h==null?void 0:h.spacingGuides)??[],d=c.current;for(let v=0;v<Hte;v++){const b=a.current[v];if(!b)continue;const w=m[v];if(!w){b.style.display="none";continue}b.style.display="";const O=Jyt(w,d);b.style.left=`${O.left}px`,b.style.top=`${O.top}px`,b.style.width=`${O.width}px`,b.style.height=`${O.height}px`}for(let v=0;v<Qte;v++){const b=o.current[v],w=l.current[v];if(!b)continue;const O=y[v];if(!O){b.style.display="none";continue}b.style.display="flex",b.style.alignItems="center",b.style.justifyContent="center",O.axis==="x"?(b.style.left=`${O.position}px`,b.style.top=`${O.from}px`,b.style.width=`${O.size}px`,b.style.height=`${O.to-O.from}px`,b.style.borderLeft=`1px dashed ${e4}`,b.style.borderRight=`1px dashed ${e4}`,b.style.borderTop="none",b.style.borderBottom="none"):(b.style.left=`${O.from}px`,b.style.top=`${O.position}px`,b.style.width=`${O.to-O.from}px`,b.style.height=`${O.size}px`,b.style.borderTop=`1px dashed ${e4}`,b.style.borderBottom=`1px dashed ${e4}`,b.style.borderLeft="none",b.style.borderRight="none"),w&&(w.textContent=`${Math.round(O.size)}`)}};return u=requestAnimationFrame(f),()=>cancelAnimationFrame(u)}),p.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[Array.from({length:Hte},(u,f)=>p.jsx("div",{ref:h=>{a.current[f]=h},style:{display:"none",position:"absolute",backgroundColor:zte,zIndex:50}},`guide-${f}`)),Array.from({length:Qte},(u,f)=>p.jsx("div",{ref:h=>{o.current[f]=h},style:{display:"none",position:"absolute",zIndex:50},children:p.jsx("span",{ref:h=>{l.current[f]=h},style:{fontSize:"10px",fontFamily:"monospace",color:zte,backgroundColor:Axt,padding:"0 3px",borderRadius:"2px",lineHeight:"14px",whiteSpace:"nowrap"}})},`spacing-${f}`))]})}),wxt=x.memo(function({visible:e,spacing:n,scaleX:r,scaleY:i,compositionLeft:s,compositionTop:a,compositionWidth:o,compositionHeight:l}){if(!e||n<=0)return null;const c=n*r,u=n*i;return c<4||u<4?null:p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute",style:{left:s,top:a,width:o,height:l,backgroundImage:[`repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${c}px)`,`repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${u}px)`].join(", "),backgroundSize:`${c}px ${u}px`}})}),Zte=12,Gte=32;function Oxt(t,e){const n=e.left+e.width/2,r=e.top+e.height/2;return t==="top"?{left:n,top:e.top,transform:"translate(-50%, -100%)"}:t==="bottom"?{left:n,top:e.top+e.height,transform:"translate(-50%, 0)"}:t==="left"?{left:e.left,top:r,transform:"translate(-100%, -50%)"}:{left:e.left+e.width,top:r,transform:"translate(0, -50%)"}}const Cxt=["top","right","bottom","left"];function kxt(t){return{hitWidth:t?Zte:Gte,hitHeight:t?Gte:Zte,cursor:t?"ew-resize":"ns-resize",pillWidth:t?4:24,pillHeight:t?24:4}}function Ext({selection:t,overlayRect:e,onStyleCommit:n}){const r=x.useRef(null),[i,s]=x.useState(!1),[a,o]=x.useState(null),l=N=>{const I=Ek(N),{radius:_,...j}=I??{top:0,right:0,bottom:0,left:0,radius:0};return{element:N,croppable:I!==null,insets:j,radius:_}},[c,u]=x.useState(()=>l(t.element));c.element!==t.element&&u(l(t.element));const f=c.insets.top>0||c.insets.right>0||c.insets.bottom>0||c.insets.left>0,h=x.useRef(!1),m=x.useRef(""),y=x.useRef(null);x.useEffect(()=>{const N=t.element;if(Ek(N)!==null)return m.current=N.style.getPropertyValue("clip-path"),y.current=null,N.style.setProperty("clip-path","none"),h.current=!0,()=>{h.current=!1;const I=y.current,_=I!==null?I||null:m.current||null;_?N.style.setProperty("clip-path",_):N.style.removeProperty("clip-path")}},[t.element]);const d=Qgt(t.element,e),v=d.width/d.scaleX,b=d.height/d.scaleY,w=fve({left:0,top:0,width:d.width,height:d.height},c.insets,d.scaleX,d.scaleY),O=(N,I)=>{n&&(I.preventDefault(),I.stopPropagation(),I.currentTarget.setPointerCapture(I.pointerId),r.current={edge:N,pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,startInsets:c.insets,didMove:!1,angleDeg:d.angleDeg,scaleX:d.scaleX,scaleY:d.scaleY},s(!0))},k=N=>{const I=r.current;if(!I||I.pointerId!==N.pointerId)return;N.preventDefault(),N.stopPropagation();const _=zgt(N.clientX-I.startX,N.clientY-I.startY,I.angleDeg),j={startInsets:I.startInsets,deltaX:_.deltaX,deltaY:_.deltaY,scaleX:I.scaleX,scaleY:I.scaleY},L=I.edge==="move"?Lgt(j):jgt({...j,edge:I.edge,width:v,height:b});I.didMove=!0,u(B=>({...B,insets:L}))},E=N=>{const I=r.current;if(!I||I.pointerId!==N.pointerId||(N.preventDefault(),N.stopPropagation(),r.current=null,s(!1),!I.didMove))return;const _=t.element,j=()=>{h.current&&_.style.setProperty("clip-path","none")},L=sV(c.insets,c.radius),B=c.insets.top>0||c.insets.right>0||c.insets.bottom>0||c.insets.left>0,$=n==null?void 0:n("clip-path",L);j(),Promise.resolve($).then(()=>{y.current=B?L:""},j)},M=N=>{const I=r.current;!I||I.pointerId!==N.pointerId||(N.preventDefault(),N.stopPropagation(),r.current=null,s(!1),u(_=>({..._,insets:I.startInsets})))};return c.croppable?p.jsxs("div",{"data-dom-edit-crop-frame":"true",className:"pointer-events-none absolute",style:{left:d.left,top:d.top,width:d.width,height:d.height,transform:d.angleDeg!==0?`rotate(${d.angleDeg}deg)`:void 0},children:[f&&p.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:p.jsx("div",{className:"absolute",style:{left:w.left,top:w.top,width:w.width,height:w.height,boxShadow:"0 0 0 100000px rgba(8, 8, 12, 0.6)"}})}),p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute border border-dashed border-studio-accent",style:{left:w.left,top:w.top,width:w.width,height:w.height},children:i&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"absolute inset-y-0 left-1/3 w-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-y-0 left-2/3 w-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-x-0 top-1/3 h-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-x-0 top-2/3 h-px bg-studio-accent/40"})]})}),f&&p.jsx("button",{type:"button","aria-label":"Reposition crop",title:"Reposition crop","data-dom-edit-crop-handle":"true",className:"pointer-events-auto absolute rounded-full border-2 border-studio-accent bg-studio-accent/30 shadow-[0_0_0_1px_rgba(0,0,0,0.4)]",style:{left:w.left+w.width/2,top:w.top+w.height/2,width:22,height:22,transform:"translate(-50%, -50%)",cursor:"move",touchAction:"none"},onPointerDown:N=>O("move",N),onPointerMove:k,onPointerUp:E,onPointerCancel:M}),Cxt.map(N=>{const I=N==="left"||N==="right",_=Oxt(N,w),j=i||f||a===N,L=kxt(I);return p.jsx("button",{type:"button","aria-label":`Crop ${N}`,title:"Crop","data-dom-edit-crop-handle":"true",className:"pointer-events-auto absolute flex items-center justify-center border-0 bg-transparent p-0",style:{left:_.left,top:_.top,width:L.hitWidth,height:L.hitHeight,transform:_.transform,cursor:L.cursor,touchAction:"none"},onPointerEnter:()=>o(N),onPointerLeave:()=>o(B=>B===N?null:B),onPointerDown:B=>O(N,B),onPointerMove:k,onPointerUp:E,onPointerCancel:M,children:p.jsx("span",{className:"pointer-events-none rounded-full bg-studio-accent/90 shadow-[0_0_0_1px_rgba(0,0,0,0.4)] transition-opacity duration-100",style:{width:L.pillWidth,height:L.pillHeight,opacity:j?1:0}})},N)})]}):null}function Txt({overlayRect:t,cropOutlineInsetPx:e,onStartRotate:n}){const r=e??{right:0,bottom:0,left:0},i=t.left+r.left,s=Math.max(0,t.width-r.left-r.right),a=t.top+t.height-r.bottom;return p.jsx("button",{type:"button",className:"pointer-events-auto absolute flex items-center justify-center border-0 bg-transparent p-0",style:{left:i+s/2,top:a+12,width:22,height:22,transform:"translateX(-50%)",touchAction:"none",cursor:"grabbing"},title:"Rotate","aria-label":"Rotate selection",onPointerDown:n,children:p.jsx("span",{className:"pointer-events-none flex h-[18px] w-[18px] items-center justify-center rounded-full border border-studio-accent/70 bg-studio-surface text-studio-accent shadow-[0_0_3px_rgba(0,0,0,0.45)]",children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),p.jsx("path",{d:"M21 3v5h-5"}),p.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),p.jsx("path",{d:"M8 16H3v5"})]})})})}const Pxt=[{handle:"nw",cursor:"nwse-resize",x:"left",y:"top"},{handle:"ne",cursor:"nesw-resize",x:"right",y:"top"},{handle:"sw",cursor:"nesw-resize",x:"left",y:"bottom"},{handle:"se",cursor:"nwse-resize",x:"right",y:"bottom"}],Mxt=16,Nxt={top:0,right:0,bottom:0,left:0};function Dxt(t,e,n){const r=Mxt/2,i=n??Nxt,s={cursor:t.cursor,touchAction:"none"};return s.left=t.x==="left"?e.left+i.left-r:e.left+e.width-i.right-r,s.top=t.y==="top"?e.top+i.top-r:e.top+e.height-i.bottom-r,s}function Ixt({groupOverlayItems:t,groupBounds:e,allowCanvasMovement:n,groupCanMove:r,gestures:i,onBoxMouseDown:s,onBoxClick:a}){return p.jsxs(p.Fragment,{children:[t.map(o=>p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-xl border border-studio-accent/70",style:{left:o.rect.left,top:o.rect.top,width:o.rect.width,height:o.rect.height}},o.key)),p.jsx("div",{"data-dom-edit-selection-box":"true",className:"pointer-events-auto absolute rounded-xl border border-studio-accent shadow-[0_0_0_1px_rgba(60,230,172,0.3)]",style:{left:e.left,top:e.top,width:e.width,height:e.height,cursor:n&&r?"move":"default"},onPointerDown:o=>{!n||!r||o.shiftKey||i.startGroupDrag(o)},onMouseDown:s,onClick:a})]})}function _xt({selection:t,overlayRect:e,allowCanvasMovement:n,cropOutlineInsetPx:r,boxRef:i,boxChromeClass:s,boxClipPath:a,selectionKey:o,groupSelectionCount:l,blockedMoveRef:c,gestures:u,onStyleCommit:f,onBoxMouseDown:h,onBoxClick:m,inlineText:y}){const d=(y==null?void 0:y.editing)??!1;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"pointer-events-none absolute inset-0",style:{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,transform:e.angle?`rotate(${e.angle}deg)`:void 0},children:[n&&!d&&t.capabilities.canApplyManualRotation&&p.jsx(Txt,{overlayRect:e,cropOutlineInsetPx:r,onStartRotate:v=>{v.stopPropagation(),u.startGesture("rotate",v)}}),p.jsx("div",{ref:i,"data-dom-edit-selection-box":"true",className:`${d?"pointer-events-none":"pointer-events-auto"} absolute rounded-md ${s}`,style:{left:e.left,top:e.top,width:e.width,height:e.height,clipPath:a,cursor:n&&t.capabilities.canApplyManualOffset?"move":"default"},onPointerDown:v=>{if(y!=null&&y.startFromPress(v)){v.preventDefault(),v.stopPropagation();return}if(!(!n||v.shiftKey)){if(t.capabilities.canApplyManualOffset){u.startGesture("drag",v);return}v.preventDefault(),v.stopPropagation(),v.currentTarget.setPointerCapture(v.pointerId),c.current={pointerId:v.pointerId,startX:v.clientX,startY:v.clientY,notified:!1}}},onMouseDown:h,onClick:m,children:r&&p.jsx("div",{className:"pointer-events-none absolute rounded-md border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{left:r.left,top:r.top,right:r.right,bottom:r.bottom}})},o),n&&!d&&t.capabilities.canApplyManualSize&&Pxt.map(v=>v.handle!=="se"&&!t.capabilities.canApplyManualOffset?null:p.jsx("div",{className:"pointer-events-auto absolute flex h-4 w-4 items-center justify-center",style:{...Dxt(v,e,r??void 0),cursor:Vyt(v.handle,e.angle??0)},onPointerDown:b=>{b.stopPropagation(),u.startGesture("resize",b,{resizeHandle:v.handle})},children:p.jsx("div",{className:"pointer-events-none h-[12px] w-[12px] rounded-full border-[1.5px] border-studio-accent bg-white shadow-[0_0_3px_rgba(0,0,0,0.45)]"})},v.handle))]}),t.capabilities.canCrop&&!d&&l<=1&&p.jsx(Ext,{selection:t,overlayRect:e,onStyleCommit:f})]})}function Rxt(t){const{selection:e,overlayRect:n}=t,r=e?Ek(e.element):null,i=!!(r&&(r.top>0||r.right>0||r.bottom>0||r.left>0)),s=n&&n.editScaleX>0?n.editScaleX:1,a=n&&n.editScaleY>0?n.editScaleY:1,o=r&&i?{top:r.top*a,right:r.right*s,bottom:r.bottom*a,left:r.left*s}:void 0;return{hasCropInsets:i,cropOutlineInsetPx:o}}function jxt(t){const e={borderRadius:8,clipPath:void 0};if(!(t!=null&&t.element))return e;try{const n=t.element.tagName.toLowerCase();if(n==="svg"||n==="img"||n==="video"||n==="canvas")return e;const r=t.element.ownerDocument.defaultView;if(!r)return e;const i=r.getComputedStyle(t.element),s=i.borderRadius,a=i.clipPath;return{borderRadius:s&&s!=="0px"?s:4,clipPath:a&&a!=="none"?a:void 0}}catch{return e}}function Lxt(t,e){return t?"":e?"shadow-[inset_0_0_0_2px_rgba(60,230,172,0.6)]":"border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]"}function Fxt(t,e){const n=r=>Math.abs(t[r]-e[r]);return n("left")<.5&&n("top")<.5&&n("width")<.5&&n("height")<.5&&n("scaleX")<.001&&n("scaleY")<.001}function $xt({iframeRef:t,overlayRef:e}){const[n,r]=x.useState({left:0,top:0,width:0,height:0,scaleX:1,scaleY:1});return wr(()=>{let i=0;const s=()=>{i=requestAnimationFrame(s);const a=t.current,o=e.current;if(!a||!o)return;const l=a.getBoundingClientRect(),c=o.getBoundingClientRect(),u=l.left-c.left,f=l.top-c.top;if(l.width<=0||l.height<=0)return;const h=a.contentDocument,m=(h==null?void 0:h.querySelector("[data-composition-id]"))??(h==null?void 0:h.documentElement),y=Number.parseFloat((m==null?void 0:m.getAttribute("data-width"))??""),d=Number.parseFloat((m==null?void 0:m.getAttribute("data-height"))??""),v=y>0?l.width/y:1,b=d>0?l.height/d:1,w={left:u,top:f,width:l.width,height:l.height,scaleX:v,scaleY:b};r(O=>Fxt(O,w)?O:w)};return i=requestAnimationFrame(s),()=>cancelAnimationFrame(i)}),n}function bb(t){return Math.round(t*100)/100}function Bxt(t){return t.map(e=>`${e.key}:${bb(e.left)},${bb(e.top)},${bb(e.width)},${bb(e.height)},${bb(e.angle??0)}`).join("|")}function Vxt(t,e){const n=(t.angle??0)*Math.PI/180,r=(Math.abs(Math.cos(n))*t.width+Math.abs(Math.sin(n))*t.height)/2,i=(Math.abs(Math.sin(n))*t.width+Math.abs(Math.cos(n))*t.height)/2,s=t.left+t.width/2,a=t.top+t.height/2;return s-r<e.left||s+r>e.left+e.width||a-i<e.top||a+i>e.top+e.height}function Hxt(t,e,n,r,i,s,a,o){if(r.width<=0||!n){s.current="",a.current=new Map,o([]);return}const l=n.querySelector("[data-composition-id]")??n.body,u=A3(l,{activeCompositionPath:i??"index.html"}),f=[],h=new Map;for(const y of u){if(!by(y.element))continue;const d=f7(e,t,y.element),v=d?{...d,...Qy(d,y.element)}:null;v&&Vxt(v,r)&&(f.push({key:y.key,left:v.left,top:v.top,width:v.width,height:v.height,angle:v.angle}),h.set(y.key,y.element))}const m=Bxt(f);m!==s.current&&(s.current=m,a.current=h,o(f))}function Qxt(t){return`${Math.round(t.left)}:${Math.round(t.top)}:${Math.round(t.width)}:${Math.round(t.height)}`}function zxt(t){t.dirtyRef.current=!1,t.sigRef.current="",t.elementsRef.current=new Map,t.setRects([])}function Zxt(t,e){var i;const n=((i=t.defaultView)==null?void 0:i.MutationObserver)??globalThis.MutationObserver;if(!n)return null;const r=new n(e);return r.observe(t.documentElement,{attributes:!0,attributeFilter:["style","class","transform","width","height","data-hidden"],childList:!0,subtree:!0}),r}const Gxt=100;function Uxt(t,e,n){return t&&n-e>=Gxt}function Xxt(t){let e=0,n="",r=Number.NEGATIVE_INFINITY;const i=()=>{t.dirtyRef.current=!0},s=o=>{var l;(l=t.observerRef.current)==null||l.disconnect(),t.observerRef.current=o!=null&&o.documentElement?Zxt(o,i):null,t.observedDocRef.current=o,t.sigRef.current=""},a=()=>{e=requestAnimationFrame(a);const o=t.iframeRef.current,l=t.overlayRef.current,c=(o==null?void 0:o.contentDocument)??null;c!==t.observedDocRef.current&&(s(c),i());const u=t.compRectRef.current,f=Qxt(u);if(f!==n&&(n=f,i()),!o||!l){t.dirtyRef.current&&zxt(t);return}const h=performance.now();Uxt(t.dirtyRef.current,r,h)&&(r=h,t.dirtyRef.current=!1,Hxt(o,l,c,u,t.activeCompositionPathRef.current,t.sigRef,t.elementsRef,t.setRects))};return e=requestAnimationFrame(a),()=>{var o;cancelAnimationFrame(e),(o=t.observerRef.current)==null||o.disconnect(),t.observerRef.current=null,t.observedDocRef.current=null}}const Wxt={"bring-forward":["M3 11 L8 8.5 L13 11 L8 13.5 Z","M8 8.5 L8 2","M5.5 4.5 L8 2 L10.5 4.5"],"send-backward":["M3 5 L8 2.5 L13 5 L8 7.5 Z","M8 7.5 L8 14","M5.5 11.5 L8 14 L10.5 11.5"],"bring-to-front":["M3 9.5 L8 7 L13 9.5 L8 12 Z","M3 12.5 L8 10 L13 12.5 L8 15 Z","M8 12.5 L8 2","M5.5 4.5 L8 2 L10.5 4.5"],"send-to-back":["M3 4 L8 1.5 L13 4 L8 6.5 Z","M3 7 L8 4.5 L13 7 L8 9.5 Z","M8 3.5 L8 14","M5.5 11.5 L8 14 L10.5 11.5"]};function qxt({action:t}){return p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 shrink-0","aria-hidden":"true",children:Wxt[t].map(e=>p.jsx("path",{d:e},e))})}const Ute=[{action:"bring-to-front",label:"Bring to front"},{action:"bring-forward",label:"Bring forward"},{action:"send-backward",label:"Send backward"},{action:"send-to-back",label:"Send to back"}],Yxt=x.memo(function({x:e,y:n,selection:r,onClose:i,onApplyZIndex:s,onZOrderCrossed:a,onDelete:o}){const l=F0(i),c=!!s,u=!!o,f=c&&u,h=200,m=8+(c?Ute.length*28:0)+(f?1:0)+(u?28:0)+8,y=n+m-window.innerHeight,d=e+h>window.innerWidth?e-h:e,v=y>0?n-y-8:n,b=r.element;function w(E){if(!s)return;const M=Bhe(b,E);if(M===null)return;const N=l$e(b,E);s(M,E,N),N&&a&&a(N,E),i()}function O(){o&&(o(r),i())}if(!c&&!u)return null;const k=E=>{E.stopPropagation()};return Fl.createPortal(p.jsxs("div",{ref:l,className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:d,top:v},onPointerDown:k,onMouseDown:k,onClick:k,onContextMenu:E=>{E.preventDefault(),E.stopPropagation()},children:[c&&Ute.map(({action:E,label:M})=>{const N=c$e(b,E);return p.jsxs("button",{type:"button",className:`w-full flex items-center px-3 py-1.5 text-xs text-left ${N?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!N,onPointerDown:I=>{I.button===0&&(I.preventDefault(),I.stopPropagation(),N&&w(E))},children:[p.jsx(qxt,{action:E}),p.jsx("span",{children:M})]},E)}),f&&p.jsx("div",{className:"my-1 border-t border-neutral-700/60"}),u&&p.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onPointerDown:E=>{E.button===0&&(E.preventDefault(),E.stopPropagation(),O())},children:[p.jsx("span",{children:"Delete"}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]}),document.body)}),Kxt={B:{"font-weight":"700"},STRONG:{"font-weight":"700"},I:{"font-style":"italic"},EM:{"font-style":"italic"},U:{"text-decoration-line":"underline"}},Eve="\0";function Jxt(t,e){if(t.collapsed)return;const n=Mve(t.startContainer);if(!n||!Tve(n,t))return;const r=Nve(n),i=tbt(r,_k(n,t.startContainer,t.startOffset),_k(n,t.endContainer,t.endOffset));if(!i)return;const s=cbt(r,i.start,i.end,e);pbt(n,s),ebt(n),Abt(n,i.start,i.end)}function ebt(t){const e=t.ownerDocument.defaultView;if(e!=null&&e.getComputedStyle)for(const n of t.querySelectorAll("span")){if(!n.style.color)continue;n.style.getPropertyValue("-webkit-text-fill-color")===n.style.color&&n.style.removeProperty("-webkit-text-fill-color");const i=e.getComputedStyle(n),s=i.webkitTextFillColor;!s||!i.color||s!==i.color&&n.style.setProperty("-webkit-text-fill-color",n.style.color)}}function tbt(t,e,n){if(e===null||n===null||e>=n)return null;const r=t.map(a=>a.text).join(""),i=new Intl.Segmenter(void 0,{granularity:"grapheme"}),s=[0,...Array.from(i.segment(r),nbt)];return{start:rbt(s,e),end:s.find(a=>a>=n)??n}}function nbt({index:t,segment:e}){return t+e.length}function rbt(t,e){let n=e;for(const r of t){if(r>e)return n;n=r}return n}function Tve(t,e){return t.contains(e.startContainer)&&t.contains(e.endContainer)}function Pve(t){const e=Mve(t.startContainer);if(!e||!Tve(e,t))return null;const n=_k(e,t.startContainer,t.startOffset),r=_k(e,t.endContainer,t.endOffset);if(n===null||r===null)return null;const i=n===r,s=Dve(Nve(e)).slice(i?Math.max(0,n-1):n,i?Math.max(1,n):r).map(a=>({char:a.char,style:a.style}));return s.length>0?s:null}function Mve(t){var r;let e=t.nodeType===1?t:t.parentElement;const n=e==null?void 0:e.closest("[contenteditable]");if(n)return((r=n.getAttribute("contenteditable"))==null?void 0:r.toLowerCase())==="false"?null:n;for(;e!=null&&e.parentElement&&L$(e.tagName);)e=e.parentElement;return e}function Nve(t){const e=[],n=Array.from(t.childNodes,r=>({node:r,inherited:{},origin:null})).reverse();for(let r=n.pop();r;r=n.pop())n.push(...ibt(r,e));return e}function ibt(t,e){const{node:n,inherited:r,origin:i}=t;if(n.nodeType===3){const a=n.textContent??"";return a&&e.push(Xte(a,r,i)),[]}if(!sbt(n))return[];const s=n;return s.tagName==="BR"?(e.push(Xte(Eve,r,i)),[]):abt(s,r,i)}function sbt(t){return t.nodeType===1&&"style"in t}function Xte(t,e,n){return{text:t,style:e,origin:n,identity:obt(n)}}function abt(t,e,n){const r=L$(t.tagName),i=r?{...e,...Kxt[t.tagName],...lbt(t)}:e,s=r&&!n&&pV(t).size>0?t:n;return Array.from(t.childNodes,a=>({node:a,inherited:i,origin:s})).reverse()}function obt(t){return t?JSON.stringify([...pV(t)].sort(([e],[n])=>e<n?-1:1)):""}function lbt(t){const e={};for(let n=0;n<t.style.length;n+=1){const r=t.style.item(n);if(!r)continue;const i=t.style.getPropertyValue(r);Yme(r,i)&&(e[r]=i)}return e}function Dve(t){const e=[];for(const n of t)for(let r=0;r<n.text.length;r+=1)e.push({char:n.text[r]??"",style:n.style,origin:n.origin,identity:n.identity});return e}function cbt(t,e,n,r){const i=t.map(o=>o.text).join(""),s=Dve(t),a=[];for(let o=0;o<i.length;o+=1)fbt(a,i[o]??"",ubt(s[o],o>=e&&o<n,r));return a}function ubt(t,e,n){const r=(t==null?void 0:t.style)??{};return{style:e?hbt(r,n):r,origin:(t==null?void 0:t.origin)??null,identity:(t==null?void 0:t.identity)??""}}function fbt(t,e,n){const r=t[t.length-1];if(r&&r.identity===n.identity&&dbt(r.style,n.style)){r.text+=e;return}t.push({text:e,...n})}function hbt(t,e){const n={...t};for(const[r,i]of Object.entries(e))i===null?delete n[r]:n[r]=i;return n}function dbt(t,e){return h7(t)===h7(e)}function h7(t){return Object.keys(t).sort().map(e=>`${e}: ${t[e]}`).join("; ")}function pbt(t,e){const n=t.ownerDocument,r=mbt(n,e);if(t.replaceChildren(),r.length>1&&bbt(t)){const i=n.createElement("span");i.append(...r),t.append(i);return}t.append(...r)}function mbt(t,e){const n=[],r=new Set;for(const i of e){const s=i.origin&&!r.has(i.origin)?pV(i.origin):new Map;s.size>0&&i.origin&&r.add(i.origin),n.push(...gbt(t,i,s))}return n}function gbt(t,e,n){const r=h7(e.style),i=[];for(const[s,a]of e.text.split(Eve).entries()){if(s>0&&i.push(t.createElement("br")),!a)continue;if(!r&&n.size===0){i.push(t.createTextNode(a));continue}const o=t.createElement("span");for(const[l,c]of n)o.setAttribute(l,c);r&&o.setAttribute("style",r),o.textContent=a,i.push(o),n.clear()}return i}const ybt="data-hf-id";function pV(t){const e=new Map;for(const n of t.getAttributeNames()){if(n==="style"||n===ybt)continue;const r=t.getAttribute(n)??"";qme(n,r)&&e.set(n,r)}return e}const xbt=new Set(["flex","inline-flex","grid","inline-grid","-webkit-box","-webkit-inline-box"]);function bbt(t){const e=t.ownerDocument.defaultView;return e?xbt.has(e.getComputedStyle(t).display):!1}function _k(t,e,n){if(e===t)return Array.from(t.childNodes).slice(0,n).reduce((a,o)=>a+vbt(o),0);let r=0;const i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let s=i.nextNode();for(;s;){if(s===e)return r+n;r+=Ive(s),s=i.nextNode()}return null}function Ive(t){return t.nodeType===3?(t.textContent??"").length:_ve(t)==="BR"?1:0}function vbt(t){let e=0;const n=[t];for(let r=n.pop();r;r=n.pop())e+=Ive(r),n.push(...Array.from(r.childNodes));return e}function _ve(t){return t.nodeType===1?t.tagName:""}function Abt(t,e,n){var l;const r=t.ownerDocument,i=(l=r.defaultView)==null?void 0:l.getSelection(),s=Wte(t,e),a=Wte(t,n);if(!i||!s||!a)return;const o=r.createRange();o.setStart(s.node,s.offset),o.setEnd(a.node,a.offset),i.removeAllRanges(),i.addRange(o)}function Wte(t,e){let n=0;const r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let i=r.nextNode(),s=null;for(;i;){if(i.nodeType!==3){_ve(i)==="BR"&&(n+=1),i=r.nextNode();continue}const a=(i.textContent??"").length;if(n+a>=e)return{node:i,offset:e-n};n+=a,s=i,i=r.nextNode()}return s?{node:s,offset:(s.textContent??"").length}:{node:t,offset:0}}function Sbt(t,e){var i;const n=Pve(t);if(!n)return{};const r={};for(const s of e){const a=(i=n[0])==null?void 0:i.style[s];a!==void 0&&n.every(({style:o})=>o[s]===a)&&(r[s]=a)}return r}function wbt(t,e){const n=Pve(t);if(!n)return[];const r=new Set,i=[];for(const{char:s,style:a}of n){if(!s.trim())continue;const o=a[e];o===void 0||r.has(o)||(r.add(o),i.push(o))}return i}function Wo(t){return Math.max(0,Math.min(255,Math.round(t)))}function mV(t){return Math.max(0,Math.min(1,t))}function _D(t){return Wo(t).toString(16).padStart(2,"0")}function Obt(t){return`${ba(mV(t))}`}function zA(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="transparent")return{red:0,green:0,blue:0,alpha:0};const n=e.match(/^#([0-9a-f]{3})$/i);if(n){const[s,a,o]=n[1].split("");return{red:Number.parseInt(s+s,16),green:Number.parseInt(a+a,16),blue:Number.parseInt(o+o,16),alpha:1}}const r=e.match(/^#([0-9a-f]{6})$/i);if(r)return{red:Number.parseInt(r[1].slice(0,2),16),green:Number.parseInt(r[1].slice(2,4),16),blue:Number.parseInt(r[1].slice(4,6),16),alpha:1};const i=e.match(/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i);return i?{red:Wo(Number.parseFloat(i[1])),green:Wo(Number.parseFloat(i[2])),blue:Wo(Number.parseFloat(i[3])),alpha:mV(i[4]!=null?Number.parseFloat(i[4]):1)}:null}function kv(t){return`#${_D(t.red)}${_D(t.green)}${_D(t.blue)}`}function t1(t){const e=Wo(t.red),n=Wo(t.green),r=Wo(t.blue),i=mV(t.alpha);return i>=1?`rgb(${e}, ${n}, ${r})`:`rgba(${e}, ${n}, ${r}, ${Obt(i)})`}function Cbt(t){const e=Wo(t.red)/255,n=Wo(t.green)/255,r=Wo(t.blue)/255,i=Math.max(e,n,r),s=Math.min(e,n,r),a=i-s;let o=0;return a!==0&&(i===e?o=60*((n-r)/a%6):i===n?o=60*((r-e)/a+2):o=60*((e-n)/a+4)),o<0&&(o+=360),{hue:o,saturation:i===0?0:a/i,value:i}}function qte(t){const e=(t.hue%360+360)%360/60,n=Math.max(0,Math.min(1,t.saturation)),r=Math.max(0,Math.min(1,t.value)),i=r*n,s=i*(1-Math.abs(e%2-1)),a=r-i;let o=0,l=0,c=0;return e>=0&&e<1?(o=i,l=s):e>=1&&e<2?(o=s,l=i):e>=2&&e<3?(l=i,c=s):e>=3&&e<4?(l=s,c=i):e>=4&&e<5?(o=s,c=i):(o=i,c=s),{red:Wo((o+a)*255),green:Wo((l+a)*255),blue:Wo((c+a)*255)}}const kbt=["color","font-weight","font-style","text-decoration-line"],Yte=10,Ebt=34,g1="#ffffff";function Tbt({session:t,iframe:e}){const[n,r]=x.useState(null),i=x.useCallback(()=>{r(t&&e?Mbt(t.element,e):null)},[t,e]);x.useEffect(()=>{const o=t==null?void 0:t.element.ownerDocument;if(!o){r(null);return}return o.addEventListener("selectionchange",i),()=>o.removeEventListener("selectionchange",i)},[t,i]);const s=x.useCallback(o=>{var f;const l=t==null?void 0:t.element.ownerDocument,c=(f=l==null?void 0:l.defaultView)==null?void 0:f.getSelection();if(!c||c.rangeCount===0)return;const u=c.getRangeAt(0);Jxt(u,o),i()},[t,i]);if(!n)return null;const a=n.styles;return p.jsxs("div",{"data-inline-text-toolbar":"true",role:"toolbar","aria-label":"Text formatting",className:"pointer-events-auto fixed z-[200] flex items-center gap-1 rounded-lg border border-white/10 bg-[#15171c] p-1 shadow-[0_8px_24px_rgba(0,0,0,0.55)]",style:{left:n.left,top:n.top,transform:`translate(-50%, ${n.placeBelow?"0":"-100%"})`},onPointerDown:Kte,onMouseDown:Kte,onClick:o=>o.stopPropagation(),children:[p.jsxs("label",{className:"group relative flex h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-white/10",title:"Text colour",children:[p.jsx("span",{"aria-hidden":"true",className:"h-4 w-4 rounded-full border-2 border-white/25 transition-transform duration-150 group-hover:scale-110 group-active:scale-95",style:{background:Pbt(n.colours,a.color),backgroundOrigin:"border-box"}}),p.jsx("input",{type:"color","aria-label":"Text colour",className:"absolute inset-0 h-full w-full min-w-0 cursor-pointer opacity-0",value:n.pickerColour,onChange:o=>s({color:o.target.value})})]}),p.jsx(RD,{label:"Bold",glyph:"B",bold:!0,on:Nbt(a["font-weight"]),onToggle:o=>s({"font-weight":o?"700":null})}),p.jsx(RD,{label:"Italic",glyph:"I",italic:!0,on:a["font-style"]==="italic",onToggle:o=>s({"font-style":o?"italic":null})}),p.jsx(RD,{label:"Underline",glyph:"U",underline:!0,on:a["text-decoration-line"]==="underline",onToggle:o=>s({"text-decoration-line":o?"underline":null})})]})}function Pbt(t,e){return t.length===0?e||g1:t.length===1?t[0]:`linear-gradient(135deg, ${t.map((r,i)=>`${r} ${(i/(t.length-1)*100).toFixed(2)}%`).join(", ")})`}function Kte(t){t.preventDefault(),t.stopPropagation()}function RD({label:t,glyph:e,on:n,onToggle:r,bold:i,italic:s,underline:a}){return p.jsx("button",{type:"button",title:t,"aria-label":t,"aria-pressed":n,className:`flex h-6 w-6 items-center justify-center rounded-md text-xs ${n?"bg-studio-accent/20 text-studio-accent":"text-white/70 hover:bg-white/10"}`,style:{fontWeight:i?700:400,fontStyle:s?"italic":"normal",textDecoration:a?"underline":"none"},onClick:()=>r(!n),children:e})}function Mbt(t,e){const n=t.ownerDocument,r=n.defaultView,i=r==null?void 0:r.getSelection();if(!r||!i||i.rangeCount===0||i.isCollapsed)return null;const s=i.getRangeAt(0);if(!t.contains(s.commonAncestorContainer))return null;const a=s.getBoundingClientRect(),o=e.getBoundingClientRect(),l=r.innerWidth?o.width/r.innerWidth:1,c=o.top+a.top*l-Yte,u=c<Ebt,f=Sbt(s,kbt),h=wbt(s,"color");return{left:o.left+(a.left+a.width/2)*l,top:u?o.top+(a.top+a.height)*l+Yte:c,placeBelow:u,styles:f,colours:h,pickerColour:Dbt(f.color??h[0],n)}}function Nbt(t){return t?t==="bold"||t==="bolder"?!0:Number.parseInt(t,10)>=600:!1}function Dbt(t,e){if(!t)return g1;const n=zA(t);if(n)return kv(n);try{const r=e.createElement("canvas").getContext("2d");if(!r)return g1;r.fillStyle=g1,r.fillStyle=t;const i=typeof r.fillStyle=="string"?zA(r.fillStyle):null;return i?kv(i):g1}catch{return g1}}const Ibt="true",_bt="2px solid #3CE6AC";function Rbt(t){var r;const e=(r=t.ownerDocument.defaultView)==null?void 0:r.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0);!t.contains(n.startContainer)&&!t.contains(n.endContainer)||e.removeAllRanges()}function jbt({onCommit:t,onPause:e}){const[n,r]=x.useState(null),i=x.useRef(null),s=x.useRef(null),a=x.useCallback(()=>{var f;const u=i.current;return u?(s.current!==null&&((f=u.element.ownerDocument.defaultView)==null||f.cancelAnimationFrame(s.current),s.current=null),i.current=null,r(null),u.element.isConnected&&(u.element.removeAttribute("contenteditable"),u.element.style.outline=u.outline,u.element.style.outlineOffset=u.outlineOffset,Rbt(u.element),u.element.blur()),u):null},[]),o=x.useCallback((u,f)=>{if(i.current)return!1;const h={element:u,original:u.innerHTML,outline:u.style.outline,outlineOffset:u.style.outlineOffset};u.style.outline=_bt,u.style.outlineOffset="2px",i.current=h,r(h),e==null||e(),u.setAttribute("contenteditable",Ibt);const m=u.ownerDocument.defaultView,y=m==null?void 0:m.requestAnimationFrame(()=>{var d;s.current=null,((d=i.current)==null?void 0:d.element)===u&&(u.focus({preventScroll:!0}),Lbt(u,f))});return s.current=y??null,!0},[e]),l=x.useCallback(()=>{const u=i.current;if(!u)return;xet(u.element);const f=u.element.innerHTML;a(),t({element:u.element,html:f,previousHtml:u.original})},[t,a]),c=x.useCallback(()=>{const u=i.current;u&&(u.element.isConnected&&(u.element.innerHTML=u.original),a())},[a]);return x.useEffect(()=>{const u=n==null?void 0:n.element;if(!u)return;const f=b=>{if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),l();return}b.key==="Escape"&&(b.preventDefault(),c())},h=()=>l(),m=b=>{b&&u.ownerDocument.execCommand("insertText",!1,b)},y=b=>{var w;b.preventDefault(),m(((w=b.clipboardData)==null?void 0:w.getData("text/plain"))??"")},d=b=>b.preventDefault(),v=b=>{var w;b.preventDefault(),m(((w=b.dataTransfer)==null?void 0:w.getData("text/plain"))??"")};return u.addEventListener("keydown",f),u.addEventListener("blur",h),u.addEventListener("paste",y),u.addEventListener("dragover",d),u.addEventListener("drop",v),()=>{u.removeEventListener("keydown",f),u.removeEventListener("blur",h),u.removeEventListener("paste",y),u.removeEventListener("dragover",d),u.removeEventListener("drop",v)}},[n,l,c]),x.useEffect(()=>()=>{a()},[a]),{session:n,start:o,commit:l,cancel:c}}function Lbt(t,e){var s;const n=t.ownerDocument,r=(s=n.defaultView)==null?void 0:s.getSelection();if(!r)return;const i=e?Fbt(n,e):null;if(i&&t.contains(i.startContainer)){r.removeAllRanges(),r.addRange(i);return}$bt(t)}function Fbt(t,e){var a;const n=t;if(typeof n.caretRangeFromPoint=="function")return n.caretRangeFromPoint(e.x,e.y);const r=t,i=(a=r.caretPositionFromPoint)==null?void 0:a.call(r,e.x,e.y);if(!i)return null;const s=t.createRange();return s.setStart(i.offsetNode,i.offset),s.collapse(!0),s}function $bt(t){var s,a;const e=t.ownerDocument,n=(s=e.defaultView)==null?void 0:s.getSelection();if(!n)return;const r=e.createRange(),i=t.lastChild;i&&i.nodeType===3?(r.setStart(i,((a=i.textContent)==null?void 0:a.length)??0),r.collapse(!0)):(r.selectNodeContents(t),r.collapse(!1)),n.removeAllRanges(),n.addRange(r)}function Bbt(t){var a;const e=yS(),n=jbt({onCommit:o=>void(e==null?void 0:e.handleDomRichTextCommit(o)),onPause:()=>fe.getState().setIsPlaying(!1)}),r=x.useRef(null),i=o=>{var c,u;const l=(c=e==null?void 0:e.previewIframeRef)==null?void 0:c.current;return l?NC(l,o.clientX,o.clientY,((u=t.current)==null?void 0:u.compositionPath)??null):null},s=o=>{var h;const l=(h=e==null?void 0:e.previewIframeRef)==null?void 0:h.current,c=l==null?void 0:l.contentWindow;if(!l||!(c!=null&&c.innerWidth))return;const u=l.getBoundingClientRect(),f=u.width/c.innerWidth||1;return{x:(o.clientX-u.left)/f,y:(o.clientY-u.top)/f}};return{editing:n.session!==null,toolbar:p.jsx(Tbt,{session:n.session,iframe:((a=e==null?void 0:e.previewIframeRef)==null?void 0:a.current)??null}),handleKeyDown:o=>{if(o.key!=="Enter"||o.shiftKey||o.ctrlKey||o.metaKey||o.altKey)return!1;const l=t.current;return n.session||!l||!Eet(l)?!1:n.start(l.element)},startFromPress:o=>{if(n.session)return!1;const l=i(o),c={x:o.clientX,y:o.clientY,at:Date.now(),element:l},u=Pet(r.current,c);return r.current=c,!u||!l||!F$(l)?!1:n.start(l,s(o))}}}const Vbt=x.memo(function({iframeRef:e,activeCompositionPath:n,selection:r,groupSelections:i=[],hoverSelection:s,allowCanvasMovement:a=!0,onCanvasMouseDown:o,onCanvasPointerMove:l,onCanvasPointerLeave:c,onSelectionChange:u,onBlockedMove:f,gridVisible:h=!1,gridSpacing:m=50,onManualDragStart:y,onPathOffsetCommit:d,onGroupPathOffsetCommit:v,onBoxSizeCommit:b,onRotationCommit:w,onStyleCommit:O,onMarqueeSelect:k,onDeleteSelection:E,onApplyZIndex:M}){const N=x.useRef(null),I=x.useRef(null),_=x.useRef(k);_.current=k;const j=jxt(r),L=x.useRef(null),B=x.useRef(null),$=x.useRef(null),Q=x.useRef(!1),Y=x.useRef(!1),W=x.useRef(!1),J=x.useRef(null),ne=x.useRef(!1),le=x.useRef(r);le.current=r;const{zOrderFlashRect:ie,handleZOrderCrossed:q}=syt({overlayRef:N,iframeRef:e}),F=x.useRef(n);F.current=n;const U=x.useRef(i);U.current=i;const Z=x.useRef(s);Z.current=s;const K=Bbt(le),ee=x.useRef(d);ee.current=d;const re=x.useRef(v);re.current=v;const z=x.useRef(b);z.current=b;const H=x.useRef(w);H.current=w;const se=x.useRef(O);se.current=O;const ue=x.useRef(f);ue.current=f;const be=x.useRef(y);be.current=y;const me=x.useRef(l);me.current=l;const pe=x.useRef(c);pe.current=c;const ge=x.useRef(u);ge.current=u;const{overlayRect:Pe,overlayRectRef:ve,setOverlayRect:xe,hoverRect:we,groupOverlayItems:Ce,groupOverlayItemsRef:Me,setGroupOverlayItems:Ve,childRects:tt}=xyt({iframeRef:e,overlayRef:N,selectionRef:le,activeCompositionPathRef:F,groupSelectionsRef:U,hoverSelectionRef:Z,rafPausedRef:ne}),Ze=$xt({iframeRef:e,overlayRef:N}),qe=x.useRef(Ze);qe.current=Ze;const{hasCropInsets:pt,cropOutlineInsetPx:it}=Rxt({selection:r,overlayRect:Pe}),vt=pt?void 0:j.clipPath,Ot=Lxt(!!it,vt),Kt=x.useRef(new Map),[qt,fn]=x.useState([]),Jt=x.useRef(!0),Je=x.useRef(""),St=x.useRef(null),At=x.useRef(null);wr(()=>Xxt({iframeRef:e,overlayRef:N,compRectRef:qe,activeCompositionPathRef:F,dirtyRef:Jt,sigRef:Je,observerRef:St,observedDocRef:At,elementsRef:Kt,setRects:fn})),x.useEffect(()=>{Jt.current=!0},[n]);const Ke=uxt({overlayRef:N,iframeRef:e,boxRef:I,selectionRef:le,hoverSelectionRef:Z,overlayRectRef:ve,groupOverlayItemsRef:Me,gestureRef:L,groupGestureRef:B,blockedMoveRef:$,rafPausedRef:ne,suppressNextBoxClickRef:Q,setOverlayRect:xe,setGroupOverlayItems:Ve,onBlockedMoveRef:ue,onManualDragStartRef:be,onPathOffsetCommitRef:ee,onGroupPathOffsetCommitRef:re,onBoxSizeCommitRef:z,onRotationCommitRef:H,onCanvasPointerMoveRef:me,onCanvasMouseDown:o,snapGuidesRef:J}),{flushNudge:Be}=vxt({selection:r,groupSelections:i,allowCanvasMovement:a,selectionRef:le,overlayRectRef:ve,groupOverlayItemsRef:Me,gestureRef:L,groupGestureRef:B,blockedMoveRef:$,onManualDragStartRef:be,onPathOffsetCommitRef:ee,onGroupPathOffsetCommitRef:re}),We=nyt({iframeRef:e,overlayRef:N,activeCompositionPathRef:F,onMarqueeSelectRef:_,selectionRef:le,gestures:Ke}),Ye=x.useMemo(()=>r?`${r.sourceFile}:${r.id??r.selector??r.label}:${r.selectorIndex??0}`:"none",[r]),Zt=x.useMemo(()=>fV(Ce.map(mt=>mt.rect)),[Ce]),Te=i.length>1,De=Te&&Ce.length>1&&Ce.every(mt=>mt.selection.capabilities.canApplyManualOffset),ze=mt=>{if(!a)return;if(W.current){pc("mousedown-suppressed",{shift:mt.shiftKey}),W.current=!1,Y.current=!1,Q.current=!1,mt.preventDefault(),mt.stopPropagation();return}const vn=mt.target,mn=!!(vn!=null&&vn.closest('[data-dom-edit-selection-box="true"]'));pc("mousedown",{shift:mt.shiftKey,onBox:mn}),!mn&&(o(mt,{hoverSelection:Z.current}),mt.shiftKey&&(Y.current=!0,Q.current=!0))},st=mt=>{if(!a||mt.button!==0)return;if(mt.shiftKey){const mn=e.current,En=hyt({cached:Z.current,elementAtPoint:mn?NC(mn,mt.clientX,mt.clientY,F.current):null});if(!En)return;mt.preventDefault(),mt.stopPropagation(),W.current=!0,Y.current=!0,Q.current=!0,ge.current(En,{additive:!0});return}if(K.startFromPress(mt)){mt.preventDefault(),mt.stopPropagation();return}const vn=mt.target;if(!(vn!=null&&vn.closest('[data-dom-edit-selection-box="true"]'))&&!Z.current&&_.current&&Ze.width>0){const mn=e.current;if(mn?NC(mn,mt.clientX,mt.clientY,F.current):null)return;const jn=N.current;if(jn){const et=jn.getBoundingClientRect();mt.preventDefault(),mt.stopPropagation(),W.current=!0,mt.currentTarget.setPointerCapture(mt.pointerId);const qn=mt.clientX-et.left,Mt=mt.clientY-et.top;We.marqueeRef.current={startX:qn,startY:Mt,currentX:qn,currentY:Mt,pointerId:mt.pointerId,pastThreshold:!1};return}}},Gt=mt=>{if(a&&!(L.current||B.current)){if(Q.current){Q.current=!1,mt.stopPropagation();return}o(mt,{hoverSelection:Z.current})}},ln=mt=>{Y.current&&(Y.current=!1,mt.preventDefault(),mt.stopPropagation())},{contextMenu:Yt,closeContextMenu:Mn,handleContextMenu:Pr}=oyt({selection:r,selectionRef:le,hoverSelectionRef:Z,onCanvasPointerMoveRef:me,onSelectionChangeRef:ge});return p.jsxs("div",{ref:N,className:`absolute inset-0 z-10 outline-none ${K.editing?"pointer-events-none":"pointer-events-auto"}`,"data-editing-text":K.editing?"true":void 0,tabIndex:-1,"aria-label":"Composition canvas",style:We.marqueeRect?{cursor:"crosshair"}:void 0,onPointerDownCapture:mt=>{Be(),K.editing||uyt(mt.currentTarget)},onKeyDown:mt=>{K.handleKeyDown(mt)&&(mt.preventDefault(),mt.stopPropagation())},onPointerDown:st,onMouseDown:ze,onPointerMove:We.onPointerMove,onPointerLeave:()=>pe.current(),onPointerUp:We.onPointerUp,onPointerCancel:We.onPointerCancel,onContextMenu:Pr,children:[s&&we&&Ze.width>0&&p.jsx("div",{"aria-hidden":"true","data-dom-edit-hover-box":"true",className:"pointer-events-none absolute rounded-md border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{...Qy(we,s.element),transform:we.angle?`rotate(${we.angle}deg)`:void 0}}),Te&&Ce.length>1&&Zt&&Ze.width>0&&p.jsx(Ixt,{groupOverlayItems:Ce,groupBounds:Zt,allowCanvasMovement:a,groupCanMove:De,gestures:Ke,onBoxMouseDown:ln,onBoxClick:Gt}),!Te&&r&&Pe&&Ze.width>0&&p.jsx(_xt,{inlineText:K,selection:r,overlayRect:Pe,allowCanvasMovement:a,cropOutlineInsetPx:it??void 0,boxRef:I,boxChromeClass:Ot,boxClipPath:vt,selectionKey:Ye,groupSelectionCount:i.length,blockedMoveRef:$,gestures:Ke,onStyleCommit:se.current,onBoxMouseDown:ln,onBoxClick:Gt}),p.jsx(Ayt,{rects:Ze.width>0?tt:[]}),K.toolbar,p.jsx(vyt,{rects:qt,elements:Kt,compRect:Ze,selection:r,groupSelections:i,activeCompositionPathRef:F,onSelectionChangeRef:ge}),p.jsx(ryt,{candidateRects:We.candidateRects,marqueeRect:We.marqueeRect}),Yt&&p.jsx(Yxt,{x:Yt.x,y:Yt.y,selection:Yt.sel,onClose:Mn,onDelete:E?mt=>{Mn(),E(mt)}:void 0,onApplyZIndex:M?(mt,vn,mn)=>{M(Yt.sel,mt,vn,mn)}:void 0,onZOrderCrossed:q}),p.jsx(ayt,{rect:ie}),p.jsx(wxt,{visible:h,spacing:m,scaleX:Ze.scaleX,scaleY:Ze.scaleY,compositionLeft:Ze.left,compositionTop:Ze.top,compositionWidth:Ze.width,compositionHeight:Ze.height}),p.jsx(Sxt,{snapGuidesRef:J,compositionLeft:Ze.left,compositionTop:Ze.top,compositionWidth:Ze.width,compositionHeight:Ze.height})]})});function Jte(t,e,n){if(n.length<2)return null;let r=null;for(let i=0;i<n.length-1;i++){const s=n[i],a=n[i+1],o=a.x-s.x,l=a.y-s.y,c=o*o+l*l,u=c===0?0:Math.max(0,Math.min(1,((t-s.x)*o+(e-s.y)*l)/c)),f=s.x+u*o,h=s.y+u*l,m=Math.hypot(t-f,e-h);(!r||m<r.dist)&&(r={x:f,y:h,segIndex:i,t:u,dist:m})}return r}function Hbt(t){if(!t)return null;const e=!!t.arcPath,n=[],r=a=>typeof a=="number"&&isFinite(a),i=t.keyframes.some(a=>r(a.properties.x)),s=t.keyframes.some(a=>r(a.properties.y));return!i&&!s||(t.keyframes.forEach((a,o)=>{i&&!r(a.properties.x)||s&&!r(a.properties.y)||n.push({x:i?a.properties.x:0,y:s?a.properties.y:0,ref:e?{type:"waypoint",index:o}:{type:"keyframe",pct:a.percentage}})}),n.length<2)?null:{kind:e?"arc":"linear",points:n.map(a=>`${a.x},${a.y}`).join(" "),nodes:n}}function ene(t){return t?Oc(t):null}function Qbt(t,e){var i;const n=s=>!s.hasUnresolvedKeyframes&&!s.hasUnresolvedSelector&&!s.provenance;if(e==="arc")return((i=t.find(s=>{var a;return((a=s.arcPath)==null?void 0:a.enabled)&&n(s)}))==null?void 0:i.id)??null;const r=t.find(s=>s.keyframes&&n(s)&&(s.propertyGroup==="position"||s.keyframes.keyframes.some(a=>"x"in a.properties||"y"in a.properties)));return(r==null?void 0:r.id)??null}const Ev="var(--hf-accent, #3CE6AC)";function zbt(t){const{cx:e,cy:n,r,interactive:i,removable:s,grabbing:a,selected:o}=t,l=e+r*1.8,c=n-r*1.8,u=r*.55,f=(o?r*1.5:r)*1.414;return p.jsxs("g",{onPointerEnter:t.onEnter,onPointerLeave:t.onLeave,children:[p.jsx("rect",{x:e-f/2,y:n-f/2,width:f,height:f,rx:f*.17,transform:`rotate(45 ${e} ${n})`,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke",style:{fill:Ev}}),i&&p.jsx("circle",{cx:e,cy:n,r:r*2.4,fill:"transparent",className:"pointer-events-auto",style:{cursor:a?"grabbing":"grab"},onPointerDown:t.onPointerDown,onPointerMove:t.onPointerMove,onPointerUp:t.onPointerUp,onPointerCancel:t.onPointerUp,onContextMenu:t.onContextMenu}),s&&p.jsxs("g",{className:"pointer-events-auto",style:{cursor:"pointer"},onPointerDown:t.onRemove,children:[p.jsx("circle",{cx:l,cy:c,r:r*1.3,stroke:"#0b0f1a",strokeWidth:1,vectorEffect:"non-scaling-stroke",style:{fill:Ev}}),p.jsx("line",{x1:l-u,y1:c-u,x2:l+u,y2:c+u,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"}),p.jsx("line",{x1:l+u,y1:c-u,x2:l-u,y2:c+u,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"})]})]})}const Zbt=1.5;function Gbt(t,e,n,r,i){const s=t.type==="keyframe"?{type:"update-keyframe",animationId:r,percentage:t.pct,properties:{x:e,y:n}}:{type:"update-motion-path-point",animationId:r,pointIndex:t.index,x:e,y:n};return i(s,{label:t.type==="keyframe"?"Move keyframe":"Move waypoint",softReload:!0})}function Ubt(t,e,n,r,i){return i({type:"add-motion-path-point",animationId:t,index:e,x:n,y:r},{label:"Add waypoint",softReload:!0})}function Xbt(t,e,n,r,i){return i({type:"add-keyframe",animationId:t,percentage:e,properties:{x:n,y:r}},{label:"Add keyframe",softReload:!0})}function tne(t,e,n){return n({type:"remove-motion-path-point",animationId:t,index:e},{label:"Remove waypoint",softReload:!0})}function Wbt(t,e,n,r,i){return i({type:"add-motion-path",targetSelector:t,position:e,duration:Zbt,x:n,y:r},{label:"Create motion path",softReload:!0})}function qbt(t){var i,s;const e=(s=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:s.getComputedStyle(t).transform;if(!e||e==="none")return{x:0,y:0};const n=e.match(/matrix3d\(([^)]+)\)/);if(n){const a=n[1].split(",").map(Number);return{x:a[12]||0,y:a[13]||0}}const r=e.match(/matrix\(([^)]+)\)/);if(r){const a=r[1].split(",").map(Number);return{x:a[4]||0,y:a[5]||0}}return{x:0,y:0}}function Rve(t){var i,s;const e=(s=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:s.getComputedStyle(t).transform;if(!e||!e.startsWith("matrix3d("))return 1;const n=e.slice(9,-1).split(","),r=Number.parseFloat(n[15]??"");return Number.isFinite(r)&&r>0?r:1}function jve(t){let e=0,n=0,r=t;for(;r;){if(e+=r.offsetLeft,n+=r.offsetTop,r!==t){const o=qbt(r);e+=o.x,n+=o.y}const a=r.offsetParent;if(!a||a.hasAttribute("data-composition-id"))break;r=a}let i=e+t.offsetWidth/2,s=n+t.offsetHeight/2;return(t.style.translate??"").includes("var(")&&(i+=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-x"))||0,s+=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-y"))||0),{x:i,y:s}}function Lve(t,e){var r;const n=(r=e==null?void 0:e.contentWindow)==null?void 0:r.HTMLElement;return!!(t&&n&&t instanceof n)}function Ybt(t,e){return Math.abs(t.left-e.left)<.5&&Math.abs(t.top-e.top)<.5&&Math.abs(t.width-e.width)<.5&&Math.abs(t.height-e.height)<.5}function nne(t){var e;try{return!!((e=t==null?void 0:t.contentWindow)!=null&&e.MotionPathPlugin)}catch{return!1}}function Kbt(t,e){const[n,r]=x.useState(null),[i,s]=x.useState(null),a=x.useRef(null),o=a.current===e,[l,c]=x.useState(!0),[u,f]=x.useState(null),[h,m]=x.useState(1);return x.useEffect(()=>{if(!e){r(null),f(null);return}f(null);let y=0;const d=()=>{var b,w;const v=t.current;if(v){const O=v.getBoundingClientRect(),k=(b=v.ownerDocument)==null?void 0:b.querySelector("[data-preview-pan-surface]"),E=k==null?void 0:k.getBoundingClientRect(),M={left:E?O.left-E.left:O.left,top:E?O.top-E.top:O.top,width:O.width,height:O.height};r(j=>j&&Ybt(j,M)?j:M);let N=null;try{N=((w=v.contentDocument)==null?void 0:w.querySelector(e))??null}catch{}const I=Lve(N,v)?N:null,_=I?aV(I):!0;if(c(j=>j===_?j:_),I){const j=jve(I);f(B=>B&&Math.abs(B.x-j.x)<.5&&Math.abs(B.y-j.y)<.5?B:j);const L=1/Rve(I);m(B=>Math.abs(B-L)<.001?B:L)}}y=requestAnimationFrame(d)};return y=requestAnimationFrame(d),()=>cancelAnimationFrame(y)},[e,t]),x.useEffect(()=>{if(!e){s(null);return}const y=()=>{const v=PR(t.current,e,void 0,["x","y"]),b=Hbt(v);s(w=>(w==null?void 0:w.points)===(b==null?void 0:b.points)&&(w==null?void 0:w.kind)===(b==null?void 0:b.kind)?w:b),a.current=e};y();const d=window.setInterval(y,250);return()=>window.clearInterval(d)},[e,t]),{rect:n,geometry:i,geometryResolved:o,visibleInPreview:l,home:u,pScale:h}}function Jbt(t,e,n){return(t==null?void 0:t.type)!=="keyframe"||(e==null?void 0:e.type)!=="keyframe"?null:Math.round((t.pct+(e.pct-t.pct)*n)*1e3)/1e3}const rne=6,e2t=3,t2t=x.memo(function({iframeRef:e,selection:n,compositionSize:r,isPlaying:i}){const{commitMutation:s,selectedGsapAnimations:a,handleGsapRemoveKeyframe:o,handleGsapRemoveAllKeyframes:l,handleGsapMoveKeyframeToPlayhead:c}=QE(),{rect:u,geometry:f,geometryResolved:h,visibleInPreview:m,home:y,pScale:d}=Kbt(e,ene(n)),[v,b]=x.useState(null),[w,O]=x.useState(null),[k,E]=x.useState(null),[M,N]=x.useState(null),I=fe(Ce=>Ce.activeKeyframePct),_=fe(Ce=>{if(!n)return;const Me=C3(n);return Ce.elements.find(Ve=>(Ve.key??Ve.id)===Me||Ve.id===n.id)}),j=fe(Ce=>Ce.motionPathArmed),L=fe(Ce=>Ce.setMotionPathArmed),B=fe(Ce=>Ce.setMotionPathCreateAvailable),$=x.useRef(null),Q=x.useRef(void 0),Y=Qbt(a??[],(f==null?void 0:f.kind)??"linear");x.useEffect(()=>()=>clearTimeout(Q.current),[Y]);const W=h&&!f&&!!(n!=null&&n.element)&&!i,J=W?ene(n):null,ne=(r==null?void 0:r.width)??null,le=W&&!!J&&nne(e.current);if(x.useEffect(()=>(B(!!le),()=>B(!1)),[le,B]),x.useEffect(()=>{j&&!le&&L(!1)},[j,le,L]),x.useEffect(()=>{var tt,Ze;if(!j||!J||!ne)return;const Ce=((Ze=(tt=e.current)==null?void 0:tt.ownerDocument)==null?void 0:Ze.querySelector("[data-preview-pan-surface]"))??null;if(!Ce)return;const Me=Ce.style.cursor;Ce.style.cursor="crosshair";const Ve=qe=>{var St;if(qe.button!==0)return;const pt=e.current;if(!pt||!nne(pt))return;const it=pt.getBoundingClientRect();if(qe.clientX<it.left||qe.clientX>it.right||qe.clientY<it.top||qe.clientY>it.bottom)return;const vt=(St=pt.contentDocument)==null?void 0:St.querySelector(J);if(!Lve(vt,pt))return;qe.stopPropagation(),qe.preventDefault();const Ot=it.width/ne,Kt=jve(vt),qt=1/Rve(vt),fn=Math.round(((qe.clientX-it.left)/Ot-Kt.x)/qt),Jt=Math.round(((qe.clientY-it.top)/Ot-Kt.y)/qt),Je=Math.round(fe.getState().currentTime*100)/100;Wbt(J,Je,fn,Jt,s),L(!1)};return Ce.addEventListener("pointerdown",Ve,!0),()=>{Ce.removeEventListener("pointerdown",Ve,!0),Ce.style.cursor=Me}},[j,J,ne,e,s,L]),!u||u.width<=0||!r||r.width<=0||!m||!y)return null;if(!f){if(!j||!le)return null;const Ce=u.width/r.width,Me=rne/Ce*1.6;return p.jsx("svg",{className:"pointer-events-none absolute z-40",style:{left:u.left,top:u.top,width:u.width,height:u.height,overflow:"visible"},viewBox:`0 0 ${r.width} ${r.height}`,children:p.jsx("circle",{cx:y.x,cy:y.y,r:Me,fill:"none",strokeWidth:1.5,strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke",style:{stroke:Ev},opacity:.85})})}const ie=u.width/r.width,q=rne/ie,F=!!Y&&!i,Z=f.kind==="arc"&&F&&f.nodes.length>2,K=F,re=(v?f.nodes.map((Ce,Me)=>Me===v.index?{...Ce,x:v.x,y:v.y}:Ce):f.nodes).map(Ce=>({...Ce,ax:y.x+Ce.x*d,ay:y.y+Ce.y*d})),z=re.map(Ce=>`${Ce.ax},${Ce.ay}`).join(" "),H=Ce=>{var Ze;const Me=(Ze=e.current)==null?void 0:Ze.getBoundingClientRect(),Ve=Me?Me.left:u.left,tt=Me?Me.top:u.top;return{x:(Ce.clientX-Ve)/ie,y:(Ce.clientY-tt)/ie}},se=(Ce,Me,Ve,tt,Ze)=>{F&&Ce.button===0&&(Ce.stopPropagation(),Ce.target.setPointerCapture(Ce.pointerId),$.current={index:Me,startX:Ce.clientX,startY:Ce.clientY,initX:Ve,initY:tt,scale:ie,pScale:d,ref:Ze},b({index:Me,x:Ve,y:tt}))},ue=Ce=>{const Me=$.current;Me&&b({index:Me.index,x:Me.initX+(Ce.clientX-Me.startX)/Me.scale/Me.pScale,y:Me.initY+(Ce.clientY-Me.startY)/Me.scale/Me.pScale})},be=Ce=>{const Me=$.current;if(!Me||($.current=null,b(null),!Y))return;const Ve=Ce.clientX-Me.startX,tt=Ce.clientY-Me.startY,Ze=Math.round(Me.initX+Ve/Me.scale/Me.pScale),qe=Math.round(Me.initY+tt/Me.scale/Me.pScale);if(Math.hypot(Ve,tt)<e2t){if(Me.ref.type==="keyframe"){fe.getState().setActiveKeyframePct(Me.ref.pct);const vt=Me.ref;clearTimeout(Q.current),Ce.detail<2&&(Q.current=setTimeout(()=>{const Ot=a==null?void 0:a.find(Kt=>Kt.id===Y);Ot&&vA(Ot,vt.pct)},250))}return}if(Ze===Math.round(Me.initX)&&qe===Math.round(Me.initY))return;const it=Me.ref.type==="keyframe"?a==null?void 0:a.find(vt=>vt.id===Y):void 0;Me.ref.type==="keyframe"&&it&&n&&!fe.getState().autoKeyframeEnabled?T3(n,it,{x:Ze,y:qe},Me.ref.pct,e.current,{commitMutation:(vt,Ot,Kt)=>s(Ot,Kt)},"Move animation path"):Gbt(Me.ref,Ze,qe,Y,s),Me.ref.type==="keyframe"&&it&&vA(it,Me.ref.pct)},me=Ce=>{const Me=H(Ce),Ve=Jte(Me.x,Me.y,re.map(tt=>({x:tt.ax,y:tt.ay})));O(Ve?{x:Ve.x,y:Ve.y,segIndex:Ve.segIndex}:null)},pe=Ce=>{var qe,pt;if(!Y)return;const Me=H(Ce),Ve=Jte(Me.x,Me.y,re.map(it=>({x:it.ax,y:it.ay})));if(!Ve)return;const tt=Math.round(Ve.x-y.x),Ze=Math.round(Ve.y-y.y);if(f.kind==="arc")Ce.stopPropagation(),Ubt(Y,Ve.segIndex+1,tt,Ze,s);else{const it=Jbt((qe=re[Ve.segIndex])==null?void 0:qe.ref,(pt=re[Ve.segIndex+1])==null?void 0:pt.ref,Ve.t);if(it===null)return;Ce.stopPropagation(),Xbt(Y,it,tt,Ze,s)}O(null)},ge=(Ce,Me)=>{Ce.stopPropagation(),Y&&(E(null),tne(Y,Me,s))},Pe=(n==null?void 0:n.id)??null,ve=(Ce,Me)=>{!Y||!Pe||!_||(Ce.preventDefault(),Ce.stopPropagation(),N({ref:Me,state:{x:Ce.clientX,y:Ce.clientY,element:_,elementId:Pe,percentage:Me.type==="keyframe"?Me.pct:0,tweenPercentage:Me.type==="keyframe"?Me.pct:0}}))},xe=M==null?void 0:M.ref,we=xe===void 0||!Y?void 0:xe.type==="keyframe"?(Ce,Me)=>{o(Y,Me.percentage)}:Z?()=>{tne(Y,xe.index,s)}:void 0;return p.jsxs(p.Fragment,{children:[p.jsxs("svg",{className:"pointer-events-none absolute z-40",style:{left:u.left,top:u.top,width:u.width,height:u.height,overflow:"visible"},viewBox:`0 0 ${r.width} ${r.height}`,children:[K&&p.jsx("polyline",{points:z,fill:"none",stroke:"transparent",strokeWidth:14/ie,className:"pointer-events-auto",style:{cursor:"copy"},onPointerMove:me,onPointerLeave:()=>O(null),onPointerDown:pe}),p.jsx("polyline",{points:z,fill:"none",style:{stroke:Ev},strokeWidth:1.5,strokeDasharray:"5 5",strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke",opacity:.85}),w&&p.jsx("rect",{x:w.x-q*.707,y:w.y-q*.707,width:q*1.414,height:q*1.414,rx:q*.24,transform:`rotate(45 ${w.x} ${w.y})`,fill:"none",strokeWidth:1.5,strokeDasharray:"2 2",vectorEffect:"non-scaling-stroke",className:"pointer-events-none",style:{stroke:Ev}}),re.map((Ce,Me)=>p.jsx(zbt,{cx:Ce.ax,cy:Ce.ay,r:q,interactive:F,removable:Z&&k===Me,grabbing:(v==null?void 0:v.index)===Me,selected:Ce.ref.type==="keyframe"&&Ce.ref.pct===I,onEnter:()=>E(Me),onLeave:()=>E(Ve=>Ve===Me?null:Ve),onPointerDown:Ve=>se(Ve,Me,Ce.x,Ce.y,Ce.ref),onPointerMove:ue,onPointerUp:be,onRemove:Ve=>ge(Ve,Me),onContextMenu:Ve=>ve(Ve,Ce.ref)},Me))]}),M&&p.jsx(Rhe,{state:M.state,onClose:()=>N(null),onDelete:we,onDeleteAll:()=>Y&&l(Y),onMoveToPlayhead:M.ref.type==="keyframe"?(Ce,Me)=>Y&&c(Y,Me.percentage):void 0})]})}),t4={snapEnabled:!0,gridVisible:!1,gridSpacing:50,snapToGrid:!1};function jD(){const t=to();return{snapEnabled:t.snapEnabled??t4.snapEnabled,gridVisible:t.gridVisible??t4.gridVisible,gridSpacing:t.gridSpacing??t4.gridSpacing,snapToGrid:t.snapToGrid??t4.snapToGrid}}const n2t=x.memo(function({onSnapChange:e}){const[n,r]=x.useState(jD),[i,s]=x.useState(!1),a=fe(y=>y.motionPathCreateAvailable),o=fe(y=>y.motionPathArmed),l=fe(y=>y.setMotionPathArmed),c=x.useRef(null),u=x.useRef(null),f=x.useCallback(y=>{r(d=>{const v={...d,...y};return Ol(y),e==null||e(v),v})},[e]),h=x.useCallback(()=>{f({snapEnabled:!n.snapEnabled})},[n.snapEnabled,f]),m=x.useCallback(()=>{f({gridVisible:!n.gridVisible})},[n.gridVisible,f]);return x.useEffect(()=>{const y=d=>{if(d.defaultPrevented)return;const v=d.target;v instanceof HTMLInputElement||v instanceof HTMLTextAreaElement||v instanceof HTMLElement&&v.isContentEditable||v instanceof HTMLIFrameElement||(d.key==="s"&&!d.metaKey&&!d.ctrlKey&&!d.altKey&&(d.preventDefault(),f({snapEnabled:!jD().snapEnabled})),d.key==="g"&&!d.metaKey&&!d.ctrlKey&&!d.altKey&&(d.preventDefault(),f({gridVisible:!jD().gridVisible})))};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[f]),x.useEffect(()=>{if(!i)return;const y=d=>{var b,w;const v=d.target;(b=c.current)!=null&&b.contains(v)||(w=u.current)!=null&&w.contains(v)||s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),p.jsxs("div",{className:"absolute top-2 right-2 z-50 flex items-center gap-1",onPointerDown:y=>y.stopPropagation(),children:[a&&p.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${o?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:()=>l(!o),title:o?"Click the canvas to set the destination":"Set motion destination","aria-label":"Set motion destination",children:p.jsx($Re,{size:16,weight:o?"fill":"regular"})}),p.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${n.snapEnabled?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:h,title:n.snapEnabled?"Snap enabled (S)":"Snap disabled (S)","aria-label":"Toggle snap",children:p.jsx(IRe,{size:16,weight:n.snapEnabled?"fill":"regular"})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{ref:u,type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${n.gridVisible?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:m,onContextMenu:y=>{y.preventDefault(),s(d=>!d)},title:n.gridVisible?"Grid visible (G) — right-click for spacing options":"Grid hidden (G) — right-click for spacing options","aria-label":"Toggle grid",children:p.jsx(MRe,{size:16,weight:n.gridVisible?"fill":"regular"})}),p.jsx("button",{type:"button",className:"absolute -right-0.5 -bottom-0.5 rounded p-0.5 text-white/50 hover:text-white/90 bg-black/50",onClick:()=>s(y=>!y),title:"Grid options","aria-label":"Grid options","aria-expanded":i,children:p.jsx("svg",{width:"7",height:"7",viewBox:"0 0 8 8",fill:"currentColor","aria-hidden":"true",children:p.jsx("path",{d:"M1 2.5l3 3 3-3z"})})}),i&&p.jsxs("div",{ref:c,className:"absolute right-0 top-full mt-1 rounded-lg bg-neutral-800 border border-neutral-700 p-3 shadow-xl min-w-[180px]",children:[p.jsxs("label",{className:"flex items-center justify-between text-xs text-white/80 mb-2",children:[p.jsx("span",{children:"Grid spacing"}),p.jsx("input",{type:"number",min:10,max:500,step:10,value:n.gridSpacing,onChange:y=>{const d=Number.parseInt(y.target.value,10);Number.isFinite(d)&&d>=10&&d<=500&&f({gridSpacing:d})},className:"w-16 rounded bg-neutral-900 border border-neutral-600 px-1.5 py-0.5 text-xs text-white text-right tabular-nums outline-none focus:border-studio-accent"})]}),p.jsxs("label",{className:"flex items-center gap-2 text-xs text-white/80 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:n.snapToGrid,onChange:()=>f({snapToGrid:!n.snapToGrid}),className:"accent-studio-accent"}),p.jsx("span",{children:"Snap to grid"})]})]})]})]})}),bd=t=>t.key??t.id;function Fve(t,e){if(t.expandedParentStart==null)return null;const n=bd(t);return new Set(e.filter(r=>bd(r)!==n&&fF(r,t)).map(r=>r.track))}function ZA(t){return[...new Set(t.map(e=>e.track))].sort((e,n)=>e-n)}function r2t(t){const{action:e,element:n,elements:r}=t;if(bc(n)==="audio"||!(n.duration>0))return null;const i=bd(n),s=n.start,a=n.start+n.duration,o=e==="bring-forward"||e==="bring-to-front",l=r.filter(v=>bd(v)!==i&&bc(v)==="visual"&&cF(v,n)&&khe(s,a,v.start,v.start+v.duration)),c=o2t(t,l,o);if(c==null)return null;const u=ZA(r),f=ZA(r.filter(v=>bc(v)==="visual")),h=f.indexOf(c);if(h===-1)return null;const m=s2t(e,l,c,o),y=Fve(n,r),d=d7({elements:r,visualLanes:f,refIdx:h,up:o,boundLane:m,start:s,end:a,selfKey:i,allowedLanes:y});return d!=null?d===n.track?null:{kind:"move",displayTrack:d,persistTrack:hF(d,r,n)}:y?null:{kind:"insert",insertRow:u.indexOf(c)+(o?0:1)}}function i2t(t){const{element:e,elements:n,desiredOrderKeys:r}=t;if(bc(e)==="audio"||!(e.duration>0))return null;const i=bd(e),s=r.indexOf(i);if(s===-1)return null;const a=d=>{if(d==null)return null;const v=n.find(b=>bd(b)===d);return v&&bc(v)==="visual"&&v.duration>0&&cF(v,e)&&bd(v)!==i?v.track:null};let o=null;for(let d=s+1;d<r.length&&o==null;d++)o=a(r[d]);let l=null;for(let d=s-1;d>=0&&l==null;d--)l=a(r[d]);if(o==null&&l==null)return null;const c=ZA(n),u=ZA(n.filter(d=>bc(d)==="visual")),f=Fve(e,n),h={elements:n,visualLanes:u,start:e.start,end:e.start+e.duration,selfKey:i,allowedLanes:f};let m,y;if(o!=null){const d=u.indexOf(o);if(d===-1)return null;m=d7({...h,refIdx:d,up:!1,boundLane:l}),y=c.indexOf(o)+1}else{const d=u.indexOf(l);if(d===-1)return null;m=d7({...h,refIdx:d,up:!0,boundLane:null}),y=c.indexOf(l)}return m!=null?m===e.track?null:{kind:"move",displayTrack:m,persistTrack:hF(m,n,e)}:f?null:{kind:"insert",insertRow:y}}function s2t(t,e,n,r){if(t!=="bring-forward"&&t!=="send-backward")return null;const i=e.map(s=>s.track).filter(s=>r?s<n:s>n);return i.length===0?null:(r?Math.max:Math.min)(...i)}function d7(t){const{elements:e,visualLanes:n,refIdx:r,up:i,boundLane:s,start:a,end:o,selfKey:l,allowedLanes:c}=t,u=i?-1:1;for(let f=r+u;f>=0&&f<n.length;f+=u){const h=n[f];if(a2t(h,s,i))break;if(!(c&&!c.has(h))&&M4(e,h,a,o,l))return h}return null}function a2t(t,e,n){return e==null?!1:n?t<=e:t>=e}function o2t(t,e,n){const r=t.action==="bring-forward"||t.action==="send-backward";if(r){const s=l2t(t);if(s!=null)return s}const i=e.map(s=>s.track).filter(s=>n?s<t.element.track:s>t.element.track);return i.length===0?null:(r===n?Math.max:Math.min)(...i)}function l2t({elements:t,crossedKey:e}){if(e==null)return null;const n=t.find(r=>bd(r)===e);return n&&bc(n)==="visual"?n.track:null}function c2t(){var n;const t=$ve(),e=((n=mF())==null?void 0:n.activeCompPath)??null;return x.useCallback(r=>t(r.selectionKey,r.coalesceKey,(i,s)=>{const a=r.crossed?SS(r.crossed):void 0,o=r.crossed?G1({domId:r.crossed.id||void 0,selector:a,selectorIndex:lF(r.crossed.ownerDocument,r.crossed,a,r.sourceFile,e),sourceFile:r.sourceFile}):null;return r2t({action:r.action,element:i,elements:s,crossedKey:o})}),[t,e])}function u2t(){const t=$ve();return x.useCallback(e=>t(e.selectionKey,e.coalesceKey,(n,r)=>i2t({element:n,elements:r,desiredOrderKeys:e.desiredOrderKeys})),[t])}function $ve(){const t=rS(),e=x.useRef(t);e.current=t;const{onMoveElements:n}=lS();return x.useCallback((r,i,s)=>{const a=e.current,o=r?a.find(c=>(c.key??c.id)===r):void 0;if(!o)return Promise.resolve(!1);const l=s(o,a);return l?RFe(o,l,{elements:a,trackOrder:ZA(a),updateElement:(c,u)=>fe.getState().updateElement(c,u),onMoveElements:n?(c,u,f,h)=>sve(c,u,f,n,h):void 0},i,Number.POSITIVE_INFINITY):Promise.resolve(!1)},[n])}function f2t(t,e,n){return!!(e||n||yA(t))}function h2t(t,e){return{element:t.element,zIndex:e,id:t.id??void 0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile,key:G1({domId:t.id??void 0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile})}}function d2t(t,e,n){const r=t.id||void 0,i=SS(t);return f2t(t,r,i)?{element:t,zIndex:e,id:r,selector:i,selectorIndex:void 0,sourceFile:n,key:G1({domId:r,selector:i,sourceFile:n})}:null}function p2t(t){if(t.id)return`#${t.id}`;const e=t.classList.item(0);return e?`${t.tagName.toLowerCase()}.${e}`:t.tagName.toLowerCase()}function m2t(t,e){const n=[],r=[];for(const i of e){if(i.element===t.element){n.push(h2t(t,i.zIndex));continue}const s=d2t(i.element,i.zIndex,t.sourceFile);s?n.push(s):r.push(i)}return{entries:n,dropped:r}}function g2t({shouldShowMotionPath:t,shouldShowSelectedDomBounds:e,blockPreview:n,isGestureRecording:r,recordingState:i,onToggleRecording:s,gestureOverlay:a}){const{activeCompPath:o,previewIframeRef:l}=zl(),{captionEditMode:c,compositionLoading:u,isPlaying:f}=vy(),h=R1e(),m=An(F=>F.model!==null),y=An(F=>F.dismissed),d=An(F=>F.syncError),v=x.useCallback(()=>{const F=An.getState();F.clearSelection(),F.setDismissed(!0),F.setEditMode(!1)},[]),b=x.useCallback(()=>{const F=An.getState();F.setDismissed(!1),F.setEditMode(!0)},[]),{domEditHoverSelection:w,domEditSelection:O,domEditGroupSelections:k}=yy(),{handlePreviewCanvasMouseDown:E,handlePreviewCanvasPointerMove:M,handlePreviewCanvasPointerLeave:N,applyDomSelection:I,handleBlockedDomMove:_,handleDomManualDragStart:j,handleDomPathOffsetCommit:L,handleDomGroupPathOffsetCommit:B,handleDomBoxSizeCommit:$,handleDomRotationCommit:Q,handleDomStyleCommit:Y,applyMarqueeSelection:W,handleDomEditElementDelete:J,handleDomZIndexReorderCommit:ne}=HE(),le=c2t(),[ie,q]=x.useState(()=>{const F=to();return{snapEnabled:F.snapEnabled??!0,gridVisible:F.gridVisible??!1,gridSpacing:F.gridSpacing??50,snapToGrid:F.snapToGrid??!1}});return n?p.jsx("div",{className:"absolute inset-0 z-30 bg-black pointer-events-none",children:n.videoUrl?p.jsx("video",{src:n.videoUrl,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-contain"}):n.posterUrl?p.jsx("img",{src:n.posterUrl,alt:n.title,className:"w-full h-full object-contain"}):null}):c?p.jsxs(p.Fragment,{children:[p.jsx(Dgt,{iframeRef:l}),p.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-[60] flex items-center gap-2 rounded-full border border-studio-accent/40 bg-black/70 px-2.5 py-1",children:[p.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-studio-accent","aria-hidden":"true"}),p.jsx("span",{className:"text-2xs text-neutral-200",children:"Editing captions"}),p.jsx("button",{type:"button",onClick:v,className:"rounded text-2xs text-neutral-400 underline underline-offset-2 hover:text-neutral-100 focus-visible:outline focus-visible:outline-1 focus-visible:outline-studio-accent",children:"Exit"})]}),d&&p.jsxs("div",{role:"alert",className:"absolute top-10 left-1/2 -translate-x-1/2 z-[60] flex items-center gap-2 rounded-full border border-red-500/50 bg-red-950/90 px-2.5 py-1",children:[p.jsx("span",{className:"text-2xs text-red-200",children:d}),p.jsx("button",{type:"button",onClick:()=>{var F,U;return(U=(F=An.getState()).retrySave)==null?void 0:U.call(F)},className:"rounded text-2xs text-red-100 underline underline-offset-2 hover:text-white",children:"Retry"}),p.jsx("button",{type:"button",onClick:()=>An.getState().setSyncError(null),"aria-label":"Dismiss",className:"rounded px-0.5 text-2xs text-red-300/70 hover:text-red-100",children:"✕"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx(Vbt,{iframeRef:l,activeCompositionPath:o,hoverSelection:!c&&!u&&!f?w:null,selection:e?O:null,groupSelections:e?k:[],allowCanvasMovement:!r,onCanvasMouseDown:E,onCanvasPointerMove:M,onCanvasPointerLeave:N,onSelectionChange:I,onBlockedMove:_,onManualDragStart:j,onPathOffsetCommit:L,onGroupPathOffsetCommit:B,onBoxSizeCommit:$,onRotationCommit:Q,onStyleCommit:Y,onDeleteSelection:J,onApplyZIndex:(F,U,Z,K)=>{const{entries:ee,dropped:re}=m2t(F,U);if(re.length>0){for(const H of re)H.element.style.zIndex=String(H.zIndex);console.warn("[studio] z-index reorder: dropping sibling(s) with no stable id/selector (will revert on reload):",re.map(H=>p2t(H.element)).join(", "))}if(ee.length===0)return;const z=B$(ee,Z);The({commitZ:()=>ne(ee,z,Z),mirror:()=>{var H;return le({selectionKey:(H=ee.find(se=>se.element===F.element))==null?void 0:H.key,action:Z,crossed:K,sourceFile:F.sourceFile,coalesceKey:z})}}).catch(()=>{})},gridVisible:ie.gridVisible,gridSpacing:ie.gridSpacing,recordingState:i,onToggleRecording:s,onMarqueeSelect:W}),p.jsx(n2t,{onSnapChange:q}),p.jsx(t2t,{iframeRef:l,selection:t?O:null,compositionSize:h,isPlaying:f}),a,m&&y&&p.jsx("button",{type:"button",onClick:b,className:"absolute top-2 left-1/2 -translate-x-1/2 z-[60] rounded-full border border-neutral-700 bg-black/60 px-2.5 py-1 text-2xs text-neutral-300 transition-colors hover:border-studio-accent/50 hover:text-studio-accent focus-visible:outline focus-visible:outline-1 focus-visible:outline-studio-accent",children:"Edit captions"})]})}const y2t=.1,p7=1e-4,Bve=.01,F1=t=>Math.round(t*1e3)/1e3,x2t=(t,e,n)=>Math.max(e,Math.min(n,t));function b2t(t){const{keyframeCount:e,draggedTweenPct:n,tweenStart:r,tweenEnd:i,dropAbsTime:s}=t;if(e>0)return null;if(n!==0&&n!==100)return{kind:"noop"};if(Math.abs(s-(n===0?r:i))<=p7)return{kind:"noop"};const o=n===0?s:r,c=(n===100?s:i)-o;return c<Bve?{kind:"noop"}:{kind:"resize",position:F1(o),duration:F1(c),pctRemap:[]}}function v2t(t){const{keyframes:e,draggedTweenPct:n,tweenStart:r,tweenDuration:i,dropAbsTime:s}=t;if(i<=0)return{kind:"noop"};const a=r+i,o=b2t({keyframeCount:e.length,draggedTweenPct:n,tweenStart:r,tweenEnd:a,dropAbsTime:s});if(o)return o;if(s>=r-p7&&s<=a+p7){const y=F1(x2t((s-r)/i*100,0,100));return Math.abs(y-n)<y2t?{kind:"noop"}:{kind:"move",toTweenPct:y}}if(e.length===0)return{kind:"noop"};const l=Math.min(s,r),c=Math.max(s,a),u=Math.max(Bve,c-l);let f=0,h=1/0;e.forEach((y,d)=>{const v=Math.abs(y.percentage-n);v<h&&(h=v,f=d)});const m=e.map((y,d)=>{const v=d===f?s:r+y.percentage/100*i;return{from:y.percentage,to:F1((v-l)/u*100)}});return{kind:"resize",position:F1(l),duration:F1(u),pctRemap:m}}function A2t(t,e,n){const r=e.find(l=>Math.abs(l.percentage-t)<.2);if(!r)return null;const i=r.animationId?n.find(l=>l.id===r.animationId):void 0;if(r.animationId)return i?{animId:i.id,tweenPct:r.tweenPercentage??t}:null;const s=r==null?void 0:r.propertyGroup,a=s?n.filter(l=>l.propertyGroup===s):n.filter(l=>!l.propertyGroup),o=a.length===1?a[0]:void 0;return o?{animId:o.id,tweenPct:r.tweenPercentage??t}:null}function S2t({handleTimelineElementMove:t,handleTimelineElementsMove:e,handleTimelineElementResize:n,handleTimelineGroupResize:r,handleToggleTrackHidden:i,setAudioGroupAttribute:s,handleBlockedTimelineEdit:a,handleTimelineElementSplit:o,handleRazorSplit:l,handleRazorSplitAll:c,handleGroupClips:u,setElementFxAttribute:f}){const{projectId:h,activeCompPath:m}=zl(),{domEditSelection:y,selectedGsapAnimations:d}=yy(),{handleGsapRemoveKeyframe:v,handleGsapMoveKeyframeToPlayhead:b,handleGsapMoveKeyframe:w,handleGsapResizeKeyframedTween:O,handleGsapUpdateMeta:k,handleGsapAddKeyframe:E,handleGsapAddKeyframeBatch:M,handleGsapConvertToKeyframes:N,handleGsapRemoveAllKeyframes:I,buildDomSelectionForTimelineElement:_}=HE(),j=x.useCallback($=>{const{gsapAnimations:Q}=fe.getState(),{sourceFile:Y,domId:W}=v6($),J=Y??m??"index.html";for(const ne of T0(J,W)){const le=Q.get(ne);if(le)return le}return[]},[m]),L=x.useCallback(($,Q,Y=d)=>{const W=Q.propertyGroup!==void 0||Q.tweenPercentage!==void 0||Q.animationId!==void 0,J=fe.getState().keyframeCache,ne=J.get($)??J.get(v6($).domId);return A2t(Q.percentage,W?[Q]:(ne==null?void 0:ne.keyframes)??[],Y)},[d]),B=x.useCallback(($,Q,Y)=>{v($,Q,void 0,Y)},[v]);return x.useMemo(()=>({onMoveElement:t,onMoveElements:e,onResizeElement:n,onResizeElements:r,onToggleTrackHidden:i,onSetAudioGroupAttributeLive:s.setLive,onSetAudioGroupAttributeQuiet:s.setQuiet,onGroupClips:u,onSetElementAttributeLive:f==null?void 0:f.setLive,onSetElementAttributeQuiet:f==null?void 0:f.setQuiet,onBlockedEditAttempt:a,onSplitElement:o,onRazorSplit:l,onRazorSplitAll:c,onDeleteAllKeyframes:($,Q)=>{const Y=zn($),W=j(Y),J=Q?W.filter(ne=>ne.id===Q):W.filter(ne=>ne.keyframes);J.length!==0&&_($).then(async ne=>{if(ne)for(const le of J)await I(le.id,ne)})},onDeleteKeyframe:($,Q)=>{const Y=j($),W=L($,Q,Y);if(!W)return;const J=fe.getState().elements.find(ne=>(ne.key??ne.id)===$);if(!J){B(W.animId,W.tweenPct);return}_(J).then(ne=>{ne&&B(W.animId,W.tweenPct,ne)})},onMoveKeyframeToPlayhead:($,Q)=>{const Y=zn($),W=j(Y),J=L(Y,Q,W),ne=J?W.find(le=>le.id===J.animId):void 0;!J||!ne||_($).then(le=>{le&&b(J.animId,J.tweenPct,le,ne)})},onMoveKeyframe:async($,Q,Y)=>{var se;const W=j($),J=L($,Q,W);if(!J)return!1;const ne=fe.getState().elements.find(ue=>(ue.key??ue.id)===$),le=ne?await _(ne):y;if(!le)return!1;const ie=W.find(ue=>ue.id===J.animId),q=ie?si(ie):null;if(!ie||q===null)return Promise.resolve(!1);const F=le.sourceFile||m||"index.html",{elements:U,domClipChildren:Z}=fe.getState(),{elStart:K,elDuration:ee}=FE(le.id??"",F,U,Z),re=qi(ie,ee),z=K+Y/100*ee,H=v2t({keyframes:((se=ie.keyframes)==null?void 0:se.keyframes)??[],draggedTweenPct:J.tweenPct,tweenStart:q,tweenDuration:re,dropAbsTime:z});return H.kind==="move"&&H.toTweenPct!=null?w(J.animId,J.tweenPct,H.toTweenPct,le):H.kind==="resize"&&H.pctRemap&&H.position!=null&&H.duration!=null?H.pctRemap.length===0?k(J.animId,{position:H.position,duration:H.duration},le):O(J.animId,H.position,H.duration,H.pctRemap,le):Promise.resolve(!1)},onToggleKeyframeAtPlayhead:$=>{const Q=fe.getState().currentTime,Y=$.duration>0?Math.max(0,Math.min(100,Math.round((Q-$.start)/$.duration*100))):0,W=j(zn($));_($).then(J=>{if(!J)return;const ne=W.find(le=>le.keyframes);if(ne!=null&&ne.keyframes){const le=ne.keyframes.keyframes.find(ie=>Math.abs(ie.percentage-Y)<=1);le?v(ne.id,le.percentage,void 0,J):E(ne.id,Y,"x",0,J)}else{const le=W.find(ie=>!ie.keyframes);le&&N(le.id,void 0,void 0,void 0,J)}})},onTogglePropertyGroupKeyframe:async($,Q)=>{const Y=await _($);if(Y){if(Q.remove){B(Q.animationId,Q.tweenPercentage,Y);return}await M(Q.animationId,Q.tweenPercentage,Q.properties,void 0,Y)}}}),[t,e,n,r,i,s,u,f,a,o,l,c,I,j,L,B,d,b,w,O,k,E,M,N,_,h,m,y])}const ine=["#3CE6AC","#FF6B6B","#4ECDC4","#FFE66D","#A78BFA","#F472B6","#34D399","#FB923C","#60A5FA","#C084FC"],LD=32,w2t=x.memo(function({pixelsPerSecond:e,onSeek:n}){const r=An(f=>f.model),i=An(f=>f.selectedSegmentIds),s=An(f=>f.selectSegment),a=fe(f=>f.currentTime),o=x.useCallback((f,h)=>{f.stopPropagation(),s(h,f.shiftKey)},[s]),l=x.useCallback((f,h)=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),f.stopPropagation(),s(h,f.shiftKey))},[s]),c=x.useCallback(f=>{if(!n)return;const h=f.currentTarget.getBoundingClientRect(),m=f.clientX-h.left-LD,y=Math.max(0,m/e);n(y)},[n,e]);if(!r)return null;const u=LD+a*e;return p.jsxs("div",{className:"relative select-none overflow-x-auto",style:{height:40,minWidth:"100%"},onClick:c,children:[r.groupOrder.map((f,h)=>{const m=r.groups.get(f);if(!m)return null;const y=ine[h%ine.length];return m.segmentIds.map(d=>{const v=r.segments.get(d);if(!v)return null;const b=LD+v.start*e,w=Math.max((v.end-v.start)*e,4),O=i.has(d);return p.jsx("div",{role:"button",tabIndex:0,"aria-label":`Caption word "${v.text}"`,"aria-pressed":O,className:`absolute top-1 bottom-1 rounded flex items-center overflow-hidden cursor-pointer focus-visible:ring-1 focus-visible:ring-white outline-none${O?" ring-1 ring-white/50 z-10":""}`,style:{left:b,width:w,backgroundColor:y,zIndex:O?10:1},onClick:k=>o(k,d),onKeyDown:k=>l(k,d),children:p.jsx("span",{className:"flex-1 truncate px-2 pointer-events-none",style:{fontSize:9,color:"#000000",lineHeight:1},children:v.text})},d)})}),p.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-white/70 pointer-events-none z-20",style:{left:u},"aria-hidden":"true"})]})});function O2t(t,e){const n=[...t];return!e||!t.has(e)?n:[e,...n.filter(r=>r!==e)]}function C2t(t,e,n,r){const i=new Set(t),s=new Set(e);if(i.size!==s.size)return!1;for(const a of s)if(!i.has(a))return!1;return n===r}function k2t(t,e){return t!==null&&!e.includes(t)}function E2t({selectedElementId:t,selectedElementIds:e,timelineElements:n,domEditSelection:r,domEditGroupSelections:i,activeCompPath:s,buildDomSelectionForTimelineElement:a,applyDomSelection:o,applyMarqueeSelection:l,onSelectionNotFound:c}){const u=x.useMemo(()=>O2t(e,t),[t,e]),f=u.join("\0"),h=x.useRef(r),m=x.useRef(i),y=x.useRef(""),d=x.useRef("");h.current=r,m.current=i,x.useEffect(()=>{const v=y.current;y.current=f;const b=h.current,w=m.current,k=(w.length>1?w:b?[b]:[]).map(_=>H6(_,n,s)).filter(_=>!!_),E=b?H6(b,n,s):null;if(u.length===0){d.current="",pc("timeline-empty",{had:k.length,previousKey:v.length>0,clearing:v.length>0&&k.length>0}),v.length>0&&k.length>0&&o(null,{revealPanel:!1});return}if(C2t(k,u,E,t)){d.current="";return}let M=!1;const N=()=>{d.current!==f&&(d.current=f,c())};return(async()=>{const _=[];let j=0;for(const L of u){const B=n.find(Q=>(Q.key??Q.id)===L);if(!B)continue;j+=1;const $=await a(B);$&&_.push($)}if(!M){if(_.length<j){N(),k2t(E,u)&&o(null,{revealPanel:!1,announce:!1});return}d.current="",pc("timeline-sync",{wanted:u.length,had:k.length,resolved:_.length}),_.length===0?o(null,{revealPanel:!1}):_.length===1?o(_[0]):l(_,!1)}})(),()=>{M=!0}},[s,o,l,a,c,t,u,f,n])}function T2t(t){return typeof t!="object"||t===null?!1:typeof Reflect.get(t,"registerTool")=="function"}function Vve(t=document){const e=Reflect.get(t,"modelContext");return T2t(e)?e:null}const sne=Z0("webmcp");let n1=null;async function P2t(){try{await ly(()=>import("./index-BX3KHhGX.js"),[]);const t=Vve();return t?Ns("webmcp.polyfill_loaded"):(sne("polyfill",{loaded:!0,modelContext:!1}),Ns("webmcp.polyfill_failed",{error_name:"ModelContextMissingError"})),t}catch(t){return sne("polyfill",{failed:t instanceof Error?t.message:String(t)}),Ns("webmcp.polyfill_failed",{error_name:t instanceof Error?t.name:"NonError"}),null}}function M2t(){if(n1)return n1;const t=P2t();return n1=t,t.then(e=>{e===null&&n1===t&&(n1=null)}),n1}const N2t=/^[A-Za-z0-9_.-]{1,128}$/;function D2t(t){return N2t.test(t.name)?t.description.trim()?null:"description must not be empty":`name must be 1-128 chars of A-Z a-z 0-9 _ - . (got ${JSON.stringify(t.name)})`}function I2t(t){return t instanceof DOMException&&t.name==="AbortError"}function Hve(t,e){return{tool:t,name:"InvalidStateError",message:e}}async function _2t(t,e,n){const r=D2t(e);if(r)return{status:"failed",failure:Hve(e.name,r)};try{return await t.registerTool(e,{signal:n}),{status:"registered"}}catch(i){return I2t(i)?{status:"aborted"}:{status:"failed",failure:{tool:e.name,name:i instanceof DOMException?i.name:"Error",message:i instanceof Error?i.message:String(i)}}}}async function R2t(t,e,n){const r={registered:[],failed:[]},i=new Set;for(const s of e){if(i.has(s.name)){r.failed.push(Hve(s.name,"duplicate tool name in this registration set"));continue}i.add(s.name);const a=await _2t(t,s,n);if(a.status==="aborted")return r;a.status==="failed"?r.failed.push(a.failure):r.registered.push(s.name)}return r}function j2t(t){return{ok:!0,...t}}function ane(t,e,n){return n?{ok:!1,kind:t,reason:e,hint:n}:{ok:!1,kind:t,reason:e}}async function L2t(t,e){try{return await e()}catch(n){const r=n instanceof Error?n.message:String(n);return n instanceof TypeError||n instanceof ReferenceError?(console.error(`[hf-webmcp] ${t} threw`,n),ane("internal",r)):ane("failed",r)}}const FD=":",F2t="#";function Qve(t){if(t.hfId)return`hf${FD}${t.hfId}`;if(t.domId)return`dom${FD}${t.domId}`;if(t.selector){const e=t.selectorIndex??0;return`sel${FD}${t.selector}${F2t}${e}`}return null}function $2t(t){return{hfId:t.hfId,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex}}function B2t(t){return{hfId:t.hfId,domId:t.id,selector:t.selector,selectorIndex:t.selectorIndex}}const Rk=200,zve=128;function V2t(t){return{handle:Qve($2t(t)),label:t.label??null,tag:t.tag,kind:t.kind??null,start:t.start,duration:t.duration,track:t.track,zIndex:t.zIndex??null}}function H2t(t,e){const{capabilities:n}=t;return{handle:Qve(B2t(t)),label:t.label,tagName:t.tagName,sourceFile:t.sourceFile,box:t.boundingBox,text:t.textContent,can:{editStyles:n.canEditStyles,move:n.canMove||n.canApplyManualOffset,resize:n.canResize||n.canApplyManualSize,editText:t.textFields.length>0,reasonIfDisabled:n.reasonIfDisabled??null},animationCount:e}}function Q2t(t,e){var n,r;return(((n=t.label)==null?void 0:n.toLowerCase().includes(e))??!1)||t.tag.toLowerCase().includes(e)||(((r=t.handle)==null?void 0:r.toLowerCase().includes(e))??!1)}function z2t(t,e={}){var o;const n=t.elements.map(V2t),r=(o=e.filter)==null?void 0:o.slice(0,zve).trim().toLowerCase(),i=r?n.filter(l=>Q2t(l,r)):n,s=Number.isInteger(e.limit)&&e.limit>0?e.limit:Rk,a=Math.min(s,Rk);return j2t({projectId:t.projectId,compositionPath:t.compositionPath,playhead:t.currentTime,duration:t.duration,isPlaying:t.isPlaying,history:t.history,selection:t.selection?H2t(t.selection,t.selectionAnimationCount):null,elementCount:i.length,elements:i.slice(0,a)})}const Z2t={type:"object",properties:{filter:{type:"string",maxLength:zve,description:"Case-insensitive substring matched against element label, tag, and handle."},limit:{type:"integer",minimum:1,maximum:Rk,description:`Cap the returned elements (default and max ${Rk}). elementCount always reports the full match count.`}},additionalProperties:!1},G2t=["Read HyperFrames Studio's live state in one call: the open project and composition,","the playhead and duration, what the human currently has selected (including what that","element will and will not accept), and the timeline's elements with a handle for each.","Pass a handle back to any tool that edits an element.","Returns an object with `ok: true`, or `ok: false` with `kind`, `reason` and often a `hint`.","`history.undoLabel` is worth checkpointing before a batch: if it later names something","you did not do, a human pressed undo and your earlier edits are gone."].join(" "),m7=Z0("webmcp");function U2t(t,e){m7("registered",{native:e,...t});for(const n of t.failed)Ns("webmcp_registration_failed",{error_name:n.name,tool_name:n.tool})}function X2t(t){return[{name:"studio_look",title:"Look at the composition",description:G2t,inputSchema:Z2t,annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:e=>L2t("studio_look",async()=>z2t(t.current.getSnapshot(),e))}]}function W2t(t){const e=x.useRef(t);e.current=t,x.useEffect(()=>{if(to().agentToolsEnabled===!1){m7("skipped",{why:"disabled by preference"});return}const n=new AbortController;return(async()=>{const r=Vve();r&&Ns("webmcp.native_present");const i=r??await M2t();if(!i){m7("skipped",{why:"no model context, native or polyfilled"});return}if(n.signal.aborted)return;const s=await R2t(i,X2t(e),n.signal);U2t(s,r!==null)})(),()=>n.abort()},[])}function q2t(){const{projectId:t,activeCompPath:e,editHistory:n}=zl(),{domEditSelection:r,selectedGsapAnimations:i}=yy(),s=x.useCallback(()=>{const a=fe.getState();return{projectId:t,compositionPath:e,currentTime:a.currentTime,duration:a.duration,isPlaying:a.isPlaying,elements:a.elements,selection:r,selectionAnimationCount:i.length,history:{canUndo:n.canUndo,canRedo:n.canRedo,undoLabel:n.undoLabel??null,redoLabel:n.redoLabel??null}}},[t,e,r,i,n]);return W2t({getSnapshot:s}),null}function Y2t({left:t,right:e,hidden:n,timelineToolbar:r,renderClipContent:i,handleTimelineElementDelete:s,handleTimelineAssetDrop:a,handleTimelineBlockDrop:o,handleTimelineCompositionDrop:l,handlePreviewBlockDrop:c,handleTimelineFileDrop:u,handleTimelineElementMove:f,handleTimelineElementsMove:h,handleTimelineElementResize:m,handleTimelineGroupResize:y,handleToggleTrackHidden:d,setAudioGroupAttribute:v,handleGroupClips:b,setElementFxAttribute:w,handleBlockedTimelineEdit:O,handleTimelineElementSplit:k,handleRazorSplit:E,handleRazorSplitAll:M,setCompIdToSrc:N,setCompositionLoading:I,shouldShowMotionPath:_,shouldShowSelectedDomBounds:j,isGestureRecording:L,recordingState:B,onToggleRecording:$,blockPreview:Q,gestureOverlay:Y}){const{projectId:W,activeCompPath:J,setActiveCompPath:ne,handlePreviewIframeRef:le,showToast:ie}=zl(),{refreshKey:q,captionEditMode:F,refreshPreviewDocumentVersion:U,timelineElements:Z}=vy(),{handleTimelineElementSelect:K,buildDomSelectionForTimelineElement:ee,applyDomSelection:re,applyMarqueeSelection:z}=HE(),{domEditSelection:H,domEditGroupSelections:se}=yy(),ue=fe(ge=>ge.selectedElementId),be=fe(ge=>ge.selectedElementIds),me=x.useCallback(()=>{ie("The selected clip is not available in the preview yet.","info")},[ie]);E2t({selectedElementId:ue,selectedElementIds:be,timelineElements:Z,domEditSelection:H,domEditGroupSelections:se,activeCompPath:J,buildDomSelectionForTimelineElement:ee,applyDomSelection:re,applyMarqueeSelection:z,onSelectionNotFound:me});const pe=S2t({handleTimelineElementMove:f,handleTimelineElementsMove:h,handleTimelineElementResize:m,handleTimelineGroupResize:y,handleToggleTrackHidden:d,setAudioGroupAttribute:v,handleGroupClips:b,setElementFxAttribute:w,handleBlockedTimelineEdit:O,handleTimelineElementSplit:k,handleRazorSplit:E,handleRazorSplitAll:M});return p.jsx("div",{className:`flex flex-col flex-1 min-h-0${n?" hidden":""}`,children:p.jsx(T5e,{value:pe,children:p.jsx(ygt,{projectId:W,refreshKey:q,activeCompositionPath:J,onIframeRef:le,onCompIdToSrcChange:N,onCompositionLoadingChange:I,onCompositionChange:ge=>{ge!==J&&(ne(ge),U())},children:p.jsx(K2t,{left:t,right:e,captionEditMode:F,onSelectTimelineElement:K,onPreviewBlockDrop:c,timelineToolbar:r,renderClipContent:i,onFileDrop:u,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l,onDeleteElement:s,previewOverlay:p.jsx(g2t,{shouldShowMotionPath:_,shouldShowSelectedDomBounds:j,blockPreview:Q,isGestureRecording:L,recordingState:B,onToggleRecording:$,gestureOverlay:Y})})})})})}function K2t({left:t,right:e,captionEditMode:n,previewOverlay:r,onSelectTimelineElement:i,onPreviewBlockDrop:s,timelineToolbar:a,renderClipContent:o,onFileDrop:l,onAssetDrop:c,onBlockDrop:u,onCompositionDrop:f,onDeleteElement:h}){const{compositionStack:m,updateCompositionStack:y,containerRef:d}=rV(),v=x.useCallback(w=>{fe.getState().requestSeek(w)},[]),b=x.useCallback(w=>{w.key==="Escape"&&m.length>1&&y(O=>O.slice(0,-1))},[m.length,y]);return p.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-h-0 bg-[#18181B]",onKeyDown:b,tabIndex:-1,children:[p.jsx(q2t,{}),p.jsxs("div",{className:"flex flex-row flex-1 min-h-0 px-px pt-px",children:[t,p.jsx("div",{className:"flex-1 min-w-0 flex flex-col relative",children:p.jsx(kgt,{previewOverlay:r,onSelectTimelineElement:i,onPreviewBlockDrop:s})}),e]}),p.jsx(Pgt,{timelineToolbar:a,renderClipContent:o,onFileDrop:l,onAssetDrop:c,onBlockDrop:u,onCompositionDrop:f,onDeleteElement:h,onSelectTimelineElement:i,timelineFooter:n?p.jsxs("div",{className:"border-t border-neutral-800/30 flex-shrink-0",style:{height:60},children:[p.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5",children:p.jsx("span",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Captions"})}),p.jsx(w2t,{pixelsPerSecond:100,onSeek:v})]}):void 0})]})}const J2t=600,one=new Map;function evt(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function jk(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function tvt(t){try{const e=jk(t.section)||"unknown",n=jk(t.name),r=t.control||"unknown",i=`${t.ui}:${e}:${r}:${n||"unnamed"}`,s=evt(),a=one.get(i);if(a!==void 0&&s-a<J2t)return;one.set(i,s),Pt("design_input",{ui:t.ui,section:e,control:r,name:n||"unnamed"})}catch{}}const g7=Dc("DesignPanelInputContext",{ui:"classic",section:"unknown"});function vf({ui:t,section:e,children:n}){const r=x.useContext(g7),i=x.useMemo(()=>({ui:t??r.ui,section:e??r.section}),[t,e,r.ui,r.section]);return p.jsx(g7.Provider,{value:i,children:n})}function Dn(){const{ui:t,section:e}=x.useContext(g7);return x.useCallback((n,r)=>tvt({ui:t,section:e,control:n,name:r}),[t,e])}function nvt({element:t,copied:e,onCopy:n,onClear:r,onUngroup:i,selectedElementId:s,selectedElementHidden:a,visibilityLabel:o,onToggleHidden:l}){const c=Dn();return p.jsxs("div",{className:"flex items-center gap-1",children:[s&&l&&p.jsx("button",{type:"button","aria-label":o,title:o,onClick:()=>{c("toggle","Element visibility"),l(s,!a)},className:"flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",children:a?p.jsx($L,{size:13,weight:"bold","aria-hidden":"true"}):p.jsx(ZE,{size:13,weight:"bold","aria-hidden":"true"})}),i&&t.dataAttributes["hf-group"]!=null&&p.jsx("button",{type:"button",onClick:()=>{c("button","Ungroup"),i()},title:"Ungroup (⌘⇧G)",className:"flex h-6 items-center rounded px-2 text-[11px] font-medium text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-neutral-200",children:"Ungroup"}),p.jsx("button",{type:"button",onClick:()=>{c("button","Copy element info"),n()},className:`flex h-6 w-6 items-center justify-center rounded transition-colors ${e?"text-studio-accent":"text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300"}`,title:e?"Copied!":"Copy element info to clipboard",children:p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[p.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),p.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5"})]})}),p.jsx("button",{type:"button","aria-label":"Clear selection",onClick:()=>{c("button","Clear selection"),r()},className:"flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",children:p.jsx(Md,{size:13})})]})}function gV(t){const e=t.indexOf("?"),n=t.indexOf("#");return e<0?n<0?t:t.slice(0,n):n<0?t.slice(0,e):t.slice(0,Math.min(e,n))}function rvt(t,e){var n;return e?((n=t.find(r=>(r.key??r.id)===e))==null?void 0:n.hidden)===!0:!1}function y7(t){return[t.id??"",t.hfId??"",t.selector??"",String(t.selectorIndex??""),t.sourceFile??""].join("|")}const yV=new Set(["inherit","initial","revert","revert-layer","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-sans-serif","ui-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),ivt=[...ER,"Inter","system-ui","sans-serif","serif","monospace"];function lne(t){return t.replace(/[^\w .-]+/g," ").replace(/\s+/g," ").trim()}function n4(t){var r,i;const e=((r=t.style)==null?void 0:r.toLowerCase())??"",n=((i=t.fullName)==null?void 0:i.toLowerCase())??"";return e==="regular"||n.endsWith(" regular")?0:e==="normal"||n.endsWith(" normal")?1:e==="medium"||n.endsWith(" medium")?2:3}function $D(t){const e=new Set;return t.reduce((n,r)=>{const i=r.trim();if(!i)return n;const s=i.toLowerCase();return e.has(s)||(e.add(s),n.push(i)),n},[])}function cne(t){const e=new Set;return t.reduce((n,r)=>{const i=r.family.trim();if(!i)return n;const s=i.toLowerCase();return e.has(s)||(e.add(s),n.push({family:i,source:r.source})),n},[])}function svt(t){return[...t].sort((e,n)=>{const r=une(e.source)-une(n.source);if(r!==0)return r;const i=ER.findIndex(o=>o.toLowerCase()===e.family.toLowerCase()),s=ER.findIndex(o=>o.toLowerCase()===n.family.toLowerCase()),a=(i===-1?Number.MAX_SAFE_INTEGER:i)-(s===-1?Number.MAX_SAFE_INTEGER:s);return a===0?e.family.localeCompare(n.family):a})}function une(t){return t==="Current"?0:t==="Document"?1:t==="Imported"?2:t==="Google"?3:t==="Local"?4:5}const Nu="min-w-0 rounded-md bg-panel-input px-3 py-[7px] text-panel-text-1 transition-colors focus-within:ring-1 focus-within:ring-panel-accent/30",pr="text-[11px] font-medium text-panel-text-3",qs="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3",avt={},x7="none",Zve={none:"none",soft:"0 12px 36px rgba(0, 0, 0, 0.28)",lift:"0 18px 54px rgba(0, 0, 0, 0.38)",glow:"0 0 0 1px rgba(60, 230, 172, 0.34), 0 18px 56px rgba(60, 230, 172, 0.2)"};function r4(t){return zA(t)??{red:0,green:0,blue:0,alpha:1}}function ca(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Sc(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function Sr(t){const e=ba(t);return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function Fd(t){if(!t)return null;const e=t.trim().match(/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i);if(!e)return null;const n=Number.parseFloat(e[1]);return Number.isFinite(n)?{value:n,unit:e[2]??""}:null}function oo(t){const e=Fd(t);return!e||e.unit&&e.unit.toLowerCase()!=="px"?null:e.value}function Gve(t,e,n,r){return Number.isFinite(t)?Math.max(e,Math.min(n,t)):r}function Uve(t,e={}){const n=Fd(t.trim());if(!n||n.unit&&n.unit.toLowerCase()!=="px")return null;const r=Gve(n.value,e.min??Number.NEGATIVE_INFINITY,e.max??Number.POSITIVE_INFINITY,e.fallback??0);return`${Sr(r)}px`}function di(t){return`${Sr(t)}px`}function Lk(t,e){const n=e.trim();if(!n||n==="normal")return n||"normal";const r=Fd(n);return r?t==="letter-spacing"?r.unit?n:`${Sr(r.value)}px`:r.unit?n:r.value>4?`${Sr(r.value)}px`:Sr(r.value):n}function ovt(t){const e=t.trim(),n=[];let r=0,i=0;for(let a=0;a<e.length;a+=1){const o=e[a];if(o==="("&&(r+=1),o===")"&&(r=Math.max(0,r-1)),/\s/.test(o)&&r===0){const l=e.slice(i,a).trim();l&&n.push(l),i=a+1}}const s=e.slice(i).trim();return s&&n.push(s),n}function Fk(t,e){const n=t==null?void 0:t.trim();if(!n||n===x7)return 0;const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(?:^|\\s)${r}\\((-?\\d+(?:\\.\\d+)?)px\\)`,"i").exec(n);if(!i)return 0;const s=Number.parseFloat(i[1]);return Number.isFinite(s)?Math.max(0,s):0}function $k(t,e,n){const r=Gve(n,0,200,0),i=ovt(t&&t.trim()!==x7?t:""),s=e.toLowerCase(),a=i.filter(o=>!o.toLowerCase().startsWith(`${s}(`));return r>0&&a.push(`${e}(${Sr(r)}px)`),a.length>0?a.join(" "):x7}function Xve(t){const e=(t==null?void 0:t.trim())||"none";for(const[n,r]of Object.entries(Zve))if(e===r)return n;return e==="none"?"none":"custom"}function Wve(t,e){return t==="custom"?(e==null?void 0:e.trim())||"none":Zve[t]}function qve(t,e){const n=[["border-width",t]],r=Fd(t),i=(e==null?void 0:e.trim().toLowerCase())||"none";return r&&r.value>0&&(i==="none"||i==="hidden")&&n.push(["border-style","solid"]),n}function Yve(t,e){const n=[["border-style",t]],r=t.trim().toLowerCase();if(!r||r==="none"||r==="hidden")return n;const i=Fd((e==null?void 0:e.trim())||"0");return(!i||i.value<=0)&&n.push(["border-width","1px"]),n}function fne(t,e,n){const r=Fd(t);if(!r)return null;const i=n!=null&&n.altKey?.1:n!=null&&n.shiftKey?10:1,s=r.value+i*e;return`${Sr(s)}${r.unit}`}function Kve(t){if(!t)return"";const n=t.toLowerCase().indexOf("url(");if(n<0)return"";let r=n+4;for(;r<t.length&&(t[r]===" "||t[r]===`
|
|
338
|
+
`),children:l.count})]})}),H1t=x.memo(function t({node:e,depth:n,activeFile:r,onSelectFile:i,defaultOpen:s,onContextMenu:a,inlineInput:o,onDragStart:l,onDragOver:c,onDrop:u,onDragLeave:f,dragOverFolder:h,lintFindingsByFile:m}){const[y,d]=x.useState(s),v=x.useCallback(()=>d(E=>!E),[]),b=x.useMemo(()=>J2e(e.children),[e.children]),w=y?sfe:afe,O=h===e.fullPath;return(o==null?void 0:o.mode)==="rename"&&o.originalPath===e.fullPath?p.jsx(Ck,{defaultValue:o.originalName??e.name,depth:n,isFolder:!0,onCommit:E=>{var M;(M=o==null?void 0:o.onCommit)==null||M.call(o,E)},onCancel:()=>{var E;(E=o==null?void 0:o.onCancel)==null||E.call(o)}}):p.jsxs(p.Fragment,{children:[p.jsxs("button",{draggable:!0,onDragStart:E=>l(E,e.fullPath),onClick:v,onContextMenu:E=>{E.preventDefault(),a(E,e.fullPath,!0)},onDragOver:E=>{E.preventDefault(),E.stopPropagation(),c(E,e.fullPath)},onDrop:E=>{E.preventDefault(),E.stopPropagation(),u(E,e.fullPath)},onDragLeave:f,className:`w-full flex items-center gap-1.5 px-2.5 py-1 min-h-7 text-left text-xs text-neutral-400 hover:bg-neutral-800/30 hover:text-neutral-300 transition-colors ${O?"bg-[#3CE6AC]/10 outline outline-1 outline-[#3CE6AC]/40":""}`,style:{paddingLeft:`${8+n*12}px`},children:[p.jsx(w,{size:10,className:"flex-shrink-0 text-neutral-600"}),p.jsx("span",{className:"truncate font-medium",children:e.name})]}),y&&p.jsxs(p.Fragment,{children:[o&&(o.mode==="new-file"||o.mode==="new-folder")&&o.parentPath===e.fullPath&&p.jsx(Ck,{defaultValue:"",depth:n+1,isFolder:o.mode==="new-folder",onCommit:E=>{var M;(M=o==null?void 0:o.onCommit)==null||M.call(o,E)},onCancel:()=>{var E;(E=o==null?void 0:o.onCancel)==null||E.call(o)}}),b.map(E=>E.isFile&&E.children.size===0?p.jsx(c7,{node:E,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:a,inlineInput:o,onDragStart:l,lintInfo:m==null?void 0:m.get(E.fullPath)},E.fullPath):E.children.size>0?p.jsx(t,{node:E,depth:n+1,activeFile:r,onSelectFile:i,defaultOpen:nV(E,r),onContextMenu:a,inlineInput:o,onDragStart:l,onDragOver:c,onDrop:u,onDragLeave:f,dragOverFolder:h,lintFindingsByFile:m},E.fullPath):p.jsx(c7,{node:E,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:a,inlineInput:o,onDragStart:l,lintInfo:m==null?void 0:m.get(E.fullPath)},E.fullPath))]})]})}),Q1t=x.memo(function({files:e,activeFile:n,onSelectFile:r,onCreateFile:i,onCreateFolder:s,onDeleteFile:a,onRenameFile:o,onDuplicateFile:l,onMoveFile:c,onImportFiles:u,lintFindingsByFile:f}){const h=x.useMemo(()=>F1t(e),[e]),m=x.useMemo(()=>J2e(h.children),[h]),[y,d]=x.useState(null),[v,b]=x.useState(null),[w,O]=x.useState(null),[k,E]=x.useState(null),M=x.useRef(null),N=!!(i||s||a||o||l),I=x.useCallback((F,U,Z)=>{N&&(F.preventDefault(),d({x:F.clientX,y:F.clientY,targetPath:U,targetIsFolder:Z}))},[N]),_=x.useCallback(()=>d(null),[]),j=x.useCallback(F=>{b({parentPath:F,mode:"new-file",onCommit:U=>{const Z=F?`${F}/${U}`:U;i==null||i(Z),b(null)},onCancel:()=>b(null)})},[i]),L=x.useCallback(F=>{b({parentPath:F,mode:"new-folder",onCommit:U=>{const Z=F?`${F}/${U}`:U;s==null||s(Z),b(null)},onCancel:()=>b(null)})},[s]),B=x.useCallback(F=>{const U=F.includes("/")?F.slice(F.lastIndexOf("/")+1):F,Z=F.includes("/")?F.slice(0,F.lastIndexOf("/")):"";b({parentPath:Z,mode:"rename",originalPath:F,originalName:U,onCommit:K=>{if(K!==U){const ee=Z?`${Z}/${K}`:K;o==null||o(F,ee)}b(null)},onCancel:()=>b(null)})},[o]),$=x.useCallback(F=>{l==null||l(F)},[l]),Q=x.useCallback(F=>{O({path:F,isFolder:(y==null?void 0:y.targetIsFolder)??!1,x:(y==null?void 0:y.x)??window.innerWidth/2,y:(y==null?void 0:y.y)??window.innerHeight/2})},[y]),Y=x.useCallback(()=>{w&&(a==null||a(w.path),O(null))},[w,a]),W=x.useCallback(()=>{O(null)},[]),J=x.useCallback((F,U)=>{M.current=U,F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",U)},[]),ne=x.useCallback((F,U)=>{E(U)},[]),le=x.useCallback((F,U)=>{if(F.dataTransfer.files.length>0&&!M.current){F.preventDefault(),u==null||u(F.dataTransfer.files,U||void 0),E(null);return}const Z=M.current;if(!Z||!c){E(null);return}const K=Z.includes("/")?Z.slice(Z.lastIndexOf("/")+1):Z,ee=U?`${U}/${K}`:K;ee!==Z&&!U.startsWith(Z+"/")&&c(Z,ee),E(null),M.current=null},[c,u]),ie=x.useCallback(()=>{E(null)},[]),q=x.useCallback(F=>{N&&F.target===F.currentTarget&&(F.preventDefault(),d({x:F.clientX,y:F.clientY,targetPath:"",targetIsFolder:!0}))},[N]);return p.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[N&&p.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-b border-neutral-800/50 flex-shrink-0",children:[p.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-neutral-600 uppercase",children:"Files"}),p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx("button",{onClick:()=>j(""),className:"p-1.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 active:scale-[0.97] transition-colors",title:"New File","aria-label":"New File",children:p.jsx(zue,{size:12,weight:"bold"})}),p.jsx("button",{onClick:()=>L(""),className:"p-1.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 active:scale-[0.97] transition-colors",title:"New Folder","aria-label":"New Folder",children:p.jsx(Tue,{size:12,weight:"duotone"})})]})]}),p.jsxs("div",{className:`flex-1 overflow-y-auto py-1 transition-colors ${k===""?"bg-[#3CE6AC]/5 outline outline-1 outline-[#3CE6AC]/30 -outline-offset-1":""}`,onContextMenu:q,onDragOver:F=>{F.preventDefault(),F.target===F.currentTarget&&E("")},onDragLeave:F=>{F.target===F.currentTarget&&E(null)},onDrop:F=>{F.preventDefault(),le(F,"")},children:[v&&(v.mode==="new-file"||v.mode==="new-folder")&&v.parentPath===""&&p.jsx(Ck,{defaultValue:"",depth:0,isFolder:v.mode==="new-folder",onCommit:F=>{var U;return(U=v.onCommit)==null?void 0:U.call(v,F)},onCancel:()=>{var F;return(F=v.onCancel)==null?void 0:F.call(v)}}),m.length===0&&!v&&p.jsxs("div",{className:"px-3 py-4 text-center text-[11px] text-neutral-600",children:["No files yet",N?" — use + above to create one":"","."]}),m.map(F=>F.isFile&&F.children.size===0?p.jsx(c7,{node:F,depth:0,activeFile:n,onSelectFile:r,onContextMenu:I,inlineInput:v,onDragStart:J,lintInfo:f==null?void 0:f.get(F.fullPath)},F.fullPath):p.jsx(H1t,{node:F,depth:0,activeFile:n,onSelectFile:r,defaultOpen:nV(F,n),onContextMenu:I,inlineInput:v,onDragStart:J,onDragOver:ne,onDrop:le,onDragLeave:ie,dragOverFolder:k,lintFindingsByFile:f},F.fullPath))]}),w&&p.jsx("div",{className:"fixed z-50 w-56",style:{left:Math.min(w.x,window.innerWidth-240),top:Math.min(w.y,window.innerHeight-120)},children:p.jsx(V1t,{name:w.path.includes("/")?w.path.slice(w.path.lastIndexOf("/")+1):w.path,isFolder:w.isFolder,onConfirm:Y,onCancel:W})}),y&&p.jsx(B1t,{state:y,onClose:_,onNewFile:j,onNewFolder:L,onRename:B,onDuplicate:$,onDelete:Q})]})}),eve="hf-studio-sidebar-tab",Ate=[{id:"code",label:"Code",tooltip:"Source code editor"},{id:"compositions",label:"Comps",tooltip:"Compositions and sub-compositions"},{id:"assets",label:"Assets",tooltip:"Videos, images, audio, fonts"},{id:"blocks",label:"Catalog",tooltip:"Browse blocks and components"}];function z1t(){var e;let t=null;try{t=((e=qA())==null?void 0:e.getItem(eve))??null}catch{}return t==="assets"?"assets":t==="code"?"code":t==="blocks"?"blocks":"compositions"}const Z1t=x.memo(x.forwardRef(function({width:e=240,projectId:n,compositions:r,assets:i,activeComposition:s,onSelectComposition:a,onImportFiles:o,fileTree:l,editingFile:c,onSelectFile:u,onCreateFile:f,onCreateFolder:h,onDeleteFile:m,onRenameFile:y,onDuplicateFile:d,onMoveFile:v,codeChildren:b,onRenderComposition:w,isRendering:O,onLint:k,linting:E,lintFindingCount:M,lintFindingsByFile:N,onToggleCollapse:I,onAddBlock:_,onPreviewBlock:j,takeoverContent:L,onAddAssetToTimeline:B,onAddCompositionToTimeline:$},Q){const[Y,W]=x.useState(z1t),J=x.useRef(Y);J.current=Y;const ne=x.useRef(null),le=x.useCallback(F=>{var U;W(F);try{(U=qA())==null||U.setItem(eve,F)}catch{}Pt("tab_switch",{panel:"left_sidebar",tab:F})},[]),ie=x.useCallback(()=>J.current,[]);x.useImperativeHandle(Q,()=>({selectTab:le,getTab:ie}),[le,ie]);const q=x.useCallback(F=>{var ee,re;if(F.key!=="ArrowLeft"&&F.key!=="ArrowRight")return;F.preventDefault();const U=Ate.map(z=>z.id),Z=U.indexOf(J.current),K=U[(Z+(F.key==="ArrowRight"?1:-1)+U.length)%U.length];le(K),(re=(ee=ne.current)==null?void 0:ee.querySelector(`[data-tab-id="${K}"]`))==null||re.focus()},[le]);return p.jsx("div",{className:"flex flex-col h-full overflow-hidden rounded-lg border border-neutral-800/50 bg-neutral-950",style:{width:e},children:L?p.jsx("div",{className:"flex min-h-0 flex-1",children:L}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"border-b border-neutral-800/50 px-3 py-3 flex-shrink-0",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{ref:ne,role:"tablist","aria-label":"Sidebar panels",onKeyDown:q,className:"grid min-w-0 flex-1 gap-0.5 rounded-[18px] bg-neutral-900 p-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",style:{gridTemplateColumns:"1fr 1fr 1fr 1fr"},children:Ate.map(F=>p.jsx(br,{label:F.tooltip,side:"bottom",children:p.jsx("button",{type:"button",role:"tab","data-tab-id":F.id,"aria-selected":Y===F.id,"aria-controls":`sidebar-panel-${F.id}`,tabIndex:Y===F.id?0:-1,onClick:()=>le(F.id),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all active:scale-[0.97] ${Y===F.id?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:F.label})},F.id))}),I&&p.jsx("button",{type:"button",onClick:I,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Hide sidebar","aria-label":"Hide sidebar",children:p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"m14 7-5 5 5 5"}),p.jsx("path",{d:"M19 4v16"})]})})]})}),Y==="compositions"&&p.jsx("div",{id:"sidebar-panel-compositions",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(i1t,{projectId:n,compositions:r,activeComposition:s,onSelect:a,onAddToTimeline:$,onRenderComposition:w,isRendering:O,lintFindingsByFile:N})}),Y==="assets"&&p.jsx("div",{id:"sidebar-panel-assets",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(P1t,{projectId:n,assets:i,onImport:o,onDelete:m,onRename:y,onAddAssetToTimeline:B})}),Y==="code"&&p.jsxs("div",{id:"sidebar-panel-code",role:"tabpanel",className:"flex flex-1 min-h-0",children:[((l==null?void 0:l.length)??0)>0&&p.jsx("div",{className:"w-[160px] flex-shrink-0 border-r border-neutral-800 overflow-y-auto",children:p.jsx(Q1t,{files:l??[],activeFile:(c==null?void 0:c.path)??null,onSelectFile:u??(()=>{}),onCreateFile:f,onCreateFolder:h,onDeleteFile:m,onRenameFile:y,onDuplicateFile:d,onMoveFile:v,onImportFiles:o,lintFindingsByFile:N})}),p.jsx("div",{className:"flex-1 overflow-hidden min-w-0",children:b??p.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to edit"})})]}),Y==="blocks"&&p.jsx("div",{id:"sidebar-panel-blocks",role:"tabpanel",className:"flex flex-col flex-1 min-h-0",children:p.jsx(_1t,{onAddBlock:_,onPreviewBlock:j})}),k&&p.jsx("div",{className:"border-t border-neutral-800 p-2 flex-shrink-0",children:p.jsxs("button",{onClick:k,disabled:E,className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md text-[11px] font-medium text-neutral-500 enabled:hover:text-amber-300 enabled:hover:bg-neutral-800 enabled:active:scale-[0.98] transition-colors disabled:opacity-40",children:[p.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("path",{d:"M9 11l3 3L22 4"}),p.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),E?"Linting…":"Lint",!E&&M!=null&&M>0&&p.jsx("span",{className:"ml-1 min-w-[16px] rounded-full bg-amber-500/20 px-1 text-[9px] font-bold text-amber-400",children:M})]})})]})})}));function G1t({name:t,filePath:e}){return p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600","aria-hidden":"true",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12",strokeLinecap:"round"}),p.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16",strokeLinecap:"round"})]}),p.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:t}),p.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),p.jsx("span",{className:"text-[10px] text-neutral-500",children:"Couldn't load this file — it may be missing or corrupt"})]})}function U1t({projectId:t,filePath:e}){const n=`/api/projects/${t}/preview/${e}`,r=e.split("/").pop()??e,[i,s]=x.useState(null),a=i===e,o=()=>s(e);return a?p.jsx(G1t,{name:r,filePath:e}):m0.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[p.jsx("img",{src:n,alt:r,onError:o,className:"max-w-full max-h-[70%] object-contain rounded border border-neutral-800"}),p.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):oS.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[p.jsx("video",{src:n,controls:!0,onError:o,className:"max-w-full max-h-[70%] rounded border border-neutral-800"}),p.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):Nj.test(e)?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-3",children:[p.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[p.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),p.jsx("audio",{src:n,controls:!0,onError:o,className:"w-full max-w-[280px]"}),p.jsx("span",{className:"text-[11px] text-neutral-500 font-mono",children:e})]}):p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[p.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:r}),p.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),p.jsx("span",{className:"text-[10px] text-neutral-600",children:"Binary file — preview not available"})]})}const tve="hf-studio-render-settings";function nve(){try{const t=localStorage.getItem(tve);if(t){const e=JSON.parse(t);return{format:["mp4","webm","mov"].includes(e.format)?e.format:"mp4",quality:["draft","standard","high"].includes(e.quality)?e.quality:"standard",fps:[24,30,60].includes(e.fps)?e.fps:30}}}catch{}return{format:"mp4",quality:"standard",fps:30}}function kD(t,e,n){try{localStorage.setItem(tve,JSON.stringify({format:t,quality:e,fps:n}))}catch{}}function X1t({leftSidebarRef:t,onSelectComposition:e,onAddBlock:n,onPreviewBlock:r,onLint:i,linting:s,lintFindingCount:a,lintFindingsByFile:o,onAddAssetToTimeline:l,onAddCompositionToTimeline:c}){const{effectiveLeftCollapsed:u,leftWidth:f,adjustPanelWidth:h,toggleLeftSidebar:m,handlePanelResizeStart:y,handlePanelResizeMove:d,handlePanelResizeEnd:v,setRightPanelTab:b,setRightCollapsed:w}=Y$(),{projectId:O,renderQueue:k,waitForPendingDomEditSaves:E}=zl(),{compositions:M,assets:N,editingFile:I,fileTree:_,revealSourceOffset:j,handleFileSelect:L,handleCreateFile:B,handleCreateFolder:$,handleDeleteFile:Q,handleRenameFile:Y,handleDuplicateFile:W,handleMoveFile:J,handleImportFiles:ne,handleContentChange:le}=$0(),ie=x.useCallback(async q=>{if(k.ffmpegMissing){b("renders"),w(!1);return}await E();const{format:F,quality:U,fps:Z}=nve();await k.startRender({composition:q,format:F,quality:U,fps:Z})},[k,E,b,w]);return u?p.jsx("div",{className:"mr-0.5 flex w-10 flex-shrink-0 flex-col items-center rounded-lg border border-neutral-800/50 bg-neutral-950 pt-1",children:p.jsx("button",{type:"button",onClick:m,className:"flex h-8 w-8 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Show sidebar","aria-label":"Show sidebar",children:p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M5 4v16"}),p.jsx("path",{d:"m10 7 5 5-5 5"})]})})}):p.jsxs(p.Fragment,{children:[p.jsx(Z1t,{ref:t,width:f,projectId:O,compositions:M,assets:N,activeComposition:(I==null?void 0:I.path)??null,onSelectComposition:e,fileTree:_,editingFile:I,onSelectFile:L,onCreateFile:B,onCreateFolder:$,onDeleteFile:Q,onRenameFile:Y,onDuplicateFile:W,onMoveFile:J,onImportFiles:async(q,F)=>{await ne(q,F)},codeChildren:I?Pae(I.path)?p.jsx(U1t,{projectId:O,filePath:I.path}):I.content==null?p.jsxs("div",{className:"flex h-full items-center justify-center text-[11px] text-neutral-600",children:["Loading ",I.path,"…"]}):p.jsx(B2e,{content:I.content,filePath:I.path,onChange:le,revealOffset:j}):void 0,onRenderComposition:ie,isRendering:k.isRendering,onLint:i,linting:s,lintFindingCount:a,lintFindingsByFile:o,onToggleCollapse:m,onAddBlock:n,onPreviewBlock:r,onAddAssetToTimeline:l,onAddCompositionToTimeline:c}),p.jsxs("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",tabIndex:0,className:"group relative w-[3px] flex-shrink-0 cursor-col-resize outline-none focus-visible:bg-studio-accent/20",style:{touchAction:"none"},onPointerDown:q=>y("left",q),onPointerMove:d,onPointerUp:v,onPointerCancel:v,onKeyDown:q=>{if(q.key!=="ArrowLeft"&&q.key!=="ArrowRight")return;q.preventDefault();const F=q.key==="ArrowLeft"?-16:16;h("left",F)},children:[p.jsx("div",{className:"absolute inset-y-0 -left-[2px] w-[13px]"}),p.jsx("div",{className:"absolute top-1/2 left-0 h-[52px] w-[3px] -translate-y-1/2 bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})]})]})}const W1t=25,q1t=400,Y1t='[data-preview-pan-surface="true"]',kk=48,rve={zoomPercent:100,panX:0,panY:0},K1t=.007,Ste=10;function Gh(t){return Math.round(t*1e4)/1e4}function Df(t){return Number.isFinite(t)?Math.min(q1t,Math.max(W1t,t)):100}function J1t(t){return t===1}function ED(t,e){return t instanceof Element?e!=null&&e.contains(t)?!0:!!t.closest(Y1t):!1}function egt(t,e){if(!Number.isFinite(t))return Df(e);const r=-(Math.abs(t)>Ste?Ste*Math.sign(t):t)*K1t,i=Df(e);return Df(i*Math.exp(r))}function u7(t){const e=Df(t.zoomPercent)/100,n=t.contentWidth??t.viewportWidth,r=t.contentHeight??t.viewportHeight,i=Math.max(0,(n*e-t.viewportWidth)/2)+kk,s=Math.max(0,(r*e-t.viewportHeight)/2)+kk;return{panX:Math.min(i,Math.max(-i,t.panX)),panY:Math.min(s,Math.max(-s,t.panY))}}function tgt(t,e,n,r,i,s,a){const o=Df(n)/100,l=Math.abs(s*o-r)/2+kk,c=Math.abs(a*o-i)/2+kk;return{panX:Math.min(l,Math.max(-l,t)),panY:Math.min(c,Math.max(-c,e))}}function ngt(t){const e=Df(t.state.zoomPercent),n=egt(t.deltaY,e),r=e/100,i=n/100;let s=t.state.panX,a=t.state.panY;if(t.cursorX!==void 0&&t.cursorY!==void 0){const u=i/r;s=t.cursorX*(1-u)+s*u,a=t.cursorY*(1-u)+a*u}const o=t.contentWidth??t.viewportWidth,l=t.contentHeight??t.viewportHeight,c=tgt(s,a,n,t.viewportWidth,t.viewportHeight,o,l);return{zoomPercent:n,...c}}function rgt(t){const e=u7({panX:t.state.panX-t.deltaX,panY:t.state.panY-t.deltaY,zoomPercent:t.state.zoomPercent,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,contentWidth:t.contentWidth,contentHeight:t.contentHeight});return{zoomPercent:Df(t.state.zoomPercent),...e}}function igt({projectId:t,directUrl:e}){return e??t}const sgt=1200,agt=200,wte=16;function TD(t){return Math.abs(t.zoomPercent-100)<.5&&Math.abs(t.panX)<.1&&Math.abs(t.panY)<.1}function ogt(){const t=to().previewZoom;return t?{zoomPercent:Df(t.zoomPercent),panX:t.panX,panY:t.panY}:rve}function lgt(t){try{const e=t==null?void 0:t.contentDocument,n=(e==null?void 0:e.querySelector("[data-composition-id][data-width][data-height]"))??(e==null?void 0:e.querySelector("[data-width][data-height]"));if(!n)return null;const r=Number.parseInt(n.getAttribute("data-width")??"",10),i=Number.parseInt(n.getAttribute("data-height")??"",10);return!Number.isFinite(r)||r<=0||!Number.isFinite(i)||i<=0?null:{width:r,height:i}}catch{return null}}function Ote(t,e,n,r){const i=Math.max(0,t-wte),s=Math.max(0,e-wte),a=n&&n.width>0&&n.height>0?n.width/n.height:r?9/16:16/9;if(i===0||s===0)return{width:0,height:0};let o=i,l=o/a;return l>s&&(l=s,o=l*a),{width:Gh(o),height:Gh(l)}}const cgt=x.memo(function({projectId:e,iframeRef:n,onIframeLoad:r,onCompositionLoadingChange:i,portrait:s,directUrl:a,suppressLoadingOverlay:o,onStageRef:l,onCompositionSizeChange:c}){const u=igt({projectId:e,directUrl:a}),f=x.useRef(null),h=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{l==null||l(h)},[l]);const[y,d]=x.useState(null),[v,b]=x.useState(()=>Ote(0,0,null,s)),w=x.useRef(ogt()),[O,k]=x.useState(()=>w.current),E=x.useRef(null),M=x.useRef(null),N=x.useRef(null),I=x.useRef(!1),_=x.useRef(null);x.useEffect(()=>()=>{N.current&&clearTimeout(N.current),M.current&&clearTimeout(M.current)},[]),x.useEffect(()=>{const ie=f.current;if(!ie)return;const q=()=>{const U=ie.getBoundingClientRect();b(Ote(U.width,U.height,y,s))};q();const F=new ResizeObserver(q);return F.observe(ie),()=>F.disconnect()},[y,s]);const j=x.useRef(c);j.current=c;const L=x.useCallback(()=>{const ie=lgt(m.current);d(q=>(q==null?void 0:q.width)===(ie==null?void 0:ie.width)&&(q==null?void 0:q.height)===(ie==null?void 0:ie.height)?q:ie)},[]);x.useEffect(()=>{var ie;(ie=j.current)==null||ie.call(j,y)},[y]);const B=x.useCallback(ie=>{m.current=ie,n.current=ie},[n]),$=x.useRef(v);$.current=v;const Q=x.useCallback(ie=>{const q=h.current;if(!q)return;const F=Gh(ie.zoomPercent/100),U=Gh(ie.panX),Z=Gh(ie.panY);q.style.transform=`translate3d(${U}px, ${Z}px, 0) scale(${F})`},[]),Y=x.useCallback((ie,q)=>{const F={zoomPercent:Df(ie.zoomPercent),panX:Number.isFinite(ie.panX)?ie.panX:0,panY:Number.isFinite(ie.panY)?ie.panY:0};if(w.current=F,q){const U=E.current;U&&(I.current||(I.current=!0,U.style.opacity="1"),U.textContent=TD(F)?"Fit":`${Math.round(F.zoomPercent)}%`)}Q(F),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{I.current=!1;const U=w.current;if(Ol({previewZoom:U}),k(Z=>Z.zoomPercent===U.zoomPercent&&Z.panX===U.panX&&Z.panY===U.panY?Z:U),q){const Z=E.current;Z&&(Z.textContent=TD(U)?"Fit":`${Math.round(U.zoomPercent)}%`,M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{E.current&&(E.current.style.opacity="0")},sgt))}},agt)},[Q]),W=x.useCallback(ie=>Y(ie,!0),[Y]),J=x.useCallback(ie=>Y(ie,!1),[Y]),ne=x.useCallback(()=>{const ie=w.current;if(Math.abs(ie.zoomPercent-100)>.5||Math.abs(ie.panX)>.1||Math.abs(ie.panY)>.1){const q=f.current,F=q==null?void 0:q.getBoundingClientRect(),U=$.current;if(F&&F.width>0&&F.height>0&&U.width>0&&U.height>0){const Z=u7({panX:ie.panX,panY:ie.panY,zoomPercent:ie.zoomPercent,viewportWidth:F.width,viewportHeight:F.height,contentWidth:U.width,contentHeight:U.height});w.current={...ie,...Z}}Q(w.current)}},[Q]);x.useEffect(()=>{const ie=f.current;if(!ie)return;const q=F=>{const U=ie.getBoundingClientRect();if(F.clientX<U.left||F.clientX>U.right||F.clientY<U.top||F.clientY>U.bottom)return;if(F.ctrlKey||F.metaKey){F.preventDefault(),F.stopPropagation();const re=$.current,z=F.clientX-(U.left+U.width/2),H=F.clientY-(U.top+U.height/2),se=ngt({state:w.current,deltaY:F.deltaY,viewportWidth:U.width,viewportHeight:U.height,contentWidth:re.width,contentHeight:re.height,cursorX:z,cursorY:H});W(se);return}if(!ED(F.target,h.current))return;F.preventDefault(),F.stopPropagation();const K=$.current,ee=rgt({state:w.current,deltaX:F.deltaX,deltaY:F.deltaY,viewportWidth:U.width,viewportHeight:U.height,contentWidth:K.width,contentHeight:K.height});J(ee)};return document.addEventListener("wheel",q,{passive:!1,capture:!0}),()=>document.removeEventListener("wheel",q,{capture:!0})},[W,J]),x.useEffect(()=>{const ie=(K,ee)=>{const re=f.current;if(!re)return null;const z=re.getBoundingClientRect();return K<z.left||K>z.right||ee<z.top||ee>z.bottom?null:z},q=K=>{ie(K.clientX,K.clientY)&&ED(K.target,h.current)&&J1t(K.button)&&(K.preventDefault(),_.current={pointerId:K.pointerId,startX:K.clientX,startY:K.clientY,originX:w.current.panX,originY:w.current.panY})},F=K=>{const ee=_.current,re=f.current;if(!ee||!re||ee.pointerId!==K.pointerId)return;K.preventDefault();const z=re.getBoundingClientRect(),H=$.current,se=u7({panX:ee.originX+K.clientX-ee.startX,panY:ee.originY+K.clientY-ee.startY,zoomPercent:w.current.zoomPercent,viewportWidth:z.width,viewportHeight:z.height,contentWidth:H.width,contentHeight:H.height});J({...w.current,...se})},U=K=>{var ee;((ee=_.current)==null?void 0:ee.pointerId)===K.pointerId&&(_.current=null)},Z=K=>{K.button===1&&ie(K.clientX,K.clientY)&&ED(K.target,h.current)&&K.preventDefault()};return document.addEventListener("pointerdown",q,{capture:!0}),document.addEventListener("pointermove",F,{capture:!0}),document.addEventListener("pointerup",U,{capture:!0}),document.addEventListener("pointercancel",U,{capture:!0}),document.addEventListener("auxclick",Z,{capture:!0}),()=>{document.removeEventListener("pointerdown",q,{capture:!0}),document.removeEventListener("pointermove",F,{capture:!0}),document.removeEventListener("pointerup",U,{capture:!0}),document.removeEventListener("pointercancel",U,{capture:!0}),document.removeEventListener("auxclick",Z,{capture:!0})}},[J]);const le=w.current;return p.jsx("div",{className:"flex flex-col h-full min-h-0",children:p.jsxs("div",{ref:f,className:"relative flex-1 flex items-center justify-center p-2 overflow-hidden min-h-0 outline-none focus:ring-1 focus:ring-studio-accent/40 bg-neutral-950",tabIndex:0,"aria-label":"Composition preview",children:[p.jsx("div",{className:"absolute inset-2 flex items-center justify-center pointer-events-none",children:p.jsxs("div",{ref:h,className:"relative shrink-0 pointer-events-auto",style:{width:`${v.width}px`,height:`${v.height}px`,transform:`translate3d(${Gh(le.panX)}px, ${Gh(le.panY)}px, 0) scale(${Gh(le.zoomPercent/100)})`,transformOrigin:"center center"},"data-testid":"preview-zoom-stage",children:[(a==null?void 0:a.includes("/components/"))&&p.jsx(wI,{projectId:e,onLoad:()=>{},portrait:s,suppressLoadingOverlay:!0,style:{position:"absolute",inset:0,zIndex:0}},`backdrop-${e}`),p.jsx(wI,{ref:B,projectId:a?void 0:e,directUrl:a,onLoad:()=>{L(),r(),ne()},onCompositionLoadingChange:i,portrait:s,suppressLoadingOverlay:o,style:a!=null&&a.includes("/components/")?{position:"absolute",inset:0,zIndex:1}:void 0},u)]})}),p.jsx("div",{ref:E,className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 rounded-lg px-4 py-2 text-sm font-mono tabular-nums text-white/90 bg-black/60 backdrop-blur-sm shadow-lg",style:{opacity:0,transition:"opacity 200ms ease-in"},"aria-live":"polite"}),!TD(O)&&p.jsxs("button",{type:"button",className:"absolute bottom-3 right-3 z-50 rounded-md px-2.5 py-1 text-xs font-medium text-white/80 bg-black/50 backdrop-blur-sm hover:bg-black/70 hover:text-white transition-colors",onClick:()=>W(rve),"aria-label":"Reset zoom to fit","data-testid":"preview-reset-zoom",children:[Math.round(O.zoomPercent),"% — Reset"]})]})})});function ugt({stack:t,onNavigate:e}){return t.length<=1?null:p.jsxs("nav",{"aria-label":"Composition navigation",className:"flex items-center gap-1 px-2 h-8 border-b border-neutral-800/50 bg-neutral-900/50 flex-shrink-0",children:[p.jsx("button",{type:"button",onClick:()=>{var n;Pt("navigation",{action:"back",target:(n=t[t.length-2])==null?void 0:n.label}),e(t.length-2)},className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs text-neutral-400 hover:text-white hover:bg-neutral-800 active:scale-[0.98] transition-colors",title:"Back (Esc, or double-click empty timeline)","aria-label":"Back to parent composition",children:p.jsx(oRe,{size:12,weight:"bold"})}),t.map((n,r)=>{const i=r===t.length-1;return p.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&p.jsx(FL,{size:10,className:"text-neutral-600 flex-shrink-0"}),i?p.jsx("span",{className:"text-xs text-neutral-200 font-medium",children:n.label}):p.jsx("button",{type:"button",onClick:()=>{Pt("navigation",{action:"breadcrumb",target:n.label}),e(r)},className:"text-xs text-neutral-500 hover:text-neutral-200 transition-colors",children:n.label})]},n.id)})]})}function fgt(t){try{const e=JSON.parse(t);return e.name?e:null}catch{return null}}function hgt(t,e,n,r,i){if(n.width===0||n.height===0)return null;const s=(t-n.left)/n.width,a=(e-n.top)/n.height,o=(r==null?void 0:r.width)??(i?1080:1920),l=(r==null?void 0:r.height)??(i?1920:1080);return{left:Math.max(0,Math.min(s*o,o)),top:Math.max(0,Math.min(a*l,l))}}function dgt(t,e){var i,s;const n=((i=e.dimensions)==null?void 0:i.width)??0,r=((s=e.dimensions)==null?void 0:s.height)??0;return{left:Math.max(0,t.left-n/2),top:Math.max(0,t.top-r/2)}}function pgt({portrait:t,compositionSize:e,stageRef:n,onBlockDrop:r}){const[i,s]=x.useState(!1),a=x.useRef(0),o=x.useCallback(f=>{r&&f.dataTransfer.types.includes(X1)&&(a.current+=1,s(!0))},[r]),l=x.useCallback(f=>{r&&f.dataTransfer.types.includes(X1)&&(f.preventDefault(),f.dataTransfer.dropEffect="copy")},[r]),c=x.useCallback(()=>{a.current=Math.max(0,a.current-1),a.current===0&&s(!1)},[]),u=x.useCallback(f=>{if(a.current=0,s(!1),!r)return;const h=f.dataTransfer.getData(X1);if(!h)return;f.preventDefault();const m=fgt(h),y=n.current;if(!m||!y)return;const d=hgt(f.clientX,f.clientY,y.getBoundingClientRect(),e,t);d&&r(m.name,dgt(d,m))},[r,n,e,t]);return{isDragOver:i,handleDragEnter:o,handleDragOver:l,handleDragLeave:c,handleDrop:u}}function mgt({projectId:t,activeCompositionPath:e,onCompositionChange:n}){const[r,i]=x.useState([{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`}]),s=x.useRef(n);s.current=n;const a=x.useCallback(m=>{i(y=>{var b;const d=typeof m=="function"?m(y):m,v=(b=d[d.length-1])==null?void 0:b.id;return queueMicrotask(()=>{var w;return(w=s.current)==null?void 0:w.call(s,v==="master"?null:v)}),d})},[]),o=x.useRef(0),[l,c]=x.useState(new Map),u=x.useRef(l);u.current=l;const f=x.useCallback(m=>{m===0&&o.current>0&&fe.getState().setCurrentTime(o.current),fe.getState().setElements([]),a(y=>y.slice(0,m+1))},[]),h=x.useCallback(m=>{if(!m.compositionSrc)return;o.current=fe.getState().currentTime;const y=m.id;let d=u.current.get(y);if(!d){const v=m.compositionSrc,b=v.match(/compositions\/.*\.html/);d=b?b[0]:v}fe.getState().setElements([]),a(v=>{var k;if(v[v.length-1].id===d&&v.length>1)return v.slice(0,-1);const w=((k=d.split("/").pop())==null?void 0:k.replace(/\.html$/,""))||d,O=`/api/projects/${t}/preview/comp/${pA(d)}`;return[...v,{id:d,label:w,previewUrl:O}]})},[t]);return x.useEffect(()=>{const m={id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`};if(e==="index.html")fe.getState().setElements([]),a([m]);else if(e){const y=e.replace(/^compositions\//,"").replace(/\.html$/,""),d=`/api/projects/${t}/preview/comp/${pA(e)}`;fe.getState().setElements([]),a(v=>{var b;return((b=v[v.length-1])==null?void 0:b.id)===e?v:[m,{id:e,label:y,previewUrl:d}]})}else fe.getState().setElements([]),a([m])},[e,t,a]),{compositionStack:r,updateCompositionStack:a,handleNavigateComposition:f,handleDrillDown:h,masterSeekRef:o,compIdToSrc:l,setCompIdToSrc:c}}const ggt=360;const ive=Dc("NLEContext",null);function rV(){const t=x.useContext(ive);if(!t)throw new Error("useNLEContext must be used within an NLEProvider");return t}function ygt({projectId:t,refreshKey:e,activeCompositionPath:n,onIframeRef:r,onCompositionChange:i,onCompIdToSrcChange:s,onCompositionLoadingChange:a,children:o}){const{iframeRef:l,togglePlay:c,seek:u,onIframeLoad:f,refreshPlayer:h}=PVe();x.useEffect(()=>{fe.getState().beginTimelineSession(t),xd.getState().clearPreviewAsset()},[t]);const[m,y]=x.useState(null),d=x.useRef(e);x.useEffect(()=>{e!==d.current&&(d.current=e,h())},[e,h]);const v=x.useCallback(()=>{f(),zje(l.current),r==null||r(l.current)},[f,l,r]),{compositionStack:b,updateCompositionStack:w,handleNavigateComposition:O,handleDrillDown:k,compIdToSrc:E,setCompIdToSrc:M}=mgt({projectId:t,activeCompositionPath:n,onCompositionChange:i}),N=l,I=x.useCallback(U=>{var ee;if(!U.compositionSrc)return;fe.getState().setSelectedElementId(null);const Z=U.id;let K=E.get(Z);if(!K)try{const re=(ee=N.current)==null?void 0:ee.contentDocument;if(re){const z=re.querySelector(`[data-composition-id="${CSS.escape(Z)}"][data-composition-src]`);z&&(K=z.getAttribute("data-composition-src")||void 0)}}catch{}k({id:Z,compositionSrc:K??U.compositionSrc})},[E,k,N]),_=x.useRef(E);_.current=E;const j=x.useRef(s);j.current=s,x.useEffect(()=>{var ee;const U=new AbortController;let Z=!0;const K=new Map;return M(K),$X(K),(ee=j.current)==null||ee.call(j,K),fetch(`/api/projects/${t}/files/index.html`,{signal:U.signal}).then(re=>{if(!re.ok)throw new Error(`HTTP ${re.status}`);return re.json()}).then(re=>{var be;if(!Z)return;const z=re.content||"",H=new Map,se=/data-composition-id=["']([^"']+)["'][^>]*data-composition-src=["']([^"']+)["']|data-composition-src=["']([^"']+)["'][^>]*data-composition-id=["']([^"']+)["']/g;let ue;for(;(ue=se.exec(z))!==null;){const me=ue[1]||ue[4],pe=ue[2]||ue[3];me&&pe&&H.set(me,pe)}M(H),$X(H),(be=j.current)==null||be.call(j,H)}).catch(re=>{!Z||U.signal.aborted||console.warn("[studio] Couldn't load composition source map from index.html:",re)}),()=>{Z=!1,U.abort()}},[t,M]),x.useEffect(()=>{if(E.size===0)return;const U=ee=>{const re=_.current;if(re.size===0)return null;let z=!1;const H=ee.map(se=>{if(se.compositionSrc)return se;const ue=re.get(se.id)??re.get(se.id.replace(/-(host|comp|layer)$/,""));return ue?(z=!0,{...se,compositionSrc:ue}):se});return z?H:null},Z=U(fe.getState().elements);Z&&fe.getState().setElements(Z);let K=!1;return fe.subscribe((ee,re)=>{if(K||ee.elements===re.elements||ee.elements.length===0||ee.elements.every(H=>H.compositionSrc))return;K=!0;const z=U(ee.elements);z&&ee.setElements(z),K=!1})},[E]);const[L,B]=x.useState(()=>{const U=to().timelineHeight;return U!==void 0&&U>=P1?U:ggt}),$=x.useCallback(U=>{Ol({timelineHeight:Math.round(U)})},[]),Q=x.useRef(null);x.useEffect(()=>{const U=Q.current;if(!U||typeof ResizeObserver>"u")return;const Z=()=>{const ee=U.getBoundingClientRect().height;ee&&B(re=>z_(ee,re))};Z();const K=new ResizeObserver(Z);return K.observe(U),()=>K.disconnect()},[]);const Y=x.useRef(!1),[W,J]=x.useState(!0),ne=x.useCallback(U=>{U||(Y.current=!0),!(U&&Y.current)&&J(U)},[]),le=W,ie=fe(U=>U.timelineSessionEpoch);x.useEffect(()=>{a==null||a(W)},[W,a]);const q=x.useRef(r);q.current=r,x.useEffect(()=>{var U;(U=q.current)==null||U.call(q,l.current)},[b.length,e,l]);const F={projectId:t,iframeRef:l,togglePlay:c,seek:u,refreshPlayer:h,onIframeLoad:v,compositionStack:b,updateCompositionStack:w,handleNavigateComposition:O,handleDrillDown:I,compIdToSrc:E,timelineH:L,setTimelineH:B,persistTimelineH:$,containerRef:Q,compositionLoading:W,setCompositionLoading:ne,timelineDisabled:le,timelineSessionEpoch:ie,hasLoadedOnceRef:Y,previewCompositionSize:m,setPreviewCompositionSize:y};return p.jsx(ive.Provider,{value:F,children:o})}const xgt=1e-6;function Cte(t,e){return e.isPlaying||e.requestedSeekTime!==null?!0:Math.abs(e.currentTime-t)>xgt}function bgt(t){return t.split("/").pop()??t}function vgt(t){return oS.test(t)?"video":m0.test(t)?"image":"audio"}function Agt({kind:t,serveUrl:e,name:n}){return t==="image"?p.jsx("img",{src:e,alt:n,className:"max-w-full max-h-[40vh] rounded object-contain"}):t==="video"?p.jsx("video",{src:e,controls:!0,autoPlay:!0,muted:!0,playsInline:!0,className:"max-w-full max-h-[40vh] rounded"}):p.jsxs("div",{className:"flex flex-col items-center gap-3 px-6 py-4",children:[p.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-500",children:[p.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),p.jsx("audio",{src:e,controls:!0,className:"w-64"})]})}function Sgt(){const t=xd(a=>a.previewAsset),e=xd(a=>a.previewProjectId),n=xd(a=>a.clearPreviewAsset),r=x.useCallback(a=>{a.key==="Escape"&&n()},[n]);if(x.useEffect(()=>{if(t)return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,r]),x.useEffect(()=>{if(!t)return;const a=fe.getState(),o=a.currentTime;if(Cte(o,a)){n();return}return fe.subscribe(l=>{Cte(o,l)&&n()})},[t,n]),!t||!e)return null;const i=Ay(t,e),s=bgt(t);return p.jsx("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center bg-black/20",onClick:n,role:"dialog","aria-label":`Preview: ${s}`,children:p.jsxs("div",{className:"relative flex flex-col items-center gap-2 max-w-[58%] rounded-lg border border-neutral-800 bg-neutral-950/95 p-2 pt-8 shadow-2xl",onClick:a=>a.stopPropagation(),children:[p.jsx("button",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-neutral-800 hover:bg-neutral-700 text-neutral-300 hover:text-white flex items-center justify-center transition-colors z-10",onClick:a=>{a.stopPropagation(),n()},"aria-label":"Close preview",children:p.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5",fill:"none",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),p.jsx(Agt,{kind:vgt(t),serveUrl:i,name:s}),p.jsx("span",{className:"text-[12px] text-neutral-400 truncate max-w-full px-2 text-center",children:s})]})})}function wgt(t){return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)}function Ogt(){return document.fullscreenElement}function Cgt(t,e,n){const r=(e==null?void 0:e.parentElement)??e;if(!r)return;const i=r.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&(n==null||n(null))}function kgt({portrait:t,previewOverlay:e,onSelectTimelineElement:n,onPreviewBlockDrop:r}){const{projectId:i,iframeRef:s,togglePlay:a,seek:o,onIframeLoad:l,compositionStack:c,handleNavigateComposition:u,setCompositionLoading:f,timelineDisabled:h,hasLoadedOnceRef:m,previewCompositionSize:y,setPreviewCompositionSize:d}=rV(),v=x.useRef(null),b=x.useCallback($=>{v.current=$.current},[]),{isDragOver:w,handleDragEnter:O,handleDragOver:k,handleDragLeave:E,handleDrop:M}=pgt({portrait:t,compositionSize:y,stageRef:v,onBlockDrop:r}),N=x.useRef(null),I=x.useSyncExternalStore(wgt,Ogt),_=I===N.current&&I!=null,j=x.useCallback(()=>{N.current&&(document.fullscreenElement?document.exitFullscreen():N.current.requestFullscreen())},[]),L=c[c.length-1],B=c.length>1?L.previewUrl:void 0;return p.jsxs("div",{ref:N,className:`flex-1 min-h-0 flex flex-col overflow-hidden bg-neutral-950 ${_?"":"rounded-lg border border-neutral-800/50"}`,"data-studio-fullscreen-target":"",children:[p.jsxs("div",{className:"flex-1 min-h-0 relative overflow-hidden","data-preview-pan-surface":"true",onPointerDown:$=>Cgt($,s.current,n),onDragEnter:O,onDragOver:k,onDragLeave:E,onDrop:M,children:[p.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[p.jsx(cgt,{projectId:i,iframeRef:s,onIframeLoad:l,onCompositionLoadingChange:f,portrait:t,directUrl:B,suppressLoadingOverlay:m.current,onStageRef:b,onCompositionSizeChange:d}),w&&p.jsx("div",{className:"absolute inset-2 z-40 rounded-lg border-2 border-dashed border-studio-accent/50 bg-studio-accent/[0.04] pointer-events-none"}),p.jsx(Sgt,{})]}),!_&&e]}),p.jsxs("div",{className:"flex-shrink-0",children:[!_&&c.length>1&&p.jsx(ugt,{stack:c,onNavigate:u}),p.jsx(ZCe,{onTogglePlay:a,onSeek:o,disabled:h,isFullscreen:_,onToggleFullscreen:j})]})]})}function Egt({timelineH:t,setTimelineH:e,persistTimelineH:n,containerRef:r,disabled:i}){var f;const s=x.useRef(!1),a=x.useRef(t);a.current=t;const o=x.useCallback(h=>{i||(h.preventDefault(),s.current=!0,h.target.setPointerCapture(h.pointerId))},[i]),l=x.useCallback(h=>{if(i||!s.current||!r.current)return;const m=r.current.getBoundingClientRect(),y=h.clientY-m.top;e(z_(m.height,m.height-y))},[i,r,e]),c=x.useCallback(()=>{s.current&&n(a.current),s.current=!1},[n]),u=x.useCallback(h=>{var d;if(i||h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const m=((d=r.current)==null?void 0:d.getBoundingClientRect().height)??0,y=h.key==="ArrowUp"?16:-16;e(v=>{const b=z_(m,v+y);return n(b),b})},[i,r,e,n]);return p.jsxs("div",{role:"separator","aria-orientation":"horizontal","aria-label":"Resize timeline (arrow keys)","aria-valuenow":Math.round(t),"aria-valuemin":P1,"aria-valuemax":Math.round((((f=r.current)==null?void 0:f.getBoundingClientRect().height)??600)-fde),tabIndex:0,className:"group relative h-[3px] flex-shrink-0 cursor-row-resize z-10 outline-none focus-visible:bg-studio-accent/20",style:{touchAction:"none"},onPointerDown:o,onPointerMove:l,onPointerUp:c,onPointerCancel:c,onKeyDown:u,children:[p.jsx("div",{className:"absolute inset-x-0 -top-[4px] h-[10px]"}),p.jsx("div",{className:"h-[3px] w-full bg-transparent transition-colors group-hover:bg-white/12 group-active:bg-white/18 group-focus-visible:bg-studio-accent/60"})]})}function sve(t,e,n,r,i){return r(t.map(({element:s,updates:a})=>{const o=s.expandedParentStart;return o===void 0?{element:s,updates:a}:{element:{...s,id:s.domId??s.id,start:s.start-o},updates:{...a,start:Math.max(0,a.start-o)}}}),e,n,i)}function Tgt(t,e,n){return n(t.map(r=>{const i=r.element.expandedParentStart;return i===void 0?r:{...r,element:{...r.element,id:r.element.domId??r.element.id,start:r.element.start-i},start:Math.max(0,r.start-i)}}),e)}function Pgt({timelineToolbar:t,timelineFooter:e,renderClipContent:n,onFileDrop:r,onDeleteElement:i,onAssetDrop:s,onBlockDrop:a,onCompositionDrop:o,onBlockedEditAttempt:l,onSelectTimelineElement:c}){const{seek:u,handleDrillDown:f,compositionStack:h,updateCompositionStack:m,timelineH:y,setTimelineH:d,persistTimelineH:v,containerRef:b,timelineDisabled:w,timelineSessionEpoch:O}=rV(),{onMoveElement:k,onMoveElements:E,onResizeElement:M,onResizeElements:N,onSplitElement:I}=E5e(),_=x.useCallback((W,J)=>({...W,id:W.domId??W.id,start:W.start-J}),[]),j=x.useCallback((W,J)=>{const ne=W.expandedParentStart;if(ne===void 0)return k==null?void 0:k(W,J);Fm({action:"move"}),k==null||k(_(W,ne),{...J,start:Math.max(0,J.start-ne)})},[k,_]),L=x.useCallback((W,J,ne,le)=>{if(W.some(({element:ie})=>ie.expandedParentStart!==void 0)&&Fm({action:"move"}),!!E)return sve(W,J,ne,E,le)},[E]),B=x.useCallback((W,J)=>{const ne=W.expandedParentStart;if(ne===void 0)return M==null?void 0:M(W,J);Fm({action:"resize"}),M==null||M(_(W,ne),{...J,start:Math.max(0,J.start-ne)})},[M,_]),$=x.useCallback((W,J)=>{if(N)return W.some(({element:ne})=>ne.expandedParentStart!==void 0)&&Fm({action:"resize"}),Tgt(W,J,N)},[N]),Q=x.useCallback(W=>{const J=W.expandedParentStart;return J===void 0?i==null?void 0:i(W):(Fm({action:"delete"}),i==null?void 0:i(_(W,J)))},[i,_]),Y=x.useCallback((W,J)=>{const ne=W.expandedParentStart;return ne===void 0?I==null?void 0:I(W,J):(Fm({action:"split"}),I==null?void 0:I(_(W,ne),Math.max(0,J-ne)))},[I,_]);return p.jsxs(p.Fragment,{children:[p.jsx(Egt,{timelineH:y,setTimelineH:d,persistTimelineH:v,containerRef:b,disabled:w}),p.jsxs("div",{className:"relative flex flex-col flex-shrink-0 px-px pb-px",style:{height:y},"aria-disabled":w||void 0,children:[p.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden rounded-lg border border-neutral-800/50 bg-neutral-950",onDoubleClick:W=>{W.target.closest("[data-clip]")||w||h.length>1&&m(J=>J.slice(0,-1))},children:[p.jsx("div",{className:"flex-shrink-0",children:t}),p.jsx(bBe,{sessionEpoch:O,onSeek:u,onDrillDown:f,renderClipContent:n,onFileDrop:r,onDeleteElement:Q,onAssetDrop:s,onBlockDrop:a,onCompositionDrop:o,onMoveElement:j,onMoveElements:L,onResizeElement:B,onResizeElements:$,onBlockedEditAttempt:l,onSplitElement:Y,onSelectElement:c})]}),e&&p.jsx("div",{className:"flex-shrink-0",children:e}),w&&p.jsx("div",{className:"absolute inset-0 z-30 cursor-not-allowed bg-black/18 flex items-center justify-center","data-testid":"timeline-loading-disabled-overlay",role:"status",onPointerDown:W=>W.preventDefault(),onDragOver:W=>W.preventDefault(),onDrop:W=>W.preventDefault(),children:p.jsx("span",{className:"rounded-md bg-neutral-900/90 px-2.5 py-1 text-[11px] text-neutral-400",children:"Loading composition…"})})]})]})}const Mgt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Ngt(t,e){return t.metaKey||t.ctrlKey||t.altKey||e!=null&&Hf(e)?!1:Mgt.has(t.key)}const xb=8,Wa=24,PD=20;function kte(t,e,n){const r=lit(e,n);Object.keys(r).length>0&&An.getState().updateSegmentStyle(t,r)}const Dgt=x.memo(function({iframeRef:e}){const n=An(E=>E.isEditMode),r=An(E=>E.model),i=An(E=>E.selectedSegmentIds),s=An(E=>E.selectSegment),a=An(E=>E.clearSelection),[o,l]=x.useState([]),c=x.useRef(null),u=x.useRef(r);u.current=r;const f=x.useRef(null),h=x.useRef(null);wr(()=>{if(!n)return;const E=sit(e);let M=[],N=null;const I=()=>{N=null;const le=e.current,ie=u.current,q=c.current;if(!le||!ie||!q)return;const F=iit(le,ie,q);F.length===M.length&&F.every((U,Z)=>Math.abs(U.x-M[Z].x)<.5&&Math.abs(U.y-M[Z].y)<.5)||(M=F,l(F))},_=()=>{N===null&&(N=requestAnimationFrame(I))},j=fe.subscribe(_),L=le=>{const ie=le.data;(ie==null?void 0:ie.source)==="hf-preview"&&_()};window.addEventListener("message",L),window.addEventListener("resize",_);const B=new ResizeObserver(_);e.current&&B.observe(e.current),c.current&&B.observe(c.current);let $=null;const Q=()=>{const le=fe.getState().isPlaying;le&&$===null?$=setInterval(_,66):!le&&$!==null&&(clearInterval($),$=null)},Y=fe.subscribe(Q);Q(),I();const W=()=>{var le;try{return((le=e.current)==null?void 0:le.contentWindow)??null}catch{return null}},J=()=>{const le=h.current;if(!le)return!1;const ie=W();return ie&&f1(le.wordEl,ie,le.origTX,le.origTY,le.origScale,le.origRotation),h.current=null,!0};f.current=J;const ne=le=>{const ie=An.getState(),{selectedSegmentIds:q,model:F}=ie;if(le.key==="Escape"){if(J()){le.preventDefault(),_();return}q.size>0&&(le.preventDefault(),ie.clearSelection());return}if((le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="a"&&!le.shiftKey&&!le.altKey&&!Hf(le.target)){le.preventDefault(),ie.selectAll();return}if(q.size===0||!F)return;const U=le.key;if(!Ngt(le,le.target))return;le.preventDefault();const Z=le.shiftKey?10:1,K=U==="ArrowLeft"?-Z:U==="ArrowRight"?Z:0,ee=U==="ArrowUp"?-Z:U==="ArrowDown"?Z:0,re=e.current,z=re==null?void 0:re.contentWindow;if(!(!re||!z)){for(const H of q)for(let se=0;se<F.groupOrder.length;se++){const ue=F.groups.get(F.groupOrder[se]);if(!ue)continue;const be=ue.segmentIds.indexOf(H);if(be<0)continue;const me=A2(re,se,be);if(!me)continue;const pe=I1(me),ge=S2(pe,z);f1(me,z,ge.x+K,ge.y+ee,ge.scale,ge.rotation),kte(H,me,z);break}_()}};return window.addEventListener("keydown",ne),()=>{E(),j(),Y(),$!==null&&clearInterval($),N!==null&&cancelAnimationFrame(N),B.disconnect(),window.removeEventListener("message",L),window.removeEventListener("resize",_),window.removeEventListener("keydown",ne),f.current=null}});const m=x.useCallback(()=>{const E=e.current;if(!E)return 1;const M=E.getBoundingClientRect(),N=parseFloat(E.style.width)||M.width;return M.width/N},[e]),y=x.useCallback((E,M,N,I)=>{I.stopPropagation(),I.currentTarget.setPointerCapture(I.pointerId);const _=e.current;if(!_)return;const j=A2(_,E,M),L=_.contentWindow;if(!j||!L)return;const B=S2(I1(j),L);h.current={type:"move",wordEl:j,segmentId:N,startMX:I.clientX,startMY:I.clientY,origTX:B.x,origTY:B.y,origScale:B.scale,origRotation:B.rotation}},[e]),d=x.useCallback((E,M,N,I)=>{var W;I.stopPropagation(),I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId);const _=e.current;if(!_)return;const j=A2(_,E,M),L=_.contentWindow;if(!j||!L)return;const B=j.getBoundingClientRect(),$=m(),Q=B.left*$+(((W=e.current)==null?void 0:W.getBoundingClientRect().left)??0)+B.width*$/2,Y=S2(I1(j),L);h.current={type:"scale",wordEl:j,segmentId:N,startMX:I.clientX,startDxFromCenter:I.clientX-Q,origTX:Y.x,origTY:Y.y,origScale:Y.scale,origRotation:Y.rotation}},[e,m]),v=x.useCallback((E,M)=>{M.stopPropagation(),M.preventDefault(),M.currentTarget.setPointerCapture(M.pointerId);const N=e.current;if(!N)return;const I=A2(N,E.groupIndex,E.wordIndex),_=N.contentWindow;if(!I||!_)return;const j=S2(I1(I),_);h.current={type:"rotate",wordEl:I,segmentId:E.segmentId,startMX:M.clientX,origTX:j.x,origTY:j.y,origRotation:j.rotation,origScale:j.scale}},[e]),b=x.useCallback(()=>{var E;try{return((E=e.current)==null?void 0:E.contentWindow)??null}catch{return null}},[e]),w=x.useCallback(E=>{const M=h.current;if(!M)return;const N=b();if(N){if(M.type==="move"){const I=m(),_=(E.clientX-M.startMX)/I,j=(E.clientY-M.startMY)/I;f1(M.wordEl,N,M.origTX+_,M.origTY+j,M.origScale,M.origRotation)}else if(M.type==="scale"){const I=M.startMX-M.startDxFromCenter,_=Math.abs(M.startDxFromCenter),j=Math.abs(E.clientX-I),L=_>5?j/_:1,B=Math.max(.1,M.origScale*L);f1(M.wordEl,N,M.origTX,M.origTY,B,M.origRotation)}else if(M.type==="rotate"){const _=(E.clientX-M.startMX)/200*90;f1(M.wordEl,N,M.origTX,M.origTY,M.origScale,M.origRotation+_)}}},[m,b]),O=x.useCallback(()=>{const E=h.current;if(E){const M=b();M&&kte(E.segmentId,E.wordEl,M),h.current=null}},[b]),k=x.useCallback(E=>{E.target===E.currentTarget&&a()},[a]);return n?p.jsxs("div",{ref:c,className:"absolute inset-0 z-50",style:{pointerEvents:"auto"},onClick:k,onPointerMove:w,onPointerUp:O,onLostPointerCapture:O,children:[o.length===0&&r&&r.segments.size>0&&p.jsx("div",{className:"absolute inset-x-0 top-3 flex justify-center pointer-events-none",children:p.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/60 border border-neutral-700 text-2xs text-neutral-300",children:"No captions visible at this frame — scrub to a caption, or select one in the track below"})}),o.map(E=>{const M=i.has(E.segmentId);return p.jsx("div",{className:["absolute",M?"ring-2 ring-studio-accent":"hover:ring-1 hover:ring-white/30"].join(" "),style:{left:E.x,top:E.y,width:E.width,height:E.height,cursor:M?"move":"pointer",touchAction:"none",borderRadius:2},onClick:N=>{N.stopPropagation(),s(E.segmentId,N.shiftKey)},onPointerDown:N=>{M&&y(E.groupIndex,E.wordIndex,E.segmentId,N)},children:M&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"absolute",left:"50%",top:-PD-xb/2-Wa/2,marginLeft:-Wa/2,width:Wa,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",touchAction:"none"},onPointerDown:N=>v(E,N),children:p.jsx("div",{style:{width:xb,height:xb,borderRadius:"50%",backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)"}})}),p.jsx("div",{style:{position:"absolute",left:"50%",top:-PD,width:1,height:PD,marginLeft:-.5,backgroundColor:"var(--hf-accent, #3CE6AC)",opacity:.5,pointerEvents:"none"}}),[{corner:{right:-Wa/2,bottom:-Wa/2},cursor:"nwse-resize"},{corner:{left:-Wa/2,top:-Wa/2},cursor:"nwse-resize"},{corner:{right:-Wa/2,top:-Wa/2},cursor:"nesw-resize"},{corner:{left:-Wa/2,bottom:-Wa/2},cursor:"nesw-resize"}].map(({corner:N,cursor:I},_)=>p.jsx("div",{style:{position:"absolute",...N,width:Wa,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",cursor:I,touchAction:"none"},onPointerDown:j=>d(E.groupIndex,E.wordIndex,E.segmentId,j),children:p.jsx("div",{style:{width:xb,height:xb,backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",borderRadius:2}})},_))]})},E.segmentId)})]}):null}),Igt="data-composition-id";function _gt(t){if(!t||t==="none")return 0;const e=t.trim().split(/\s+/),n=e.at(-1);if(!(n!=null&&n.endsWith("deg")))return 0;if(e.length===4){const[i,s,a]=e;if(Number(i)!==0||Number(s)!==0||Math.abs(Number(a))!==1)return 0;const o=Number.parseFloat(n);return Number.isFinite(o)?o*Math.sign(Number(a)):0}if(e.length!==1)return 0;const r=Number.parseFloat(n);return Number.isFinite(r)?r:0}function ave(t,e,n){let r=e.identity();for(let i=t;i;i=i.parentElement){const s=n(i);if(!s)return null;const a=s.transform;let o=a&&a!=="none"?e.fromTransform(a):e.identity();if(!o)return null;const l=_gt(s.rotate);if(l!==0&&(o=e.compose(e.fromRotate(l),o)),r=e.compose(o,r),i.hasAttribute(Igt))break}return r}function K3(t){const e=ba(t);return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function ove(t){return`${K3(Math.max(0,t))}px`}function Ete(t){const e=t.trim();if(e==="0")return 0;const n=/^(-?\d+(?:\.\d+)?)px$/i.exec(e);if(!n)return null;const r=Number.parseFloat(n[1]);return Number.isFinite(r)?Math.max(0,r):null}function Rgt(t){if(t.length<1||t.length>4)return null;const[e,n=e,r=e,i=n]=t;return e===void 0||n===void 0||r===void 0||i===void 0?null:{top:e,right:n,bottom:r,left:i}}function iV(t){const e=t==null?void 0:t.trim();return!e||e==="none"?"none":/^inset\(/i.test(e)?"inset":/^circle\(/i.test(e)?"circle":"custom"}function J3(t){var c,u;const e=/^inset\(([^()]*)\)$/i.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=e[1].trim().replace(/\s+/g," ").split(/ round /i),r=(c=n[0])==null?void 0:c.trim();if(!r||n.length>2)return null;const i=r.split(/\s+/).map(Ete);if(i.some(f=>f==null))return null;const s=[];for(const f of i){if(f==null)return null;s.push(f)}const a=Rgt(s);if(!a)return null;const o=(u=n[1])==null?void 0:u.trim(),l=o?Ete(o):0;return l==null?null:{...a,radius:l}}function lve(t){const e=J3(t);if(!e)return 0;const{top:n,right:r,bottom:i,left:s}=e;return n===r&&n===i&&n===s?n:0}function cve(t,e,n){return t==="custom"?(n==null?void 0:n.trim())||"none":t==="circle"?"circle(50% at 50% 50%)":t==="inset"?`inset(0 round ${K3(Math.max(0,e))}px)`:"none"}function sV(t,e=0){const n=[t.top,t.right,t.bottom,t.left].map(ove),[r,i,s,a]=n,o=r===i&&r===s&&r===a?r:`${r} ${i} ${s} ${a}`,l=Math.max(0,e);return l>0?`inset(${o} round ${K3(l)}px)`:`inset(${o})`}function uve(t,e){return`inset(${ove(t)} round ${K3(Math.max(0,e))}px)`}function fve(t,e,n,r){const i=n>0?n:1,s=r>0?r:1,a=t.left+e.left*i,o=t.top+e.top*s;return{left:a,top:o,width:Math.max(0,t.width-(e.left+e.right)*i),height:Math.max(0,t.height-(e.top+e.bottom)*s)}}function Ek(t){var r;const n=t.style.getPropertyValue("clip-path").trim()||((r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t).clipPath.trim())||"";return!n||n==="none"?{top:0,right:0,bottom:0,left:0,radius:0}:J3(n)}function Y8(t,e){return Number.isFinite(t)?Math.min(Math.max(0,t),Math.max(0,e)):0}function jgt(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1,r={...t.startInsets};return t.edge==="left"?r.left=Y8(t.startInsets.left+t.deltaX/e,t.width-r.right):t.edge==="right"?r.right=Y8(t.startInsets.right-t.deltaX/e,t.width-r.left):t.edge==="top"?r.top=Y8(t.startInsets.top+t.deltaY/n,t.height-r.bottom):r.bottom=Y8(t.startInsets.bottom-t.deltaY/n,t.height-r.top),r}function Lgt(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1,r=t.startInsets.left+t.startInsets.right,i=t.startInsets.top+t.startInsets.bottom,s=Math.min(Math.max(0,t.startInsets.left+t.deltaX/e),r),a=Math.min(Math.max(0,t.startInsets.top+t.deltaY/n),i);return{left:s,right:r-s,top:a,bottom:i-a}}function Qy(t,e){const n=Ek(e);return!n||n.top<=0&&n.right<=0&&n.bottom<=0&&n.left<=0?t:fve(t,n,t.editScaleX,t.editScaleY)}const Fgt={a:1,b:0,c:0,d:1},M2=1e-6;function $gt(t){const e=/^matrix\(([^)]+)\)$/.exec(t);if(e){const[s,a,o,l]=e[1].split(",").map(c=>Number.parseFloat(c));return[s,a,o,l].every(Number.isFinite)?{a:s,b:a,c:o,d:l}:null}const n=/^matrix3d\(([^)]+)\)$/.exec(t);if(!n)return null;const r=n[1].split(",").map(s=>Number.parseFloat(s));return r.length!==16||!r.every(Number.isFinite)||![r[3],r[7],r[11]].every(s=>Math.abs(s)<M2)?null:{a:r[0],b:r[1],c:r[4],d:r[5]}}const Bgt={identity:()=>Fgt,fromTransform:$gt,fromRotate:t=>{const e=t*Math.PI/180;return{a:Math.cos(e),b:Math.sin(e),c:-Math.sin(e),d:Math.cos(e)}},compose:(t,e)=>({a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d})};function Vgt(t){return Math.abs(t.a-1)<M2&&Math.abs(t.b)<M2&&Math.abs(t.c)<M2&&Math.abs(t.d-1)<M2}function Hgt(t){const e=ave(t,Bgt,n=>{var r;try{return((r=n.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(n))??null}catch{return null}});return e&&!Vgt(e)?e:null}function Qgt(t,e){const n=e.editScaleX>0?e.editScaleX:1,r=e.editScaleY>0?e.editScaleY:1,i={angleDeg:0,left:e.left,top:e.top,width:e.width,height:e.height,scaleX:n,scaleY:r},s=Hgt(t);if(!s)return i;const{a,b:o,c:l,d:c}=s,u=Math.hypot(a,o),f=a*c-o*l,h=u!==0?Math.abs(f)/u:1;if(u<=0||h<=0)return i;const m=Math.atan2(o,a)*180/Math.PI,y=u*n,d=h*r,v=t.offsetWidth*y,b=t.offsetHeight*d;if(!(v>0)||!(b>0))return i;const w=e.left+e.width/2,O=e.top+e.height/2;return{angleDeg:m,left:w-v/2,top:O-b/2,width:v,height:b,scaleX:y,scaleY:d}}function zgt(t,e,n){if(n===0)return{deltaX:t,deltaY:e};const r=-n*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return{deltaX:t*i-e*s,deltaY:t*s+e*i}}function aV(t){return fhe(t)}function Tk(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function Zgt(t){let e=t;for(;e;){if(e.hasAttribute("data-composition-file")||e.hasAttribute("data-composition-src"))return e;e=e.parentElement}return null}function Ggt(t){const e=t.rootScaleX>0?t.rootScaleX:1,n=t.rootScaleY>0?t.rootScaleY:1,r=t.sourceRectWidth&&t.sourceRectWidth>0&&t.sourceWidth&&t.sourceWidth>0?t.sourceRectWidth*e/t.sourceWidth:e,i=t.sourceRectHeight&&t.sourceRectHeight>0&&t.sourceHeight&&t.sourceHeight>0?t.sourceRectHeight*n/t.sourceHeight:n;return{scaleX:r>0?r:e,scaleY:i>0?i:n}}function oV(t,e,n){const r=Pk(t,e,n);return r?{...r,...Qy(r,n)}:null}function hve(t,e){const n=t.DOMMatrix;if(!n)return null;const r=t.getComputedStyle(e),i={identity:()=>new n,fromTransform:s=>new n(s),fromRotate:s=>new n().rotateSelf(s),compose:(s,a)=>s.multiply(a)};try{const s=ave(e,i,a=>a===e?r:t.getComputedStyle(a));return s?{matrix:s,cs:r}:null}catch{return null}}function Ugt(t){const e=Number.isFinite(t.a)?t.a:1,n=Number.isFinite(t.b)?t.b:0,r=Number.isFinite(t.c)?t.c:0,i=Number.isFinite(t.d)?t.d:1,s=Math.atan2(n,e)*180/Math.PI,a=e*i-n*r,o=Math.atan2(-r,i)*180/Math.PI,l=a<0&&Math.abs(o)<Math.abs(s)?o:s;return Number.isFinite(l)?l:0}const Xgt=1e-4;function Wgt(t){return(t==null?void 0:t.querySelector("[data-composition-id]"))??(t==null?void 0:t.documentElement)??null}function qgt(t){if(!t)return null;const e=t.getBoundingClientRect(),n=Tk(t.getAttribute("data-width"))??e.width,r=Tk(t.getAttribute("data-height"))??e.height;return!n||!r?null:{width:n,height:r}}function lV(t,e,n){const r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=qgt(Wgt(n));return s?{iframeRect:r,overlayRect:i,rootScaleX:r.width/s.width,rootScaleY:r.height/s.height}:null}function Pk(t,e,n,r){const i=r??lV(t,e,e.contentDocument);if(!i)return null;const{iframeRect:s,overlayRect:a,rootScaleX:o,rootScaleY:l}=i,c=n.getBoundingClientRect(),u=Zgt(n),f=u==null?void 0:u.getBoundingClientRect(),h=Ggt({rootScaleX:o,rootScaleY:l,sourceRectWidth:f==null?void 0:f.width,sourceRectHeight:f==null?void 0:f.height,sourceWidth:Tk((u==null?void 0:u.getAttribute("data-width"))??null),sourceHeight:Tk((u==null?void 0:u.getAttribute("data-height"))??null)});return{left:s.left-a.left+c.left*o,top:s.top-a.top+c.top*l,width:c.width*o,height:c.height*l,editScaleX:h.scaleX,editScaleY:h.scaleY}}function Mk(t,e){return Math.hypot(e.x-t.x,e.y-t.y)}function dve(t){return{x:(t.nw.x+t.ne.x+t.se.x+t.sw.x)/4,y:(t.nw.y+t.ne.y+t.se.y+t.sw.y)/4}}function cV(t,e,n,r,i){const s=e.contentWindow,a=e.contentDocument;if(!s||!a)return null;const o=s.DOMPoint;if(!o)return null;const l=r??lV(t,e,a);if(!l)return null;const{iframeRect:c,overlayRect:u,rootScaleX:f,rootScaleY:h}=l,m=i??hve(s,n);if(!m)return null;const{matrix:y,cs:d}=m,v=n.offsetWidth,b=n.offsetHeight,w=d.transformOrigin.split(" ").map($=>Number.parseFloat($)),O=Number.isFinite(w[0])?w[0]:v/2,k=Number.isFinite(w[1])?w[1]:b/2,E=($,Q)=>{const Y=y.transformPoint(new o($-O,Q-k));return{x:Y.x,y:Y.y}},M={nw:E(0,0),ne:E(v,0),se:E(v,b),sw:E(0,b)},N=[M.nw.x,M.ne.x,M.se.x,M.sw.x],I=[M.nw.y,M.ne.y,M.se.y,M.sw.y],_=n.getBoundingClientRect(),j=_.left-Math.min(...N),L=_.top-Math.min(...I),B=$=>({x:c.left-u.left+($.x+j)*f,y:c.top-u.top+($.y+L)*h});return{nw:B(M.nw),ne:B(M.ne),se:B(M.se),sw:B(M.sw)}}function uV(t,e,n){const r=lV(t,e,e.contentDocument);if(!r)return null;const i=Pk(t,e,n,r);if(!i)return null;const s=e.contentWindow,a=s?hve(s,n):null,o=a?Ugt(a.matrix):0;if(Math.abs(o)<Xgt)return i;const l=cV(t,e,n,r,a);if(!l)return i;const c=Mk(l.nw,l.ne),u=Mk(l.nw,l.sw),f=(l.nw.x+l.se.x)/2,h=(l.nw.y+l.se.y)/2;return!Number.isFinite(c)||!Number.isFinite(u)||c<=0||u<=0?i:{left:f-c/2,top:h-u/2,width:c,height:u,editScaleX:i.editScaleX,editScaleY:i.editScaleY,angle:o}}function Ygt(t,e,n){const r=uV(t,e,n);return r?{...r,...Qy(r,n)}:null}const K8=.5,Kgt=.1;function Nk(t,e){return t===e?!0:!t||!e?!1:Math.abs(t.left-e.left)<K8&&Math.abs(t.top-e.top)<K8&&Math.abs(t.width-e.width)<K8&&Math.abs(t.height-e.height)<K8&&Math.abs(t.editScaleX-e.editScaleX)<.001&&Math.abs(t.editScaleY-e.editScaleY)<.001&&Math.abs((t.angle??0)-(e.angle??0))<Kgt}function Jgt(t,e){return t===e?!0:t.length!==e.length?!1:t.every((n,r)=>{const i=e[r];return!!(i&&n.key===i.key&&n.element===i.element&&n.selection===i.selection&&Nk(n.rect,i.rect))})}function fV(t){const e=t[0];if(!e)return null;let n=e.left,r=e.top,i=e.left+e.width,s=e.top+e.height;for(const a of t.slice(1))n=Math.min(n,a.left),r=Math.min(r,a.top),i=Math.max(i,a.left+a.width),s=Math.max(s,a.top+a.height);return{left:n,top:r,width:i-n,height:s-r,editScaleX:1,editScaleY:1}}function pve(t,e,n){const r=Pk(t,e,n);if(!r||!n.hasAttribute("data-hf-group"))return r;const i=[];for(const a of Array.from(n.children)){const o=Pk(t,e,a);o&&i.push(o)}const s=i.length>0?fV(i):null;return s?{...s,editScaleX:r.editScaleX,editScaleY:r.editScaleY}:r}function f7(t,e,n){return n.hasAttribute("data-hf-group")?pve(t,e,n):uV(t,e,n)}function mve(t){return t.filter(e=>!t.some(n=>n!==e&&n.element.contains(e.element)))}function lf(t){return[t.sourceFile??"",t.hfId??"",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function Tte(t,e,n,r){const i=lf(e),s=r.current;if((s==null?void 0:s.key)===i&&s.element.isConnected&&s.element.ownerDocument===t)return s.element;const a=Ds(t,e,n);return r.current=a?{key:i,element:a}:null,a}const eyt=4;function Pte(t,e,n){const r=t.contentDocument;if(!r)return[];const i=r.querySelector("[data-composition-id]")??r.body,s=A3(i,{activeCompositionPath:n}),a=r.querySelector("[data-composition-id]")??r.documentElement,o=Number.parseFloat((a==null?void 0:a.getAttribute("data-width"))??""),l=Number.parseFloat((a==null?void 0:a.getAttribute("data-height"))??""),c={width:o>0?o:a.getBoundingClientRect().width||1,height:l>0?l:a.getBoundingClientRect().height||1},u=[];for(const f of s){const h=f.element;if(!by(h)||Hme(h.getBoundingClientRect(),c))continue;const m=oV(e,t,h);m&&u.push({element:h,rect:{left:m.left,top:m.top,width:m.width,height:m.height}})}return u}function gve(t,e){return e.filter(n=>Cae(t,n.rect))}async function tyt(t,e,n){const r=!n||n==="index.html",i=[];for(const{element:s}of gve(t,e)){const a=await v3(s,{activeCompositionPath:n,isMasterView:r,skipSourceProbe:!0});a&&i.push(a)}return i}function nyt(t){const e=x.useRef(null),[n,r]=x.useState(null),[i,s]=x.useState([]),a=x.useRef(null),o=x.useCallback(async(f,h)=>{const m=t.iframeRef.current,y=t.overlayRef.current;if(!m||!y||!t.onMarqueeSelectRef.current)return;const d=t.activeCompositionPathRef.current??"index.html",v=a.current??Pte(m,y,d),b=await tyt(f,v,d);t.onMarqueeSelectRef.current(b,h)},[t.iframeRef,t.overlayRef,t.onMarqueeSelectRef,t.activeCompositionPathRef]),l=x.useCallback(f=>{var m;const h=e.current;if(h){const y=(m=t.overlayRef.current)==null?void 0:m.getBoundingClientRect();if(!y)return;if(h.currentX=f.clientX-y.left,h.currentY=f.clientY-y.top,!h.pastThreshold){const w=h.currentX-h.startX,O=h.currentY-h.startY;if(Math.hypot(w,O)<eyt)return;h.pastThreshold=!0,a.current=null}const d={left:Math.min(h.startX,h.currentX),top:Math.min(h.startY,h.currentY),width:Math.abs(h.currentX-h.startX),height:Math.abs(h.currentY-h.startY)};r(d);const v=t.iframeRef.current,b=t.overlayRef.current;if(v&&b){const w=t.activeCompositionPathRef.current??"index.html";a.current??(a.current=Pte(v,b,w)),s(gve(d,a.current).map(O=>O.rect))}return}t.gestures.onPointerMove(f)},[t.gestures,t.overlayRef,t.iframeRef,t.activeCompositionPathRef]),c=x.useCallback(f=>{var m,y;const h=e.current;if(h){e.current=null;try{f.currentTarget.releasePointerCapture(h.pointerId)}catch{}h.pastThreshold?o({left:Math.min(h.startX,h.currentX),top:Math.min(h.startY,h.currentY),width:Math.abs(h.currentX-h.startX),height:Math.abs(h.currentY-h.startY)},f.shiftKey):(y=(m=t.onMarqueeSelectRef).current)==null||y.call(m,[],!1),r(null),s([]),a.current=null;return}t.gestures.onPointerUp(f)},[t.gestures,o,t.onMarqueeSelectRef]),u=x.useCallback(()=>{if(e.current){e.current=null,r(null),s([]),a.current=null;return}t.gestures.clearPointerState(t.selectionRef)},[t.gestures,t.selectionRef]);return{marqueeRef:e,marqueeRect:n,candidateRects:i,onPointerMove:l,onPointerUp:c,onPointerCancel:u}}function ryt({candidateRects:t,marqueeRect:e}){return p.jsxs(p.Fragment,{children:[t.map((n,r)=>p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-sm border border-studio-accent bg-studio-accent/5",style:{left:n.left,top:n.top,width:n.width,height:n.height}},r)),e&&p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute border border-dashed border-studio-accent bg-studio-accent/10",style:{left:e.left,top:e.top,width:e.width,height:e.height}})]})}const iyt=600;function syt({overlayRef:t,iframeRef:e}){const[n,r]=x.useState(null),i=x.useRef(null);x.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const s=x.useCallback(a=>{const o=t.current,l=e.current;if(!o||!l)return;const c=oV(o,l,a);!c||c.width<=0||c.height<=0||(i.current&&clearTimeout(i.current),r(c),i.current=setTimeout(()=>{i.current=null,r(null)},iyt))},[t,e]);return{zOrderFlashRect:n,handleZOrderCrossed:s}}function ayt({rect:t}){return t?p.jsx("div",{"aria-hidden":"true","data-dom-edit-z-flash":"true",className:"pointer-events-none absolute rounded-md border-2 border-studio-accent shadow-[0_0_0_2px_rgba(60,230,172,0.35)] animate-pulse",style:{left:t.left,top:t.top,width:t.width,height:t.height}}):null}function oyt({selection:t,selectionRef:e,hoverSelectionRef:n,onCanvasPointerMoveRef:r,onSelectionChangeRef:i}){const[s,a]=x.useState(null),o=x.useCallback(()=>a(null),[]);x.useEffect(()=>{s&&(!t||t.element!==s.sel.element)&&a(null)},[t,s]);const l=x.useCallback(async c=>{c.preventDefault();const u=e.current;let f=u;if(u){const h=n.current;h&&h.element!==u.element&&(i.current(h,{revealPanel:!0}),f=h)}else{const h=c,m=await r.current(h);if(!m)return;i.current(m,{revealPanel:!0}),f=m}f&&a({x:c.clientX,y:c.clientY,sel:f})},[e,n,r,i]);return{contextMenu:s,closeContextMenu:o,handleContextMenu:l}}const J8=4,lyt=.05,Mte=15,cyt=.5;function uyt(t){t==null||t.focus({preventScroll:!0})}function fyt(t,e){return!t||!e?!1:t===e||t.contains(e)}function hyt(t){var n,r,i;const e=fyt((n=t.cached)==null?void 0:n.element,t.elementAtPoint);return pc("shift-pointerdown",{candidate:t.cached?t.cached.selector??null:null,pointTarget:((r=t.elementAtPoint)==null?void 0:r.id)??((i=t.elementAtPoint)==null?void 0:i.tagName)??null,cacheIsAboutThisPoint:e}),e?t.cached:null}function dyt(t){return{dx:(t.originWidth-t.overlayWidth)/2,dy:(t.originHeight-t.overlayHeight)/2}}function Nte(t,e,n,r){return Math.atan2(r-e,n-t)*180/Math.PI}function pyt(t){return((t+180)%360+360)%360-180}function myt(t){return Math.round(t*10)/10}function Dte(t){const e=Nte(t.centerX,t.centerY,t.startX,t.startY),n=Nte(t.centerX,t.centerY,t.currentX,t.currentY),r=pyt(n-e),i=t.actualAngle+r;return{angle:t.snap?Math.round(i/Mte)*Mte:myt(i)}}function gyt(t,e){return Math.abs(e-t)>=lyt}function yyt(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Nk(t[n],e[n]))return!1;return!0}function xyt({iframeRef:t,overlayRef:e,selectionRef:n,activeCompositionPathRef:r,groupSelectionsRef:i,hoverSelectionRef:s,rafPausedRef:a}){const[o,l]=x.useState(null),[c,u]=x.useState(null),[f,h]=x.useState([]),[m,y]=x.useState([]),d=x.useRef(null),v=x.useRef(null),b=x.useRef([]),w=x.useRef(null),O=x.useRef(null),k=x.useRef(new Map),E=x.useRef([]),M=j=>{Nk(d.current,j)||(d.current=j,l(j))},N=j=>{Nk(v.current,j)||(v.current=j,u(j))},I=j=>{Jgt(b.current,j)||(b.current=j,h(j))},_=(j,L)=>{const B=lf(L),$=k.current.get(B);if($!=null&&$.isConnected&&$.ownerDocument===j)return $;const Q=Ds(j,L,r.current);return Q?k.current.set(B,Q):k.current.delete(B),Q};return wr(()=>{let j=0;const L=()=>{M(null),N(null),I([])},B=()=>{if(j=requestAnimationFrame(B),a.current){E.current.length>0&&(E.current=[],y([]));return}const $=n.current,Q=t.current,Y=e.current;if(!Q||!Y){w.current=null,O.current=null,k.current.clear(),L();return}const W=Q.contentDocument;if(!W){w.current=null,O.current=null,k.current.clear(),L();return}if($){const F=Tte(W,$,r.current,w);if(F&&aV(F)){const U=f7(Y,Q,F);M(U);const Z=F.querySelectorAll("*");if(Z.length>0&&Z.length<=60){const K=[];for(let ee=0;ee<Z.length;ee++){const re=Z[ee];if(!re.getBoundingClientRect)continue;const z=Ygt(Y,Q,re);z&&z.width>2&&z.height>2&&K.push(z)}yyt(E.current,K)||(E.current=K,y(K))}else E.current.length>0&&(E.current=[],y([]))}else M(null),E.current.length>0&&(E.current=[],y([]))}else w.current=null,M(null),E.current.length>0&&(E.current=[],y([]));const J=i.current;if(J.length>0){const F=[],U=new Set;for(const Z of J){const K=lf(Z);if(U.has(K))continue;U.add(K);const ee=_(W,Z),re=ee?pve(Y,Q,ee):null,z=re&&ee?{...re,...Qy(re,ee)}:re;ee&&z&&F.push({key:K,selection:Z,element:ee,rect:z})}for(const Z of k.current.keys())U.has(Z)||k.current.delete(Z);I(F)}else k.current.clear(),I([]);const ne=s.current,le=!!($&&ne&&lf($)===lf(ne)),ie=!!(ne&&J.some(F=>lf(F)===lf(ne)));if(!ne||le||ie){O.current=null,N(null);return}const q=Tte(W,ne,r.current,O);if(!q){N(null);return}N(f7(Y,Q,q))};return j=requestAnimationFrame(B),()=>cancelAnimationFrame(j)}),{overlayRect:o,overlayRectRef:d,setOverlayRect:M,hoverRect:c,hoverRectRef:v,setHoverRect:N,groupOverlayItems:f,groupOverlayItemsRef:b,setGroupOverlayItems:I,childRects:m}}function byt(t,e){const n=t.angle??0;if(!n){const y=Math.max(0,e.left-t.left),d=Math.max(0,e.top-t.top),v=Math.min(t.width,e.left+e.width-t.left),b=Math.min(t.height,e.top+e.height-t.top);return y>=v||d>=b?void 0:`polygon(evenodd, 0 0, ${t.width}px 0, ${t.width}px ${t.height}px, 0 ${t.height}px, 0 0, ${y}px ${d}px, ${v}px ${d}px, ${v}px ${b}px, ${y}px ${b}px, ${y}px ${d}px)`}const r=-n*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=t.left+t.width/2,o=t.top+t.height/2,l=(y,d)=>{const v=y-a,b=d-o;return`${t.width/2+v*i-b*s}px ${t.height/2+v*s+b*i}px`},c=e.left,u=e.top,f=c+e.width,h=u+e.height,m=[l(c,u),l(f,u),l(f,h),l(c,h),l(c,u)].join(", ");return`polygon(evenodd, 0 0, ${t.width}px 0, ${t.width}px ${t.height}px, 0 ${t.height}px, 0 0, ${m})`}function vyt({rects:t,elements:e,compRect:n,selection:r,groupSelections:i,activeCompositionPathRef:s,onSelectionChangeRef:a}){return p.jsx(p.Fragment,{children:t.filter(o=>{const l=e.current.get(o.key);return l?(r==null?void 0:r.element)===l?!1:!i.some(c=>c.element===l):!0}).map(o=>{const l={left:o.left,top:o.top,width:o.width,height:o.height,transform:o.angle?`rotate(${o.angle}deg)`:void 0,transformOrigin:"center"},c=byt(o,n),u=async()=>{const h=e.current.get(o.key);if(!h)return;const{resolveDomEditSelection:m}=await ly(async()=>{const{resolveDomEditSelection:v}=await Promise.resolve().then(()=>EJe);return{resolveDomEditSelection:v}},void 0),y=s.current??"index.html",d=await m(h,{activeCompositionPath:y,isMasterView:!y||y==="index.html",skipSourceProbe:!0});d&&a.current(d,{revealPanel:!0})},f=h=>{h.stopPropagation(),u()};return p.jsx("div",{className:"pointer-events-none absolute",style:l,children:p.jsx("div",{role:"button",tabIndex:0,"aria-label":`Select off-canvas element ${o.key}`,className:"pointer-events-auto absolute inset-0 border-2 border-dashed border-studio-accent/10 rounded-md cursor-pointer hover:border-studio-accent hover:bg-studio-accent/10 transition-colors",style:c?{clipPath:c}:void 0,title:`Off-canvas: ${o.key} — click to select`,onClick:f,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),u())}})},`offcanvas-${o.key}`)})})}function Ayt({rects:t}){return p.jsx(p.Fragment,{children:t.map((e,n)=>p.jsx("div",{className:"pointer-events-none absolute border border-dashed border-white/20 rounded-sm",style:{left:e.left,top:e.top,width:e.width,height:e.height,transform:e.angle?`rotate(${e.angle}deg)`:void 0}},n))})}function e5(t){const e=t.ownerDocument.defaultView,n=e==null?void 0:e.gsap;return n!=null&&n.set&&n.getProperty?n:null}function hV(t,e,n){const r=e5(t);if(!r)return!1;t.style.setProperty("translate","none");const{newX:i,newY:s}=Ry(t,e,n);return r.set(t,{x:i,y:s}),!0}function MD(t,e){const n=e5(t);return n?(t.style.setProperty("rotate","none"),n.set(t,{rotation:e}),!0):!1}function Syt(t){const e=e5(t);return e&&Number(e.getProperty(t,"rotation"))||0}const wyt=100,Ite=.01,Oyt=1e-6;function _te(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)}function Rte(t){return Math.hypot(t.x,t.y)}function jte(t){return Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.width)&&Number.isFinite(t.height)}function Cyt(t){const e=t.document.documentElement,n=t.innerWidth||e.clientWidth||1,r=t.innerHeight||e.clientHeight||1;return{width:n>0?n:1,height:r>0?r:1}}function kyt(t){try{const e=t.frameElement;if(!e)return null;const n=e.ownerDocument.defaultView,r=n==null?void 0:n.HTMLElement;return r&&e instanceof r?e:null}catch{return null}}function ND(t){const e=t.getBoundingClientRect();if(!jte(e)||e.width<=0&&e.height<=0)return null;let n={x:e.left+e.width/2,y:e.top+e.height/2},r=t.ownerDocument.defaultView;for(;r;){const i=kyt(r);if(!i)break;const s=i.getBoundingClientRect();if(!jte(s)||s.width<=0||s.height<=0)return null;const a=Cyt(r);n={x:s.left+n.x*(s.width/a.width),y:s.top+n.y*(s.height/a.height)},r=i.ownerDocument.defaultView}return n}function Eyt(t){const e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<Oyt?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e}}function Tyt(t,e){return{x:t.a*e.x+t.c*e.y,y:t.b*e.x+t.d*e.y}}function Pyt(t){var i;const e=(i=t.ownerDocument.defaultView)==null?void 0:i.getComputedStyle(t).transform;if(!e||!e.startsWith("matrix3d("))return 1;const n=e.slice(9,-1).split(","),r=Number.parseFloat(n[15]??"");return Number.isFinite(r)&&r>0?r:1}function Myt(t,e,n={}){const r=n.probeSize??wyt;if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:"Invalid movement probe size."};const i=J1(t);try{rv(t,e);const s=ND(t);if(!s)return{ok:!1,reason:"Element has no measurable box."};rv(t,{x:e.x+r,y:e.y});const a=ND(t);if(!a)return{ok:!1,reason:"Element X movement could not be measured."};rv(t,{x:e.x,y:e.y+r});const o=ND(t);if(!o)return{ok:!1,reason:"Element Y movement could not be measured."};const l={x:(a.x-s.x)/r,y:(a.y-s.y)/r},c={x:(o.x-s.x)/r,y:(o.y-s.y)/r};if(!_te(l)||!_te(c)||Rte(l)<Ite||Rte(c)<Ite)return{ok:!1,reason:"Element movement response is too small to measure."};const u={a:l.x,b:l.y,c:c.x,d:c.y},f=Eyt(u);return f?{ok:!0,matrix:f}:{ok:!1,reason:"Element movement response is not invertible."}}finally{lc(t,i)}}function Nyt(t){const e=Tyt(t.screenToOffset,{x:t.dx,y:t.dy});return{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y}}function Dk(t){var c,u,f,h,m;const e=ZHe(t.element);t.element.setAttribute("data-hf-drag-initial-offset-x",String(e.x)),t.element.setAttribute("data-hf-drag-initial-offset-y",String(e.y));const n=t.element.ownerDocument.defaultView,r=((u=(c=n==null?void 0:n.gsap)==null?void 0:c.getProperty)==null?void 0:u.call(c,t.element,"x"))||0,i=((h=(f=n==null?void 0:n.gsap)==null?void 0:f.getProperty)==null?void 0:h.call(f,t.element,"y"))||0;if(t.element.setAttribute("data-hf-drag-gsap-base-x",String(r)),t.element.setAttribute("data-hf-drag-gsap-base-y",String(i)),n!=null&&n.__timelines){const y=[];for(const[d,v]of Object.entries(n.__timelines))try{v!=null&&v.pause&&!((m=v.paused)!=null&&m.call(v))&&(v.pause(),y.push(d))}catch{}y.length>0&&t.element.setAttribute("data-hf-drag-paused-timelines",y.join(","))}const s=J1(t.element),a=X_(t.element),o=Myt(t.element,e,{scaleX:t.rect.editScaleX,scaleY:t.rect.editScaleY}),l={x:r,y:i};if(!o.ok){const y=t.rect.editScaleX||1,d=t.rect.editScaleY||1,v=Pyt(t.element);return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,baseGsap:l,initialPathOffset:s,gestureToken:a,screenToOffset:{a:v/y,b:0,c:0,d:v/d},originRect:t.rect}}}return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,baseGsap:l,initialPathOffset:s,gestureToken:a,screenToOffset:o.matrix,originRect:t.rect}}}function yve(t,e,n){return Nyt({initialOffset:t.initialOffset,screenToOffset:t.screenToOffset,dx:e,dy:n})}function dV(t,e,n){const r=yve(t,e,n);return hV(t.element,r,t.baseGsap)||rv(t.element,r),r}function Dyt(t){t.element.setAttribute("data-hf-drag-gsap-base-x",String(t.baseGsap.x)),t.element.setAttribute("data-hf-drag-gsap-base-y",String(t.baseGsap.y)),t.element.setAttribute("data-hf-drag-initial-offset-x",String(t.initialOffset.x)),t.element.setAttribute("data-hf-drag-initial-offset-y",String(t.initialOffset.y))}function xve(t,e){return Dyt(t),hV(t.element,e,t.baseGsap)||fC(t.element,e),e}function DD(t,e,n){return xve(t,yve(t,e,n))}function Iyt(t,e){const n={x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y};return hV(t.element,n,t.baseGsap)||rv(t.element,n),n}function _yt(t,e){return xve(t,{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y})}function Ryt(t){lc(t.element,t.initialPathOffset),tu(t.element,t.gestureToken)}function Cv(t){for(const e of t)Ryt(e),Ik(e.element)}function i6(t){for(const e of t)tu(e.element,e.gestureToken),e.element.removeAttribute("data-hf-drag-initial-offset-x"),e.element.removeAttribute("data-hf-drag-initial-offset-y"),e.element.removeAttribute("data-hf-drag-gsap-base-x"),e.element.removeAttribute("data-hf-drag-gsap-base-y"),e.element.style.getPropertyValue("translate")==="none"&&e.element.style.removeProperty("translate"),e5(e.element)&&Ode(e.element),Ik(e.element)}function Ik(t){var i,s,a,o,l,c,u;const e=t.getAttribute("data-hf-drag-paused-timelines");if(t.removeAttribute("data-hf-drag-paused-timelines"),!e)return;const n=t.ownerDocument.defaultView;if(!n)return;for(const f of e.split(","))try{(a=(s=(i=n.__timelines)==null?void 0:i[f])==null?void 0:s.paused)==null||a.call(s,!1)}catch{}const r=((l=(o=n.__player)==null?void 0:o.getTime)==null?void 0:l.call(o))??0;(u=(c=n.__player)==null?void 0:c.seek)==null||u.call(c,r)}const ID=1,jyt=3;function Lyt(t){const e=Math.hypot(t.pointerStart.x-t.centerStart.x,t.pointerStart.y-t.centerStart.y);return!Number.isFinite(e)||e<jyt?1:Math.hypot(t.pointer.x-t.centerStart.x,t.pointer.y-t.centerStart.y)/e}function Fyt(t){const e=Math.max(t.baseWidth,ID),n=Math.max(t.baseHeight,ID),r=Lyt({pointer:t.pointer,pointerStart:t.pointerStart,centerStart:t.centerStart}),i=ID/Math.min(e,n),s=Math.max(i,r);return{width:e*s,height:n*s}}const $yt=["ns-resize","nesw-resize","ew-resize","nwse-resize","ns-resize","nesw-resize","ew-resize","nwse-resize"],Byt={nw:315,ne:45,se:135,sw:225};function Vyt(t,e){const r=((Byt[t]+e)%360+360)%360,i=Math.round(r/45)%8;return $yt[i]}function Hyt(t,e,n){const r=t??{dx:0,dy:0};return{dx:r.dx+(e.x-n.x),dy:r.dy+(e.y-n.y)}}function Qyt(t,e,n){const r=t.resizeFixedCenterStart;if(e&&r)return Hyt(t.lastResizeAnchor,r,dve(e));const i=n();return dyt({originWidth:t.originWidth,originHeight:t.originHeight,overlayWidth:i?i.width:t.originWidth,overlayHeight:i?i.height:t.originHeight})}function zyt(t,e,n,r,i,s){const a=r&&i?cV(r,i,n):null,o=Qyt(t,a,s);return t.lastResizeAnchor=o,dV(e,o.dx,o.dy),s()??{left:t.originLeft+o.dx,top:t.originTop+o.dy,width:a?Mk(a.nw,a.ne):t.originWidth,height:a?Mk(a.nw,a.sw):t.originHeight,editScaleX:t.editScaleX,editScaleY:t.editScaleY,angle:t.actualRotation}}function Zyt(t,e,n,r,i){return t.pathOffsetMember?zyt(t,t.pathOffsetMember,e,n,r,i):i()??{left:t.originLeft,top:t.originTop,width:t.originWidth,height:t.originHeight,editScaleX:t.editScaleX,editScaleY:t.editScaleY,angle:t.actualRotation}}const bve=6,Gyt=4;function vve(t,e){return Math.hypot(t,e)>=Gyt}const Lte=1;function sw(t){return t.left+t.width}function aw(t){return t.top+t.height}function t5(t){return t.left+t.width/2}function n5(t){return t.top+t.height/2}function Uyt(t){return t.map(({rect:e,id:n})=>({left:e.left,top:e.top,right:sw(e),bottom:aw(e),centerX:t5(e),centerY:n5(e),id:n}))}function Xyt(t){return{left:t.left,top:t.top,right:sw(t),bottom:aw(t),centerX:t5(t),centerY:n5(t),id:"composition"}}function Wyt(t,e,n){const r=[],i=[];if(e<=0||n<=0)return{x:r,y:i};const s=e*n;let a=t.left+s;const o=t.left+t.width;let l=0;for(;a<o;)r.push({position:a,source:"grid",id:`grid-x-${l}`}),a+=s,l++;let c=t.top+s;const u=t.top+t.height;for(l=0;c<u;)i.push({position:c,source:"grid",id:`grid-y-${l}`}),c+=s,l++;return{x:r,y:i}}function Fte(t,e,n,r,i){const s=[];for(const a of e){const o=n(a);for(const l of t)for(const c of o){const u=c-l,f=Math.abs(u);f<=i&&s.push({adjustment:u,distance:f,guidePosition:c,source:a.id==="composition"?"composition":"element",targetId:a.id})}}if(r)for(const a of r)for(const o of t){const l=a.position-o,c=Math.abs(l);c<=i&&s.push({adjustment:l,distance:c,guidePosition:a.position,source:"grid",targetId:a.id})}return s}function $te(t){if(t.length===0)return null;const e=t.filter(h=>h.source==="element"||h.source==="composition"),n=t.filter(h=>h.source==="grid");let r;const i=e.length?Math.min(...e.map(h=>h.distance)):1/0,s=n.length?Math.min(...n.map(h=>h.distance)):1/0;i<=s?r=e:r=n;const a=Math.min(...r.map(h=>h.distance)),o=r.filter(h=>h.distance===a),l=o.some(h=>h.adjustment>0),c=o.some(h=>h.adjustment<0);if(l&&c)return null;const u=o[0].adjustment,f=r.filter(h=>h.adjustment===u);return{adjustment:u,matches:f}}function qyt(t,e,n,r){const i=[];if(t==="x"){i.push(e.top,aw(e));for(const s of n){const a=r.get(s);a&&i.push(a.top,a.bottom)}}else{i.push(e.left,sw(e));for(const s of n){const a=r.get(s);a&&i.push(a.left,a.right)}}return{from:Math.min(...i),to:Math.max(...i)}}function Yyt(t,e,n,r){const i=[];for(const[s,a]of[["x",t],["y",e]]){if(!a)continue;const o=new Set;for(const l of a.matches){if(o.has(l.guidePosition))continue;o.add(l.guidePosition);const c=a.matches.filter(f=>f.guidePosition===l.guidePosition).map(f=>f.targetId),u=qyt(s,n,c,r);i.push({axis:s,position:l.guidePosition,from:u.from,to:u.to})}}return i}const Kyt=(t,e)=>({dx:t,dy:e,guides:[],spacingGuides:[]});function Ave(t){var f,h;if(t.disabled||t.disabledForTravel||t.threshold<=0)return Kyt(t.proposedDx,t.proposedDy);const e=t.movingRect,n={left:e.left+t.proposedDx,top:e.top+t.proposedDy,width:e.width,height:e.height},r=Fte([n.left,t5(n),sw(n)],t.targets,m=>[m.left,m.centerX,m.right],(f=t.gridEdges)==null?void 0:f.x,t.threshold),i=Fte([n.top,n5(n),aw(n)],t.targets,m=>[m.top,m.centerY,m.bottom],(h=t.gridEdges)==null?void 0:h.y,t.threshold),s=$te(r),a=$te(i),o=t.proposedDx+((s==null?void 0:s.adjustment)??0),l=t.proposedDy+((a==null?void 0:a.adjustment)??0),c={left:e.left+o,top:e.top+l,width:e.width,height:e.height},u=new Map(t.targets.map(m=>[m.id,m]));return{dx:o,dy:l,guides:Yyt(s,a,c,u),spacingGuides:[]}}function Jyt(t,e){return t.axis==="x"?{left:t.position,top:e.top,width:1,height:e.height}:{left:e.left,top:t.position,width:e.width,height:1}}function Sve(t){const e=[],n=t.movingRect,r={left:n.left,top:n.top,right:sw(n),bottom:aw(n),centerX:t5(n),centerY:n5(n),id:"\0__snap_moving__"},i=[...t.targets,r],s=[...i].sort((o,l)=>o.centerX-l.centerX);for(let o=0;o<s.length-2;o++){const l=s[o],c=s[o+1],u=s[o+2],f=c.left-l.right,h=u.left-c.right;if(!(f<0||h<0||!(l.id==="\0__snap_moving__"||c.id==="\0__snap_moving__"||u.id==="\0__snap_moving__"))&&Math.abs(f-h)<=Lte){const y=Math.min(l.top,c.top,u.top),d=Math.max(l.bottom,c.bottom,u.bottom);e.push({axis:"x",position:l.right,size:f,from:y,to:d}),e.push({axis:"x",position:c.right,size:h,from:y,to:d})}}const a=[...i].sort((o,l)=>o.centerY-l.centerY);for(let o=0;o<a.length-2;o++){const l=a[o],c=a[o+1],u=a[o+2],f=c.top-l.bottom,h=u.top-c.bottom;if(!(f<0||h<0||!(l.id==="\0__snap_moving__"||c.id==="\0__snap_moving__"||u.id==="\0__snap_moving__"))&&Math.abs(f-h)<=Lte){const y=Math.min(l.left,c.left,u.left),d=Math.max(l.right,c.right,u.right);e.push({axis:"y",position:l.bottom,size:f,from:y,to:d}),e.push({axis:"y",position:c.bottom,size:h,from:y,to:d})}}return e}function Bte(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}const ext=new Set(["script","style","link","meta","base","template","br","wbr"]);function txt(t){return t.nodeType===1}function nxt(t,e,n){const r=[],i=s=>{if(!(r.length>=n))for(const a of Array.from(s.children))txt(a)&&(ext.has(a.tagName.toLowerCase())||a.hasAttribute("data-composition-id")||e.has(a)||aV(a)&&(r.push(a),i(a)))};return i(t),r}function wve(t){const e=to(),n=e.snapEnabled??!0,r=t.iframe.contentDocument;if(!r)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const i=r.querySelector("[data-composition-id]")??r.documentElement,s=i==null?void 0:i.getBoundingClientRect(),a=Bte((i==null?void 0:i.getAttribute("data-width"))??null),o=Bte((i==null?void 0:i.getAttribute("data-height"))??null),l=a??(s==null?void 0:s.width),c=o??(s==null?void 0:s.height);if(!l||!c||!s)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const u=t.iframe.getBoundingClientRect(),f=t.overlayEl.getBoundingClientRect(),h=u.width/l;u.height/c;const m={left:u.left-f.left,top:u.top-f.top,width:u.width,height:u.height},y=Xyt(m),v=nxt(i,t.excludeElements,80),b=[];for(let M=0;M<v.length;M++){const N=oV(t.overlayEl,t.iframe,v[M]);N&&b.push({rect:N,id:`snap-target-${M}`})}const w=Uyt(b);let O=null;const k=e.gridSpacing??50;return(e.snapToGrid??!1)&&k>0&&(O=Wyt(m,k,h)),{targets:w,compositionTarget:y,gridEdges:O,snapEnabled:n}}function Ove(t){const e=new Set,n=t.selection;if(n!=null&&n.element&&e.add(n.element),t.groupSelections)for(const r of t.groupSelections)r.element&&e.add(r.element);return e}const bf=Z0("drag");let s6=0;function rxt(t){bf("move",()=>(s6+=1,s6%8===1?{n:s6,...t}:null))}function ixt(){s6=0}function cd(t){const e={};for(const{key:n,element:r}of t){const i=r.getBoundingClientRect();e[n]=`${Math.round(i.left)},${Math.round(i.top)}`}return e}function sxt(t,e){var a,o;const n=new Map;for(const l of Object.keys(e)){const c=(a=t[l])==null?void 0:a.split(",").map(Number),u=(o=e[l])==null?void 0:o.split(",").map(Number);!c||!u||c.length!==2||u.length!==2||n.set(l,`${Math.round(u[0]-c[0])},${Math.round(u[1]-c[1])}`)}const r=new Map;for(const l of n.values())r.set(l,(r.get(l)??0)+1);let i="",s=0;for(const[l,c]of r)c>s&&([i,s]=[l,c]);return[...n].filter(([,l])=>l!==i).map(([l,c])=>`${l.split("|")[2]??l} moved ${c}, group moved ${i}`)}function axt(t,e){bf(t,()=>{var i;const n=cd(e),r=(i=e[0])==null?void 0:i.element.ownerDocument.defaultView;return r&&(r.setTimeout(()=>bf(`${t}+120ms`,()=>({at:cd(e)})),120),r.setTimeout(()=>bf(`${t}+400ms`,()=>({at:cd(e)})),400),r.setTimeout(()=>bf(`${t}+900ms`,()=>({at:cd(e)})),900)),{at:n}})}function oxt(t,e){var c,u,f;const n=e.groupOverlayItemsRef.current;if(n.length<=1)return!1;const r=(c=n.find(h=>!h.selection.capabilities.canApplyManualOffset))==null?void 0:c.selection;if(r)return t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(r),!1;(f=(u=e.onManualDragStartRef).current)==null||f.call(u);const i=mve(n),s=[];for(const h of i){const m=Dk({key:h.key,selection:h.selection,element:h.element,rect:h.rect});if(!m.ok)return Cv(s),t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(m.selection),!1;s.push(m.member)}ixt(),bf("group-start",{members:Object.fromEntries(s.map(h=>[h.key,{map:`${h.screenToOffset.a.toFixed(3)},${h.screenToOffset.d.toFixed(3)}`,base:`${Math.round(h.baseGsap.x)},${Math.round(h.baseGsap.y)}`,offset:`${Math.round(h.initialOffset.x)},${Math.round(h.initialOffset.y)}`}])),at:cd(s)});const a=e.overlayRef.current,o=e.iframeRef.current,l=a&&o?wve({overlayEl:a,iframe:o,excludeElements:Ove({groupSelections:n.map(h=>h.selection)})}):void 0;return t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId),e.rafPausedRef.current=!0,e.groupGestureRef.current={startX:t.clientX,startY:t.clientY,originItems:n,members:s,snapContext:l},!0}function lxt(t,e,n,r){var $,Q,Y;const i=(r==null?void 0:r.selection)??n.selectionRef.current,s=(r==null?void 0:r.rect)??n.overlayRectRef.current,a=n.boxRef.current,o=n.overlayRef.current;if(!i||!s||t!=="drag"&&!a)return!1;const l=t==="rotate"?"rotation":t==="drag"?"path-offset":"box-size";if(t==="drag"&&!i.capabilities.canApplyManualOffset||t==="resize"&&!i.capabilities.canApplyManualSize||t==="rotate"&&!i.capabilities.canApplyManualRotation||t==="resize"&&(!Number.isFinite(s.width)||!Number.isFinite(s.height)))return!1;const c=o3(i.element),u={angle:Syt(i.element)+gde(i.element).angle},f=i.element.offsetWidth,h=i.element.offsetHeight,m=c.width>0?c.width:f>0?f:s.width/s.editScaleX,y=c.height>0?c.height:h>0?h:s.height/s.editScaleY,d=s.width/(s.editScaleX*m),v=s.height/(s.editScaleY*y),b=Number.isFinite(d)&&d>0?d:1,w=Number.isFinite(v)&&v>0?v:1;let O;if(t==="resize"){const W=i.element.getBoundingClientRect();O={anchorX:W.x,anchorY:W.y,baseGsapX:WY(i.element,"x")??0,baseGsapY:WY(i.element,"y")??0,pinX:0,pinY:0}}let k=J1(i.element),E,M;if(t==="drag"){(Q=($=n.onManualDragStartRef).current)==null||Q.call($),n.rafPausedRef.current=!0;const W=Dk({key:lf(i),selection:i,element:i.element,rect:s});if(!W.ok)return n.onBlockedMoveRef.current(W.selection),!1;M=W.member,k=W.member.initialPathOffset,E=W.member.gestureToken}else if(t==="resize"&&i.capabilities.canApplyManualOffset){const J=Dk({key:lf(i),selection:i,element:i.element,rect:s});J.ok?(M=J.member,k=J.member.initialPathOffset,E=J.member.gestureToken):E=X_(i.element)}else E=X_(i.element);const N=o==null?void 0:o.getBoundingClientRect(),I=((N==null?void 0:N.left)??0)+s.left+s.width/2,_=((N==null?void 0:N.top)??0)+s.top+s.height/2,j=n.iframeRef.current;let L;if(t==="resize"&&M&&o&&j){const W=cV(o,j,i.element);W&&(L=dve(W))}const B=(t==="drag"||t==="resize")&&o&&j?wve({overlayEl:o,iframe:j,excludeElements:Ove({selection:i})}):void 0;return e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),n.rafPausedRef.current=!0,n.gestureRef.current={kind:t,mode:l,selection:i,startX:e.clientX,startY:e.clientY,centerX:I,centerY:_,initialPathOffset:k,initialRotation:J_(i.element),initialBoxSize:K_(i.element),pathOffsetMember:M,originLeft:s.left,originTop:s.top,originWidth:s.width,originHeight:s.height,actualWidth:m,actualHeight:y,actualRotation:u.angle,editScaleX:s.editScaleX,editScaleY:s.editScaleY,contentScaleX:b,contentScaleY:w,resizeAnchor:O,manualEditDragToken:E,snapContext:B,resizeHandle:t==="resize"?(r==null?void 0:r.resizeHandle)??"se":void 0,resizeFixedCenterStart:L},t==="resize"&&(ort(),aa("start",{handle:(r==null?void 0:r.resizeHandle)??"se",pointer:{x:e.clientX,y:e.clientY},center:{x:I,y:_},origin:{left:s.left,top:s.top,w:s.width,h:s.height},actual:{w:m,h:y},editScale:{x:s.editScaleX,y:s.editScaleY},contentScale:{x:b,y:w},rotation:u.angle,hasOffsetMember:!!M,fixedCenterStart:L??null,initialBoxSize:((Y=n.gestureRef.current)==null?void 0:Y.initialBoxSize)??null,initialInlineStyle:i.element.getAttribute("style")})),!0}function cxt(t,e){let n={},r=null;const i=(a,o,l)=>{const c=a.snapContext;if(!(c!=null&&c.snapEnabled)||c.targets.length===0)return l;if(!vve(l.dx,l.dy))return t.snapGuidesRef.current=null,l;const u=fV(a.originItems.map(d=>d.rect));if(!u)return l;const f=c.compositionTarget?[...c.targets,c.compositionTarget]:c.targets,h=Ave({movingRect:u,proposedDx:l.dx,proposedDy:l.dy,targets:f,gridEdges:c.gridEdges??void 0,threshold:bve,disabled:o.altKey}),m={...u,left:u.left+h.dx,top:u.top+h.dy},y=o.altKey?[]:Sve({movingRect:m,targets:f});return t.snapGuidesRef.current={guides:h.guides,spacingGuides:y},{dx:h.dx,dy:h.dy}};return(a,o)=>{a!==r&&(r=a,n={});const{dx:l,dy:c}=i(a,o,{dx:o.clientX-a.startX,dy:o.clientY-a.startY});a.lastSnappedDx=l,a.lastSnappedDy=c,e(a.originItems.map(v=>({...v,rect:{...v.rect,left:v.rect.left+l,top:v.rect.top+c}})));const u={};for(const v of a.members){const b=dV(v,l,c);u[v.key]=`${Math.round(b.x)},${Math.round(b.y)}`}const f=cd(a.members),h=Math.round(o.clientX-a.startX),m=Math.round(o.clientY-a.startY),y={pointer:`${h},${m}`,applied:`${Math.round(l)},${Math.round(c)}`,at:f},d=sxt(n,f);d.length>0&&bf("drift",{...y,drift:d}),n=f,rxt({...y,offsets:u})}}function Vte(t,e){e instanceof DF||console.error(t,e)}function uxt(t){const e=f=>{t.setOverlayRect(f)},n=f=>{e({left:f.originLeft,top:f.originTop,width:f.originWidth,height:f.originHeight,editScaleX:f.editScaleX,editScaleY:f.editScaleY,angle:f.actualRotation})},r=f=>{t.setGroupOverlayItems(f)},i=f=>{Cv(f.members),r(f.originItems)},s=f=>oxt(f,t),a=(f,h,m)=>lxt(f,h,t,m),o=cxt(t,r);return{startGesture:a,startGroupDrag:s,onPointerMove:f=>{const h=t.gestureRef.current,m=t.groupGestureRef.current,y=(h==null?void 0:h.selection)??t.selectionRef.current,d=t.boxRef.current,v=t.blockedMoveRef.current;if(!v&&!h&&!m&&t.onCanvasPointerMoveRef.current(f,{preferClipAncestor:!1}),v&&y){const O=f.clientX-v.startX,k=f.clientY-v.startY;!v.notified&&Math.hypot(O,k)>=J8&&(v.notified=!0,t.suppressNextBoxClickRef.current=!0,t.onBlockedMoveRef.current(y));return}if(m){o(m,f);return}if(!h||!y)return;let b=f.clientX-h.startX,w=f.clientY-h.startY;if(h.kind==="rotate"){const O=Dte({centerX:h.centerX,centerY:h.centerY,startX:h.startX,startY:h.startY,currentX:f.clientX,currentY:f.clientY,actualAngle:h.actualRotation,snap:f.shiftKey});MD(y.element,O.angle)||tQe(y.element,O);return}if(h.kind==="drag"){const O=h.snapContext;if(!(Math.abs(h.actualRotation)>=cyt)&&(O!=null&&O.snapEnabled)&&O.targets.length>0){const N=Qy({left:h.originLeft,top:h.originTop,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY},h.selection.element),I=O.compositionTarget?[...O.targets,O.compositionTarget]:O.targets,_=Ave({movingRect:N,proposedDx:b,proposedDy:w,disabledForTravel:!vve(b,w),targets:I,gridEdges:O.gridEdges??void 0,threshold:bve,disabled:f.altKey});b=_.dx,w=_.dy;const j={left:N.left+b,top:N.top+w,width:N.width,height:N.height},L=f.altKey?[]:Sve({movingRect:j,targets:I});t.snapGuidesRef.current={guides:_.guides,spacingGuides:L}}h.lastSnappedDx=b,h.lastSnappedDy=w;const E=h.originLeft+b,M=h.originTop+w;e({left:E,top:M,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY,angle:h.actualRotation}),d&&(d.style.left=`${E}px`,d.style.top=`${M}px`),h.pathOffsetMember&&dV(h.pathOffsetMember,b,w)}else{if(!d)return;const O=Fyt({baseWidth:h.actualWidth,baseHeight:h.actualHeight,pointer:{x:f.clientX,y:f.clientY},pointerStart:{x:h.startX,y:h.startY},centerStart:{x:h.centerX,y:h.centerY}});KHe(y.element,O);const k=t.overlayRef.current,E=t.iframeRef.current,M=()=>k&&E?uV(k,E,y.element):null,N=Zyt(h,y.element,k,E,M);art({pointer:{x:f.clientX,y:f.clientY},nextSize:O,anchor:h.lastResizeAnchor??null,draftRect:N,liveInlineStyle:y.element.getAttribute("style")}),d.style.left=`${N.left}px`,d.style.top=`${N.top}px`,d.style.width=`${N.width}px`,d.style.height=`${N.height}px`,e(N)}},onPointerUp:f=>{t.snapGuidesRef.current=null;const h=t.gestureRef.current,m=t.groupGestureRef.current,y=(h==null?void 0:h.selection)??t.selectionRef.current,d=t.boxRef.current;if(t.blockedMoveRef.current=null,m){t.groupGestureRef.current=null,t.rafPausedRef.current=!1;const b=f.clientX-m.startX,w=f.clientY-m.startY;if(t.suppressNextBoxClickRef.current=!0,Math.hypot(b,w)<J8){i(m);return}const O=m.lastSnappedDx??b,k=m.lastSnappedDy??w;r(m.originItems.map(M=>({...M,rect:{...M.rect,left:M.rect.left+O,top:M.rect.top+k}})));const E=m.members.map(M=>({selection:M.selection,next:DD(M,O,k)}));bf("drop",{pointer:`${Math.round(b)},${Math.round(w)}`,applied:`${Math.round(O)},${Math.round(k)}`,committed:Object.fromEntries(E.map((M,N)=>{var I;return[((I=m.members[N])==null?void 0:I.key)??String(N),`${Math.round(M.next.x)},${Math.round(M.next.y)}`]})),at:cd(m.members)}),Promise.resolve(t.onGroupPathOffsetCommitRef.current(E)).catch(()=>{for(const M of m.members)M.gestureToken&&x2(M.element,M.gestureToken)&&lc(M.element,M.initialPathOffset)}).finally(()=>{bf("committed",{at:cd(m.members)}),i6(m.members),axt("settle",m.members)});return}if(!h||!y){t.gestureRef.current=null,t.rafPausedRef.current=!1;return}t.gestureRef.current=null,t.rafPausedRef.current=!1;const v=Math.hypot(f.clientX-h.startX,f.clientY-h.startY);if(h.kind==="drag"&&v<J8){lc(y.element,h.initialPathOffset),tu(y.element,h.manualEditDragToken),Ik(y.element),d&&(d.style.left=`${h.originLeft}px`,d.style.top=`${h.originTop}px`),n(h),t.suppressNextBoxClickRef.current=!0,t.onCanvasMouseDown(f,{preferClipAncestor:!1,hoverSelection:t.hoverSelectionRef.current});return}if(h.kind==="resize"&&v<J8){sv(y.element,h.initialBoxSize),h.pathOffsetMember?Cv([h.pathOffsetMember]):tu(y.element,h.manualEditDragToken),d&&(d.style.width=`${h.originWidth}px`,d.style.height=`${h.originHeight}px`),n(h),t.suppressNextBoxClickRef.current=!0;return}if(h.kind==="rotate"){const b=Dte({centerX:h.centerX,centerY:h.centerY,startX:h.startX,startY:h.startY,currentX:f.clientX,currentY:f.clientY,actualAngle:h.actualRotation,snap:f.shiftKey}),w=()=>{MD(y.element,h.actualRotation)||hC(y.element,h.initialRotation)};if(!gyt(h.actualRotation,b.angle)){w(),tu(y.element,h.manualEditDragToken);return}MD(y.element,b.angle)||TF(y.element,b),Promise.resolve(t.onRotationCommitRef.current(y,b)).catch(O=>{Vte("rotate commit failed",O),h.manualEditDragToken&&x2(y.element,h.manualEditDragToken)&&w()}).finally(()=>tu(y.element,h.manualEditDragToken))}else if(h.kind==="drag"){t.suppressNextBoxClickRef.current=!0;const b=h.lastSnappedDx??f.clientX-h.startX,w=h.lastSnappedDy??f.clientY-h.startY;if(!h.pathOffsetMember)return;const O=DD(h.pathOffsetMember,b,w),k=h.originLeft+b,E=h.originTop+w;e({left:k,top:E,width:h.originWidth,height:h.originHeight,editScaleX:h.editScaleX,editScaleY:h.editScaleY,angle:h.actualRotation}),d&&(d.style.left=`${k}px`,d.style.top=`${E}px`),Promise.resolve(t.onPathOffsetCommitRef.current(y,O,{altKey:f.altKey})).catch(()=>{var M;(M=h.pathOffsetMember)!=null&&M.gestureToken&&x2(y.element,h.pathOffsetMember.gestureToken)&&lc(y.element,h.initialPathOffset)}).finally(()=>{h.pathOffsetMember&&i6([h.pathOffsetMember])})}else{t.suppressNextBoxClickRef.current=!0;const b=o3(y.element);kF(y.element,b);const w=h.pathOffsetMember,O=h.lastResizeAnchor,k=w&&O&&(O.dx!==0||O.dy!==0)?DD(w,O.dx,O.dy):null;aa("release",{finalSize:b,anchor:O??null,finalOffset:k??null,hasMember:!!w,inlineStyle:y.element.getAttribute("style")});const E=()=>{!h.manualEditDragToken||!x2(y.element,h.manualEditDragToken)||(sv(y.element,h.initialBoxSize),k&&lc(y.element,h.initialPathOffset))};Promise.resolve(t.onBoxSizeCommitRef.current(y,b,k??void 0,E)).catch(M=>{Vte("resize commit failed",M)}).finally(()=>{w?i6([w]):tu(y.element,h.manualEditDragToken)}),RR(y.element,"post-release")}},clearPointerState:f=>{t.snapGuidesRef.current=null;const h=t.groupGestureRef.current;h&&i(h);const m=t.gestureRef.current,y=(m==null?void 0:m.selection)??f.current;(m==null?void 0:m.mode)==="path-offset"&&y&&(lc(y.element,m.initialPathOffset),tu(y.element,m.manualEditDragToken),Ik(y.element),n(m)),(m==null?void 0:m.mode)==="box-size"&&y&&(sv(y.element,m.initialBoxSize),m.pathOffsetMember?Cv([m.pathOffsetMember]):tu(y.element,m.manualEditDragToken),n(m)),(m==null?void 0:m.mode)==="rotation"&&y&&(hC(y.element,m.initialRotation),tu(y.element,m.manualEditDragToken)),t.blockedMoveRef.current=null,t.groupGestureRef.current=null,t.gestureRef.current=null,t.rafPausedRef.current=!1}}}const fxt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),hxt=1,dxt=10,pxt=400;function mxt(t){if(t.metaKey||t.ctrlKey||t.altKey||!fxt.has(t.key))return null;const e=t.shiftKey?dxt:hxt;return{dx:t.key==="ArrowLeft"?-e:t.key==="ArrowRight"?e:0,dy:t.key==="ArrowUp"?-e:t.key==="ArrowDown"?e:0}}function Cve(t){return t.length>0&&t.every(e=>e.capabilities.canApplyManualOffset)}function kve(t){return t?[t.id??"",t.hfId??"",t.selector??"",t.selectorIndex??"",t.label].join("\0"):""}function gxt(t){return t.map(kve).join(" ")}function yxt(t){return Cve(t.map(e=>e.selection))?mve(t):null}function xxt(t,e){return!t||!e||!t.capabilities.canApplyManualOffset||!t.element.isConnected?null:[{key:t.id??t.selector??t.label,selection:t,element:t.element,rect:e}]}function bxt(t,e){return!t.allowCanvasMovement||e.defaultPrevented||t.gestureRef.current||t.groupGestureRef.current||t.blockedMoveRef.current?!0:Hf(e.target)}function vxt(t){const e=x.useRef(null),n=x.useRef(t);n.current=t;const r=()=>{const f=e.current;if(!f)return;e.current=null,f.timer&&clearTimeout(f.timer);const h=f.members.map(d=>({selection:d.selection,next:_yt(d,f.accum)})),m=n.current,y=f.isGroup?m.onGroupPathOffsetCommitRef.current(h):m.onPathOffsetCommitRef.current(h[0].selection,h[0].next);Promise.resolve(y).catch(()=>{for(const d of f.members)x2(d.element,d.gestureToken)&&lc(d.element,d.initialPathOffset)}).finally(()=>i6(f.members))},i=x.useRef(r);i.current=r;const s=()=>{var v,b;const f=n.current,h=f.groupOverlayItemsRef.current,m=h.length>1,y=m?yxt(h):xxt(f.selectionRef.current,f.overlayRectRef.current);if(!y)return null;const d=[];for(const w of y){const O=Dk(w);if(!O.ok)return Cv(d),null;d.push(O.member)}return d.length===0?null:((b=(v=f.onManualDragStartRef).current)==null||b.call(v),{members:d,isGroup:m,accum:{x:0,y:0},timer:null})},a=f=>{const h=n.current;if(bxt(h,f))return;const m=mxt(f);if(!m)return;const y=e.current??s();if(y){e.current=y,f.preventDefault(),y.accum={x:y.accum.x+m.dx,y:y.accum.y+m.dy};for(const d of y.members)Iyt(d,y.accum);y.timer&&clearTimeout(y.timer),y.timer=setTimeout(()=>i.current(),pxt)}},o=x.useRef(a);o.current=a,wr(()=>{const f=h=>o.current(h);return window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0),i.current()}});const l=kve(t.selection),c=gxt(t.groupSelections);return x.useEffect(()=>()=>i.current(),[l,c]),x.useEffect(()=>{const f=t.groupSelections.length>1?t.groupSelections:t.selection?[t.selection]:[];if(!(!t.allowCanvasMovement||!Cve(f)))return BBe()},[t.selection,t.groupSelections,t.allowCanvasMovement]),{flushNudge:x.useCallback(()=>i.current(),[])}}const Hte=6,Qte=4,zte="rgba(255, 68, 204, 0.85)",e4="rgba(255, 68, 204, 0.6)",Axt="rgba(255, 68, 204, 0.15)",Sxt=x.memo(function({snapGuidesRef:e,compositionLeft:n,compositionTop:r,compositionWidth:i,compositionHeight:s}){const a=x.useRef([]),o=x.useRef([]),l=x.useRef([]),c=x.useRef({left:n,top:r,width:i,height:s});return c.current={left:n,top:r,width:i,height:s},wr(()=>{let u=0;const f=()=>{u=requestAnimationFrame(f);const h=e.current,m=(h==null?void 0:h.guides)??[],y=(h==null?void 0:h.spacingGuides)??[],d=c.current;for(let v=0;v<Hte;v++){const b=a.current[v];if(!b)continue;const w=m[v];if(!w){b.style.display="none";continue}b.style.display="";const O=Jyt(w,d);b.style.left=`${O.left}px`,b.style.top=`${O.top}px`,b.style.width=`${O.width}px`,b.style.height=`${O.height}px`}for(let v=0;v<Qte;v++){const b=o.current[v],w=l.current[v];if(!b)continue;const O=y[v];if(!O){b.style.display="none";continue}b.style.display="flex",b.style.alignItems="center",b.style.justifyContent="center",O.axis==="x"?(b.style.left=`${O.position}px`,b.style.top=`${O.from}px`,b.style.width=`${O.size}px`,b.style.height=`${O.to-O.from}px`,b.style.borderLeft=`1px dashed ${e4}`,b.style.borderRight=`1px dashed ${e4}`,b.style.borderTop="none",b.style.borderBottom="none"):(b.style.left=`${O.from}px`,b.style.top=`${O.position}px`,b.style.width=`${O.to-O.from}px`,b.style.height=`${O.size}px`,b.style.borderTop=`1px dashed ${e4}`,b.style.borderBottom=`1px dashed ${e4}`,b.style.borderLeft="none",b.style.borderRight="none"),w&&(w.textContent=`${Math.round(O.size)}`)}};return u=requestAnimationFrame(f),()=>cancelAnimationFrame(u)}),p.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[Array.from({length:Hte},(u,f)=>p.jsx("div",{ref:h=>{a.current[f]=h},style:{display:"none",position:"absolute",backgroundColor:zte,zIndex:50}},`guide-${f}`)),Array.from({length:Qte},(u,f)=>p.jsx("div",{ref:h=>{o.current[f]=h},style:{display:"none",position:"absolute",zIndex:50},children:p.jsx("span",{ref:h=>{l.current[f]=h},style:{fontSize:"10px",fontFamily:"monospace",color:zte,backgroundColor:Axt,padding:"0 3px",borderRadius:"2px",lineHeight:"14px",whiteSpace:"nowrap"}})},`spacing-${f}`))]})}),wxt=x.memo(function({visible:e,spacing:n,scaleX:r,scaleY:i,compositionLeft:s,compositionTop:a,compositionWidth:o,compositionHeight:l}){if(!e||n<=0)return null;const c=n*r,u=n*i;return c<4||u<4?null:p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute",style:{left:s,top:a,width:o,height:l,backgroundImage:[`repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${c}px)`,`repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${u}px)`].join(", "),backgroundSize:`${c}px ${u}px`}})}),Zte=12,Gte=32;function Oxt(t,e){const n=e.left+e.width/2,r=e.top+e.height/2;return t==="top"?{left:n,top:e.top,transform:"translate(-50%, -100%)"}:t==="bottom"?{left:n,top:e.top+e.height,transform:"translate(-50%, 0)"}:t==="left"?{left:e.left,top:r,transform:"translate(-100%, -50%)"}:{left:e.left+e.width,top:r,transform:"translate(0, -50%)"}}const Cxt=["top","right","bottom","left"];function kxt(t){return{hitWidth:t?Zte:Gte,hitHeight:t?Gte:Zte,cursor:t?"ew-resize":"ns-resize",pillWidth:t?4:24,pillHeight:t?24:4}}function Ext({selection:t,overlayRect:e,onStyleCommit:n}){const r=x.useRef(null),[i,s]=x.useState(!1),[a,o]=x.useState(null),l=N=>{const I=Ek(N),{radius:_,...j}=I??{top:0,right:0,bottom:0,left:0,radius:0};return{element:N,croppable:I!==null,insets:j,radius:_}},[c,u]=x.useState(()=>l(t.element));c.element!==t.element&&u(l(t.element));const f=c.insets.top>0||c.insets.right>0||c.insets.bottom>0||c.insets.left>0,h=x.useRef(!1),m=x.useRef(""),y=x.useRef(null);x.useEffect(()=>{const N=t.element;if(Ek(N)!==null)return m.current=N.style.getPropertyValue("clip-path"),y.current=null,N.style.setProperty("clip-path","none"),h.current=!0,()=>{h.current=!1;const I=y.current,_=I!==null?I||null:m.current||null;_?N.style.setProperty("clip-path",_):N.style.removeProperty("clip-path")}},[t.element]);const d=Qgt(t.element,e),v=d.width/d.scaleX,b=d.height/d.scaleY,w=fve({left:0,top:0,width:d.width,height:d.height},c.insets,d.scaleX,d.scaleY),O=(N,I)=>{n&&(I.preventDefault(),I.stopPropagation(),I.currentTarget.setPointerCapture(I.pointerId),r.current={edge:N,pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,startInsets:c.insets,didMove:!1,angleDeg:d.angleDeg,scaleX:d.scaleX,scaleY:d.scaleY},s(!0))},k=N=>{const I=r.current;if(!I||I.pointerId!==N.pointerId)return;N.preventDefault(),N.stopPropagation();const _=zgt(N.clientX-I.startX,N.clientY-I.startY,I.angleDeg),j={startInsets:I.startInsets,deltaX:_.deltaX,deltaY:_.deltaY,scaleX:I.scaleX,scaleY:I.scaleY},L=I.edge==="move"?Lgt(j):jgt({...j,edge:I.edge,width:v,height:b});I.didMove=!0,u(B=>({...B,insets:L}))},E=N=>{const I=r.current;if(!I||I.pointerId!==N.pointerId||(N.preventDefault(),N.stopPropagation(),r.current=null,s(!1),!I.didMove))return;const _=t.element,j=()=>{h.current&&_.style.setProperty("clip-path","none")},L=sV(c.insets,c.radius),B=c.insets.top>0||c.insets.right>0||c.insets.bottom>0||c.insets.left>0,$=n==null?void 0:n("clip-path",L);j(),Promise.resolve($).then(()=>{y.current=B?L:""},j)},M=N=>{const I=r.current;!I||I.pointerId!==N.pointerId||(N.preventDefault(),N.stopPropagation(),r.current=null,s(!1),u(_=>({..._,insets:I.startInsets})))};return c.croppable?p.jsxs("div",{"data-dom-edit-crop-frame":"true",className:"pointer-events-none absolute",style:{left:d.left,top:d.top,width:d.width,height:d.height,transform:d.angleDeg!==0?`rotate(${d.angleDeg}deg)`:void 0},children:[f&&p.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:p.jsx("div",{className:"absolute",style:{left:w.left,top:w.top,width:w.width,height:w.height,boxShadow:"0 0 0 100000px rgba(8, 8, 12, 0.6)"}})}),p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute border border-dashed border-studio-accent",style:{left:w.left,top:w.top,width:w.width,height:w.height},children:i&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"absolute inset-y-0 left-1/3 w-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-y-0 left-2/3 w-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-x-0 top-1/3 h-px bg-studio-accent/40"}),p.jsx("div",{className:"absolute inset-x-0 top-2/3 h-px bg-studio-accent/40"})]})}),f&&p.jsx("button",{type:"button","aria-label":"Reposition crop",title:"Reposition crop","data-dom-edit-crop-handle":"true",className:"pointer-events-auto absolute rounded-full border-2 border-studio-accent bg-studio-accent/30 shadow-[0_0_0_1px_rgba(0,0,0,0.4)]",style:{left:w.left+w.width/2,top:w.top+w.height/2,width:22,height:22,transform:"translate(-50%, -50%)",cursor:"move",touchAction:"none"},onPointerDown:N=>O("move",N),onPointerMove:k,onPointerUp:E,onPointerCancel:M}),Cxt.map(N=>{const I=N==="left"||N==="right",_=Oxt(N,w),j=i||f||a===N,L=kxt(I);return p.jsx("button",{type:"button","aria-label":`Crop ${N}`,title:"Crop","data-dom-edit-crop-handle":"true",className:"pointer-events-auto absolute flex items-center justify-center border-0 bg-transparent p-0",style:{left:_.left,top:_.top,width:L.hitWidth,height:L.hitHeight,transform:_.transform,cursor:L.cursor,touchAction:"none"},onPointerEnter:()=>o(N),onPointerLeave:()=>o(B=>B===N?null:B),onPointerDown:B=>O(N,B),onPointerMove:k,onPointerUp:E,onPointerCancel:M,children:p.jsx("span",{className:"pointer-events-none rounded-full bg-studio-accent/90 shadow-[0_0_0_1px_rgba(0,0,0,0.4)] transition-opacity duration-100",style:{width:L.pillWidth,height:L.pillHeight,opacity:j?1:0}})},N)})]}):null}function Txt({overlayRect:t,cropOutlineInsetPx:e,onStartRotate:n}){const r=e??{right:0,bottom:0,left:0},i=t.left+r.left,s=Math.max(0,t.width-r.left-r.right),a=t.top+t.height-r.bottom;return p.jsx("button",{type:"button",className:"pointer-events-auto absolute flex items-center justify-center border-0 bg-transparent p-0",style:{left:i+s/2,top:a+12,width:22,height:22,transform:"translateX(-50%)",touchAction:"none",cursor:"grabbing"},title:"Rotate","aria-label":"Rotate selection",onPointerDown:n,children:p.jsx("span",{className:"pointer-events-none flex h-[18px] w-[18px] items-center justify-center rounded-full border border-studio-accent/70 bg-studio-surface text-studio-accent shadow-[0_0_3px_rgba(0,0,0,0.45)]",children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),p.jsx("path",{d:"M21 3v5h-5"}),p.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),p.jsx("path",{d:"M8 16H3v5"})]})})})}const Pxt=[{handle:"nw",cursor:"nwse-resize",x:"left",y:"top"},{handle:"ne",cursor:"nesw-resize",x:"right",y:"top"},{handle:"sw",cursor:"nesw-resize",x:"left",y:"bottom"},{handle:"se",cursor:"nwse-resize",x:"right",y:"bottom"}],Mxt=16,Nxt={top:0,right:0,bottom:0,left:0};function Dxt(t,e,n){const r=Mxt/2,i=n??Nxt,s={cursor:t.cursor,touchAction:"none"};return s.left=t.x==="left"?e.left+i.left-r:e.left+e.width-i.right-r,s.top=t.y==="top"?e.top+i.top-r:e.top+e.height-i.bottom-r,s}function Ixt({groupOverlayItems:t,groupBounds:e,allowCanvasMovement:n,groupCanMove:r,gestures:i,onBoxMouseDown:s,onBoxClick:a}){return p.jsxs(p.Fragment,{children:[t.map(o=>p.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-xl border border-studio-accent/70",style:{left:o.rect.left,top:o.rect.top,width:o.rect.width,height:o.rect.height}},o.key)),p.jsx("div",{"data-dom-edit-selection-box":"true",className:"pointer-events-auto absolute rounded-xl border border-studio-accent shadow-[0_0_0_1px_rgba(60,230,172,0.3)]",style:{left:e.left,top:e.top,width:e.width,height:e.height,cursor:n&&r?"move":"default"},onPointerDown:o=>{!n||!r||o.shiftKey||i.startGroupDrag(o)},onMouseDown:s,onClick:a})]})}function _xt({selection:t,overlayRect:e,allowCanvasMovement:n,cropOutlineInsetPx:r,boxRef:i,boxChromeClass:s,boxClipPath:a,selectionKey:o,groupSelectionCount:l,blockedMoveRef:c,gestures:u,onStyleCommit:f,onBoxMouseDown:h,onBoxClick:m,inlineText:y}){const d=(y==null?void 0:y.editing)??!1;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"pointer-events-none absolute inset-0",style:{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,transform:e.angle?`rotate(${e.angle}deg)`:void 0},children:[n&&!d&&t.capabilities.canApplyManualRotation&&p.jsx(Txt,{overlayRect:e,cropOutlineInsetPx:r,onStartRotate:v=>{v.stopPropagation(),u.startGesture("rotate",v)}}),p.jsx("div",{ref:i,"data-dom-edit-selection-box":"true",className:`${d?"pointer-events-none":"pointer-events-auto"} absolute rounded-md ${s}`,style:{left:e.left,top:e.top,width:e.width,height:e.height,clipPath:a,cursor:n&&t.capabilities.canApplyManualOffset?"move":"default"},onPointerDown:v=>{if(y!=null&&y.startFromPress(v)){v.preventDefault(),v.stopPropagation();return}if(!(!n||v.shiftKey)){if(t.capabilities.canApplyManualOffset){u.startGesture("drag",v);return}v.preventDefault(),v.stopPropagation(),v.currentTarget.setPointerCapture(v.pointerId),c.current={pointerId:v.pointerId,startX:v.clientX,startY:v.clientY,notified:!1}}},onMouseDown:h,onClick:m,children:r&&p.jsx("div",{className:"pointer-events-none absolute rounded-md border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{left:r.left,top:r.top,right:r.right,bottom:r.bottom}})},o),n&&!d&&t.capabilities.canApplyManualSize&&Pxt.map(v=>v.handle!=="se"&&!t.capabilities.canApplyManualOffset?null:p.jsx("div",{className:"pointer-events-auto absolute flex h-4 w-4 items-center justify-center",style:{...Dxt(v,e,r??void 0),cursor:Vyt(v.handle,e.angle??0)},onPointerDown:b=>{b.stopPropagation(),u.startGesture("resize",b,{resizeHandle:v.handle})},children:p.jsx("div",{className:"pointer-events-none h-[12px] w-[12px] rounded-full border-[1.5px] border-studio-accent bg-white shadow-[0_0_3px_rgba(0,0,0,0.45)]"})},v.handle))]}),t.capabilities.canCrop&&!d&&l<=1&&p.jsx(Ext,{selection:t,overlayRect:e,onStyleCommit:f})]})}function Rxt(t){const{selection:e,overlayRect:n}=t,r=e?Ek(e.element):null,i=!!(r&&(r.top>0||r.right>0||r.bottom>0||r.left>0)),s=n&&n.editScaleX>0?n.editScaleX:1,a=n&&n.editScaleY>0?n.editScaleY:1,o=r&&i?{top:r.top*a,right:r.right*s,bottom:r.bottom*a,left:r.left*s}:void 0;return{hasCropInsets:i,cropOutlineInsetPx:o}}function jxt(t){const e={borderRadius:8,clipPath:void 0};if(!(t!=null&&t.element))return e;try{const n=t.element.tagName.toLowerCase();if(n==="svg"||n==="img"||n==="video"||n==="canvas")return e;const r=t.element.ownerDocument.defaultView;if(!r)return e;const i=r.getComputedStyle(t.element),s=i.borderRadius,a=i.clipPath;return{borderRadius:s&&s!=="0px"?s:4,clipPath:a&&a!=="none"?a:void 0}}catch{return e}}function Lxt(t,e){return t?"":e?"shadow-[inset_0_0_0_2px_rgba(60,230,172,0.6)]":"border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]"}function Fxt(t,e){const n=r=>Math.abs(t[r]-e[r]);return n("left")<.5&&n("top")<.5&&n("width")<.5&&n("height")<.5&&n("scaleX")<.001&&n("scaleY")<.001}function $xt({iframeRef:t,overlayRef:e}){const[n,r]=x.useState({left:0,top:0,width:0,height:0,scaleX:1,scaleY:1});return wr(()=>{let i=0;const s=()=>{i=requestAnimationFrame(s);const a=t.current,o=e.current;if(!a||!o)return;const l=a.getBoundingClientRect(),c=o.getBoundingClientRect(),u=l.left-c.left,f=l.top-c.top;if(l.width<=0||l.height<=0)return;const h=a.contentDocument,m=(h==null?void 0:h.querySelector("[data-composition-id]"))??(h==null?void 0:h.documentElement),y=Number.parseFloat((m==null?void 0:m.getAttribute("data-width"))??""),d=Number.parseFloat((m==null?void 0:m.getAttribute("data-height"))??""),v=y>0?l.width/y:1,b=d>0?l.height/d:1,w={left:u,top:f,width:l.width,height:l.height,scaleX:v,scaleY:b};r(O=>Fxt(O,w)?O:w)};return i=requestAnimationFrame(s),()=>cancelAnimationFrame(i)}),n}function bb(t){return Math.round(t*100)/100}function Bxt(t){return t.map(e=>`${e.key}:${bb(e.left)},${bb(e.top)},${bb(e.width)},${bb(e.height)},${bb(e.angle??0)}`).join("|")}function Vxt(t,e){const n=(t.angle??0)*Math.PI/180,r=(Math.abs(Math.cos(n))*t.width+Math.abs(Math.sin(n))*t.height)/2,i=(Math.abs(Math.sin(n))*t.width+Math.abs(Math.cos(n))*t.height)/2,s=t.left+t.width/2,a=t.top+t.height/2;return s-r<e.left||s+r>e.left+e.width||a-i<e.top||a+i>e.top+e.height}function Hxt(t,e,n,r,i,s,a,o){if(r.width<=0||!n){s.current="",a.current=new Map,o([]);return}const l=n.querySelector("[data-composition-id]")??n.body,u=A3(l,{activeCompositionPath:i??"index.html"}),f=[],h=new Map;for(const y of u){if(!by(y.element))continue;const d=f7(e,t,y.element),v=d?{...d,...Qy(d,y.element)}:null;v&&Vxt(v,r)&&(f.push({key:y.key,left:v.left,top:v.top,width:v.width,height:v.height,angle:v.angle}),h.set(y.key,y.element))}const m=Bxt(f);m!==s.current&&(s.current=m,a.current=h,o(f))}function Qxt(t){return`${Math.round(t.left)}:${Math.round(t.top)}:${Math.round(t.width)}:${Math.round(t.height)}`}function zxt(t){t.dirtyRef.current=!1,t.sigRef.current="",t.elementsRef.current=new Map,t.setRects([])}function Zxt(t,e){var i;const n=((i=t.defaultView)==null?void 0:i.MutationObserver)??globalThis.MutationObserver;if(!n)return null;const r=new n(e);return r.observe(t.documentElement,{attributes:!0,attributeFilter:["style","class","transform","width","height","data-hidden"],childList:!0,subtree:!0}),r}const Gxt=100;function Uxt(t,e,n){return t&&n-e>=Gxt}function Xxt(t){let e=0,n="",r=Number.NEGATIVE_INFINITY;const i=()=>{t.dirtyRef.current=!0},s=o=>{var l;(l=t.observerRef.current)==null||l.disconnect(),t.observerRef.current=o!=null&&o.documentElement?Zxt(o,i):null,t.observedDocRef.current=o,t.sigRef.current=""},a=()=>{e=requestAnimationFrame(a);const o=t.iframeRef.current,l=t.overlayRef.current,c=(o==null?void 0:o.contentDocument)??null;c!==t.observedDocRef.current&&(s(c),i());const u=t.compRectRef.current,f=Qxt(u);if(f!==n&&(n=f,i()),!o||!l){t.dirtyRef.current&&zxt(t);return}const h=performance.now();Uxt(t.dirtyRef.current,r,h)&&(r=h,t.dirtyRef.current=!1,Hxt(o,l,c,u,t.activeCompositionPathRef.current,t.sigRef,t.elementsRef,t.setRects))};return e=requestAnimationFrame(a),()=>{var o;cancelAnimationFrame(e),(o=t.observerRef.current)==null||o.disconnect(),t.observerRef.current=null,t.observedDocRef.current=null}}const Wxt={"bring-forward":["M3 11 L8 8.5 L13 11 L8 13.5 Z","M8 8.5 L8 2","M5.5 4.5 L8 2 L10.5 4.5"],"send-backward":["M3 5 L8 2.5 L13 5 L8 7.5 Z","M8 7.5 L8 14","M5.5 11.5 L8 14 L10.5 11.5"],"bring-to-front":["M3 9.5 L8 7 L13 9.5 L8 12 Z","M3 12.5 L8 10 L13 12.5 L8 15 Z","M8 12.5 L8 2","M5.5 4.5 L8 2 L10.5 4.5"],"send-to-back":["M3 4 L8 1.5 L13 4 L8 6.5 Z","M3 7 L8 4.5 L13 7 L8 9.5 Z","M8 3.5 L8 14","M5.5 11.5 L8 14 L10.5 11.5"]};function qxt({action:t}){return p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 shrink-0","aria-hidden":"true",children:Wxt[t].map(e=>p.jsx("path",{d:e},e))})}const Ute=[{action:"bring-to-front",label:"Bring to front"},{action:"bring-forward",label:"Bring forward"},{action:"send-backward",label:"Send backward"},{action:"send-to-back",label:"Send to back"}],Yxt=x.memo(function({x:e,y:n,selection:r,onClose:i,onApplyZIndex:s,onZOrderCrossed:a,onDelete:o}){const l=F0(i),c=!!s,u=!!o,f=c&&u,h=200,m=8+(c?Ute.length*28:0)+(f?1:0)+(u?28:0)+8,y=n+m-window.innerHeight,d=e+h>window.innerWidth?e-h:e,v=y>0?n-y-8:n,b=r.element;function w(E){if(!s)return;const M=Bhe(b,E);if(M===null)return;const N=l$e(b,E);s(M,E,N),N&&a&&a(N,E),i()}function O(){o&&(o(r),i())}if(!c&&!u)return null;const k=E=>{E.stopPropagation()};return Fl.createPortal(p.jsxs("div",{ref:l,className:"fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:d,top:v},onPointerDown:k,onMouseDown:k,onClick:k,onContextMenu:E=>{E.preventDefault(),E.stopPropagation()},children:[c&&Ute.map(({action:E,label:M})=>{const N=c$e(b,E);return p.jsxs("button",{type:"button",className:`w-full flex items-center px-3 py-1.5 text-xs text-left ${N?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!N,onPointerDown:I=>{I.button===0&&(I.preventDefault(),I.stopPropagation(),N&&w(E))},children:[p.jsx(qxt,{action:E}),p.jsx("span",{children:M})]},E)}),f&&p.jsx("div",{className:"my-1 border-t border-neutral-700/60"}),u&&p.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onPointerDown:E=>{E.button===0&&(E.preventDefault(),E.stopPropagation(),O())},children:[p.jsx("span",{children:"Delete"}),p.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]}),document.body)}),Kxt={B:{"font-weight":"700"},STRONG:{"font-weight":"700"},I:{"font-style":"italic"},EM:{"font-style":"italic"},U:{"text-decoration-line":"underline"}},Eve="\0";function Jxt(t,e){if(t.collapsed)return;const n=Mve(t.startContainer);if(!n||!Tve(n,t))return;const r=Nve(n),i=tbt(r,_k(n,t.startContainer,t.startOffset),_k(n,t.endContainer,t.endOffset));if(!i)return;const s=cbt(r,i.start,i.end,e);pbt(n,s),ebt(n),Abt(n,i.start,i.end)}function ebt(t){const e=t.ownerDocument.defaultView;if(e!=null&&e.getComputedStyle)for(const n of t.querySelectorAll("span")){if(!n.style.color)continue;n.style.getPropertyValue("-webkit-text-fill-color")===n.style.color&&n.style.removeProperty("-webkit-text-fill-color");const i=e.getComputedStyle(n),s=i.webkitTextFillColor;!s||!i.color||s!==i.color&&n.style.setProperty("-webkit-text-fill-color",n.style.color)}}function tbt(t,e,n){if(e===null||n===null||e>=n)return null;const r=t.map(a=>a.text).join(""),i=new Intl.Segmenter(void 0,{granularity:"grapheme"}),s=[0,...Array.from(i.segment(r),nbt)];return{start:rbt(s,e),end:s.find(a=>a>=n)??n}}function nbt({index:t,segment:e}){return t+e.length}function rbt(t,e){let n=e;for(const r of t){if(r>e)return n;n=r}return n}function Tve(t,e){return t.contains(e.startContainer)&&t.contains(e.endContainer)}function Pve(t){const e=Mve(t.startContainer);if(!e||!Tve(e,t))return null;const n=_k(e,t.startContainer,t.startOffset),r=_k(e,t.endContainer,t.endOffset);if(n===null||r===null)return null;const i=n===r,s=Dve(Nve(e)).slice(i?Math.max(0,n-1):n,i?Math.max(1,n):r).map(a=>({char:a.char,style:a.style}));return s.length>0?s:null}function Mve(t){var r;let e=t.nodeType===1?t:t.parentElement;const n=e==null?void 0:e.closest("[contenteditable]");if(n)return((r=n.getAttribute("contenteditable"))==null?void 0:r.toLowerCase())==="false"?null:n;for(;e!=null&&e.parentElement&&L$(e.tagName);)e=e.parentElement;return e}function Nve(t){const e=[],n=Array.from(t.childNodes,r=>({node:r,inherited:{},origin:null})).reverse();for(let r=n.pop();r;r=n.pop())n.push(...ibt(r,e));return e}function ibt(t,e){const{node:n,inherited:r,origin:i}=t;if(n.nodeType===3){const a=n.textContent??"";return a&&e.push(Xte(a,r,i)),[]}if(!sbt(n))return[];const s=n;return s.tagName==="BR"?(e.push(Xte(Eve,r,i)),[]):abt(s,r,i)}function sbt(t){return t.nodeType===1&&"style"in t}function Xte(t,e,n){return{text:t,style:e,origin:n,identity:obt(n)}}function abt(t,e,n){const r=L$(t.tagName),i=r?{...e,...Kxt[t.tagName],...lbt(t)}:e,s=r&&!n&&pV(t).size>0?t:n;return Array.from(t.childNodes,a=>({node:a,inherited:i,origin:s})).reverse()}function obt(t){return t?JSON.stringify([...pV(t)].sort(([e],[n])=>e<n?-1:1)):""}function lbt(t){const e={};for(let n=0;n<t.style.length;n+=1){const r=t.style.item(n);if(!r)continue;const i=t.style.getPropertyValue(r);Yme(r,i)&&(e[r]=i)}return e}function Dve(t){const e=[];for(const n of t)for(let r=0;r<n.text.length;r+=1)e.push({char:n.text[r]??"",style:n.style,origin:n.origin,identity:n.identity});return e}function cbt(t,e,n,r){const i=t.map(o=>o.text).join(""),s=Dve(t),a=[];for(let o=0;o<i.length;o+=1)fbt(a,i[o]??"",ubt(s[o],o>=e&&o<n,r));return a}function ubt(t,e,n){const r=(t==null?void 0:t.style)??{};return{style:e?hbt(r,n):r,origin:(t==null?void 0:t.origin)??null,identity:(t==null?void 0:t.identity)??""}}function fbt(t,e,n){const r=t[t.length-1];if(r&&r.identity===n.identity&&dbt(r.style,n.style)){r.text+=e;return}t.push({text:e,...n})}function hbt(t,e){const n={...t};for(const[r,i]of Object.entries(e))i===null?delete n[r]:n[r]=i;return n}function dbt(t,e){return h7(t)===h7(e)}function h7(t){return Object.keys(t).sort().map(e=>`${e}: ${t[e]}`).join("; ")}function pbt(t,e){const n=t.ownerDocument,r=mbt(n,e);if(t.replaceChildren(),r.length>1&&bbt(t)){const i=n.createElement("span");i.append(...r),t.append(i);return}t.append(...r)}function mbt(t,e){const n=[],r=new Set;for(const i of e){const s=i.origin&&!r.has(i.origin)?pV(i.origin):new Map;s.size>0&&i.origin&&r.add(i.origin),n.push(...gbt(t,i,s))}return n}function gbt(t,e,n){const r=h7(e.style),i=[];for(const[s,a]of e.text.split(Eve).entries()){if(s>0&&i.push(t.createElement("br")),!a)continue;if(!r&&n.size===0){i.push(t.createTextNode(a));continue}const o=t.createElement("span");for(const[l,c]of n)o.setAttribute(l,c);r&&o.setAttribute("style",r),o.textContent=a,i.push(o),n.clear()}return i}const ybt="data-hf-id";function pV(t){const e=new Map;for(const n of t.getAttributeNames()){if(n==="style"||n===ybt)continue;const r=t.getAttribute(n)??"";qme(n,r)&&e.set(n,r)}return e}const xbt=new Set(["flex","inline-flex","grid","inline-grid","-webkit-box","-webkit-inline-box"]);function bbt(t){const e=t.ownerDocument.defaultView;return e?xbt.has(e.getComputedStyle(t).display):!1}function _k(t,e,n){if(e===t)return Array.from(t.childNodes).slice(0,n).reduce((a,o)=>a+vbt(o),0);let r=0;const i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let s=i.nextNode();for(;s;){if(s===e)return r+n;r+=Ive(s),s=i.nextNode()}return null}function Ive(t){return t.nodeType===3?(t.textContent??"").length:_ve(t)==="BR"?1:0}function vbt(t){let e=0;const n=[t];for(let r=n.pop();r;r=n.pop())e+=Ive(r),n.push(...Array.from(r.childNodes));return e}function _ve(t){return t.nodeType===1?t.tagName:""}function Abt(t,e,n){var l;const r=t.ownerDocument,i=(l=r.defaultView)==null?void 0:l.getSelection(),s=Wte(t,e),a=Wte(t,n);if(!i||!s||!a)return;const o=r.createRange();o.setStart(s.node,s.offset),o.setEnd(a.node,a.offset),i.removeAllRanges(),i.addRange(o)}function Wte(t,e){let n=0;const r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let i=r.nextNode(),s=null;for(;i;){if(i.nodeType!==3){_ve(i)==="BR"&&(n+=1),i=r.nextNode();continue}const a=(i.textContent??"").length;if(n+a>=e)return{node:i,offset:e-n};n+=a,s=i,i=r.nextNode()}return s?{node:s,offset:(s.textContent??"").length}:{node:t,offset:0}}function Sbt(t,e){var i;const n=Pve(t);if(!n)return{};const r={};for(const s of e){const a=(i=n[0])==null?void 0:i.style[s];a!==void 0&&n.every(({style:o})=>o[s]===a)&&(r[s]=a)}return r}function wbt(t,e){const n=Pve(t);if(!n)return[];const r=new Set,i=[];for(const{char:s,style:a}of n){if(!s.trim())continue;const o=a[e];o===void 0||r.has(o)||(r.add(o),i.push(o))}return i}function Wo(t){return Math.max(0,Math.min(255,Math.round(t)))}function mV(t){return Math.max(0,Math.min(1,t))}function _D(t){return Wo(t).toString(16).padStart(2,"0")}function Obt(t){return`${ba(mV(t))}`}function zA(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="transparent")return{red:0,green:0,blue:0,alpha:0};const n=e.match(/^#([0-9a-f]{3})$/i);if(n){const[s,a,o]=n[1].split("");return{red:Number.parseInt(s+s,16),green:Number.parseInt(a+a,16),blue:Number.parseInt(o+o,16),alpha:1}}const r=e.match(/^#([0-9a-f]{6})$/i);if(r)return{red:Number.parseInt(r[1].slice(0,2),16),green:Number.parseInt(r[1].slice(2,4),16),blue:Number.parseInt(r[1].slice(4,6),16),alpha:1};const i=e.match(/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i);return i?{red:Wo(Number.parseFloat(i[1])),green:Wo(Number.parseFloat(i[2])),blue:Wo(Number.parseFloat(i[3])),alpha:mV(i[4]!=null?Number.parseFloat(i[4]):1)}:null}function kv(t){return`#${_D(t.red)}${_D(t.green)}${_D(t.blue)}`}function t1(t){const e=Wo(t.red),n=Wo(t.green),r=Wo(t.blue),i=mV(t.alpha);return i>=1?`rgb(${e}, ${n}, ${r})`:`rgba(${e}, ${n}, ${r}, ${Obt(i)})`}function Cbt(t){const e=Wo(t.red)/255,n=Wo(t.green)/255,r=Wo(t.blue)/255,i=Math.max(e,n,r),s=Math.min(e,n,r),a=i-s;let o=0;return a!==0&&(i===e?o=60*((n-r)/a%6):i===n?o=60*((r-e)/a+2):o=60*((e-n)/a+4)),o<0&&(o+=360),{hue:o,saturation:i===0?0:a/i,value:i}}function qte(t){const e=(t.hue%360+360)%360/60,n=Math.max(0,Math.min(1,t.saturation)),r=Math.max(0,Math.min(1,t.value)),i=r*n,s=i*(1-Math.abs(e%2-1)),a=r-i;let o=0,l=0,c=0;return e>=0&&e<1?(o=i,l=s):e>=1&&e<2?(o=s,l=i):e>=2&&e<3?(l=i,c=s):e>=3&&e<4?(l=s,c=i):e>=4&&e<5?(o=s,c=i):(o=i,c=s),{red:Wo((o+a)*255),green:Wo((l+a)*255),blue:Wo((c+a)*255)}}const kbt=["color","font-weight","font-style","text-decoration-line"],Yte=10,Ebt=34,g1="#ffffff";function Tbt({session:t,iframe:e}){const[n,r]=x.useState(null),i=x.useCallback(()=>{r(t&&e?Mbt(t.element,e):null)},[t,e]);x.useEffect(()=>{const o=t==null?void 0:t.element.ownerDocument;if(!o){r(null);return}return o.addEventListener("selectionchange",i),()=>o.removeEventListener("selectionchange",i)},[t,i]);const s=x.useCallback(o=>{var f;const l=t==null?void 0:t.element.ownerDocument,c=(f=l==null?void 0:l.defaultView)==null?void 0:f.getSelection();if(!c||c.rangeCount===0)return;const u=c.getRangeAt(0);Jxt(u,o),i()},[t,i]);if(!n)return null;const a=n.styles;return p.jsxs("div",{"data-inline-text-toolbar":"true",role:"toolbar","aria-label":"Text formatting",className:"pointer-events-auto fixed z-[200] flex items-center gap-1 rounded-lg border border-white/10 bg-[#15171c] p-1 shadow-[0_8px_24px_rgba(0,0,0,0.55)]",style:{left:n.left,top:n.top,transform:`translate(-50%, ${n.placeBelow?"0":"-100%"})`},onPointerDown:Kte,onMouseDown:Kte,onClick:o=>o.stopPropagation(),children:[p.jsxs("label",{className:"group relative flex h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-white/10",title:"Text colour",children:[p.jsx("span",{"aria-hidden":"true",className:"h-4 w-4 rounded-full border-2 border-white/25 transition-transform duration-150 group-hover:scale-110 group-active:scale-95",style:{background:Pbt(n.colours,a.color),backgroundOrigin:"border-box"}}),p.jsx("input",{type:"color","aria-label":"Text colour",className:"absolute inset-0 h-full w-full min-w-0 cursor-pointer opacity-0",value:n.pickerColour,onChange:o=>s({color:o.target.value})})]}),p.jsx(RD,{label:"Bold",glyph:"B",bold:!0,on:Nbt(a["font-weight"]),onToggle:o=>s({"font-weight":o?"700":null})}),p.jsx(RD,{label:"Italic",glyph:"I",italic:!0,on:a["font-style"]==="italic",onToggle:o=>s({"font-style":o?"italic":null})}),p.jsx(RD,{label:"Underline",glyph:"U",underline:!0,on:a["text-decoration-line"]==="underline",onToggle:o=>s({"text-decoration-line":o?"underline":null})})]})}function Pbt(t,e){return t.length===0?e||g1:t.length===1?t[0]:`linear-gradient(135deg, ${t.map((r,i)=>`${r} ${(i/(t.length-1)*100).toFixed(2)}%`).join(", ")})`}function Kte(t){t.preventDefault(),t.stopPropagation()}function RD({label:t,glyph:e,on:n,onToggle:r,bold:i,italic:s,underline:a}){return p.jsx("button",{type:"button",title:t,"aria-label":t,"aria-pressed":n,className:`flex h-6 w-6 items-center justify-center rounded-md text-xs ${n?"bg-studio-accent/20 text-studio-accent":"text-white/70 hover:bg-white/10"}`,style:{fontWeight:i?700:400,fontStyle:s?"italic":"normal",textDecoration:a?"underline":"none"},onClick:()=>r(!n),children:e})}function Mbt(t,e){const n=t.ownerDocument,r=n.defaultView,i=r==null?void 0:r.getSelection();if(!r||!i||i.rangeCount===0||i.isCollapsed)return null;const s=i.getRangeAt(0);if(!t.contains(s.commonAncestorContainer))return null;const a=s.getBoundingClientRect(),o=e.getBoundingClientRect(),l=r.innerWidth?o.width/r.innerWidth:1,c=o.top+a.top*l-Yte,u=c<Ebt,f=Sbt(s,kbt),h=wbt(s,"color");return{left:o.left+(a.left+a.width/2)*l,top:u?o.top+(a.top+a.height)*l+Yte:c,placeBelow:u,styles:f,colours:h,pickerColour:Dbt(f.color??h[0],n)}}function Nbt(t){return t?t==="bold"||t==="bolder"?!0:Number.parseInt(t,10)>=600:!1}function Dbt(t,e){if(!t)return g1;const n=zA(t);if(n)return kv(n);try{const r=e.createElement("canvas").getContext("2d");if(!r)return g1;r.fillStyle=g1,r.fillStyle=t;const i=typeof r.fillStyle=="string"?zA(r.fillStyle):null;return i?kv(i):g1}catch{return g1}}const Ibt="true",_bt="2px solid #3CE6AC";function Rbt(t){var r;const e=(r=t.ownerDocument.defaultView)==null?void 0:r.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0);!t.contains(n.startContainer)&&!t.contains(n.endContainer)||e.removeAllRanges()}function jbt({onCommit:t,onPause:e}){const[n,r]=x.useState(null),i=x.useRef(null),s=x.useRef(null),a=x.useCallback(()=>{var f;const u=i.current;return u?(s.current!==null&&((f=u.element.ownerDocument.defaultView)==null||f.cancelAnimationFrame(s.current),s.current=null),i.current=null,r(null),u.element.isConnected&&(u.element.removeAttribute("contenteditable"),u.element.style.outline=u.outline,u.element.style.outlineOffset=u.outlineOffset,Rbt(u.element),u.element.blur()),u):null},[]),o=x.useCallback((u,f)=>{if(i.current)return!1;const h={element:u,original:u.innerHTML,outline:u.style.outline,outlineOffset:u.style.outlineOffset};u.style.outline=_bt,u.style.outlineOffset="2px",i.current=h,r(h),e==null||e(),u.setAttribute("contenteditable",Ibt);const m=u.ownerDocument.defaultView,y=m==null?void 0:m.requestAnimationFrame(()=>{var d;s.current=null,((d=i.current)==null?void 0:d.element)===u&&(u.focus({preventScroll:!0}),Lbt(u,f))});return s.current=y??null,!0},[e]),l=x.useCallback(()=>{const u=i.current;if(!u)return;xet(u.element);const f=u.element.innerHTML;a(),t({element:u.element,html:f,previousHtml:u.original})},[t,a]),c=x.useCallback(()=>{const u=i.current;u&&(u.element.isConnected&&(u.element.innerHTML=u.original),a())},[a]);return x.useEffect(()=>{const u=n==null?void 0:n.element;if(!u)return;const f=b=>{if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),l();return}b.key==="Escape"&&(b.preventDefault(),c())},h=()=>l(),m=b=>{b&&u.ownerDocument.execCommand("insertText",!1,b)},y=b=>{var w;b.preventDefault(),m(((w=b.clipboardData)==null?void 0:w.getData("text/plain"))??"")},d=b=>b.preventDefault(),v=b=>{var w;b.preventDefault(),m(((w=b.dataTransfer)==null?void 0:w.getData("text/plain"))??"")};return u.addEventListener("keydown",f),u.addEventListener("blur",h),u.addEventListener("paste",y),u.addEventListener("dragover",d),u.addEventListener("drop",v),()=>{u.removeEventListener("keydown",f),u.removeEventListener("blur",h),u.removeEventListener("paste",y),u.removeEventListener("dragover",d),u.removeEventListener("drop",v)}},[n,l,c]),x.useEffect(()=>()=>{a()},[a]),{session:n,start:o,commit:l,cancel:c}}function Lbt(t,e){var s;const n=t.ownerDocument,r=(s=n.defaultView)==null?void 0:s.getSelection();if(!r)return;const i=e?Fbt(n,e):null;if(i&&t.contains(i.startContainer)){r.removeAllRanges(),r.addRange(i);return}$bt(t)}function Fbt(t,e){var a;const n=t;if(typeof n.caretRangeFromPoint=="function")return n.caretRangeFromPoint(e.x,e.y);const r=t,i=(a=r.caretPositionFromPoint)==null?void 0:a.call(r,e.x,e.y);if(!i)return null;const s=t.createRange();return s.setStart(i.offsetNode,i.offset),s.collapse(!0),s}function $bt(t){var s,a;const e=t.ownerDocument,n=(s=e.defaultView)==null?void 0:s.getSelection();if(!n)return;const r=e.createRange(),i=t.lastChild;i&&i.nodeType===3?(r.setStart(i,((a=i.textContent)==null?void 0:a.length)??0),r.collapse(!0)):(r.selectNodeContents(t),r.collapse(!1)),n.removeAllRanges(),n.addRange(r)}function Bbt(t){var a;const e=yS(),n=jbt({onCommit:o=>void(e==null?void 0:e.handleDomRichTextCommit(o)),onPause:()=>fe.getState().setIsPlaying(!1)}),r=x.useRef(null),i=o=>{var c,u;const l=(c=e==null?void 0:e.previewIframeRef)==null?void 0:c.current;return l?NC(l,o.clientX,o.clientY,((u=t.current)==null?void 0:u.compositionPath)??null):null},s=o=>{var h;const l=(h=e==null?void 0:e.previewIframeRef)==null?void 0:h.current,c=l==null?void 0:l.contentWindow;if(!l||!(c!=null&&c.innerWidth))return;const u=l.getBoundingClientRect(),f=u.width/c.innerWidth||1;return{x:(o.clientX-u.left)/f,y:(o.clientY-u.top)/f}};return{editing:n.session!==null,toolbar:p.jsx(Tbt,{session:n.session,iframe:((a=e==null?void 0:e.previewIframeRef)==null?void 0:a.current)??null}),handleKeyDown:o=>{if(o.key!=="Enter"||o.shiftKey||o.ctrlKey||o.metaKey||o.altKey)return!1;const l=t.current;return n.session||!l||!Eet(l)?!1:n.start(l.element)},startFromPress:o=>{if(n.session)return!1;const l=i(o),c={x:o.clientX,y:o.clientY,at:Date.now(),element:l},u=Pet(r.current,c);return r.current=c,!u||!l||!F$(l)?!1:n.start(l,s(o))}}}const Vbt=x.memo(function({iframeRef:e,activeCompositionPath:n,selection:r,groupSelections:i=[],hoverSelection:s,allowCanvasMovement:a=!0,onCanvasMouseDown:o,onCanvasPointerMove:l,onCanvasPointerLeave:c,onSelectionChange:u,onBlockedMove:f,gridVisible:h=!1,gridSpacing:m=50,onManualDragStart:y,onPathOffsetCommit:d,onGroupPathOffsetCommit:v,onBoxSizeCommit:b,onRotationCommit:w,onStyleCommit:O,onMarqueeSelect:k,onDeleteSelection:E,onApplyZIndex:M}){const N=x.useRef(null),I=x.useRef(null),_=x.useRef(k);_.current=k;const j=jxt(r),L=x.useRef(null),B=x.useRef(null),$=x.useRef(null),Q=x.useRef(!1),Y=x.useRef(!1),W=x.useRef(!1),J=x.useRef(null),ne=x.useRef(!1),le=x.useRef(r);le.current=r;const{zOrderFlashRect:ie,handleZOrderCrossed:q}=syt({overlayRef:N,iframeRef:e}),F=x.useRef(n);F.current=n;const U=x.useRef(i);U.current=i;const Z=x.useRef(s);Z.current=s;const K=Bbt(le),ee=x.useRef(d);ee.current=d;const re=x.useRef(v);re.current=v;const z=x.useRef(b);z.current=b;const H=x.useRef(w);H.current=w;const se=x.useRef(O);se.current=O;const ue=x.useRef(f);ue.current=f;const be=x.useRef(y);be.current=y;const me=x.useRef(l);me.current=l;const pe=x.useRef(c);pe.current=c;const ge=x.useRef(u);ge.current=u;const{overlayRect:Pe,overlayRectRef:ve,setOverlayRect:xe,hoverRect:we,groupOverlayItems:Ce,groupOverlayItemsRef:Me,setGroupOverlayItems:Ve,childRects:tt}=xyt({iframeRef:e,overlayRef:N,selectionRef:le,activeCompositionPathRef:F,groupSelectionsRef:U,hoverSelectionRef:Z,rafPausedRef:ne}),Ze=$xt({iframeRef:e,overlayRef:N}),qe=x.useRef(Ze);qe.current=Ze;const{hasCropInsets:pt,cropOutlineInsetPx:it}=Rxt({selection:r,overlayRect:Pe}),vt=pt?void 0:j.clipPath,Ot=Lxt(!!it,vt),Kt=x.useRef(new Map),[qt,fn]=x.useState([]),Jt=x.useRef(!0),Je=x.useRef(""),St=x.useRef(null),At=x.useRef(null);wr(()=>Xxt({iframeRef:e,overlayRef:N,compRectRef:qe,activeCompositionPathRef:F,dirtyRef:Jt,sigRef:Je,observerRef:St,observedDocRef:At,elementsRef:Kt,setRects:fn})),x.useEffect(()=>{Jt.current=!0},[n]);const Ke=uxt({overlayRef:N,iframeRef:e,boxRef:I,selectionRef:le,hoverSelectionRef:Z,overlayRectRef:ve,groupOverlayItemsRef:Me,gestureRef:L,groupGestureRef:B,blockedMoveRef:$,rafPausedRef:ne,suppressNextBoxClickRef:Q,setOverlayRect:xe,setGroupOverlayItems:Ve,onBlockedMoveRef:ue,onManualDragStartRef:be,onPathOffsetCommitRef:ee,onGroupPathOffsetCommitRef:re,onBoxSizeCommitRef:z,onRotationCommitRef:H,onCanvasPointerMoveRef:me,onCanvasMouseDown:o,snapGuidesRef:J}),{flushNudge:Be}=vxt({selection:r,groupSelections:i,allowCanvasMovement:a,selectionRef:le,overlayRectRef:ve,groupOverlayItemsRef:Me,gestureRef:L,groupGestureRef:B,blockedMoveRef:$,onManualDragStartRef:be,onPathOffsetCommitRef:ee,onGroupPathOffsetCommitRef:re}),We=nyt({iframeRef:e,overlayRef:N,activeCompositionPathRef:F,onMarqueeSelectRef:_,selectionRef:le,gestures:Ke}),Ye=x.useMemo(()=>r?`${r.sourceFile}:${r.id??r.selector??r.label}:${r.selectorIndex??0}`:"none",[r]),Zt=x.useMemo(()=>fV(Ce.map(mt=>mt.rect)),[Ce]),Te=i.length>1,De=Te&&Ce.length>1&&Ce.every(mt=>mt.selection.capabilities.canApplyManualOffset),ze=mt=>{if(!a)return;if(W.current){pc("mousedown-suppressed",{shift:mt.shiftKey}),W.current=!1,Y.current=!1,Q.current=!1,mt.preventDefault(),mt.stopPropagation();return}const vn=mt.target,mn=!!(vn!=null&&vn.closest('[data-dom-edit-selection-box="true"]'));pc("mousedown",{shift:mt.shiftKey,onBox:mn}),!mn&&(o(mt,{hoverSelection:Z.current}),mt.shiftKey&&(Y.current=!0,Q.current=!0))},st=mt=>{if(!a||mt.button!==0)return;if(mt.shiftKey){const mn=e.current,En=hyt({cached:Z.current,elementAtPoint:mn?NC(mn,mt.clientX,mt.clientY,F.current):null});if(!En)return;mt.preventDefault(),mt.stopPropagation(),W.current=!0,Y.current=!0,Q.current=!0,ge.current(En,{additive:!0});return}if(K.startFromPress(mt)){mt.preventDefault(),mt.stopPropagation();return}const vn=mt.target;if(!(vn!=null&&vn.closest('[data-dom-edit-selection-box="true"]'))&&!Z.current&&_.current&&Ze.width>0){const mn=e.current;if(mn?NC(mn,mt.clientX,mt.clientY,F.current):null)return;const jn=N.current;if(jn){const et=jn.getBoundingClientRect();mt.preventDefault(),mt.stopPropagation(),W.current=!0,mt.currentTarget.setPointerCapture(mt.pointerId);const qn=mt.clientX-et.left,Mt=mt.clientY-et.top;We.marqueeRef.current={startX:qn,startY:Mt,currentX:qn,currentY:Mt,pointerId:mt.pointerId,pastThreshold:!1};return}}},Gt=mt=>{if(a&&!(L.current||B.current)){if(Q.current){Q.current=!1,mt.stopPropagation();return}o(mt,{hoverSelection:Z.current})}},ln=mt=>{Y.current&&(Y.current=!1,mt.preventDefault(),mt.stopPropagation())},{contextMenu:Yt,closeContextMenu:Mn,handleContextMenu:Pr}=oyt({selection:r,selectionRef:le,hoverSelectionRef:Z,onCanvasPointerMoveRef:me,onSelectionChangeRef:ge});return p.jsxs("div",{ref:N,className:`absolute inset-0 z-10 outline-none ${K.editing?"pointer-events-none":"pointer-events-auto"}`,"data-editing-text":K.editing?"true":void 0,tabIndex:-1,"aria-label":"Composition canvas",style:We.marqueeRect?{cursor:"crosshair"}:void 0,onPointerDownCapture:mt=>{Be(),K.editing||uyt(mt.currentTarget)},onKeyDown:mt=>{K.handleKeyDown(mt)&&(mt.preventDefault(),mt.stopPropagation())},onPointerDown:st,onMouseDown:ze,onPointerMove:We.onPointerMove,onPointerLeave:()=>pe.current(),onPointerUp:We.onPointerUp,onPointerCancel:We.onPointerCancel,onContextMenu:Pr,children:[s&&we&&Ze.width>0&&p.jsx("div",{"aria-hidden":"true","data-dom-edit-hover-box":"true",className:"pointer-events-none absolute rounded-md border border-studio-accent/80 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{...Qy(we,s.element),transform:we.angle?`rotate(${we.angle}deg)`:void 0}}),Te&&Ce.length>1&&Zt&&Ze.width>0&&p.jsx(Ixt,{groupOverlayItems:Ce,groupBounds:Zt,allowCanvasMovement:a,groupCanMove:De,gestures:Ke,onBoxMouseDown:ln,onBoxClick:Gt}),!Te&&r&&Pe&&Ze.width>0&&p.jsx(_xt,{inlineText:K,selection:r,overlayRect:Pe,allowCanvasMovement:a,cropOutlineInsetPx:it??void 0,boxRef:I,boxChromeClass:Ot,boxClipPath:vt,selectionKey:Ye,groupSelectionCount:i.length,blockedMoveRef:$,gestures:Ke,onStyleCommit:se.current,onBoxMouseDown:ln,onBoxClick:Gt}),p.jsx(Ayt,{rects:Ze.width>0?tt:[]}),K.toolbar,p.jsx(vyt,{rects:qt,elements:Kt,compRect:Ze,selection:r,groupSelections:i,activeCompositionPathRef:F,onSelectionChangeRef:ge}),p.jsx(ryt,{candidateRects:We.candidateRects,marqueeRect:We.marqueeRect}),Yt&&p.jsx(Yxt,{x:Yt.x,y:Yt.y,selection:Yt.sel,onClose:Mn,onDelete:E?mt=>{Mn(),E(mt)}:void 0,onApplyZIndex:M?(mt,vn,mn)=>{M(Yt.sel,mt,vn,mn)}:void 0,onZOrderCrossed:q}),p.jsx(ayt,{rect:ie}),p.jsx(wxt,{visible:h,spacing:m,scaleX:Ze.scaleX,scaleY:Ze.scaleY,compositionLeft:Ze.left,compositionTop:Ze.top,compositionWidth:Ze.width,compositionHeight:Ze.height}),p.jsx(Sxt,{snapGuidesRef:J,compositionLeft:Ze.left,compositionTop:Ze.top,compositionWidth:Ze.width,compositionHeight:Ze.height})]})});function Jte(t,e,n){if(n.length<2)return null;let r=null;for(let i=0;i<n.length-1;i++){const s=n[i],a=n[i+1],o=a.x-s.x,l=a.y-s.y,c=o*o+l*l,u=c===0?0:Math.max(0,Math.min(1,((t-s.x)*o+(e-s.y)*l)/c)),f=s.x+u*o,h=s.y+u*l,m=Math.hypot(t-f,e-h);(!r||m<r.dist)&&(r={x:f,y:h,segIndex:i,t:u,dist:m})}return r}function Hbt(t){if(!t)return null;const e=!!t.arcPath,n=[],r=a=>typeof a=="number"&&isFinite(a),i=t.keyframes.some(a=>r(a.properties.x)),s=t.keyframes.some(a=>r(a.properties.y));return!i&&!s||(t.keyframes.forEach((a,o)=>{i&&!r(a.properties.x)||s&&!r(a.properties.y)||n.push({x:i?a.properties.x:0,y:s?a.properties.y:0,ref:e?{type:"waypoint",index:o}:{type:"keyframe",pct:a.percentage}})}),n.length<2)?null:{kind:e?"arc":"linear",points:n.map(a=>`${a.x},${a.y}`).join(" "),nodes:n}}function ene(t){return t?Oc(t):null}function Qbt(t,e){var i;const n=s=>!s.hasUnresolvedKeyframes&&!s.hasUnresolvedSelector&&!s.provenance;if(e==="arc")return((i=t.find(s=>{var a;return((a=s.arcPath)==null?void 0:a.enabled)&&n(s)}))==null?void 0:i.id)??null;const r=t.find(s=>s.keyframes&&n(s)&&(s.propertyGroup==="position"||s.keyframes.keyframes.some(a=>"x"in a.properties||"y"in a.properties)));return(r==null?void 0:r.id)??null}const Ev="var(--hf-accent, #3CE6AC)";function zbt(t){const{cx:e,cy:n,r,interactive:i,removable:s,grabbing:a,selected:o}=t,l=e+r*1.8,c=n-r*1.8,u=r*.55,f=(o?r*1.5:r)*1.414;return p.jsxs("g",{onPointerEnter:t.onEnter,onPointerLeave:t.onLeave,children:[p.jsx("rect",{x:e-f/2,y:n-f/2,width:f,height:f,rx:f*.17,transform:`rotate(45 ${e} ${n})`,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke",style:{fill:Ev}}),i&&p.jsx("circle",{cx:e,cy:n,r:r*2.4,fill:"transparent",className:"pointer-events-auto",style:{cursor:a?"grabbing":"grab"},onPointerDown:t.onPointerDown,onPointerMove:t.onPointerMove,onPointerUp:t.onPointerUp,onPointerCancel:t.onPointerUp,onContextMenu:t.onContextMenu}),s&&p.jsxs("g",{className:"pointer-events-auto",style:{cursor:"pointer"},onPointerDown:t.onRemove,children:[p.jsx("circle",{cx:l,cy:c,r:r*1.3,stroke:"#0b0f1a",strokeWidth:1,vectorEffect:"non-scaling-stroke",style:{fill:Ev}}),p.jsx("line",{x1:l-u,y1:c-u,x2:l+u,y2:c+u,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"}),p.jsx("line",{x1:l+u,y1:c-u,x2:l-u,y2:c+u,stroke:"#0b0f1a",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"})]})]})}const Zbt=1.5;function Gbt(t,e,n,r,i){const s=t.type==="keyframe"?{type:"update-keyframe",animationId:r,percentage:t.pct,properties:{x:e,y:n}}:{type:"update-motion-path-point",animationId:r,pointIndex:t.index,x:e,y:n};return i(s,{label:t.type==="keyframe"?"Move keyframe":"Move waypoint",softReload:!0})}function Ubt(t,e,n,r,i){return i({type:"add-motion-path-point",animationId:t,index:e,x:n,y:r},{label:"Add waypoint",softReload:!0})}function Xbt(t,e,n,r,i){return i({type:"add-keyframe",animationId:t,percentage:e,properties:{x:n,y:r}},{label:"Add keyframe",softReload:!0})}function tne(t,e,n){return n({type:"remove-motion-path-point",animationId:t,index:e},{label:"Remove waypoint",softReload:!0})}function Wbt(t,e,n,r,i){return i({type:"add-motion-path",targetSelector:t,position:e,duration:Zbt,x:n,y:r},{label:"Create motion path",softReload:!0})}function qbt(t){var i,s;const e=(s=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:s.getComputedStyle(t).transform;if(!e||e==="none")return{x:0,y:0};const n=e.match(/matrix3d\(([^)]+)\)/);if(n){const a=n[1].split(",").map(Number);return{x:a[12]||0,y:a[13]||0}}const r=e.match(/matrix\(([^)]+)\)/);if(r){const a=r[1].split(",").map(Number);return{x:a[4]||0,y:a[5]||0}}return{x:0,y:0}}function Rve(t){var i,s;const e=(s=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:s.getComputedStyle(t).transform;if(!e||!e.startsWith("matrix3d("))return 1;const n=e.slice(9,-1).split(","),r=Number.parseFloat(n[15]??"");return Number.isFinite(r)&&r>0?r:1}function jve(t){let e=0,n=0,r=t;for(;r;){if(e+=r.offsetLeft,n+=r.offsetTop,r!==t){const o=qbt(r);e+=o.x,n+=o.y}const a=r.offsetParent;if(!a||a.hasAttribute("data-composition-id"))break;r=a}let i=e+t.offsetWidth/2,s=n+t.offsetHeight/2;return(t.style.translate??"").includes("var(")&&(i+=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-x"))||0,s+=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-y"))||0),{x:i,y:s}}function Lve(t,e){var r;const n=(r=e==null?void 0:e.contentWindow)==null?void 0:r.HTMLElement;return!!(t&&n&&t instanceof n)}function Ybt(t,e){return Math.abs(t.left-e.left)<.5&&Math.abs(t.top-e.top)<.5&&Math.abs(t.width-e.width)<.5&&Math.abs(t.height-e.height)<.5}function nne(t){var e;try{return!!((e=t==null?void 0:t.contentWindow)!=null&&e.MotionPathPlugin)}catch{return!1}}function Kbt(t,e){const[n,r]=x.useState(null),[i,s]=x.useState(null),a=x.useRef(null),o=a.current===e,[l,c]=x.useState(!0),[u,f]=x.useState(null),[h,m]=x.useState(1);return x.useEffect(()=>{if(!e){r(null),f(null);return}f(null);let y=0;const d=()=>{var b,w;const v=t.current;if(v){const O=v.getBoundingClientRect(),k=(b=v.ownerDocument)==null?void 0:b.querySelector("[data-preview-pan-surface]"),E=k==null?void 0:k.getBoundingClientRect(),M={left:E?O.left-E.left:O.left,top:E?O.top-E.top:O.top,width:O.width,height:O.height};r(j=>j&&Ybt(j,M)?j:M);let N=null;try{N=((w=v.contentDocument)==null?void 0:w.querySelector(e))??null}catch{}const I=Lve(N,v)?N:null,_=I?aV(I):!0;if(c(j=>j===_?j:_),I){const j=jve(I);f(B=>B&&Math.abs(B.x-j.x)<.5&&Math.abs(B.y-j.y)<.5?B:j);const L=1/Rve(I);m(B=>Math.abs(B-L)<.001?B:L)}}y=requestAnimationFrame(d)};return y=requestAnimationFrame(d),()=>cancelAnimationFrame(y)},[e,t]),x.useEffect(()=>{if(!e){s(null);return}const y=()=>{const v=PR(t.current,e,void 0,["x","y"]),b=Hbt(v);s(w=>(w==null?void 0:w.points)===(b==null?void 0:b.points)&&(w==null?void 0:w.kind)===(b==null?void 0:b.kind)?w:b),a.current=e};y();const d=window.setInterval(y,250);return()=>window.clearInterval(d)},[e,t]),{rect:n,geometry:i,geometryResolved:o,visibleInPreview:l,home:u,pScale:h}}function Jbt(t,e,n){return(t==null?void 0:t.type)!=="keyframe"||(e==null?void 0:e.type)!=="keyframe"?null:Math.round((t.pct+(e.pct-t.pct)*n)*1e3)/1e3}const rne=6,e2t=3,t2t=x.memo(function({iframeRef:e,selection:n,compositionSize:r,isPlaying:i}){const{commitMutation:s,selectedGsapAnimations:a,handleGsapRemoveKeyframe:o,handleGsapRemoveAllKeyframes:l,handleGsapMoveKeyframeToPlayhead:c}=QE(),{rect:u,geometry:f,geometryResolved:h,visibleInPreview:m,home:y,pScale:d}=Kbt(e,ene(n)),[v,b]=x.useState(null),[w,O]=x.useState(null),[k,E]=x.useState(null),[M,N]=x.useState(null),I=fe(Ce=>Ce.activeKeyframePct),_=fe(Ce=>{if(!n)return;const Me=C3(n);return Ce.elements.find(Ve=>(Ve.key??Ve.id)===Me||Ve.id===n.id)}),j=fe(Ce=>Ce.motionPathArmed),L=fe(Ce=>Ce.setMotionPathArmed),B=fe(Ce=>Ce.setMotionPathCreateAvailable),$=x.useRef(null),Q=x.useRef(void 0),Y=Qbt(a??[],(f==null?void 0:f.kind)??"linear");x.useEffect(()=>()=>clearTimeout(Q.current),[Y]);const W=h&&!f&&!!(n!=null&&n.element)&&!i,J=W?ene(n):null,ne=(r==null?void 0:r.width)??null,le=W&&!!J&&nne(e.current);if(x.useEffect(()=>(B(!!le),()=>B(!1)),[le,B]),x.useEffect(()=>{j&&!le&&L(!1)},[j,le,L]),x.useEffect(()=>{var tt,Ze;if(!j||!J||!ne)return;const Ce=((Ze=(tt=e.current)==null?void 0:tt.ownerDocument)==null?void 0:Ze.querySelector("[data-preview-pan-surface]"))??null;if(!Ce)return;const Me=Ce.style.cursor;Ce.style.cursor="crosshair";const Ve=qe=>{var St;if(qe.button!==0)return;const pt=e.current;if(!pt||!nne(pt))return;const it=pt.getBoundingClientRect();if(qe.clientX<it.left||qe.clientX>it.right||qe.clientY<it.top||qe.clientY>it.bottom)return;const vt=(St=pt.contentDocument)==null?void 0:St.querySelector(J);if(!Lve(vt,pt))return;qe.stopPropagation(),qe.preventDefault();const Ot=it.width/ne,Kt=jve(vt),qt=1/Rve(vt),fn=Math.round(((qe.clientX-it.left)/Ot-Kt.x)/qt),Jt=Math.round(((qe.clientY-it.top)/Ot-Kt.y)/qt),Je=Math.round(fe.getState().currentTime*100)/100;Wbt(J,Je,fn,Jt,s),L(!1)};return Ce.addEventListener("pointerdown",Ve,!0),()=>{Ce.removeEventListener("pointerdown",Ve,!0),Ce.style.cursor=Me}},[j,J,ne,e,s,L]),!u||u.width<=0||!r||r.width<=0||!m||!y)return null;if(!f){if(!j||!le)return null;const Ce=u.width/r.width,Me=rne/Ce*1.6;return p.jsx("svg",{className:"pointer-events-none absolute z-40",style:{left:u.left,top:u.top,width:u.width,height:u.height,overflow:"visible"},viewBox:`0 0 ${r.width} ${r.height}`,children:p.jsx("circle",{cx:y.x,cy:y.y,r:Me,fill:"none",strokeWidth:1.5,strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke",style:{stroke:Ev},opacity:.85})})}const ie=u.width/r.width,q=rne/ie,F=!!Y&&!i,Z=f.kind==="arc"&&F&&f.nodes.length>2,K=F,re=(v?f.nodes.map((Ce,Me)=>Me===v.index?{...Ce,x:v.x,y:v.y}:Ce):f.nodes).map(Ce=>({...Ce,ax:y.x+Ce.x*d,ay:y.y+Ce.y*d})),z=re.map(Ce=>`${Ce.ax},${Ce.ay}`).join(" "),H=Ce=>{var Ze;const Me=(Ze=e.current)==null?void 0:Ze.getBoundingClientRect(),Ve=Me?Me.left:u.left,tt=Me?Me.top:u.top;return{x:(Ce.clientX-Ve)/ie,y:(Ce.clientY-tt)/ie}},se=(Ce,Me,Ve,tt,Ze)=>{F&&Ce.button===0&&(Ce.stopPropagation(),Ce.target.setPointerCapture(Ce.pointerId),$.current={index:Me,startX:Ce.clientX,startY:Ce.clientY,initX:Ve,initY:tt,scale:ie,pScale:d,ref:Ze},b({index:Me,x:Ve,y:tt}))},ue=Ce=>{const Me=$.current;Me&&b({index:Me.index,x:Me.initX+(Ce.clientX-Me.startX)/Me.scale/Me.pScale,y:Me.initY+(Ce.clientY-Me.startY)/Me.scale/Me.pScale})},be=Ce=>{const Me=$.current;if(!Me||($.current=null,b(null),!Y))return;const Ve=Ce.clientX-Me.startX,tt=Ce.clientY-Me.startY,Ze=Math.round(Me.initX+Ve/Me.scale/Me.pScale),qe=Math.round(Me.initY+tt/Me.scale/Me.pScale);if(Math.hypot(Ve,tt)<e2t){if(Me.ref.type==="keyframe"){fe.getState().setActiveKeyframePct(Me.ref.pct);const vt=Me.ref;clearTimeout(Q.current),Ce.detail<2&&(Q.current=setTimeout(()=>{const Ot=a==null?void 0:a.find(Kt=>Kt.id===Y);Ot&&vA(Ot,vt.pct)},250))}return}if(Ze===Math.round(Me.initX)&&qe===Math.round(Me.initY))return;const it=Me.ref.type==="keyframe"?a==null?void 0:a.find(vt=>vt.id===Y):void 0;Me.ref.type==="keyframe"&&it&&n&&!fe.getState().autoKeyframeEnabled?T3(n,it,{x:Ze,y:qe},Me.ref.pct,e.current,{commitMutation:(vt,Ot,Kt)=>s(Ot,Kt)},"Move animation path"):Gbt(Me.ref,Ze,qe,Y,s),Me.ref.type==="keyframe"&&it&&vA(it,Me.ref.pct)},me=Ce=>{const Me=H(Ce),Ve=Jte(Me.x,Me.y,re.map(tt=>({x:tt.ax,y:tt.ay})));O(Ve?{x:Ve.x,y:Ve.y,segIndex:Ve.segIndex}:null)},pe=Ce=>{var qe,pt;if(!Y)return;const Me=H(Ce),Ve=Jte(Me.x,Me.y,re.map(it=>({x:it.ax,y:it.ay})));if(!Ve)return;const tt=Math.round(Ve.x-y.x),Ze=Math.round(Ve.y-y.y);if(f.kind==="arc")Ce.stopPropagation(),Ubt(Y,Ve.segIndex+1,tt,Ze,s);else{const it=Jbt((qe=re[Ve.segIndex])==null?void 0:qe.ref,(pt=re[Ve.segIndex+1])==null?void 0:pt.ref,Ve.t);if(it===null)return;Ce.stopPropagation(),Xbt(Y,it,tt,Ze,s)}O(null)},ge=(Ce,Me)=>{Ce.stopPropagation(),Y&&(E(null),tne(Y,Me,s))},Pe=(n==null?void 0:n.id)??null,ve=(Ce,Me)=>{!Y||!Pe||!_||(Ce.preventDefault(),Ce.stopPropagation(),N({ref:Me,state:{x:Ce.clientX,y:Ce.clientY,element:_,elementId:Pe,percentage:Me.type==="keyframe"?Me.pct:0,tweenPercentage:Me.type==="keyframe"?Me.pct:0}}))},xe=M==null?void 0:M.ref,we=xe===void 0||!Y?void 0:xe.type==="keyframe"?(Ce,Me)=>{o(Y,Me.percentage)}:Z?()=>{tne(Y,xe.index,s)}:void 0;return p.jsxs(p.Fragment,{children:[p.jsxs("svg",{className:"pointer-events-none absolute z-40",style:{left:u.left,top:u.top,width:u.width,height:u.height,overflow:"visible"},viewBox:`0 0 ${r.width} ${r.height}`,children:[K&&p.jsx("polyline",{points:z,fill:"none",stroke:"transparent",strokeWidth:14/ie,className:"pointer-events-auto",style:{cursor:"copy"},onPointerMove:me,onPointerLeave:()=>O(null),onPointerDown:pe}),p.jsx("polyline",{points:z,fill:"none",style:{stroke:Ev},strokeWidth:1.5,strokeDasharray:"5 5",strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke",opacity:.85}),w&&p.jsx("rect",{x:w.x-q*.707,y:w.y-q*.707,width:q*1.414,height:q*1.414,rx:q*.24,transform:`rotate(45 ${w.x} ${w.y})`,fill:"none",strokeWidth:1.5,strokeDasharray:"2 2",vectorEffect:"non-scaling-stroke",className:"pointer-events-none",style:{stroke:Ev}}),re.map((Ce,Me)=>p.jsx(zbt,{cx:Ce.ax,cy:Ce.ay,r:q,interactive:F,removable:Z&&k===Me,grabbing:(v==null?void 0:v.index)===Me,selected:Ce.ref.type==="keyframe"&&Ce.ref.pct===I,onEnter:()=>E(Me),onLeave:()=>E(Ve=>Ve===Me?null:Ve),onPointerDown:Ve=>se(Ve,Me,Ce.x,Ce.y,Ce.ref),onPointerMove:ue,onPointerUp:be,onRemove:Ve=>ge(Ve,Me),onContextMenu:Ve=>ve(Ve,Ce.ref)},Me))]}),M&&p.jsx(Rhe,{state:M.state,onClose:()=>N(null),onDelete:we,onDeleteAll:()=>Y&&l(Y),onMoveToPlayhead:M.ref.type==="keyframe"?(Ce,Me)=>Y&&c(Y,Me.percentage):void 0})]})}),t4={snapEnabled:!0,gridVisible:!1,gridSpacing:50,snapToGrid:!1};function jD(){const t=to();return{snapEnabled:t.snapEnabled??t4.snapEnabled,gridVisible:t.gridVisible??t4.gridVisible,gridSpacing:t.gridSpacing??t4.gridSpacing,snapToGrid:t.snapToGrid??t4.snapToGrid}}const n2t=x.memo(function({onSnapChange:e}){const[n,r]=x.useState(jD),[i,s]=x.useState(!1),a=fe(y=>y.motionPathCreateAvailable),o=fe(y=>y.motionPathArmed),l=fe(y=>y.setMotionPathArmed),c=x.useRef(null),u=x.useRef(null),f=x.useCallback(y=>{r(d=>{const v={...d,...y};return Ol(y),e==null||e(v),v})},[e]),h=x.useCallback(()=>{f({snapEnabled:!n.snapEnabled})},[n.snapEnabled,f]),m=x.useCallback(()=>{f({gridVisible:!n.gridVisible})},[n.gridVisible,f]);return x.useEffect(()=>{const y=d=>{if(d.defaultPrevented)return;const v=d.target;v instanceof HTMLInputElement||v instanceof HTMLTextAreaElement||v instanceof HTMLElement&&v.isContentEditable||v instanceof HTMLIFrameElement||(d.key==="s"&&!d.metaKey&&!d.ctrlKey&&!d.altKey&&(d.preventDefault(),f({snapEnabled:!jD().snapEnabled})),d.key==="g"&&!d.metaKey&&!d.ctrlKey&&!d.altKey&&(d.preventDefault(),f({gridVisible:!jD().gridVisible})))};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[f]),x.useEffect(()=>{if(!i)return;const y=d=>{var b,w;const v=d.target;(b=c.current)!=null&&b.contains(v)||(w=u.current)!=null&&w.contains(v)||s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),p.jsxs("div",{className:"absolute top-2 right-2 z-50 flex items-center gap-1",onPointerDown:y=>y.stopPropagation(),children:[a&&p.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${o?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:()=>l(!o),title:o?"Click the canvas to set the destination":"Set motion destination","aria-label":"Set motion destination",children:p.jsx($Re,{size:16,weight:o?"fill":"regular"})}),p.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${n.snapEnabled?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:h,title:n.snapEnabled?"Snap enabled (S)":"Snap disabled (S)","aria-label":"Toggle snap",children:p.jsx(IRe,{size:16,weight:n.snapEnabled?"fill":"regular"})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{ref:u,type:"button",className:`rounded-md p-1.5 transition-colors active:scale-[0.95] ${n.gridVisible?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:m,onContextMenu:y=>{y.preventDefault(),s(d=>!d)},title:n.gridVisible?"Grid visible (G) — right-click for spacing options":"Grid hidden (G) — right-click for spacing options","aria-label":"Toggle grid",children:p.jsx(MRe,{size:16,weight:n.gridVisible?"fill":"regular"})}),p.jsx("button",{type:"button",className:"absolute -right-0.5 -bottom-0.5 rounded p-0.5 text-white/50 hover:text-white/90 bg-black/50",onClick:()=>s(y=>!y),title:"Grid options","aria-label":"Grid options","aria-expanded":i,children:p.jsx("svg",{width:"7",height:"7",viewBox:"0 0 8 8",fill:"currentColor","aria-hidden":"true",children:p.jsx("path",{d:"M1 2.5l3 3 3-3z"})})}),i&&p.jsxs("div",{ref:c,className:"absolute right-0 top-full mt-1 rounded-lg bg-neutral-800 border border-neutral-700 p-3 shadow-xl min-w-[180px]",children:[p.jsxs("label",{className:"flex items-center justify-between text-xs text-white/80 mb-2",children:[p.jsx("span",{children:"Grid spacing"}),p.jsx("input",{type:"number",min:10,max:500,step:10,value:n.gridSpacing,onChange:y=>{const d=Number.parseInt(y.target.value,10);Number.isFinite(d)&&d>=10&&d<=500&&f({gridSpacing:d})},className:"w-16 rounded bg-neutral-900 border border-neutral-600 px-1.5 py-0.5 text-xs text-white text-right tabular-nums outline-none focus:border-studio-accent"})]}),p.jsxs("label",{className:"flex items-center gap-2 text-xs text-white/80 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:n.snapToGrid,onChange:()=>f({snapToGrid:!n.snapToGrid}),className:"accent-studio-accent"}),p.jsx("span",{children:"Snap to grid"})]})]})]})]})}),bd=t=>t.key??t.id;function Fve(t,e){if(t.expandedParentStart==null)return null;const n=bd(t);return new Set(e.filter(r=>bd(r)!==n&&fF(r,t)).map(r=>r.track))}function ZA(t){return[...new Set(t.map(e=>e.track))].sort((e,n)=>e-n)}function r2t(t){const{action:e,element:n,elements:r}=t;if(bc(n)==="audio"||!(n.duration>0))return null;const i=bd(n),s=n.start,a=n.start+n.duration,o=e==="bring-forward"||e==="bring-to-front",l=r.filter(v=>bd(v)!==i&&bc(v)==="visual"&&cF(v,n)&&khe(s,a,v.start,v.start+v.duration)),c=o2t(t,l,o);if(c==null)return null;const u=ZA(r),f=ZA(r.filter(v=>bc(v)==="visual")),h=f.indexOf(c);if(h===-1)return null;const m=s2t(e,l,c,o),y=Fve(n,r),d=d7({elements:r,visualLanes:f,refIdx:h,up:o,boundLane:m,start:s,end:a,selfKey:i,allowedLanes:y});return d!=null?d===n.track?null:{kind:"move",displayTrack:d,persistTrack:hF(d,r,n)}:y?null:{kind:"insert",insertRow:u.indexOf(c)+(o?0:1)}}function i2t(t){const{element:e,elements:n,desiredOrderKeys:r}=t;if(bc(e)==="audio"||!(e.duration>0))return null;const i=bd(e),s=r.indexOf(i);if(s===-1)return null;const a=d=>{if(d==null)return null;const v=n.find(b=>bd(b)===d);return v&&bc(v)==="visual"&&v.duration>0&&cF(v,e)&&bd(v)!==i?v.track:null};let o=null;for(let d=s+1;d<r.length&&o==null;d++)o=a(r[d]);let l=null;for(let d=s-1;d>=0&&l==null;d--)l=a(r[d]);if(o==null&&l==null)return null;const c=ZA(n),u=ZA(n.filter(d=>bc(d)==="visual")),f=Fve(e,n),h={elements:n,visualLanes:u,start:e.start,end:e.start+e.duration,selfKey:i,allowedLanes:f};let m,y;if(o!=null){const d=u.indexOf(o);if(d===-1)return null;m=d7({...h,refIdx:d,up:!1,boundLane:l}),y=c.indexOf(o)+1}else{const d=u.indexOf(l);if(d===-1)return null;m=d7({...h,refIdx:d,up:!0,boundLane:null}),y=c.indexOf(l)}return m!=null?m===e.track?null:{kind:"move",displayTrack:m,persistTrack:hF(m,n,e)}:f?null:{kind:"insert",insertRow:y}}function s2t(t,e,n,r){if(t!=="bring-forward"&&t!=="send-backward")return null;const i=e.map(s=>s.track).filter(s=>r?s<n:s>n);return i.length===0?null:(r?Math.max:Math.min)(...i)}function d7(t){const{elements:e,visualLanes:n,refIdx:r,up:i,boundLane:s,start:a,end:o,selfKey:l,allowedLanes:c}=t,u=i?-1:1;for(let f=r+u;f>=0&&f<n.length;f+=u){const h=n[f];if(a2t(h,s,i))break;if(!(c&&!c.has(h))&&M4(e,h,a,o,l))return h}return null}function a2t(t,e,n){return e==null?!1:n?t<=e:t>=e}function o2t(t,e,n){const r=t.action==="bring-forward"||t.action==="send-backward";if(r){const s=l2t(t);if(s!=null)return s}const i=e.map(s=>s.track).filter(s=>n?s<t.element.track:s>t.element.track);return i.length===0?null:(r===n?Math.max:Math.min)(...i)}function l2t({elements:t,crossedKey:e}){if(e==null)return null;const n=t.find(r=>bd(r)===e);return n&&bc(n)==="visual"?n.track:null}function c2t(){var n;const t=$ve(),e=((n=mF())==null?void 0:n.activeCompPath)??null;return x.useCallback(r=>t(r.selectionKey,r.coalesceKey,(i,s)=>{const a=r.crossed?SS(r.crossed):void 0,o=r.crossed?G1({domId:r.crossed.id||void 0,selector:a,selectorIndex:lF(r.crossed.ownerDocument,r.crossed,a,r.sourceFile,e),sourceFile:r.sourceFile}):null;return r2t({action:r.action,element:i,elements:s,crossedKey:o})}),[t,e])}function u2t(){const t=$ve();return x.useCallback(e=>t(e.selectionKey,e.coalesceKey,(n,r)=>i2t({element:n,elements:r,desiredOrderKeys:e.desiredOrderKeys})),[t])}function $ve(){const t=rS(),e=x.useRef(t);e.current=t;const{onMoveElements:n}=lS();return x.useCallback((r,i,s)=>{const a=e.current,o=r?a.find(c=>(c.key??c.id)===r):void 0;if(!o)return Promise.resolve(!1);const l=s(o,a);return l?RFe(o,l,{elements:a,trackOrder:ZA(a),updateElement:(c,u)=>fe.getState().updateElement(c,u),onMoveElements:n?(c,u,f,h)=>sve(c,u,f,n,h):void 0},i,Number.POSITIVE_INFINITY):Promise.resolve(!1)},[n])}function f2t(t,e,n){return!!(e||n||yA(t))}function h2t(t,e){return{element:t.element,zIndex:e,id:t.id??void 0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile,key:G1({domId:t.id??void 0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile})}}function d2t(t,e,n){const r=t.id||void 0,i=SS(t);return f2t(t,r,i)?{element:t,zIndex:e,id:r,selector:i,selectorIndex:void 0,sourceFile:n,key:G1({domId:r,selector:i,sourceFile:n})}:null}function p2t(t){if(t.id)return`#${t.id}`;const e=t.classList.item(0);return e?`${t.tagName.toLowerCase()}.${e}`:t.tagName.toLowerCase()}function m2t(t,e){const n=[],r=[];for(const i of e){if(i.element===t.element){n.push(h2t(t,i.zIndex));continue}const s=d2t(i.element,i.zIndex,t.sourceFile);s?n.push(s):r.push(i)}return{entries:n,dropped:r}}function g2t({shouldShowMotionPath:t,shouldShowSelectedDomBounds:e,blockPreview:n,isGestureRecording:r,recordingState:i,onToggleRecording:s,gestureOverlay:a}){const{activeCompPath:o,previewIframeRef:l}=zl(),{captionEditMode:c,compositionLoading:u,isPlaying:f}=vy(),h=R1e(),m=An(F=>F.model!==null),y=An(F=>F.dismissed),d=An(F=>F.syncError),v=x.useCallback(()=>{const F=An.getState();F.clearSelection(),F.setDismissed(!0),F.setEditMode(!1)},[]),b=x.useCallback(()=>{const F=An.getState();F.setDismissed(!1),F.setEditMode(!0)},[]),{domEditHoverSelection:w,domEditSelection:O,domEditGroupSelections:k}=yy(),{handlePreviewCanvasMouseDown:E,handlePreviewCanvasPointerMove:M,handlePreviewCanvasPointerLeave:N,applyDomSelection:I,handleBlockedDomMove:_,handleDomManualDragStart:j,handleDomPathOffsetCommit:L,handleDomGroupPathOffsetCommit:B,handleDomBoxSizeCommit:$,handleDomRotationCommit:Q,handleDomStyleCommit:Y,applyMarqueeSelection:W,handleDomEditElementDelete:J,handleDomZIndexReorderCommit:ne}=HE(),le=c2t(),[ie,q]=x.useState(()=>{const F=to();return{snapEnabled:F.snapEnabled??!0,gridVisible:F.gridVisible??!1,gridSpacing:F.gridSpacing??50,snapToGrid:F.snapToGrid??!1}});return n?p.jsx("div",{className:"absolute inset-0 z-30 bg-black pointer-events-none",children:n.videoUrl?p.jsx("video",{src:n.videoUrl,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-contain"}):n.posterUrl?p.jsx("img",{src:n.posterUrl,alt:n.title,className:"w-full h-full object-contain"}):null}):c?p.jsxs(p.Fragment,{children:[p.jsx(Dgt,{iframeRef:l}),p.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-[60] flex items-center gap-2 rounded-full border border-studio-accent/40 bg-black/70 px-2.5 py-1",children:[p.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-studio-accent","aria-hidden":"true"}),p.jsx("span",{className:"text-2xs text-neutral-200",children:"Editing captions"}),p.jsx("button",{type:"button",onClick:v,className:"rounded text-2xs text-neutral-400 underline underline-offset-2 hover:text-neutral-100 focus-visible:outline focus-visible:outline-1 focus-visible:outline-studio-accent",children:"Exit"})]}),d&&p.jsxs("div",{role:"alert",className:"absolute top-10 left-1/2 -translate-x-1/2 z-[60] flex items-center gap-2 rounded-full border border-red-500/50 bg-red-950/90 px-2.5 py-1",children:[p.jsx("span",{className:"text-2xs text-red-200",children:d}),p.jsx("button",{type:"button",onClick:()=>{var F,U;return(U=(F=An.getState()).retrySave)==null?void 0:U.call(F)},className:"rounded text-2xs text-red-100 underline underline-offset-2 hover:text-white",children:"Retry"}),p.jsx("button",{type:"button",onClick:()=>An.getState().setSyncError(null),"aria-label":"Dismiss",className:"rounded px-0.5 text-2xs text-red-300/70 hover:text-red-100",children:"✕"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx(Vbt,{iframeRef:l,activeCompositionPath:o,hoverSelection:!c&&!u&&!f?w:null,selection:e?O:null,groupSelections:e?k:[],allowCanvasMovement:!r,onCanvasMouseDown:E,onCanvasPointerMove:M,onCanvasPointerLeave:N,onSelectionChange:I,onBlockedMove:_,onManualDragStart:j,onPathOffsetCommit:L,onGroupPathOffsetCommit:B,onBoxSizeCommit:$,onRotationCommit:Q,onStyleCommit:Y,onDeleteSelection:J,onApplyZIndex:(F,U,Z,K)=>{const{entries:ee,dropped:re}=m2t(F,U);if(re.length>0){for(const H of re)H.element.style.zIndex=String(H.zIndex);console.warn("[studio] z-index reorder: dropping sibling(s) with no stable id/selector (will revert on reload):",re.map(H=>p2t(H.element)).join(", "))}if(ee.length===0)return;const z=B$(ee,Z);The({commitZ:()=>ne(ee,z,Z),mirror:()=>{var H;return le({selectionKey:(H=ee.find(se=>se.element===F.element))==null?void 0:H.key,action:Z,crossed:K,sourceFile:F.sourceFile,coalesceKey:z})}}).catch(()=>{})},gridVisible:ie.gridVisible,gridSpacing:ie.gridSpacing,recordingState:i,onToggleRecording:s,onMarqueeSelect:W}),p.jsx(n2t,{onSnapChange:q}),p.jsx(t2t,{iframeRef:l,selection:t?O:null,compositionSize:h,isPlaying:f}),a,m&&y&&p.jsx("button",{type:"button",onClick:b,className:"absolute top-2 left-1/2 -translate-x-1/2 z-[60] rounded-full border border-neutral-700 bg-black/60 px-2.5 py-1 text-2xs text-neutral-300 transition-colors hover:border-studio-accent/50 hover:text-studio-accent focus-visible:outline focus-visible:outline-1 focus-visible:outline-studio-accent",children:"Edit captions"})]})}const y2t=.1,p7=1e-4,Bve=.01,F1=t=>Math.round(t*1e3)/1e3,x2t=(t,e,n)=>Math.max(e,Math.min(n,t));function b2t(t){const{keyframeCount:e,draggedTweenPct:n,tweenStart:r,tweenEnd:i,dropAbsTime:s}=t;if(e>0)return null;if(n!==0&&n!==100)return{kind:"noop"};if(Math.abs(s-(n===0?r:i))<=p7)return{kind:"noop"};const o=n===0?s:r,c=(n===100?s:i)-o;return c<Bve?{kind:"noop"}:{kind:"resize",position:F1(o),duration:F1(c),pctRemap:[]}}function v2t(t){const{keyframes:e,draggedTweenPct:n,tweenStart:r,tweenDuration:i,dropAbsTime:s}=t;if(i<=0)return{kind:"noop"};const a=r+i,o=b2t({keyframeCount:e.length,draggedTweenPct:n,tweenStart:r,tweenEnd:a,dropAbsTime:s});if(o)return o;if(s>=r-p7&&s<=a+p7){const y=F1(x2t((s-r)/i*100,0,100));return Math.abs(y-n)<y2t?{kind:"noop"}:{kind:"move",toTweenPct:y}}if(e.length===0)return{kind:"noop"};const l=Math.min(s,r),c=Math.max(s,a),u=Math.max(Bve,c-l);let f=0,h=1/0;e.forEach((y,d)=>{const v=Math.abs(y.percentage-n);v<h&&(h=v,f=d)});const m=e.map((y,d)=>{const v=d===f?s:r+y.percentage/100*i;return{from:y.percentage,to:F1((v-l)/u*100)}});return{kind:"resize",position:F1(l),duration:F1(u),pctRemap:m}}function A2t(t,e,n){const r=e.find(l=>Math.abs(l.percentage-t)<.2);if(!r)return null;const i=r.animationId?n.find(l=>l.id===r.animationId):void 0;if(r.animationId)return i?{animId:i.id,tweenPct:r.tweenPercentage??t}:null;const s=r==null?void 0:r.propertyGroup,a=s?n.filter(l=>l.propertyGroup===s):n.filter(l=>!l.propertyGroup),o=a.length===1?a[0]:void 0;return o?{animId:o.id,tweenPct:r.tweenPercentage??t}:null}function S2t({handleTimelineElementMove:t,handleTimelineElementsMove:e,handleTimelineElementResize:n,handleTimelineGroupResize:r,handleToggleTrackHidden:i,setAudioGroupAttribute:s,handleBlockedTimelineEdit:a,handleTimelineElementSplit:o,handleRazorSplit:l,handleRazorSplitAll:c,handleGroupClips:u,setElementFxAttribute:f}){const{projectId:h,activeCompPath:m}=zl(),{domEditSelection:y,selectedGsapAnimations:d}=yy(),{handleGsapRemoveKeyframe:v,handleGsapMoveKeyframeToPlayhead:b,handleGsapMoveKeyframe:w,handleGsapResizeKeyframedTween:O,handleGsapUpdateMeta:k,handleGsapAddKeyframe:E,handleGsapAddKeyframeBatch:M,handleGsapConvertToKeyframes:N,handleGsapRemoveAllKeyframes:I,buildDomSelectionForTimelineElement:_}=HE(),j=x.useCallback($=>{const{gsapAnimations:Q}=fe.getState(),{sourceFile:Y,domId:W}=v6($),J=Y??m??"index.html";for(const ne of T0(J,W)){const le=Q.get(ne);if(le)return le}return[]},[m]),L=x.useCallback(($,Q,Y=d)=>{const W=Q.propertyGroup!==void 0||Q.tweenPercentage!==void 0||Q.animationId!==void 0,J=fe.getState().keyframeCache,ne=J.get($)??J.get(v6($).domId);return A2t(Q.percentage,W?[Q]:(ne==null?void 0:ne.keyframes)??[],Y)},[d]),B=x.useCallback(($,Q,Y)=>{v($,Q,void 0,Y)},[v]);return x.useMemo(()=>({onMoveElement:t,onMoveElements:e,onResizeElement:n,onResizeElements:r,onToggleTrackHidden:i,onSetAudioGroupAttributeLive:s.setLive,onSetAudioGroupAttributeQuiet:s.setQuiet,onGroupClips:u,onSetElementAttributeLive:f==null?void 0:f.setLive,onSetElementAttributeQuiet:f==null?void 0:f.setQuiet,onBlockedEditAttempt:a,onSplitElement:o,onRazorSplit:l,onRazorSplitAll:c,onDeleteAllKeyframes:($,Q)=>{const Y=zn($),W=j(Y),J=Q?W.filter(ne=>ne.id===Q):W.filter(ne=>ne.keyframes);J.length!==0&&_($).then(async ne=>{if(ne)for(const le of J)await I(le.id,ne)})},onDeleteKeyframe:($,Q)=>{const Y=j($),W=L($,Q,Y);if(!W)return;const J=fe.getState().elements.find(ne=>(ne.key??ne.id)===$);if(!J){B(W.animId,W.tweenPct);return}_(J).then(ne=>{ne&&B(W.animId,W.tweenPct,ne)})},onMoveKeyframeToPlayhead:($,Q)=>{const Y=zn($),W=j(Y),J=L(Y,Q,W),ne=J?W.find(le=>le.id===J.animId):void 0;!J||!ne||_($).then(le=>{le&&b(J.animId,J.tweenPct,le,ne)})},onMoveKeyframe:async($,Q,Y)=>{var se;const W=j($),J=L($,Q,W);if(!J)return!1;const ne=fe.getState().elements.find(ue=>(ue.key??ue.id)===$),le=ne?await _(ne):y;if(!le)return!1;const ie=W.find(ue=>ue.id===J.animId),q=ie?si(ie):null;if(!ie||q===null)return Promise.resolve(!1);const F=le.sourceFile||m||"index.html",{elements:U,domClipChildren:Z}=fe.getState(),{elStart:K,elDuration:ee}=FE(le.id??"",F,U,Z),re=qi(ie,ee),z=K+Y/100*ee,H=v2t({keyframes:((se=ie.keyframes)==null?void 0:se.keyframes)??[],draggedTweenPct:J.tweenPct,tweenStart:q,tweenDuration:re,dropAbsTime:z});return H.kind==="move"&&H.toTweenPct!=null?w(J.animId,J.tweenPct,H.toTweenPct,le):H.kind==="resize"&&H.pctRemap&&H.position!=null&&H.duration!=null?H.pctRemap.length===0?k(J.animId,{position:H.position,duration:H.duration},le):O(J.animId,H.position,H.duration,H.pctRemap,le):Promise.resolve(!1)},onToggleKeyframeAtPlayhead:$=>{const Q=fe.getState().currentTime,Y=$.duration>0?Math.max(0,Math.min(100,Math.round((Q-$.start)/$.duration*100))):0,W=j(zn($));_($).then(J=>{if(!J)return;const ne=W.find(le=>le.keyframes);if(ne!=null&&ne.keyframes){const le=ne.keyframes.keyframes.find(ie=>Math.abs(ie.percentage-Y)<=1);le?v(ne.id,le.percentage,void 0,J):E(ne.id,Y,"x",0,J)}else{const le=W.find(ie=>!ie.keyframes);le&&N(le.id,void 0,void 0,void 0,J)}})},onTogglePropertyGroupKeyframe:async($,Q)=>{const Y=await _($);if(Y){if(Q.remove){B(Q.animationId,Q.tweenPercentage,Y);return}await M(Q.animationId,Q.tweenPercentage,Q.properties,void 0,Y)}}}),[t,e,n,r,i,s,u,f,a,o,l,c,I,j,L,B,d,b,w,O,k,E,M,N,_,h,m,y])}const ine=["#3CE6AC","#FF6B6B","#4ECDC4","#FFE66D","#A78BFA","#F472B6","#34D399","#FB923C","#60A5FA","#C084FC"],LD=32,w2t=x.memo(function({pixelsPerSecond:e,onSeek:n}){const r=An(f=>f.model),i=An(f=>f.selectedSegmentIds),s=An(f=>f.selectSegment),a=fe(f=>f.currentTime),o=x.useCallback((f,h)=>{f.stopPropagation(),s(h,f.shiftKey)},[s]),l=x.useCallback((f,h)=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),f.stopPropagation(),s(h,f.shiftKey))},[s]),c=x.useCallback(f=>{if(!n)return;const h=f.currentTarget.getBoundingClientRect(),m=f.clientX-h.left-LD,y=Math.max(0,m/e);n(y)},[n,e]);if(!r)return null;const u=LD+a*e;return p.jsxs("div",{className:"relative select-none overflow-x-auto",style:{height:40,minWidth:"100%"},onClick:c,children:[r.groupOrder.map((f,h)=>{const m=r.groups.get(f);if(!m)return null;const y=ine[h%ine.length];return m.segmentIds.map(d=>{const v=r.segments.get(d);if(!v)return null;const b=LD+v.start*e,w=Math.max((v.end-v.start)*e,4),O=i.has(d);return p.jsx("div",{role:"button",tabIndex:0,"aria-label":`Caption word "${v.text}"`,"aria-pressed":O,className:`absolute top-1 bottom-1 rounded flex items-center overflow-hidden cursor-pointer focus-visible:ring-1 focus-visible:ring-white outline-none${O?" ring-1 ring-white/50 z-10":""}`,style:{left:b,width:w,backgroundColor:y,zIndex:O?10:1},onClick:k=>o(k,d),onKeyDown:k=>l(k,d),children:p.jsx("span",{className:"flex-1 truncate px-2 pointer-events-none",style:{fontSize:9,color:"#000000",lineHeight:1},children:v.text})},d)})}),p.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-white/70 pointer-events-none z-20",style:{left:u},"aria-hidden":"true"})]})});function O2t(t,e){const n=[...t];return!e||!t.has(e)?n:[e,...n.filter(r=>r!==e)]}function C2t(t,e,n,r){const i=new Set(t),s=new Set(e);if(i.size!==s.size)return!1;for(const a of s)if(!i.has(a))return!1;return n===r}function k2t(t,e){return t!==null&&!e.includes(t)}function E2t({selectedElementId:t,selectedElementIds:e,timelineElements:n,domEditSelection:r,domEditGroupSelections:i,activeCompPath:s,buildDomSelectionForTimelineElement:a,applyDomSelection:o,applyMarqueeSelection:l,onSelectionNotFound:c}){const u=x.useMemo(()=>O2t(e,t),[t,e]),f=u.join("\0"),h=x.useRef(r),m=x.useRef(i),y=x.useRef(""),d=x.useRef("");h.current=r,m.current=i,x.useEffect(()=>{const v=y.current;y.current=f;const b=h.current,w=m.current,k=(w.length>1?w:b?[b]:[]).map(_=>H6(_,n,s)).filter(_=>!!_),E=b?H6(b,n,s):null;if(u.length===0){d.current="",pc("timeline-empty",{had:k.length,previousKey:v.length>0,clearing:v.length>0&&k.length>0}),v.length>0&&k.length>0&&o(null,{revealPanel:!1});return}if(C2t(k,u,E,t)){d.current="";return}let M=!1;const N=()=>{d.current!==f&&(d.current=f,c())};return(async()=>{const _=[];let j=0;for(const L of u){const B=n.find(Q=>(Q.key??Q.id)===L);if(!B)continue;j+=1;const $=await a(B);$&&_.push($)}if(!M){if(_.length<j){N(),k2t(E,u)&&o(null,{revealPanel:!1,announce:!1});return}d.current="",pc("timeline-sync",{wanted:u.length,had:k.length,resolved:_.length}),_.length===0?o(null,{revealPanel:!1}):_.length===1?o(_[0]):l(_,!1)}})(),()=>{M=!0}},[s,o,l,a,c,t,u,f,n])}function T2t(t){return typeof t!="object"||t===null?!1:typeof Reflect.get(t,"registerTool")=="function"}function Vve(t=document){const e=Reflect.get(t,"modelContext");return T2t(e)?e:null}const sne=Z0("webmcp");let n1=null;async function P2t(){try{await ly(()=>import("./index-BX3KHhGX.js"),[]);const t=Vve();return t?Ns("webmcp.polyfill_loaded"):(sne("polyfill",{loaded:!0,modelContext:!1}),Ns("webmcp.polyfill_failed",{error_name:"ModelContextMissingError"})),t}catch(t){return sne("polyfill",{failed:t instanceof Error?t.message:String(t)}),Ns("webmcp.polyfill_failed",{error_name:t instanceof Error?t.name:"NonError"}),null}}function M2t(){if(n1)return n1;const t=P2t();return n1=t,t.then(e=>{e===null&&n1===t&&(n1=null)}),n1}const N2t=/^[A-Za-z0-9_.-]{1,128}$/;function D2t(t){return N2t.test(t.name)?t.description.trim()?null:"description must not be empty":`name must be 1-128 chars of A-Z a-z 0-9 _ - . (got ${JSON.stringify(t.name)})`}function I2t(t){return t instanceof DOMException&&t.name==="AbortError"}function Hve(t,e){return{tool:t,name:"InvalidStateError",message:e}}async function _2t(t,e,n){const r=D2t(e);if(r)return{status:"failed",failure:Hve(e.name,r)};try{return await t.registerTool(e,{signal:n}),{status:"registered"}}catch(i){return I2t(i)?{status:"aborted"}:{status:"failed",failure:{tool:e.name,name:i instanceof DOMException?i.name:"Error",message:i instanceof Error?i.message:String(i)}}}}async function R2t(t,e,n){const r={registered:[],failed:[]},i=new Set;for(const s of e){if(i.has(s.name)){r.failed.push(Hve(s.name,"duplicate tool name in this registration set"));continue}i.add(s.name);const a=await _2t(t,s,n);if(a.status==="aborted")return r;a.status==="failed"?r.failed.push(a.failure):r.registered.push(s.name)}return r}function j2t(t){return{ok:!0,...t}}function ane(t,e,n){return n?{ok:!1,kind:t,reason:e,hint:n}:{ok:!1,kind:t,reason:e}}async function L2t(t,e){try{return await e()}catch(n){const r=n instanceof Error?n.message:String(n);return n instanceof TypeError||n instanceof ReferenceError?(console.error(`[hf-webmcp] ${t} threw`,n),ane("internal",r)):ane("failed",r)}}const FD=":",F2t="#";function Qve(t){if(t.hfId)return`hf${FD}${t.hfId}`;if(t.domId)return`dom${FD}${t.domId}`;if(t.selector){const e=t.selectorIndex??0;return`sel${FD}${t.selector}${F2t}${e}`}return null}function $2t(t){return{hfId:t.hfId,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex}}function B2t(t){return{hfId:t.hfId,domId:t.id,selector:t.selector,selectorIndex:t.selectorIndex}}const Rk=200,zve=128;function V2t(t){return{handle:Qve($2t(t)),label:t.label??null,tag:t.tag,kind:t.kind??null,start:t.start,duration:t.duration,track:t.track,zIndex:t.zIndex??null}}function H2t(t,e){const{capabilities:n}=t;return{handle:Qve(B2t(t)),label:t.label,tagName:t.tagName,sourceFile:t.sourceFile,box:t.boundingBox,text:t.textContent,can:{editStyles:n.canEditStyles,move:n.canMove||n.canApplyManualOffset,resize:n.canResize||n.canApplyManualSize,editText:t.textFields.length>0,reasonIfDisabled:n.reasonIfDisabled??null},animationCount:e}}function Q2t(t,e){var n,r;return(((n=t.label)==null?void 0:n.toLowerCase().includes(e))??!1)||t.tag.toLowerCase().includes(e)||(((r=t.handle)==null?void 0:r.toLowerCase().includes(e))??!1)}function z2t(t,e={}){var o;const n=t.elements.map(V2t),r=(o=e.filter)==null?void 0:o.slice(0,zve).trim().toLowerCase(),i=r?n.filter(l=>Q2t(l,r)):n,s=Number.isInteger(e.limit)&&e.limit>0?e.limit:Rk,a=Math.min(s,Rk);return j2t({projectId:t.projectId,compositionPath:t.compositionPath,playhead:t.currentTime,duration:t.duration,isPlaying:t.isPlaying,history:t.history,selection:t.selection?H2t(t.selection,t.selectionAnimationCount):null,elementCount:i.length,elements:i.slice(0,a)})}const Z2t={type:"object",properties:{filter:{type:"string",maxLength:zve,description:"Case-insensitive substring matched against element label, tag, and handle."},limit:{type:"integer",minimum:1,maximum:Rk,description:`Cap the returned elements (default and max ${Rk}). elementCount always reports the full match count.`}},additionalProperties:!1},G2t=["Read HyperFrames Studio's live state in one call: the open project and composition,","the playhead and duration, what the human currently has selected (including what that","element will and will not accept), and the timeline's elements with a handle for each.","Pass a handle back to any tool that edits an element.","Returns an object with `ok: true`, or `ok: false` with `kind`, `reason` and often a `hint`.","`history.undoLabel` is worth checkpointing before a batch: if it later names something","you did not do, a human pressed undo and your earlier edits are gone."].join(" "),m7=Z0("webmcp");function U2t(t,e){m7("registered",{native:e,...t});for(const n of t.failed)Ns("webmcp_registration_failed",{error_name:n.name,tool_name:n.tool})}function X2t(t){return[{name:"studio_look",title:"Look at the composition",description:G2t,inputSchema:Z2t,annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:e=>L2t("studio_look",async()=>z2t(t.current.getSnapshot(),e))}]}function W2t(t){const e=x.useRef(t);e.current=t,x.useEffect(()=>{if(to().agentToolsEnabled===!1){m7("skipped",{why:"disabled by preference"});return}const n=new AbortController;return(async()=>{const r=Vve();r&&Ns("webmcp.native_present");const i=r??await M2t();if(!i){m7("skipped",{why:"no model context, native or polyfilled"});return}if(n.signal.aborted)return;const s=await R2t(i,X2t(e),n.signal);U2t(s,r!==null)})(),()=>n.abort()},[])}function q2t(){const{projectId:t,activeCompPath:e,editHistory:n}=zl(),{domEditSelection:r,selectedGsapAnimations:i}=yy(),s=x.useCallback(()=>{const a=fe.getState();return{projectId:t,compositionPath:e,currentTime:a.currentTime,duration:a.duration,isPlaying:a.isPlaying,elements:a.elements,selection:r,selectionAnimationCount:i.length,history:{canUndo:n.canUndo,canRedo:n.canRedo,undoLabel:n.undoLabel??null,redoLabel:n.redoLabel??null}}},[t,e,r,i,n]);return W2t({getSnapshot:s}),null}function Y2t({left:t,right:e,hidden:n,timelineToolbar:r,renderClipContent:i,handleTimelineElementDelete:s,handleTimelineAssetDrop:a,handleTimelineBlockDrop:o,handleTimelineCompositionDrop:l,handlePreviewBlockDrop:c,handleTimelineFileDrop:u,handleTimelineElementMove:f,handleTimelineElementsMove:h,handleTimelineElementResize:m,handleTimelineGroupResize:y,handleToggleTrackHidden:d,setAudioGroupAttribute:v,handleGroupClips:b,setElementFxAttribute:w,handleBlockedTimelineEdit:O,handleTimelineElementSplit:k,handleRazorSplit:E,handleRazorSplitAll:M,setCompIdToSrc:N,setCompositionLoading:I,shouldShowMotionPath:_,shouldShowSelectedDomBounds:j,isGestureRecording:L,recordingState:B,onToggleRecording:$,blockPreview:Q,gestureOverlay:Y}){const{projectId:W,activeCompPath:J,setActiveCompPath:ne,handlePreviewIframeRef:le,showToast:ie}=zl(),{refreshKey:q,captionEditMode:F,refreshPreviewDocumentVersion:U,timelineElements:Z}=vy(),{handleTimelineElementSelect:K,buildDomSelectionForTimelineElement:ee,applyDomSelection:re,applyMarqueeSelection:z}=HE(),{domEditSelection:H,domEditGroupSelections:se}=yy(),ue=fe(ge=>ge.selectedElementId),be=fe(ge=>ge.selectedElementIds),me=x.useCallback(()=>{ie("The selected clip is not available in the preview yet.","info")},[ie]);E2t({selectedElementId:ue,selectedElementIds:be,timelineElements:Z,domEditSelection:H,domEditGroupSelections:se,activeCompPath:J,buildDomSelectionForTimelineElement:ee,applyDomSelection:re,applyMarqueeSelection:z,onSelectionNotFound:me});const pe=S2t({handleTimelineElementMove:f,handleTimelineElementsMove:h,handleTimelineElementResize:m,handleTimelineGroupResize:y,handleToggleTrackHidden:d,setAudioGroupAttribute:v,handleGroupClips:b,setElementFxAttribute:w,handleBlockedTimelineEdit:O,handleTimelineElementSplit:k,handleRazorSplit:E,handleRazorSplitAll:M});return p.jsx("div",{className:`flex flex-col flex-1 min-h-0${n?" hidden":""}`,children:p.jsx(T5e,{value:pe,children:p.jsx(ygt,{projectId:W,refreshKey:q,activeCompositionPath:J,onIframeRef:le,onCompIdToSrcChange:N,onCompositionLoadingChange:I,onCompositionChange:ge=>{ge!==J&&(ne(ge),U())},children:p.jsx(K2t,{left:t,right:e,captionEditMode:F,onSelectTimelineElement:K,onPreviewBlockDrop:c,timelineToolbar:r,renderClipContent:i,onFileDrop:u,onAssetDrop:a,onBlockDrop:o,onCompositionDrop:l,onDeleteElement:s,previewOverlay:p.jsx(g2t,{shouldShowMotionPath:_,shouldShowSelectedDomBounds:j,blockPreview:Q,isGestureRecording:L,recordingState:B,onToggleRecording:$,gestureOverlay:Y})})})})})}function K2t({left:t,right:e,captionEditMode:n,previewOverlay:r,onSelectTimelineElement:i,onPreviewBlockDrop:s,timelineToolbar:a,renderClipContent:o,onFileDrop:l,onAssetDrop:c,onBlockDrop:u,onCompositionDrop:f,onDeleteElement:h}){const{compositionStack:m,updateCompositionStack:y,containerRef:d}=rV(),v=x.useCallback(w=>{fe.getState().requestSeek(w)},[]),b=x.useCallback(w=>{w.key==="Escape"&&m.length>1&&y(O=>O.slice(0,-1))},[m.length,y]);return p.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-h-0 bg-[#18181B]",onKeyDown:b,tabIndex:-1,children:[p.jsx(q2t,{}),p.jsxs("div",{className:"flex flex-row flex-1 min-h-0 px-px pt-px",children:[t,p.jsx("div",{className:"flex-1 min-w-0 flex flex-col relative",children:p.jsx(kgt,{previewOverlay:r,onSelectTimelineElement:i,onPreviewBlockDrop:s})}),e]}),p.jsx(Pgt,{timelineToolbar:a,renderClipContent:o,onFileDrop:l,onAssetDrop:c,onBlockDrop:u,onCompositionDrop:f,onDeleteElement:h,onSelectTimelineElement:i,timelineFooter:n?p.jsxs("div",{className:"border-t border-neutral-800/30 flex-shrink-0",style:{height:60},children:[p.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5",children:p.jsx("span",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Captions"})}),p.jsx(w2t,{pixelsPerSecond:100,onSeek:v})]}):void 0})]})}const J2t=600,one=new Map;function evt(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function jk(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function tvt(t){try{const e=jk(t.section)||"unknown",n=jk(t.name),r=t.control||"unknown",i=`${t.ui}:${e}:${r}:${n||"unnamed"}`,s=evt(),a=one.get(i);if(a!==void 0&&s-a<J2t)return;one.set(i,s),Pt("design_input",{ui:t.ui,section:e,control:r,name:n||"unnamed"})}catch{}}const g7=Dc("DesignPanelInputContext",{ui:"classic",section:"unknown"});function vf({ui:t,section:e,children:n}){const r=x.useContext(g7),i=x.useMemo(()=>({ui:t??r.ui,section:e??r.section}),[t,e,r.ui,r.section]);return p.jsx(g7.Provider,{value:i,children:n})}function Dn(){const{ui:t,section:e}=x.useContext(g7);return x.useCallback((n,r)=>tvt({ui:t,section:e,control:n,name:r}),[t,e])}function nvt({element:t,copied:e,onCopy:n,onClear:r,onUngroup:i,selectedElementId:s,selectedElementHidden:a,visibilityLabel:o,onToggleHidden:l}){const c=Dn();return p.jsxs("div",{className:"flex items-center gap-1",children:[s&&l&&p.jsx("button",{type:"button","aria-label":o,title:o,onClick:()=>{c("toggle","Element visibility"),l(s,!a)},className:"flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",children:a?p.jsx($L,{size:13,weight:"bold","aria-hidden":"true"}):p.jsx(ZE,{size:13,weight:"bold","aria-hidden":"true"})}),i&&t.dataAttributes["hf-group"]!=null&&p.jsx("button",{type:"button",onClick:()=>{c("button","Ungroup"),i()},title:"Ungroup (⌘⇧G)",className:"flex h-6 items-center rounded px-2 text-[11px] font-medium text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-neutral-200",children:"Ungroup"}),p.jsx("button",{type:"button",onClick:()=>{c("button","Copy element info"),n()},className:`flex h-6 w-6 items-center justify-center rounded transition-colors ${e?"text-studio-accent":"text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300"}`,title:e?"Copied!":"Copy element info to clipboard",children:p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[p.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),p.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5"})]})}),p.jsx("button",{type:"button","aria-label":"Clear selection",onClick:()=>{c("button","Clear selection"),r()},className:"flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",children:p.jsx(Md,{size:13})})]})}function gV(t){const e=t.indexOf("?"),n=t.indexOf("#");return e<0?n<0?t:t.slice(0,n):n<0?t.slice(0,e):t.slice(0,Math.min(e,n))}function rvt(t,e){var n;return e?((n=t.find(r=>(r.key??r.id)===e))==null?void 0:n.hidden)===!0:!1}function y7(t){return[t.id??"",t.hfId??"",t.selector??"",String(t.selectorIndex??""),t.sourceFile??""].join("|")}const yV=new Set(["inherit","initial","revert","revert-layer","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-sans-serif","ui-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),ivt=[...ER,"Inter","system-ui","sans-serif","serif","monospace"];function lne(t){return t.replace(/[^\w .-]+/g," ").replace(/\s+/g," ").trim()}function n4(t){var r,i;const e=((r=t.style)==null?void 0:r.toLowerCase())??"",n=((i=t.fullName)==null?void 0:i.toLowerCase())??"";return e==="regular"||n.endsWith(" regular")?0:e==="normal"||n.endsWith(" normal")?1:e==="medium"||n.endsWith(" medium")?2:3}function $D(t){const e=new Set;return t.reduce((n,r)=>{const i=r.trim();if(!i)return n;const s=i.toLowerCase();return e.has(s)||(e.add(s),n.push(i)),n},[])}function cne(t){const e=new Set;return t.reduce((n,r)=>{const i=r.family.trim();if(!i)return n;const s=i.toLowerCase();return e.has(s)||(e.add(s),n.push({family:i,source:r.source})),n},[])}function svt(t){return[...t].sort((e,n)=>{const r=une(e.source)-une(n.source);if(r!==0)return r;const i=ER.findIndex(o=>o.toLowerCase()===e.family.toLowerCase()),s=ER.findIndex(o=>o.toLowerCase()===n.family.toLowerCase()),a=(i===-1?Number.MAX_SAFE_INTEGER:i)-(s===-1?Number.MAX_SAFE_INTEGER:s);return a===0?e.family.localeCompare(n.family):a})}function une(t){return t==="Current"?0:t==="Document"?1:t==="Imported"?2:t==="Google"?3:t==="Local"?4:5}const Nu="min-w-0 rounded-md bg-panel-input px-3 py-[7px] text-panel-text-1 transition-colors focus-within:ring-1 focus-within:ring-panel-accent/30",pr="text-[11px] font-medium text-panel-text-3",qs="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3",avt={},x7="none",Zve={none:"none",soft:"0 12px 36px rgba(0, 0, 0, 0.28)",lift:"0 18px 54px rgba(0, 0, 0, 0.38)",glow:"0 0 0 1px rgba(60, 230, 172, 0.34), 0 18px 56px rgba(60, 230, 172, 0.2)"};function r4(t){return zA(t)??{red:0,green:0,blue:0,alpha:1}}function ca(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Sc(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function Sr(t){const e=ba(t);return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function Fd(t){if(!t)return null;const e=t.trim().match(/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i);if(!e)return null;const n=Number.parseFloat(e[1]);return Number.isFinite(n)?{value:n,unit:e[2]??""}:null}function oo(t){const e=Fd(t);return!e||e.unit&&e.unit.toLowerCase()!=="px"?null:e.value}function Gve(t,e,n,r){return Number.isFinite(t)?Math.max(e,Math.min(n,t)):r}function Uve(t,e={}){const n=Fd(t.trim());if(!n||n.unit&&n.unit.toLowerCase()!=="px")return null;const r=Gve(n.value,e.min??Number.NEGATIVE_INFINITY,e.max??Number.POSITIVE_INFINITY,e.fallback??0);return`${Sr(r)}px`}function di(t){return`${Sr(t)}px`}function Lk(t,e){const n=e.trim();if(!n||n==="normal")return n||"normal";const r=Fd(n);return r?t==="letter-spacing"?r.unit?n:`${Sr(r.value)}px`:r.unit?n:r.value>4?`${Sr(r.value)}px`:Sr(r.value):n}function ovt(t){const e=t.trim(),n=[];let r=0,i=0;for(let a=0;a<e.length;a+=1){const o=e[a];if(o==="("&&(r+=1),o===")"&&(r=Math.max(0,r-1)),/\s/.test(o)&&r===0){const l=e.slice(i,a).trim();l&&n.push(l),i=a+1}}const s=e.slice(i).trim();return s&&n.push(s),n}function Fk(t,e){const n=t==null?void 0:t.trim();if(!n||n===x7)return 0;const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(?:^|\\s)${r}\\((-?\\d+(?:\\.\\d+)?)px\\)`,"i").exec(n);if(!i)return 0;const s=Number.parseFloat(i[1]);return Number.isFinite(s)?Math.max(0,s):0}function $k(t,e,n){const r=Gve(n,0,200,0),i=ovt(t&&t.trim()!==x7?t:""),s=e.toLowerCase(),a=i.filter(o=>!o.toLowerCase().startsWith(`${s}(`));return r>0&&a.push(`${e}(${Sr(r)}px)`),a.length>0?a.join(" "):x7}function Xve(t){const e=(t==null?void 0:t.trim())||"none";for(const[n,r]of Object.entries(Zve))if(e===r)return n;return e==="none"?"none":"custom"}function Wve(t,e){return t==="custom"?(e==null?void 0:e.trim())||"none":Zve[t]}function qve(t,e){const n=[["border-width",t]],r=Fd(t),i=(e==null?void 0:e.trim().toLowerCase())||"none";return r&&r.value>0&&(i==="none"||i==="hidden")&&n.push(["border-style","solid"]),n}function Yve(t,e){const n=[["border-style",t]],r=t.trim().toLowerCase();if(!r||r==="none"||r==="hidden")return n;const i=Fd((e==null?void 0:e.trim())||"0");return(!i||i.value<=0)&&n.push(["border-width","1px"]),n}function fne(t,e,n){const r=Fd(t);if(!r)return null;const i=n!=null&&n.altKey?.1:n!=null&&n.shiftKey?10:1,s=r.value+i*e;return`${Sr(s)}${r.unit}`}function Kve(t){if(!t)return"";const n=t.toLowerCase().indexOf("url(");if(n<0)return"";let r=n+4;for(;r<t.length&&(t[r]===" "||t[r]===`
|
|
339
339
|
`||t[r]==="\r"||t[r]===" "||t[r]==="\f");)r+=1;const i=t[r]==='"'||t[r]==="'"?t[r]:null;if(i){r+=1;const a=t.indexOf(i,r);return a>=r?t.slice(r,a):""}const s=t.indexOf(")",r);return s<r?"":t.slice(r,s).trim()}const lvt=["x","y","rotation","rotationX","rotationY","rotationZ","z","scale","transformPerspective","opacity"];function cvt(t){const e=new Set(lvt);for(const n of t){if(n.keyframes)for(const r of n.keyframes.keyframes)for(const i of Object.keys(r.properties))e.add(i);for(const r of Object.keys(n.properties))e.add(r)}return e}function uvt(t,e,n,r){var a;if(!t||e.length===0)return null;const i=r==null?void 0:r.current;if(!(i!=null&&i.contentWindow))return null;const s=n.id?`#${n.id}`:n.selector;if(!s)return null;try{const o=i.contentWindow.gsap;if(!(o!=null&&o.getProperty))return null;const l=(a=i.contentDocument)==null?void 0:a.querySelector(s);if(!l)return null;const c=cvt(e),u={};for(const f of c){const h=Number(o.getProperty(l,f));Number.isFinite(h)&&(u[f]=ba(h))}return Object.keys(u).length>0?u:null}catch{return null}}function fvt(t,e,n,r){if((!t||!("borderRadius"in t))&&!e.some(o=>{var l;return"borderRadius"in o.properties||((l=o.keyframes)==null?void 0:l.keyframes.some(c=>"borderRadius"in c.properties))}))return null;const i=r==null?void 0:r.current,s=n.id?`#${n.id}`:n.selector;if(!(i!=null&&i.contentDocument)||!s)return null;try{const a=i.contentDocument.querySelector(s);if(!a||!i.contentWindow)return null;const o=i.contentWindow.getComputedStyle(a),l=c=>Number.parseFloat(c)||0;return{tl:l(o.borderTopLeftRadius),tr:l(o.borderTopRightRadius),br:l(o.borderBottomRightRadius),bl:l(o.borderBottomLeftRadius)}}catch{return null}}function hvt(t,e,n,r){var l,c,u;const i=t.sourceFile??"index.html";let s=null;try{const f=((u=(c=(l=r==null?void 0:r.current)==null?void 0:l.contentDocument)==null?void 0:c.documentElement)==null?void 0:u.outerHTML)??"";if(f&&t.id){const h=f.indexOf(`id="${t.id}"`);h>-1&&(s=f.slice(0,h).split(`
|
|
340
340
|
`).length)}if(!s&&t.selector){const h=t.tagName.toLowerCase(),m=t.selector.startsWith(".")?t.selector.slice(1).split(".")[0]:null,y=m?`class="${m}`:`<${h}`,d=f.indexOf(y);d>-1&&(s=f.slice(0,d).split(`
|
|
341
341
|
`).length)}}catch{}const a=s?`${i}:${s}`:i,o=[`Element: ${t.label} (${e})`,`File: ${a}`,`Position: x=${Math.round(t.boundingBox.x)}, y=${Math.round(t.boundingBox.y)}`,`Size: ${Math.round(t.boundingBox.width)}×${Math.round(t.boundingBox.height)}`,`Tag: <${t.tagName}>`];if(t.computedStyles["z-index"]&&t.computedStyles["z-index"]!=="auto"&&o.push(`Z-index: ${t.computedStyles["z-index"]}`),n.length>0){const f=n[0];o.push(`Animation: ${f.method}() ${f.duration}s at ${f.position}s, ease: ${f.ease??"default"}`);const h=Object.entries(f.properties).map(([m,y])=>`${m}: ${y}`).join(", ");h&&o.push(`Properties: ${h}`)}return o.join(`
|