hyperframes 0.6.89 → 0.6.91
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/cli.js +5732 -1172
- package/dist/studio/assets/index-CgYcO2PV.js +146 -0
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
- package/dist/studio/assets/index-2SbRRd33.js +0 -146
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var jE=Object.defineProperty;var PE=(t,e,n)=>e in t?jE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zy=(t,e,n)=>PE(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function QE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yp={exports:{}},_c={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Fy;function ZE(){if(Fy)return _c;Fy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:a}}return _c.Fragment=e,_c.jsx=n,_c.jsxs=n,_c}var By;function NE(){return By||(By=1,yp.exports=ZE()),yp.exports}var m=NE(),bp={exports:{}},Ke={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Yy;function RE(){if(Yy)return Ke;Yy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),x=Symbol.iterator;function y(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function A(R,P,L){this.props=R,this.context=P,this.refs=k,this.updater=L||b}A.prototype.isReactComponent={},A.prototype.setState=function(R,P){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,P,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=A.prototype;function T(R,P,L){this.props=R,this.context=P,this.refs=k,this.updater=L||b}var j=T.prototype=new C;j.constructor=T,S(j,A.prototype),j.isPureReactComponent=!0;var M=Array.isArray;function E(){}var $={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function D(R,P,L){var V=L.ref;return{$$typeof:t,type:R,key:P,ref:V!==void 0?V:null,props:L}}function z(R,P){return D(R.type,P,R.props)}function B(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function X(R){var P={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(L){return P[L]})}var U=/\/+/g;function I(R,P){return typeof R=="object"&&R!==null&&R.key!=null?X(""+R.key):P.toString(36)}function K(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(E,E):(R.status="pending",R.then(function(P){R.status==="pending"&&(R.status="fulfilled",R.value=P)},function(P){R.status==="pending"&&(R.status="rejected",R.reason=P)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Z(R,P,L,V,W){var ee=typeof R;(ee==="undefined"||ee==="boolean")&&(R=null);var ue=!1;if(R===null)ue=!0;else switch(ee){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(R.$$typeof){case t:case e:ue=!0;break;case p:return ue=R._init,Z(ue(R._payload),P,L,V,W)}}if(ue)return W=W(R),ue=V===""?"."+I(R,0):V,M(W)?(L="",ue!=null&&(L=ue.replace(U,"$&/")+"/"),Z(W,P,L,"",function(re){return re})):W!=null&&(B(W)&&(W=z(W,L+(W.key==null||R&&R.key===W.key?"":(""+W.key).replace(U,"$&/")+"/")+ue)),P.push(W)),1;ue=0;var ae=V===""?".":V+":";if(M(R))for(var Y=0;Y<R.length;Y++)V=R[Y],ee=ae+I(V,Y),ue+=Z(V,P,L,ee,W);else if(Y=y(R),typeof Y=="function")for(R=Y.call(R),Y=0;!(V=R.next()).done;)V=V.value,ee=ae+I(V,Y++),ue+=Z(V,P,L,ee,W);else if(ee==="object"){if(typeof R.then=="function")return Z(K(R),P,L,V,W);throw P=String(R),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ue}function F(R,P,L){if(R==null)return R;var V=[],W=0;return Z(R,V,"","",function(ee){return P.call(L,ee,W++)}),V}function _(R){if(R._status===-1){var P=R._result;P=P(),P.then(function(L){(R._status===0||R._status===-1)&&(R._status=1,R._result=L)},function(L){(R._status===0||R._status===-1)&&(R._status=2,R._result=L)}),R._status===-1&&(R._status=0,R._result=P)}if(R._status===1)return R._result.default;throw R._result}var q=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},G={map:F,forEach:function(R,P,L){F(R,function(){P.apply(this,arguments)},L)},count:function(R){var P=0;return F(R,function(){P++}),P},toArray:function(R){return F(R,function(P){return P})||[]},only:function(R){if(!B(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ke.Activity=O,Ke.Children=G,Ke.Component=A,Ke.Fragment=n,Ke.Profiler=i,Ke.PureComponent=T,Ke.StrictMode=r,Ke.Suspense=u,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(R){return $.H.useMemoCache(R)}},Ke.cache=function(R){return function(){return R.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(R,P,L){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var V=S({},R.props),W=R.key;if(P!=null)for(ee in P.key!==void 0&&(W=""+P.key),P)!N.call(P,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&P.ref===void 0||(V[ee]=P[ee]);var ee=arguments.length-2;if(ee===1)V.children=L;else if(1<ee){for(var ue=Array(ee),ae=0;ae<ee;ae++)ue[ae]=arguments[ae+2];V.children=ue}return D(R.type,W,V)},Ke.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:a,_context:R},R},Ke.createElement=function(R,P,L){var V,W={},ee=null;if(P!=null)for(V in P.key!==void 0&&(ee=""+P.key),P)N.call(P,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(W[V]=P[V]);var ue=arguments.length-2;if(ue===1)W.children=L;else if(1<ue){for(var ae=Array(ue),Y=0;Y<ue;Y++)ae[Y]=arguments[Y+2];W.children=ae}if(R&&R.defaultProps)for(V in ue=R.defaultProps,ue)W[V]===void 0&&(W[V]=ue[V]);return D(R,ee,W)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(R){return{$$typeof:c,render:R}},Ke.isValidElement=B,Ke.lazy=function(R){return{$$typeof:p,_payload:{_status:-1,_result:R},_init:_}},Ke.memo=function(R,P){return{$$typeof:h,type:R,compare:P===void 0?null:P}},Ke.startTransition=function(R){var P=$.T,L={};$.T=L;try{var V=R(),W=$.S;W!==null&&W(L,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(E,q)}catch(ee){q(ee)}finally{P!==null&&L.types!==null&&(P.types=L.types),$.T=P}},Ke.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Ke.use=function(R){return $.H.use(R)},Ke.useActionState=function(R,P,L){return $.H.useActionState(R,P,L)},Ke.useCallback=function(R,P){return $.H.useCallback(R,P)},Ke.useContext=function(R){return $.H.useContext(R)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(R,P){return $.H.useDeferredValue(R,P)},Ke.useEffect=function(R,P){return $.H.useEffect(R,P)},Ke.useEffectEvent=function(R){return $.H.useEffectEvent(R)},Ke.useId=function(){return $.H.useId()},Ke.useImperativeHandle=function(R,P,L){return $.H.useImperativeHandle(R,P,L)},Ke.useInsertionEffect=function(R,P){return $.H.useInsertionEffect(R,P)},Ke.useLayoutEffect=function(R,P){return $.H.useLayoutEffect(R,P)},Ke.useMemo=function(R,P){return $.H.useMemo(R,P)},Ke.useOptimistic=function(R,P){return $.H.useOptimistic(R,P)},Ke.useReducer=function(R,P,L){return $.H.useReducer(R,P,L)},Ke.useRef=function(R){return $.H.useRef(R)},Ke.useState=function(R){return $.H.useState(R)},Ke.useSyncExternalStore=function(R,P,L){return $.H.useSyncExternalStore(R,P,L)},Ke.useTransition=function(){return $.H.useTransition()},Ke.version="19.2.6",Ke}var Iy;function R8(){return Iy||(Iy=1,bp.exports=RE()),bp.exports}var d=R8();const M1=QE(d);var vp={exports:{}},Dc={},Sp={exports:{}},wp={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var qy;function VE(){return qy||(qy=1,(function(t){function e(Z,F){var _=Z.length;Z.push(F);e:for(;0<_;){var q=_-1>>>1,G=Z[q];if(0<i(G,F))Z[q]=F,Z[_]=G,_=q;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var F=Z[0],_=Z.pop();if(_!==F){Z[0]=_;e:for(var q=0,G=Z.length,R=G>>>1;q<R;){var P=2*(q+1)-1,L=Z[P],V=P+1,W=Z[V];if(0>i(L,_))V<G&&0>i(W,L)?(Z[q]=W,Z[V]=_,q=V):(Z[q]=L,Z[P]=_,q=P);else if(V<G&&0>i(W,_))Z[q]=W,Z[V]=_,q=V;else break e}}return F}function i(Z,F){var _=Z.sortIndex-F.sortIndex;return _!==0?_:Z.id-F.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var u=[],h=[],p=1,O=null,x=3,y=!1,b=!1,S=!1,k=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function j(Z){for(var F=n(h);F!==null;){if(F.callback===null)r(h);else if(F.startTime<=Z)r(h),F.sortIndex=F.expirationTime,e(u,F);else break;F=n(h)}}function M(Z){if(S=!1,j(Z),!b)if(n(u)!==null)b=!0,E||(E=!0,X());else{var F=n(h);F!==null&&K(M,F.startTime-Z)}}var E=!1,$=-1,N=5,D=-1;function z(){return k?!0:!(t.unstable_now()-D<N)}function B(){if(k=!1,E){var Z=t.unstable_now();D=Z;var F=!0;try{e:{b=!1,S&&(S=!1,C($),$=-1),y=!0;var _=x;try{t:{for(j(Z),O=n(u);O!==null&&!(O.expirationTime>Z&&z());){var q=O.callback;if(typeof q=="function"){O.callback=null,x=O.priorityLevel;var G=q(O.expirationTime<=Z);if(Z=t.unstable_now(),typeof G=="function"){O.callback=G,j(Z),F=!0;break t}O===n(u)&&r(u),j(Z)}else r(u);O=n(u)}if(O!==null)F=!0;else{var R=n(h);R!==null&&K(M,R.startTime-Z),F=!1}}break e}finally{O=null,x=_,y=!1}F=void 0}}finally{F?X():E=!1}}}var X;if(typeof T=="function")X=function(){T(B)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,I=U.port2;U.port1.onmessage=B,X=function(){I.postMessage(null)}}else X=function(){A(B,0)};function K(Z,F){$=A(function(){Z(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(Z){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var _=x;x=F;try{return Z()}finally{x=_}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(Z,F){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var _=x;x=Z;try{return F()}finally{x=_}},t.unstable_scheduleCallback=function(Z,F,_){var q=t.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?q+_:q):_=q,Z){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=_+G,Z={id:p++,callback:F,priorityLevel:Z,startTime:_,expirationTime:G,sortIndex:-1},_>q?(Z.sortIndex=_,e(h,Z),n(u)===null&&Z===n(h)&&(S?(C($),$=-1):S=!0,K(M,_-q))):(Z.sortIndex=G,e(u,Z),b||y||(b=!0,E||(E=!0,X()))),Z},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(Z){var F=x;return function(){var _=x;x=F;try{return Z.apply(this,arguments)}finally{x=_}}}})(wp)),wp}var Gy;function LE(){return Gy||(Gy=1,Sp.exports=VE()),Sp.exports}var kp={exports:{}},Yn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Uy;function _E(){if(Uy)return Yn;Uy=1;var t=R8();function e(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(u,h,p){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:O==null?null:""+O,children:u,containerInfo:h,implementation:p}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Yn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Yn.createPortal=function(u,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(u,h,null,p)},Yn.flushSync=function(u){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,u)return u()}finally{l.T=h,r.p=p,r.d.f()}},Yn.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(u,h))},Yn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Yn.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var p=h.as,O=c(p,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:O,integrity:x,fetchPriority:y}):p==="script"&&r.d.X(u,{crossOrigin:O,integrity:x,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Yn.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(u)},Yn.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,O=c(p,h.crossOrigin);r.d.L(u,p,{crossOrigin:O,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Yn.preloadModule=function(u,h){if(typeof u=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(u)},Yn.requestFormReset=function(u){r.d.r(u)},Yn.unstable_batchedUpdates=function(u,h){return u(h)},Yn.useFormState=function(u,h,p){return l.H.useFormState(u,h,p)},Yn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Yn.version="19.2.6",Yn}var Wy;function YS(){if(Wy)return kp.exports;Wy=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(),kp.exports=_E(),kp.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Ky;function DE(){if(Ky)return Dc;Ky=1;var t=LE(),e=R8(),n=YS();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var o=s,f=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(f=o.return),s=o.return;while(s)}return o.tag===3?f:null}function l(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function c(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(r(188))}function h(s){var o=s.alternate;if(!o){if(o=a(s),o===null)throw Error(r(188));return o!==s?null:s}for(var f=s,g=o;;){var v=f.return;if(v===null)break;var w=v.alternate;if(w===null){if(g=v.return,g!==null){f=g;continue}break}if(v.child===w.child){for(w=v.child;w;){if(w===f)return u(v),s;if(w===g)return u(v),o;w=w.sibling}throw Error(r(188))}if(f.return!==g.return)f=v,g=w;else{for(var Q=!1,H=v.child;H;){if(H===f){Q=!0,f=v,g=w;break}if(H===g){Q=!0,g=v,f=w;break}H=H.sibling}if(!Q){for(H=w.child;H;){if(H===f){Q=!0,f=w,g=v;break}if(H===g){Q=!0,g=w,f=v;break}H=H.sibling}if(!Q)throw Error(r(189))}}if(f.alternate!==g)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?s:o}function p(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=p(s),o!==null)return o;s=s.sibling}return null}var O=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function X(s){return s===null||typeof s!="object"?null:(s=B&&s[B]||s["@@iterator"],typeof s=="function"?s:null)}var U=Symbol.for("react.client.reference");function I(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===U?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case A:return"Profiler";case k:return"StrictMode";case M:return"Suspense";case E:return"SuspenseList";case D:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case T:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case j:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case $:return o=s.displayName||null,o!==null?o:I(s.type)||"Memo";case N:o=s._payload,s=s._init;try{return I(s(o))}catch{}}return null}var K=Array.isArray,Z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_={pending:!1,data:null,method:null,action:null},q=[],G=-1;function R(s){return{current:s}}function P(s){0>G||(s.current=q[G],q[G]=null,G--)}function L(s,o){G++,q[G]=s.current,s.current=o}var V=R(null),W=R(null),ee=R(null),ue=R(null);function ae(s,o){switch(L(ee,o),L(W,s),L(V,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?dy(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=dy(o),s=hy(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}P(V),L(V,s)}function Y(){P(V),P(W),P(ee)}function re(s){s.memoizedState!==null&&L(ue,s);var o=V.current,f=hy(o,s.type);o!==f&&(L(W,s),L(V,f))}function he(s){W.current===s&&(P(V),P(W)),ue.current===s&&(P(ue),Nc._currentValue=_)}var xe,ke;function be(s){if(xe===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);xe=o&&o[1]||"",ke=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+xe+s+ke}var Se=!1;function Ve(s,o){if(!s||Se)return"";Se=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(fe){var ce=fe}Reflect.construct(s,[],pe)}else{try{pe.call()}catch(fe){ce=fe}s.call(pe.prototype)}}else{try{throw Error()}catch(fe){ce=fe}(pe=s())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(fe){if(fe&&ce&&typeof fe.stack=="string")return[fe.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=g.DetermineComponentFrameRoot(),Q=w[0],H=w[1];if(Q&&H){var J=Q.split(`
|
|
44
|
+
`),le=H.split(`
|
|
45
|
+
`);for(v=g=0;g<J.length&&!J[g].includes("DetermineComponentFrameRoot");)g++;for(;v<le.length&&!le[v].includes("DetermineComponentFrameRoot");)v++;if(g===J.length||v===le.length)for(g=J.length-1,v=le.length-1;1<=g&&0<=v&&J[g]!==le[v];)v--;for(;1<=g&&0<=v;g--,v--)if(J[g]!==le[v]){if(g!==1||v!==1)do if(g--,v--,0>v||J[g]!==le[v]){var de=`
|
|
46
|
+
`+J[g].replace(" at new "," at ");return s.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",s.displayName)),de}while(1<=g&&0<=v);break}}}finally{Se=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?be(f):""}function Te(s,o){switch(s.tag){case 26:case 27:case 5:return be(s.type);case 16:return be("Lazy");case 13:return s.child!==o&&o!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ve(s.type,!1);case 11:return Ve(s.type.render,!1);case 1:return Ve(s.type,!0);case 31:return be("Activity");default:return""}}function Ze(s){try{var o="",f=null;do o+=Te(s,f),f=s,s=s.return;while(s);return o}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var Xe=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,et=t.unstable_cancelCallback,Ot=t.unstable_shouldYield,He=t.unstable_requestPaint,ct=t.unstable_now,yt=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,$e=t.log,ut=t.unstable_setDisableYieldValue,Ae=null,Be=null;function lt(s){if(typeof $e=="function"&&ut(s),Be&&typeof Be.setStrictMode=="function")try{Be.setStrictMode(Ae,s)}catch{}}var ot=Math.clz32?Math.clz32:Le,gn=Math.log,at=Math.LN2;function Le(s){return s>>>=0,s===0?32:31-(gn(s)/at|0)|0}var Ue=256,Mt=262144,We=4194304;function bt(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Et(s,o,f){var g=s.pendingLanes;if(g===0)return 0;var v=0,w=s.suspendedLanes,Q=s.pingedLanes;s=s.warmLanes;var H=g&134217727;return H!==0?(g=H&~w,g!==0?v=bt(g):(Q&=H,Q!==0?v=bt(Q):f||(f=H&~s,f!==0&&(v=bt(f))))):(H=g&~w,H!==0?v=bt(H):Q!==0?v=bt(Q):f||(f=g&~s,f!==0&&(v=bt(f)))),v===0?0:o!==0&&o!==v&&(o&w)===0&&(w=v&-v,f=o&-o,w>=f||w===32&&(f&4194048)!==0)?o:v}function It(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function qt(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Tn(){var s=We;return We<<=1,(We&62914560)===0&&(We=4194304),s}function Zn(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function Fn(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ni(s,o,f,g,v,w){var Q=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var H=s.entanglements,J=s.expirationTimes,le=s.hiddenUpdates;for(f=Q&~f;0<f;){var de=31-ot(f),pe=1<<de;H[de]=0,J[de]=-1;var ce=le[de];if(ce!==null)for(le[de]=null,de=0;de<ce.length;de++){var fe=ce[de];fe!==null&&(fe.lane&=-536870913)}f&=~pe}g!==0&&ri(s,g,0),w!==0&&v===0&&s.tag!==0&&(s.suspendedLanes|=w&~(Q&~o))}function ri(s,o,f){s.pendingLanes|=o,s.suspendedLanes&=~o;var g=31-ot(o);s.entangledLanes|=o,s.entanglements[g]=s.entanglements[g]|1073741824|f&261930}function ii(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var g=31-ot(f),v=1<<g;v&o|s[g]&o&&(s[g]|=o),f&=~v}}function Pe(s,o){var f=o&-o;return f=(f&42)!==0?1:jt(f),(f&(s.suspendedLanes|o))!==0?0:f}function jt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Nt(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function nn(){var s=F.p;return s!==0?s:(s=window.event,s===void 0?32:Ry(s.type))}function Jn(s,o){var f=F.p;try{return F.p=s,o()}finally{F.p=f}}var Sn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Sn,ve="__reactProps$"+Sn,tt="__reactContainer$"+Sn,wn="__reactEvents$"+Sn,vr="__reactListeners$"+Sn,Yi="__reactHandles$"+Sn,Ii="__reactResources$"+Sn,wi="__reactMarker$"+Sn;function ai(s){delete s[Rt],delete s[ve],delete s[wn],delete s[vr],delete s[Yi]}function si(s){var o=s[Rt];if(o)return o;for(var f=s.parentNode;f;){if(o=f[tt]||f[Rt]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=by(s);s!==null;){if(f=s[Rt])return f;s=by(s)}return o}s=f,f=s.parentNode}return null}function ye(s){if(s=s[Rt]||s[tt]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function _e(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function ft(s){var o=s[Ii];return o||(o=s[Ii]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function rt(s){s[wi]=!0}var Sr=new Set,Za={};function Bn(s,o){Na(s,o),Na(s+"Capture",o)}function Na(s,o){for(Za[s]=o,s=0;s<o.length;s++)Sr.add(o[s])}var fh=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]*$"),m0={},p0={};function dh(s){return Xe.call(p0,s)?!0:Xe.call(m0,s)?!1:fh.test(s)?p0[s]=!0:(m0[s]=!0,!1)}function Ol(s,o,f){if(dh(o))if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+f)}}function xl(s,o,f){if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+f)}}function li(s,o,f,g){if(g===null)s.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(f);return}s.setAttributeNS(o,f,""+g)}}function ar(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function g0(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function hh(s,o,f){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var v=g.get,w=g.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return v.call(this)},set:function(Q){f=""+Q,w.call(this,Q)}}),Object.defineProperty(s,o,{enumerable:g.enumerable}),{getValue:function(){return f},setValue:function(Q){f=""+Q},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Wo(s){if(!s._valueTracker){var o=g0(s)?"checked":"value";s._valueTracker=hh(s,o,""+s[o])}}function vt(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),g="";return s&&(g=g0(s)?s.checked?"true":"false":s.value),s=g,s!==f?(o.setValue(s),!0):!1}function Ft(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var wr=/[\n"\\]/g;function kn(s){return s.replace(wr,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ki(s,o,f,g,v,w,Q,H){s.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?s.type=Q:s.removeAttribute("type"),o!=null?Q==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+ar(o)):s.value!==""+ar(o)&&(s.value=""+ar(o)):Q!=="submit"&&Q!=="reset"||s.removeAttribute("value"),o!=null?mh(s,Q,ar(o)):f!=null?mh(s,Q,ar(f)):g!=null&&s.removeAttribute("value"),v==null&&w!=null&&(s.defaultChecked=!!w),v!=null&&(s.checked=v&&typeof v!="function"&&typeof v!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?s.name=""+ar(H):s.removeAttribute("name")}function Es(s,o,f,g,v,w,Q,H){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.type=w),o!=null||f!=null){if(!(w!=="submit"&&w!=="reset"||o!=null)){Wo(s);return}f=f!=null?""+ar(f):"",o=o!=null?""+ar(o):f,H||o===s.value||(s.value=o),s.defaultValue=o}g=g??v,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=H?s.checked:!!g,s.defaultChecked=!!g,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(s.name=Q),Wo(s)}function mh(s,o,f){o==="number"&&Ft(s.ownerDocument)===s||s.defaultValue===""+f||(s.defaultValue=""+f)}function yl(s,o,f,g){if(s=s.options,o){o={};for(var v=0;v<f.length;v++)o["$"+f[v]]=!0;for(f=0;f<s.length;f++)v=o.hasOwnProperty("$"+s[f].value),s[f].selected!==v&&(s[f].selected=v),v&&g&&(s[f].defaultSelected=!0)}else{for(f=""+ar(f),o=null,v=0;v<s.length;v++){if(s[v].value===f){s[v].selected=!0,g&&(s[v].defaultSelected=!0);return}o!==null||s[v].disabled||(o=s[v])}o!==null&&(o.selected=!0)}}function l6(s,o,f){if(o!=null&&(o=""+ar(o),o!==s.value&&(s.value=o),f==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=f!=null?""+ar(f):""}function o6(s,o,f,g){if(o==null){if(g!=null){if(f!=null)throw Error(r(92));if(K(g)){if(1<g.length)throw Error(r(93));g=g[0]}f=g}f==null&&(f=""),o=f}f=ar(o),s.defaultValue=f,g=s.textContent,g===f&&g!==""&&g!==null&&(s.value=g),Wo(s)}function bl(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var MC=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 c6(s,o,f){var g=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?g?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":g?s.setProperty(o,f):typeof f!="number"||f===0||MC.has(o)?o==="float"?s.cssFloat=f:s[o]=(""+f).trim():s[o]=f+"px"}function u6(s,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,f!=null){for(var g in f)!f.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var v in o)g=o[v],o.hasOwnProperty(v)&&f[v]!==g&&c6(s,v,g)}else for(var w in o)o.hasOwnProperty(w)&&c6(s,w,o[w])}function ph(s){if(s.indexOf("-")===-1)return!1;switch(s){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 CC=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"]]),TC=/^[\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 O0(s){return TC.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function qi(){}var gh=null;function Oh(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var vl=null,Sl=null;function f6(s){var o=ye(s);if(o&&(s=o.stateNode)){var f=s[ve]||null;e:switch(s=o.stateNode,o.type){case"input":if(ki(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+kn(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var g=f[o];if(g!==s&&g.form===s.form){var v=g[ve]||null;if(!v)throw Error(r(90));ki(g,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<f.length;o++)g=f[o],g.form===s.form&&vt(g)}break e;case"textarea":l6(s,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&yl(s,!!f.multiple,o,!1)}}}var xh=!1;function d6(s,o,f){if(xh)return s(o,f);xh=!0;try{var g=s(o);return g}finally{if(xh=!1,(vl!==null||Sl!==null)&&(i1(),vl&&(o=vl,s=Sl,Sl=vl=null,f6(o),s)))for(o=0;o<s.length;o++)f6(s[o])}}function Ko(s,o){var f=s.stateNode;if(f===null)return null;var g=f[ve]||null;if(g===null)return null;f=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var Gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yh=!1;if(Gi)try{var Jo={};Object.defineProperty(Jo,"passive",{get:function(){yh=!0}}),window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{yh=!1}var Ra=null,bh=null,x0=null;function h6(){if(x0)return x0;var s,o=bh,f=o.length,g,v="value"in Ra?Ra.value:Ra.textContent,w=v.length;for(s=0;s<f&&o[s]===v[s];s++);var Q=f-s;for(g=1;g<=Q&&o[f-g]===v[w-g];g++);return x0=v.slice(s,1<g?1-g:void 0)}function y0(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function b0(){return!0}function m6(){return!1}function sr(s){function o(f,g,v,w,Q){this._reactName=f,this._targetInst=v,this.type=g,this.nativeEvent=w,this.target=Q,this.currentTarget=null;for(var H in s)s.hasOwnProperty(H)&&(f=s[H],this[H]=f?f(w):w[H]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?b0:m6,this.isPropagationStopped=m6,this}return O(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=b0)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=b0)},persist:function(){},isPersistent:b0}),o}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},v0=sr($s),ec=O({},$s,{view:0,detail:0}),EC=sr(ec),vh,Sh,tc,S0=O({},ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==tc&&(tc&&s.type==="mousemove"?(vh=s.screenX-tc.screenX,Sh=s.screenY-tc.screenY):Sh=vh=0,tc=s),vh)},movementY:function(s){return"movementY"in s?s.movementY:Sh}}),p6=sr(S0),$C=O({},S0,{dataTransfer:0}),jC=sr($C),PC=O({},ec,{relatedTarget:0}),wh=sr(PC),QC=O({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),ZC=sr(QC),NC=O({},$s,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),RC=sr(NC),VC=O({},$s,{data:0}),g6=sr(VC),LC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_C={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"},DC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HC(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=DC[s])?!!o[s]:!1}function kh(){return HC}var XC=O({},ec,{key:function(s){if(s.key){var o=LC[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=y0(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?_C[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kh,charCode:function(s){return s.type==="keypress"?y0(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?y0(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),zC=sr(XC),FC=O({},S0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O6=sr(FC),BC=O({},ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kh}),YC=sr(BC),IC=O({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),qC=sr(IC),GC=O({},S0,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),UC=sr(GC),WC=O({},$s,{newState:0,oldState:0}),KC=sr(WC),JC=[9,13,27,32],Ah=Gi&&"CompositionEvent"in window,nc=null;Gi&&"documentMode"in document&&(nc=document.documentMode);var eT=Gi&&"TextEvent"in window&&!nc,x6=Gi&&(!Ah||nc&&8<nc&&11>=nc),y6=" ",b6=!1;function v6(s,o){switch(s){case"keyup":return JC.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S6(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var wl=!1;function tT(s,o){switch(s){case"compositionend":return S6(o);case"keypress":return o.which!==32?null:(b6=!0,y6);case"textInput":return s=o.data,s===y6&&b6?null:s;default:return null}}function nT(s,o){if(wl)return s==="compositionend"||!Ah&&v6(s,o)?(s=h6(),x0=bh=Ra=null,wl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return x6&&o.locale!=="ko"?null:o.data;default:return null}}var rT={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 w6(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!rT[s.type]:o==="textarea"}function k6(s,o,f,g){vl?Sl?Sl.push(g):Sl=[g]:vl=g,o=f1(o,"onChange"),0<o.length&&(f=new v0("onChange","change",null,f,g),s.push({event:f,listeners:o}))}var rc=null,ic=null;function iT(s){sy(s,0)}function w0(s){var o=_e(s);if(vt(o))return s}function A6(s,o){if(s==="change")return o}var M6=!1;if(Gi){var Mh;if(Gi){var Ch="oninput"in document;if(!Ch){var C6=document.createElement("div");C6.setAttribute("oninput","return;"),Ch=typeof C6.oninput=="function"}Mh=Ch}else Mh=!1;M6=Mh&&(!document.documentMode||9<document.documentMode)}function T6(){rc&&(rc.detachEvent("onpropertychange",E6),ic=rc=null)}function E6(s){if(s.propertyName==="value"&&w0(ic)){var o=[];k6(o,ic,s,Oh(s)),d6(iT,o)}}function aT(s,o,f){s==="focusin"?(T6(),rc=o,ic=f,rc.attachEvent("onpropertychange",E6)):s==="focusout"&&T6()}function sT(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return w0(ic)}function lT(s,o){if(s==="click")return w0(o)}function oT(s,o){if(s==="input"||s==="change")return w0(o)}function cT(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var kr=typeof Object.is=="function"?Object.is:cT;function ac(s,o){if(kr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),g=Object.keys(o);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var v=f[g];if(!Xe.call(o,v)||!kr(s[v],o[v]))return!1}return!0}function $6(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function j6(s,o){var f=$6(s);s=0;for(var g;f;){if(f.nodeType===3){if(g=s+f.textContent.length,s<=o&&g>=o)return{node:f,offset:o-s};s=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=$6(f)}}function P6(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?P6(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Q6(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Ft(s.document);o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=Ft(s.document)}return o}function Th(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var uT=Gi&&"documentMode"in document&&11>=document.documentMode,kl=null,Eh=null,sc=null,$h=!1;function Z6(s,o,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;$h||kl==null||kl!==Ft(g)||(g=kl,"selectionStart"in g&&Th(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),sc&&ac(sc,g)||(sc=g,g=f1(Eh,"onSelect"),0<g.length&&(o=new v0("onSelect","select",null,o,f),s.push({event:o,listeners:g}),o.target=kl)))}function js(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var Al={animationend:js("Animation","AnimationEnd"),animationiteration:js("Animation","AnimationIteration"),animationstart:js("Animation","AnimationStart"),transitionrun:js("Transition","TransitionRun"),transitionstart:js("Transition","TransitionStart"),transitioncancel:js("Transition","TransitionCancel"),transitionend:js("Transition","TransitionEnd")},jh={},N6={};Gi&&(N6=document.createElement("div").style,"AnimationEvent"in window||(delete Al.animationend.animation,delete Al.animationiteration.animation,delete Al.animationstart.animation),"TransitionEvent"in window||delete Al.transitionend.transition);function Ps(s){if(jh[s])return jh[s];if(!Al[s])return s;var o=Al[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in N6)return jh[s]=o[f];return s}var R6=Ps("animationend"),V6=Ps("animationiteration"),L6=Ps("animationstart"),fT=Ps("transitionrun"),dT=Ps("transitionstart"),hT=Ps("transitioncancel"),_6=Ps("transitionend"),D6=new Map,Ph="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(" ");Ph.push("scrollEnd");function oi(s,o){D6.set(s,o),Bn(o,[s])}var k0=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Dr=[],Ml=0,Qh=0;function A0(){for(var s=Ml,o=Qh=Ml=0;o<s;){var f=Dr[o];Dr[o++]=null;var g=Dr[o];Dr[o++]=null;var v=Dr[o];Dr[o++]=null;var w=Dr[o];if(Dr[o++]=null,g!==null&&v!==null){var Q=g.pending;Q===null?v.next=v:(v.next=Q.next,Q.next=v),g.pending=v}w!==0&&H6(f,v,w)}}function M0(s,o,f,g){Dr[Ml++]=s,Dr[Ml++]=o,Dr[Ml++]=f,Dr[Ml++]=g,Qh|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Zh(s,o,f,g){return M0(s,o,f,g),C0(s)}function Qs(s,o){return M0(s,null,null,o),C0(s)}function H6(s,o,f){s.lanes|=f;var g=s.alternate;g!==null&&(g.lanes|=f);for(var v=!1,w=s.return;w!==null;)w.childLanes|=f,g=w.alternate,g!==null&&(g.childLanes|=f),w.tag===22&&(s=w.stateNode,s===null||s._visibility&1||(v=!0)),s=w,w=w.return;return s.tag===3?(w=s.stateNode,v&&o!==null&&(v=31-ot(f),s=w.hiddenUpdates,g=s[v],g===null?s[v]=[o]:g.push(o),o.lane=f|536870912),w):null}function C0(s){if(50<Tc)throw Tc=0,zm=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var Cl={};function mT(s,o,f,g){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ar(s,o,f,g){return new mT(s,o,f,g)}function Nh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ui(s,o){var f=s.alternate;return f===null?(f=Ar(s.tag,o,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=o,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&65011712,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,o=s.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f.refCleanup=s.refCleanup,f}function X6(s,o){s.flags&=65011714;var f=s.alternate;return f===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=f.childLanes,s.lanes=f.lanes,s.child=f.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=f.memoizedProps,s.memoizedState=f.memoizedState,s.updateQueue=f.updateQueue,s.type=f.type,o=f.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function T0(s,o,f,g,v,w){var Q=0;if(g=s,typeof s=="function")Nh(s)&&(Q=1);else if(typeof s=="string")Q=yE(s,f,V.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case D:return s=Ar(31,f,o,v),s.elementType=D,s.lanes=w,s;case S:return Zs(f.children,v,w,o);case k:Q=8,v|=24;break;case A:return s=Ar(12,f,o,v|2),s.elementType=A,s.lanes=w,s;case M:return s=Ar(13,f,o,v),s.elementType=M,s.lanes=w,s;case E:return s=Ar(19,f,o,v),s.elementType=E,s.lanes=w,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:Q=10;break e;case C:Q=9;break e;case j:Q=11;break e;case $:Q=14;break e;case N:Q=16,g=null;break e}Q=29,f=Error(r(130,s===null?"null":typeof s,"")),g=null}return o=Ar(Q,f,o,v),o.elementType=s,o.type=g,o.lanes=w,o}function Zs(s,o,f,g){return s=Ar(7,s,g,o),s.lanes=f,s}function Rh(s,o,f){return s=Ar(6,s,null,o),s.lanes=f,s}function z6(s){var o=Ar(18,null,null,0);return o.stateNode=s,o}function Vh(s,o,f){return o=Ar(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var F6=new WeakMap;function Hr(s,o){if(typeof s=="object"&&s!==null){var f=F6.get(s);return f!==void 0?f:(o={value:s,source:o,stack:Ze(o)},F6.set(s,o),o)}return{value:s,source:o,stack:Ze(o)}}var Tl=[],El=0,E0=null,lc=0,Xr=[],zr=0,Va=null,Ai=1,Mi="";function Wi(s,o){Tl[El++]=lc,Tl[El++]=E0,E0=s,lc=o}function B6(s,o,f){Xr[zr++]=Ai,Xr[zr++]=Mi,Xr[zr++]=Va,Va=s;var g=Ai;s=Mi;var v=32-ot(g)-1;g&=~(1<<v),f+=1;var w=32-ot(o)+v;if(30<w){var Q=v-v%5;w=(g&(1<<Q)-1).toString(32),g>>=Q,v-=Q,Ai=1<<32-ot(o)+v|f<<v|g,Mi=w+s}else Ai=1<<w|f<<v|g,Mi=s}function Lh(s){s.return!==null&&(Wi(s,1),B6(s,1,0))}function _h(s){for(;s===E0;)E0=Tl[--El],Tl[El]=null,lc=Tl[--El],Tl[El]=null;for(;s===Va;)Va=Xr[--zr],Xr[zr]=null,Mi=Xr[--zr],Xr[zr]=null,Ai=Xr[--zr],Xr[zr]=null}function Y6(s,o){Xr[zr++]=Ai,Xr[zr++]=Mi,Xr[zr++]=Va,Ai=o.id,Mi=o.overflow,Va=s}var Nn=null,Gt=null,xt=!1,La=null,Fr=!1,Dh=Error(r(519));function _a(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oc(Hr(o,s)),Dh}function I6(s){var o=s.stateNode,f=s.type,g=s.memoizedProps;switch(o[Rt]=s,o[ve]=g,f){case"dialog":ht("cancel",o),ht("close",o);break;case"iframe":case"object":case"embed":ht("load",o);break;case"video":case"audio":for(f=0;f<$c.length;f++)ht($c[f],o);break;case"source":ht("error",o);break;case"img":case"image":case"link":ht("error",o),ht("load",o);break;case"details":ht("toggle",o);break;case"input":ht("invalid",o),Es(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ht("invalid",o);break;case"textarea":ht("invalid",o),o6(o,g.value,g.defaultValue,g.children)}f=g.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||g.suppressHydrationWarning===!0||uy(o.textContent,f)?(g.popover!=null&&(ht("beforetoggle",o),ht("toggle",o)),g.onScroll!=null&&ht("scroll",o),g.onScrollEnd!=null&&ht("scrollend",o),g.onClick!=null&&(o.onclick=qi),o=!0):o=!1,o||_a(s,!0)}function q6(s){for(Nn=s.return;Nn;)switch(Nn.tag){case 5:case 31:case 13:Fr=!1;return;case 27:case 3:Fr=!0;return;default:Nn=Nn.return}}function $l(s){if(s!==Nn)return!1;if(!xt)return q6(s),xt=!0,!1;var o=s.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=s.type,f=!(f!=="form"&&f!=="button")||ip(s.type,s.memoizedProps)),f=!f),f&&Gt&&_a(s),q6(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Gt=yy(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Gt=yy(s)}else o===27?(o=Gt,Ja(s.type)?(s=cp,cp=null,Gt=s):Gt=o):Gt=Nn?Yr(s.stateNode.nextSibling):null;return!0}function Ns(){Gt=Nn=null,xt=!1}function Hh(){var s=La;return s!==null&&(ur===null?ur=s:ur.push.apply(ur,s),La=null),s}function oc(s){La===null?La=[s]:La.push(s)}var Xh=R(null),Rs=null,Ki=null;function Da(s,o,f){L(Xh,o._currentValue),o._currentValue=f}function Ji(s){s._currentValue=Xh.current,P(Xh)}function zh(s,o,f){for(;s!==null;){var g=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),s===f)break;s=s.return}}function Fh(s,o,f,g){var v=s.child;for(v!==null&&(v.return=s);v!==null;){var w=v.dependencies;if(w!==null){var Q=v.child;w=w.firstContext;e:for(;w!==null;){var H=w;w=v;for(var J=0;J<o.length;J++)if(H.context===o[J]){w.lanes|=f,H=w.alternate,H!==null&&(H.lanes|=f),zh(w.return,f,s),g||(Q=null);break e}w=H.next}}else if(v.tag===18){if(Q=v.return,Q===null)throw Error(r(341));Q.lanes|=f,w=Q.alternate,w!==null&&(w.lanes|=f),zh(Q,f,s),Q=null}else Q=v.child;if(Q!==null)Q.return=v;else for(Q=v;Q!==null;){if(Q===s){Q=null;break}if(v=Q.sibling,v!==null){v.return=Q.return,Q=v;break}Q=Q.return}v=Q}}function jl(s,o,f,g){s=null;for(var v=o,w=!1;v!==null;){if(!w){if((v.flags&524288)!==0)w=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var Q=v.alternate;if(Q===null)throw Error(r(387));if(Q=Q.memoizedProps,Q!==null){var H=v.type;kr(v.pendingProps.value,Q.value)||(s!==null?s.push(H):s=[H])}}else if(v===ue.current){if(Q=v.alternate,Q===null)throw Error(r(387));Q.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(s!==null?s.push(Nc):s=[Nc])}v=v.return}s!==null&&Fh(o,s,f,g),o.flags|=262144}function $0(s){for(s=s.firstContext;s!==null;){if(!kr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Vs(s){Rs=s,Ki=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Rn(s){return G6(Rs,s)}function j0(s,o){return Rs===null&&Vs(s),G6(s,o)}function G6(s,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},Ki===null){if(s===null)throw Error(r(308));Ki=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Ki=Ki.next=o;return f}var pT=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(f,g){s.push(g)}};this.abort=function(){o.aborted=!0,s.forEach(function(f){return f()})}},gT=t.unstable_scheduleCallback,OT=t.unstable_NormalPriority,On={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bh(){return{controller:new pT,data:new Map,refCount:0}}function cc(s){s.refCount--,s.refCount===0&&gT(OT,function(){s.controller.abort()})}var uc=null,Yh=0,Pl=0,Ql=null;function xT(s,o){if(uc===null){var f=uc=[];Yh=0,Pl=Gm(),Ql={status:"pending",value:void 0,then:function(g){f.push(g)}}}return Yh++,o.then(U6,U6),o}function U6(){if(--Yh===0&&uc!==null){Ql!==null&&(Ql.status="fulfilled");var s=uc;uc=null,Pl=0,Ql=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function yT(s,o){var f=[],g={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return s.then(function(){g.status="fulfilled",g.value=o;for(var v=0;v<f.length;v++)(0,f[v])(o)},function(v){for(g.status="rejected",g.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),g}var W6=Z.S;Z.S=function(s,o){Zx=ct(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&xT(s,o),W6!==null&&W6(s,o)};var Ls=R(null);function Ih(){var s=Ls.current;return s!==null?s:Dt.pooledCache}function P0(s,o){o===null?L(Ls,Ls.current):L(Ls,o.pool)}function K6(){var s=Ih();return s===null?null:{parent:On._currentValue,pool:s}}var Zl=Error(r(460)),qh=Error(r(474)),Q0=Error(r(542)),Z0={then:function(){}};function J6(s){return s=s.status,s==="fulfilled"||s==="rejected"}function e4(s,o,f){switch(f=s[f],f===void 0?s.push(o):f!==o&&(o.then(qi,qi),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,n4(s),s;default:if(typeof o.status=="string")o.then(qi,qi);else{if(s=Dt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(g){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=g}},function(g){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,n4(s),s}throw Ds=o,Zl}}function _s(s){try{var o=s._init;return o(s._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ds=f,Zl):f}}var Ds=null;function t4(){if(Ds===null)throw Error(r(459));var s=Ds;return Ds=null,s}function n4(s){if(s===Zl||s===Q0)throw Error(r(483))}var Nl=null,fc=0;function N0(s){var o=fc;return fc+=1,Nl===null&&(Nl=[]),e4(Nl,s,o)}function dc(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function R0(s,o){throw o.$$typeof===x?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function r4(s){function o(ie,ne){if(s){var se=ie.deletions;se===null?(ie.deletions=[ne],ie.flags|=16):se.push(ne)}}function f(ie,ne){if(!s)return null;for(;ne!==null;)o(ie,ne),ne=ne.sibling;return null}function g(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=Ui(ie,ne),ie.index=0,ie.sibling=null,ie}function w(ie,ne,se){return ie.index=se,s?(se=ie.alternate,se!==null?(se=se.index,se<ne?(ie.flags|=67108866,ne):se):(ie.flags|=67108866,ne)):(ie.flags|=1048576,ne)}function Q(ie){return s&&ie.alternate===null&&(ie.flags|=67108866),ie}function H(ie,ne,se,me){return ne===null||ne.tag!==6?(ne=Rh(se,ie.mode,me),ne.return=ie,ne):(ne=v(ne,se),ne.return=ie,ne)}function J(ie,ne,se,me){var De=se.type;return De===S?de(ie,ne,se.props.children,me,se.key):ne!==null&&(ne.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===N&&_s(De)===ne.type)?(ne=v(ne,se.props),dc(ne,se),ne.return=ie,ne):(ne=T0(se.type,se.key,se.props,null,ie.mode,me),dc(ne,se),ne.return=ie,ne)}function le(ie,ne,se,me){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==se.containerInfo||ne.stateNode.implementation!==se.implementation?(ne=Vh(se,ie.mode,me),ne.return=ie,ne):(ne=v(ne,se.children||[]),ne.return=ie,ne)}function de(ie,ne,se,me,De){return ne===null||ne.tag!==7?(ne=Zs(se,ie.mode,me,De),ne.return=ie,ne):(ne=v(ne,se),ne.return=ie,ne)}function pe(ie,ne,se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Rh(""+ne,ie.mode,se),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case y:return se=T0(ne.type,ne.key,ne.props,null,ie.mode,se),dc(se,ne),se.return=ie,se;case b:return ne=Vh(ne,ie.mode,se),ne.return=ie,ne;case N:return ne=_s(ne),pe(ie,ne,se)}if(K(ne)||X(ne))return ne=Zs(ne,ie.mode,se,null),ne.return=ie,ne;if(typeof ne.then=="function")return pe(ie,N0(ne),se);if(ne.$$typeof===T)return pe(ie,j0(ie,ne),se);R0(ie,ne)}return null}function ce(ie,ne,se,me){var De=ne!==null?ne.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return De!==null?null:H(ie,ne,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return se.key===De?J(ie,ne,se,me):null;case b:return se.key===De?le(ie,ne,se,me):null;case N:return se=_s(se),ce(ie,ne,se,me)}if(K(se)||X(se))return De!==null?null:de(ie,ne,se,me,null);if(typeof se.then=="function")return ce(ie,ne,N0(se),me);if(se.$$typeof===T)return ce(ie,ne,j0(ie,se),me);R0(ie,se)}return null}function fe(ie,ne,se,me,De){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ie=ie.get(se)||null,H(ne,ie,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case y:return ie=ie.get(me.key===null?se:me.key)||null,J(ne,ie,me,De);case b:return ie=ie.get(me.key===null?se:me.key)||null,le(ne,ie,me,De);case N:return me=_s(me),fe(ie,ne,se,me,De)}if(K(me)||X(me))return ie=ie.get(se)||null,de(ne,ie,me,De,null);if(typeof me.then=="function")return fe(ie,ne,se,N0(me),De);if(me.$$typeof===T)return fe(ie,ne,se,j0(ne,me),De);R0(ne,me)}return null}function Ce(ie,ne,se,me){for(var De=null,Ct=null,Qe=ne,it=ne=0,gt=null;Qe!==null&&it<se.length;it++){Qe.index>it?(gt=Qe,Qe=null):gt=Qe.sibling;var Tt=ce(ie,Qe,se[it],me);if(Tt===null){Qe===null&&(Qe=gt);break}s&&Qe&&Tt.alternate===null&&o(ie,Qe),ne=w(Tt,ne,it),Ct===null?De=Tt:Ct.sibling=Tt,Ct=Tt,Qe=gt}if(it===se.length)return f(ie,Qe),xt&&Wi(ie,it),De;if(Qe===null){for(;it<se.length;it++)Qe=pe(ie,se[it],me),Qe!==null&&(ne=w(Qe,ne,it),Ct===null?De=Qe:Ct.sibling=Qe,Ct=Qe);return xt&&Wi(ie,it),De}for(Qe=g(Qe);it<se.length;it++)gt=fe(Qe,ie,it,se[it],me),gt!==null&&(s&>.alternate!==null&&Qe.delete(gt.key===null?it:gt.key),ne=w(gt,ne,it),Ct===null?De=gt:Ct.sibling=gt,Ct=gt);return s&&Qe.forEach(function(is){return o(ie,is)}),xt&&Wi(ie,it),De}function Fe(ie,ne,se,me){if(se==null)throw Error(r(151));for(var De=null,Ct=null,Qe=ne,it=ne=0,gt=null,Tt=se.next();Qe!==null&&!Tt.done;it++,Tt=se.next()){Qe.index>it?(gt=Qe,Qe=null):gt=Qe.sibling;var is=ce(ie,Qe,Tt.value,me);if(is===null){Qe===null&&(Qe=gt);break}s&&Qe&&is.alternate===null&&o(ie,Qe),ne=w(is,ne,it),Ct===null?De=is:Ct.sibling=is,Ct=is,Qe=gt}if(Tt.done)return f(ie,Qe),xt&&Wi(ie,it),De;if(Qe===null){for(;!Tt.done;it++,Tt=se.next())Tt=pe(ie,Tt.value,me),Tt!==null&&(ne=w(Tt,ne,it),Ct===null?De=Tt:Ct.sibling=Tt,Ct=Tt);return xt&&Wi(ie,it),De}for(Qe=g(Qe);!Tt.done;it++,Tt=se.next())Tt=fe(Qe,ie,it,Tt.value,me),Tt!==null&&(s&&Tt.alternate!==null&&Qe.delete(Tt.key===null?it:Tt.key),ne=w(Tt,ne,it),Ct===null?De=Tt:Ct.sibling=Tt,Ct=Tt);return s&&Qe.forEach(function($E){return o(ie,$E)}),xt&&Wi(ie,it),De}function _t(ie,ne,se,me){if(typeof se=="object"&&se!==null&&se.type===S&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case y:e:{for(var De=se.key;ne!==null;){if(ne.key===De){if(De=se.type,De===S){if(ne.tag===7){f(ie,ne.sibling),me=v(ne,se.props.children),me.return=ie,ie=me;break e}}else if(ne.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===N&&_s(De)===ne.type){f(ie,ne.sibling),me=v(ne,se.props),dc(me,se),me.return=ie,ie=me;break e}f(ie,ne);break}else o(ie,ne);ne=ne.sibling}se.type===S?(me=Zs(se.props.children,ie.mode,me,se.key),me.return=ie,ie=me):(me=T0(se.type,se.key,se.props,null,ie.mode,me),dc(me,se),me.return=ie,ie=me)}return Q(ie);case b:e:{for(De=se.key;ne!==null;){if(ne.key===De)if(ne.tag===4&&ne.stateNode.containerInfo===se.containerInfo&&ne.stateNode.implementation===se.implementation){f(ie,ne.sibling),me=v(ne,se.children||[]),me.return=ie,ie=me;break e}else{f(ie,ne);break}else o(ie,ne);ne=ne.sibling}me=Vh(se,ie.mode,me),me.return=ie,ie=me}return Q(ie);case N:return se=_s(se),_t(ie,ne,se,me)}if(K(se))return Ce(ie,ne,se,me);if(X(se)){if(De=X(se),typeof De!="function")throw Error(r(150));return se=De.call(se),Fe(ie,ne,se,me)}if(typeof se.then=="function")return _t(ie,ne,N0(se),me);if(se.$$typeof===T)return _t(ie,ne,j0(ie,se),me);R0(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,ne!==null&&ne.tag===6?(f(ie,ne.sibling),me=v(ne,se),me.return=ie,ie=me):(f(ie,ne),me=Rh(se,ie.mode,me),me.return=ie,ie=me),Q(ie)):f(ie,ne)}return function(ie,ne,se,me){try{fc=0;var De=_t(ie,ne,se,me);return Nl=null,De}catch(Qe){if(Qe===Zl||Qe===Q0)throw Qe;var Ct=Ar(29,Qe,null,ie.mode);return Ct.lanes=me,Ct.return=ie,Ct}finally{}}}var Hs=r4(!0),i4=r4(!1),Ha=!1;function Gh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uh(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Xa(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function za(s,o,f){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,($t&2)!==0){var v=g.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),g.pending=o,o=C0(s),H6(s,null,f),o}return M0(s,g,o,f),C0(s)}function hc(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,ii(s,f)}}function Wh(s,o){var f=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var v=null,w=null;if(f=f.firstBaseUpdate,f!==null){do{var Q={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};w===null?v=w=Q:w=w.next=Q,f=f.next}while(f!==null);w===null?v=w=o:w=w.next=o}else v=w=o;f={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:w,shared:g.shared,callbacks:g.callbacks},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}var Kh=!1;function mc(){if(Kh){var s=Ql;if(s!==null)throw s}}function pc(s,o,f,g){Kh=!1;var v=s.updateQueue;Ha=!1;var w=v.firstBaseUpdate,Q=v.lastBaseUpdate,H=v.shared.pending;if(H!==null){v.shared.pending=null;var J=H,le=J.next;J.next=null,Q===null?w=le:Q.next=le,Q=J;var de=s.alternate;de!==null&&(de=de.updateQueue,H=de.lastBaseUpdate,H!==Q&&(H===null?de.firstBaseUpdate=le:H.next=le,de.lastBaseUpdate=J))}if(w!==null){var pe=v.baseState;Q=0,de=le=J=null,H=w;do{var ce=H.lane&-536870913,fe=ce!==H.lane;if(fe?(pt&ce)===ce:(g&ce)===ce){ce!==0&&ce===Pl&&(Kh=!0),de!==null&&(de=de.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ce=s,Fe=H;ce=o;var _t=f;switch(Fe.tag){case 1:if(Ce=Fe.payload,typeof Ce=="function"){pe=Ce.call(_t,pe,ce);break e}pe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Fe.payload,ce=typeof Ce=="function"?Ce.call(_t,pe,ce):Ce,ce==null)break e;pe=O({},pe,ce);break e;case 2:Ha=!0}}ce=H.callback,ce!==null&&(s.flags|=64,fe&&(s.flags|=8192),fe=v.callbacks,fe===null?v.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:H.tag,payload:H.payload,callback:H.callback,next:null},de===null?(le=de=fe,J=pe):de=de.next=fe,Q|=ce;if(H=H.next,H===null){if(H=v.shared.pending,H===null)break;fe=H,H=fe.next,fe.next=null,v.lastBaseUpdate=fe,v.shared.pending=null}}while(!0);de===null&&(J=pe),v.baseState=J,v.firstBaseUpdate=le,v.lastBaseUpdate=de,w===null&&(v.shared.lanes=0),qa|=Q,s.lanes=Q,s.memoizedState=pe}}function a4(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function s4(s,o){var f=s.callbacks;if(f!==null)for(s.callbacks=null,s=0;s<f.length;s++)a4(f[s],o)}var Rl=R(null),V0=R(0);function l4(s,o){s=oa,L(V0,s),L(Rl,o),oa=s|o.baseLanes}function Jh(){L(V0,oa),L(Rl,Rl.current)}function em(){oa=V0.current,P(Rl),P(V0)}var Mr=R(null),Br=null;function Fa(s){var o=s.alternate;L(cn,cn.current&1),L(Mr,s),Br===null&&(o===null||Rl.current!==null||o.memoizedState!==null)&&(Br=s)}function tm(s){L(cn,cn.current),L(Mr,s),Br===null&&(Br=s)}function o4(s){s.tag===22?(L(cn,cn.current),L(Mr,s),Br===null&&(Br=s)):Ba()}function Ba(){L(cn,cn.current),L(Mr,Mr.current)}function Cr(s){P(Mr),Br===s&&(Br=null),P(cn)}var cn=R(0);function L0(s){for(var o=s;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||lp(f)||op(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ea=0,nt=null,Vt=null,xn=null,_0=!1,Vl=!1,Xs=!1,D0=0,gc=0,Ll=null,bT=0;function an(){throw Error(r(321))}function nm(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!kr(s[f],o[f]))return!1;return!0}function rm(s,o,f,g,v,w){return ea=w,nt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Z.H=s===null||s.memoizedState===null?B4:xm,Xs=!1,w=f(g,v),Xs=!1,Vl&&(w=u4(o,f,g,v)),c4(s),w}function c4(s){Z.H=yc;var o=Vt!==null&&Vt.next!==null;if(ea=0,xn=Vt=nt=null,_0=!1,gc=0,Ll=null,o)throw Error(r(300));s===null||yn||(s=s.dependencies,s!==null&&$0(s)&&(yn=!0))}function u4(s,o,f,g){nt=s;var v=0;do{if(Vl&&(Ll=null),gc=0,Vl=!1,25<=v)throw Error(r(301));if(v+=1,xn=Vt=null,s.updateQueue!=null){var w=s.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}Z.H=Y4,w=o(f,g)}while(Vl);return w}function vT(){var s=Z.H,o=s.useState()[0];return o=typeof o.then=="function"?Oc(o):o,s=s.useState()[0],(Vt!==null?Vt.memoizedState:null)!==s&&(nt.flags|=1024),o}function im(){var s=D0!==0;return D0=0,s}function am(s,o,f){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~f}function sm(s){if(_0){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}_0=!1}ea=0,xn=Vt=nt=null,Vl=!1,gc=D0=0,Ll=null}function er(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xn===null?nt.memoizedState=xn=s:xn=xn.next=s,xn}function un(){if(Vt===null){var s=nt.alternate;s=s!==null?s.memoizedState:null}else s=Vt.next;var o=xn===null?nt.memoizedState:xn.next;if(o!==null)xn=o,Vt=s;else{if(s===null)throw nt.alternate===null?Error(r(467)):Error(r(310));Vt=s,s={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},xn===null?nt.memoizedState=xn=s:xn=xn.next=s}return xn}function H0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oc(s){var o=gc;return gc+=1,Ll===null&&(Ll=[]),s=e4(Ll,s,o),o=nt,(xn===null?o.memoizedState:xn.next)===null&&(o=o.alternate,Z.H=o===null||o.memoizedState===null?B4:xm),s}function X0(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Oc(s);if(s.$$typeof===T)return Rn(s)}throw Error(r(438,String(s)))}function lm(s){var o=null,f=nt.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var g=nt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=H0(),nt.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(s),g=0;g<s;g++)f[g]=z;return o.index++,f}function ta(s,o){return typeof o=="function"?o(s):o}function z0(s){var o=un();return om(o,Vt,s)}function om(s,o,f){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=f;var v=s.baseQueue,w=g.pending;if(w!==null){if(v!==null){var Q=v.next;v.next=w.next,w.next=Q}o.baseQueue=v=w,g.pending=null}if(w=s.baseState,v===null)s.memoizedState=w;else{o=v.next;var H=Q=null,J=null,le=o,de=!1;do{var pe=le.lane&-536870913;if(pe!==le.lane?(pt&pe)===pe:(ea&pe)===pe){var ce=le.revertLane;if(ce===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),pe===Pl&&(de=!0);else if((ea&ce)===ce){le=le.next,ce===Pl&&(de=!0);continue}else pe={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(H=J=pe,Q=w):J=J.next=pe,nt.lanes|=ce,qa|=ce;pe=le.action,Xs&&f(w,pe),w=le.hasEagerState?le.eagerState:f(w,pe)}else ce={lane:pe,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(H=J=ce,Q=w):J=J.next=ce,nt.lanes|=pe,qa|=pe;le=le.next}while(le!==null&&le!==o);if(J===null?Q=w:J.next=H,!kr(w,s.memoizedState)&&(yn=!0,de&&(f=Ql,f!==null)))throw f;s.memoizedState=w,s.baseState=Q,s.baseQueue=J,g.lastRenderedState=w}return v===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function cm(s){var o=un(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var g=f.dispatch,v=f.pending,w=o.memoizedState;if(v!==null){f.pending=null;var Q=v=v.next;do w=s(w,Q.action),Q=Q.next;while(Q!==v);kr(w,o.memoizedState)||(yn=!0),o.memoizedState=w,o.baseQueue===null&&(o.baseState=w),f.lastRenderedState=w}return[w,g]}function f4(s,o,f){var g=nt,v=un(),w=xt;if(w){if(f===void 0)throw Error(r(407));f=f()}else f=o();var Q=!kr((Vt||v).memoizedState,f);if(Q&&(v.memoizedState=f,yn=!0),v=v.queue,dm(m4.bind(null,g,v,s),[s]),v.getSnapshot!==o||Q||xn!==null&&xn.memoizedState.tag&1){if(g.flags|=2048,_l(9,{destroy:void 0},h4.bind(null,g,v,f,o),null),Dt===null)throw Error(r(349));w||(ea&127)!==0||d4(g,o,f)}return f}function d4(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=nt.updateQueue,o===null?(o=H0(),nt.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function h4(s,o,f,g){o.value=f,o.getSnapshot=g,p4(o)&&g4(s)}function m4(s,o,f){return f(function(){p4(o)&&g4(s)})}function p4(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!kr(s,f)}catch{return!0}}function g4(s){var o=Qs(s,2);o!==null&&fr(o,s,2)}function um(s){var o=er();if(typeof s=="function"){var f=s;if(s=f(),Xs){lt(!0);try{f()}finally{lt(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:s},o}function O4(s,o,f,g){return s.baseState=f,om(s,Vt,typeof g=="function"?g:ta)}function ST(s,o,f,g,v){if(Y0(s))throw Error(r(485));if(s=o.action,s!==null){var w={payload:v,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){w.listeners.push(Q)}};Z.T!==null?f(!0):w.isTransition=!1,g(w),f=o.pending,f===null?(w.next=o.pending=w,x4(o,w)):(w.next=f.next,o.pending=f.next=w)}}function x4(s,o){var f=o.action,g=o.payload,v=s.state;if(o.isTransition){var w=Z.T,Q={};Z.T=Q;try{var H=f(v,g),J=Z.S;J!==null&&J(Q,H),y4(s,o,H)}catch(le){fm(s,o,le)}finally{w!==null&&Q.types!==null&&(w.types=Q.types),Z.T=w}}else try{w=f(v,g),y4(s,o,w)}catch(le){fm(s,o,le)}}function y4(s,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(g){b4(s,o,g)},function(g){return fm(s,o,g)}):b4(s,o,f)}function b4(s,o,f){o.status="fulfilled",o.value=f,v4(o),s.state=f,o=s.pending,o!==null&&(f=o.next,f===o?s.pending=null:(f=f.next,o.next=f,x4(s,f)))}function fm(s,o,f){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=f,v4(o),o=o.next;while(o!==g)}s.action=null}function v4(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function S4(s,o){return o}function w4(s,o){if(xt){var f=Dt.formState;if(f!==null){e:{var g=nt;if(xt){if(Gt){t:{for(var v=Gt,w=Fr;v.nodeType!==8;){if(!w){v=null;break t}if(v=Yr(v.nextSibling),v===null){v=null;break t}}w=v.data,v=w==="F!"||w==="F"?v:null}if(v){Gt=Yr(v.nextSibling),g=v.data==="F!";break e}}_a(g)}g=!1}g&&(o=f[0])}}return f=er(),f.memoizedState=f.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:S4,lastRenderedState:o},f.queue=g,f=X4.bind(null,nt,g),g.dispatch=f,g=um(!1),w=Om.bind(null,nt,!1,g.queue),g=er(),v={state:o,dispatch:null,action:s,pending:null},g.queue=v,f=ST.bind(null,nt,v,w,f),v.dispatch=f,g.memoizedState=s,[o,f,!1]}function k4(s){var o=un();return A4(o,Vt,s)}function A4(s,o,f){if(o=om(s,o,S4)[0],s=z0(ta)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Oc(o)}catch(Q){throw Q===Zl?Q0:Q}else g=o;o=un();var v=o.queue,w=v.dispatch;return f!==o.memoizedState&&(nt.flags|=2048,_l(9,{destroy:void 0},wT.bind(null,v,f),null)),[g,w,s]}function wT(s,o){s.action=o}function M4(s){var o=un(),f=Vt;if(f!==null)return A4(o,f,s);un(),o=o.memoizedState,f=un();var g=f.queue.dispatch;return f.memoizedState=s,[o,g,!1]}function _l(s,o,f,g){return s={tag:s,create:f,deps:g,inst:o,next:null},o=nt.updateQueue,o===null&&(o=H0(),nt.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=s.next=s:(g=f.next,f.next=s,s.next=g,o.lastEffect=s),s}function C4(){return un().memoizedState}function F0(s,o,f,g){var v=er();nt.flags|=s,v.memoizedState=_l(1|o,{destroy:void 0},f,g===void 0?null:g)}function B0(s,o,f,g){var v=un();g=g===void 0?null:g;var w=v.memoizedState.inst;Vt!==null&&g!==null&&nm(g,Vt.memoizedState.deps)?v.memoizedState=_l(o,w,f,g):(nt.flags|=s,v.memoizedState=_l(1|o,w,f,g))}function T4(s,o){F0(8390656,8,s,o)}function dm(s,o){B0(2048,8,s,o)}function kT(s){nt.flags|=4;var o=nt.updateQueue;if(o===null)o=H0(),nt.updateQueue=o,o.events=[s];else{var f=o.events;f===null?o.events=[s]:f.push(s)}}function E4(s){var o=un().memoizedState;return kT({ref:o,nextImpl:s}),function(){if(($t&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function $4(s,o){return B0(4,2,s,o)}function j4(s,o){return B0(4,4,s,o)}function P4(s,o){if(typeof o=="function"){s=s();var f=o(s);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function Q4(s,o,f){f=f!=null?f.concat([s]):null,B0(4,4,P4.bind(null,o,s),f)}function hm(){}function Z4(s,o){var f=un();o=o===void 0?null:o;var g=f.memoizedState;return o!==null&&nm(o,g[1])?g[0]:(f.memoizedState=[s,o],s)}function N4(s,o){var f=un();o=o===void 0?null:o;var g=f.memoizedState;if(o!==null&&nm(o,g[1]))return g[0];if(g=s(),Xs){lt(!0);try{s()}finally{lt(!1)}}return f.memoizedState=[g,o],g}function mm(s,o,f){return f===void 0||(ea&1073741824)!==0&&(pt&261930)===0?s.memoizedState=o:(s.memoizedState=f,s=Rx(),nt.lanes|=s,qa|=s,f)}function R4(s,o,f,g){return kr(f,o)?f:Rl.current!==null?(s=mm(s,f,g),kr(s,o)||(yn=!0),s):(ea&42)===0||(ea&1073741824)!==0&&(pt&261930)===0?(yn=!0,s.memoizedState=f):(s=Rx(),nt.lanes|=s,qa|=s,o)}function V4(s,o,f,g,v){var w=F.p;F.p=w!==0&&8>w?w:8;var Q=Z.T,H={};Z.T=H,Om(s,!1,o,f);try{var J=v(),le=Z.S;if(le!==null&&le(H,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=yT(J,g);xc(s,o,de,$r(s))}else xc(s,o,g,$r(s))}catch(pe){xc(s,o,{then:function(){},status:"rejected",reason:pe},$r())}finally{F.p=w,Q!==null&&H.types!==null&&(Q.types=H.types),Z.T=Q}}function AT(){}function pm(s,o,f,g){if(s.tag!==5)throw Error(r(476));var v=L4(s).queue;V4(s,v,o,_,f===null?AT:function(){return _4(s),f(g)})}function L4(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:_,baseState:_,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:_},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:f},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function _4(s){var o=L4(s);o.next===null&&(o=s.alternate.memoizedState),xc(s,o.next.queue,{},$r())}function gm(){return Rn(Nc)}function D4(){return un().memoizedState}function H4(){return un().memoizedState}function MT(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var f=$r();s=Xa(f);var g=za(o,s,f);g!==null&&(fr(g,o,f),hc(g,o,f)),o={cache:Bh()},s.payload=o;return}o=o.return}}function CT(s,o,f){var g=$r();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Y0(s)?z4(o,f):(f=Zh(s,o,f,g),f!==null&&(fr(f,s,g),F4(f,o,g)))}function X4(s,o,f){var g=$r();xc(s,o,f,g)}function xc(s,o,f,g){var v={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Y0(s))z4(o,v);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=o.lastRenderedReducer,w!==null))try{var Q=o.lastRenderedState,H=w(Q,f);if(v.hasEagerState=!0,v.eagerState=H,kr(H,Q))return M0(s,o,v,0),Dt===null&&A0(),!1}catch{}finally{}if(f=Zh(s,o,v,g),f!==null)return fr(f,s,g),F4(f,o,g),!0}return!1}function Om(s,o,f,g){if(g={lane:2,revertLane:Gm(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Y0(s)){if(o)throw Error(r(479))}else o=Zh(s,f,g,2),o!==null&&fr(o,s,2)}function Y0(s){var o=s.alternate;return s===nt||o!==null&&o===nt}function z4(s,o){Vl=_0=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function F4(s,o,f){if((f&4194048)!==0){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,ii(s,f)}}var yc={readContext:Rn,use:X0,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an};yc.useEffectEvent=an;var B4={readContext:Rn,use:X0,useCallback:function(s,o){return er().memoizedState=[s,o===void 0?null:o],s},useContext:Rn,useEffect:T4,useImperativeHandle:function(s,o,f){f=f!=null?f.concat([s]):null,F0(4194308,4,P4.bind(null,o,s),f)},useLayoutEffect:function(s,o){return F0(4194308,4,s,o)},useInsertionEffect:function(s,o){F0(4,2,s,o)},useMemo:function(s,o){var f=er();o=o===void 0?null:o;var g=s();if(Xs){lt(!0);try{s()}finally{lt(!1)}}return f.memoizedState=[g,o],g},useReducer:function(s,o,f){var g=er();if(f!==void 0){var v=f(o);if(Xs){lt(!0);try{f(o)}finally{lt(!1)}}}else v=o;return g.memoizedState=g.baseState=v,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:v},g.queue=s,s=s.dispatch=CT.bind(null,nt,s),[g.memoizedState,s]},useRef:function(s){var o=er();return s={current:s},o.memoizedState=s},useState:function(s){s=um(s);var o=s.queue,f=X4.bind(null,nt,o);return o.dispatch=f,[s.memoizedState,f]},useDebugValue:hm,useDeferredValue:function(s,o){var f=er();return mm(f,s,o)},useTransition:function(){var s=um(!1);return s=V4.bind(null,nt,s.queue,!0,!1),er().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,f){var g=nt,v=er();if(xt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),Dt===null)throw Error(r(349));(pt&127)!==0||d4(g,o,f)}v.memoizedState=f;var w={value:f,getSnapshot:o};return v.queue=w,T4(m4.bind(null,g,w,s),[s]),g.flags|=2048,_l(9,{destroy:void 0},h4.bind(null,g,w,f,o),null),f},useId:function(){var s=er(),o=Dt.identifierPrefix;if(xt){var f=Mi,g=Ai;f=(g&~(1<<32-ot(g)-1)).toString(32)+f,o="_"+o+"R_"+f,f=D0++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=bT++,o="_"+o+"r_"+f.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:gm,useFormState:w4,useActionState:w4,useOptimistic:function(s){var o=er();o.memoizedState=o.baseState=s;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=Om.bind(null,nt,!0,f),f.dispatch=o,[s,o]},useMemoCache:lm,useCacheRefresh:function(){return er().memoizedState=MT.bind(null,nt)},useEffectEvent:function(s){var o=er(),f={impl:s};return o.memoizedState=f,function(){if(($t&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},xm={readContext:Rn,use:X0,useCallback:Z4,useContext:Rn,useEffect:dm,useImperativeHandle:Q4,useInsertionEffect:$4,useLayoutEffect:j4,useMemo:N4,useReducer:z0,useRef:C4,useState:function(){return z0(ta)},useDebugValue:hm,useDeferredValue:function(s,o){var f=un();return R4(f,Vt.memoizedState,s,o)},useTransition:function(){var s=z0(ta)[0],o=un().memoizedState;return[typeof s=="boolean"?s:Oc(s),o]},useSyncExternalStore:f4,useId:D4,useHostTransitionStatus:gm,useFormState:k4,useActionState:k4,useOptimistic:function(s,o){var f=un();return O4(f,Vt,s,o)},useMemoCache:lm,useCacheRefresh:H4};xm.useEffectEvent=E4;var Y4={readContext:Rn,use:X0,useCallback:Z4,useContext:Rn,useEffect:dm,useImperativeHandle:Q4,useInsertionEffect:$4,useLayoutEffect:j4,useMemo:N4,useReducer:cm,useRef:C4,useState:function(){return cm(ta)},useDebugValue:hm,useDeferredValue:function(s,o){var f=un();return Vt===null?mm(f,s,o):R4(f,Vt.memoizedState,s,o)},useTransition:function(){var s=cm(ta)[0],o=un().memoizedState;return[typeof s=="boolean"?s:Oc(s),o]},useSyncExternalStore:f4,useId:D4,useHostTransitionStatus:gm,useFormState:M4,useActionState:M4,useOptimistic:function(s,o){var f=un();return Vt!==null?O4(f,Vt,s,o):(f.baseState=s,[s,f.queue.dispatch])},useMemoCache:lm,useCacheRefresh:H4};Y4.useEffectEvent=E4;function ym(s,o,f,g){o=s.memoizedState,f=f(g,o),f=f==null?o:O({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var bm={enqueueSetState:function(s,o,f){s=s._reactInternals;var g=$r(),v=Xa(g);v.payload=o,f!=null&&(v.callback=f),o=za(s,v,g),o!==null&&(fr(o,s,g),hc(o,s,g))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var g=$r(),v=Xa(g);v.tag=1,v.payload=o,f!=null&&(v.callback=f),o=za(s,v,g),o!==null&&(fr(o,s,g),hc(o,s,g))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=$r(),g=Xa(f);g.tag=2,o!=null&&(g.callback=o),o=za(s,g,f),o!==null&&(fr(o,s,f),hc(o,s,f))}};function I4(s,o,f,g,v,w,Q){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,w,Q):o.prototype&&o.prototype.isPureReactComponent?!ac(f,g)||!ac(v,w):!0}function q4(s,o,f,g){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,g),o.state!==s&&bm.enqueueReplaceState(o,o.state,null)}function zs(s,o){var f=o;if("ref"in o){f={};for(var g in o)g!=="ref"&&(f[g]=o[g])}if(s=s.defaultProps){f===o&&(f=O({},f));for(var v in s)f[v]===void 0&&(f[v]=s[v])}return f}function G4(s){k0(s)}function U4(s){console.error(s)}function W4(s){k0(s)}function I0(s,o){try{var f=s.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function K4(s,o,f){try{var g=s.onCaughtError;g(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function vm(s,o,f){return f=Xa(f),f.tag=3,f.payload={element:null},f.callback=function(){I0(s,o)},f}function J4(s){return s=Xa(s),s.tag=3,s}function ex(s,o,f,g){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var w=g.value;s.payload=function(){return v(w)},s.callback=function(){K4(o,f,g)}}var Q=f.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(s.callback=function(){K4(o,f,g),typeof v!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var H=g.stack;this.componentDidCatch(g.value,{componentStack:H!==null?H:""})})}function TT(s,o,f,g,v){if(f.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=f.alternate,o!==null&&jl(o,f,v,!0),f=Mr.current,f!==null){switch(f.tag){case 31:case 13:return Br===null?a1():f.alternate===null&&sn===0&&(sn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,g===Z0?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([g]):o.add(g),Ym(s,g,v)),!1;case 22:return f.flags|=65536,g===Z0?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([g]):f.add(g)),Ym(s,g,v)),!1}throw Error(r(435,f.tag))}return Ym(s,g,v),a1(),!1}if(xt)return o=Mr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,g!==Dh&&(s=Error(r(422),{cause:g}),oc(Hr(s,f)))):(g!==Dh&&(o=Error(r(423),{cause:g}),oc(Hr(o,f))),s=s.current.alternate,s.flags|=65536,v&=-v,s.lanes|=v,g=Hr(g,f),v=vm(s.stateNode,g,v),Wh(s,v),sn!==4&&(sn=2)),!1;var w=Error(r(520),{cause:g});if(w=Hr(w,f),Cc===null?Cc=[w]:Cc.push(w),sn!==4&&(sn=2),o===null)return!0;g=Hr(g,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,s=v&-v,f.lanes|=s,s=vm(f.stateNode,g,s),Wh(f,s),!1;case 1:if(o=f.type,w=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ga===null||!Ga.has(w))))return f.flags|=65536,v&=-v,f.lanes|=v,v=J4(v),ex(v,s,f,g),Wh(f,v),!1}f=f.return}while(f!==null);return!1}var Sm=Error(r(461)),yn=!1;function Vn(s,o,f,g){o.child=s===null?i4(o,null,f,g):Hs(o,s.child,f,g)}function tx(s,o,f,g,v){f=f.render;var w=o.ref;if("ref"in g){var Q={};for(var H in g)H!=="ref"&&(Q[H]=g[H])}else Q=g;return Vs(o),g=rm(s,o,f,Q,w,v),H=im(),s!==null&&!yn?(am(s,o,v),na(s,o,v)):(xt&&H&&Lh(o),o.flags|=1,Vn(s,o,g,v),o.child)}function nx(s,o,f,g,v){if(s===null){var w=f.type;return typeof w=="function"&&!Nh(w)&&w.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=w,rx(s,o,w,g,v)):(s=T0(f.type,null,g,o,o.mode,v),s.ref=o.ref,s.return=o,o.child=s)}if(w=s.child,!$m(s,v)){var Q=w.memoizedProps;if(f=f.compare,f=f!==null?f:ac,f(Q,g)&&s.ref===o.ref)return na(s,o,v)}return o.flags|=1,s=Ui(w,g),s.ref=o.ref,s.return=o,o.child=s}function rx(s,o,f,g,v){if(s!==null){var w=s.memoizedProps;if(ac(w,g)&&s.ref===o.ref)if(yn=!1,o.pendingProps=g=w,$m(s,v))(s.flags&131072)!==0&&(yn=!0);else return o.lanes=s.lanes,na(s,o,v)}return wm(s,o,f,g,v)}function ix(s,o,f,g){var v=g.children,w=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(w=w!==null?w.baseLanes|f:f,s!==null){for(g=o.child=s.child,v=0;g!==null;)v=v|g.lanes|g.childLanes,g=g.sibling;g=v&~w}else g=0,o.child=null;return ax(s,o,w,f,g)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&P0(o,w!==null?w.cachePool:null),w!==null?l4(o,w):Jh(),o4(o);else return g=o.lanes=536870912,ax(s,o,w!==null?w.baseLanes|f:f,f,g)}else w!==null?(P0(o,w.cachePool),l4(o,w),Ba(),o.memoizedState=null):(s!==null&&P0(o,null),Jh(),Ba());return Vn(s,o,v,f),o.child}function bc(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function ax(s,o,f,g,v){var w=Ih();return w=w===null?null:{parent:On._currentValue,pool:w},o.memoizedState={baseLanes:f,cachePool:w},s!==null&&P0(o,null),Jh(),o4(o),s!==null&&jl(s,o,g,!0),o.childLanes=v,null}function q0(s,o){return o=U0({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function sx(s,o,f){return Hs(o,s.child,null,f),s=q0(o,o.pendingProps),s.flags|=2,Cr(o),o.memoizedState=null,s}function ET(s,o,f){var g=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(xt){if(g.mode==="hidden")return s=q0(o,g),o.lanes=536870912,bc(null,s);if(tm(o),(s=Gt)?(s=xy(s,Fr),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Va!==null?{id:Ai,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},f=z6(s),f.return=o,o.child=f,Nn=o,Gt=null)):s=null,s===null)throw _a(o);return o.lanes=536870912,null}return q0(o,g)}var w=s.memoizedState;if(w!==null){var Q=w.dehydrated;if(tm(o),v)if(o.flags&256)o.flags&=-257,o=sx(s,o,f);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(yn||jl(s,o,f,!1),v=(f&s.childLanes)!==0,yn||v){if(g=Dt,g!==null&&(Q=Pe(g,f),Q!==0&&Q!==w.retryLane))throw w.retryLane=Q,Qs(s,Q),fr(g,s,Q),Sm;a1(),o=sx(s,o,f)}else s=w.treeContext,Gt=Yr(Q.nextSibling),Nn=o,xt=!0,La=null,Fr=!1,s!==null&&Y6(o,s),o=q0(o,g),o.flags|=4096;return o}return s=Ui(s.child,{mode:g.mode,children:g.children}),s.ref=o.ref,o.child=s,s.return=o,s}function G0(s,o){var f=o.ref;if(f===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(s===null||s.ref!==f)&&(o.flags|=4194816)}}function wm(s,o,f,g,v){return Vs(o),f=rm(s,o,f,g,void 0,v),g=im(),s!==null&&!yn?(am(s,o,v),na(s,o,v)):(xt&&g&&Lh(o),o.flags|=1,Vn(s,o,f,v),o.child)}function lx(s,o,f,g,v,w){return Vs(o),o.updateQueue=null,f=u4(o,g,f,v),c4(s),g=im(),s!==null&&!yn?(am(s,o,w),na(s,o,w)):(xt&&g&&Lh(o),o.flags|=1,Vn(s,o,f,w),o.child)}function ox(s,o,f,g,v){if(Vs(o),o.stateNode===null){var w=Cl,Q=f.contextType;typeof Q=="object"&&Q!==null&&(w=Rn(Q)),w=new f(g,w),o.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=bm,o.stateNode=w,w._reactInternals=o,w=o.stateNode,w.props=g,w.state=o.memoizedState,w.refs={},Gh(o),Q=f.contextType,w.context=typeof Q=="object"&&Q!==null?Rn(Q):Cl,w.state=o.memoizedState,Q=f.getDerivedStateFromProps,typeof Q=="function"&&(ym(o,f,Q,g),w.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(Q=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),Q!==w.state&&bm.enqueueReplaceState(w,w.state,null),pc(o,g,w,v),mc(),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(s===null){w=o.stateNode;var H=o.memoizedProps,J=zs(f,H);w.props=J;var le=w.context,de=f.contextType;Q=Cl,typeof de=="object"&&de!==null&&(Q=Rn(de));var pe=f.getDerivedStateFromProps;de=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",H=o.pendingProps!==H,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(H||le!==Q)&&q4(o,w,g,Q),Ha=!1;var ce=o.memoizedState;w.state=ce,pc(o,g,w,v),mc(),le=o.memoizedState,H||ce!==le||Ha?(typeof pe=="function"&&(ym(o,f,pe,g),le=o.memoizedState),(J=Ha||I4(o,f,J,g,ce,le,Q))?(de||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(o.flags|=4194308)):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=le),w.props=g,w.state=le,w.context=Q,g=J):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{w=o.stateNode,Uh(s,o),Q=o.memoizedProps,de=zs(f,Q),w.props=de,pe=o.pendingProps,ce=w.context,le=f.contextType,J=Cl,typeof le=="object"&&le!==null&&(J=Rn(le)),H=f.getDerivedStateFromProps,(le=typeof H=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(Q!==pe||ce!==J)&&q4(o,w,g,J),Ha=!1,ce=o.memoizedState,w.state=ce,pc(o,g,w,v),mc();var fe=o.memoizedState;Q!==pe||ce!==fe||Ha||s!==null&&s.dependencies!==null&&$0(s.dependencies)?(typeof H=="function"&&(ym(o,f,H,g),fe=o.memoizedState),(de=Ha||I4(o,f,de,g,ce,fe,J)||s!==null&&s.dependencies!==null&&$0(s.dependencies))?(le||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(g,fe,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(g,fe,J)),typeof w.componentDidUpdate=="function"&&(o.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof w.componentDidUpdate!="function"||Q===s.memoizedProps&&ce===s.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||Q===s.memoizedProps&&ce===s.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=fe),w.props=g,w.state=fe,w.context=J,g=de):(typeof w.componentDidUpdate!="function"||Q===s.memoizedProps&&ce===s.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||Q===s.memoizedProps&&ce===s.memoizedState||(o.flags|=1024),g=!1)}return w=g,G0(s,o),g=(o.flags&128)!==0,w||g?(w=o.stateNode,f=g&&typeof f.getDerivedStateFromError!="function"?null:w.render(),o.flags|=1,s!==null&&g?(o.child=Hs(o,s.child,null,v),o.child=Hs(o,null,f,v)):Vn(s,o,f,v),o.memoizedState=w.state,s=o.child):s=na(s,o,v),s}function cx(s,o,f,g){return Ns(),o.flags|=256,Vn(s,o,f,g),o.child}var km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Am(s){return{baseLanes:s,cachePool:K6()}}function Mm(s,o,f){return s=s!==null?s.childLanes&~f:0,o&&(s|=Er),s}function ux(s,o,f){var g=o.pendingProps,v=!1,w=(o.flags&128)!==0,Q;if((Q=w)||(Q=s!==null&&s.memoizedState===null?!1:(cn.current&2)!==0),Q&&(v=!0,o.flags&=-129),Q=(o.flags&32)!==0,o.flags&=-33,s===null){if(xt){if(v?Fa(o):Ba(),(s=Gt)?(s=xy(s,Fr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Va!==null?{id:Ai,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},f=z6(s),f.return=o,o.child=f,Nn=o,Gt=null)):s=null,s===null)throw _a(o);return op(s)?o.lanes=32:o.lanes=536870912,null}var H=g.children;return g=g.fallback,v?(Ba(),v=o.mode,H=U0({mode:"hidden",children:H},v),g=Zs(g,v,f,null),H.return=o,g.return=o,H.sibling=g,o.child=H,g=o.child,g.memoizedState=Am(f),g.childLanes=Mm(s,Q,f),o.memoizedState=km,bc(null,g)):(Fa(o),Cm(o,H))}var J=s.memoizedState;if(J!==null&&(H=J.dehydrated,H!==null)){if(w)o.flags&256?(Fa(o),o.flags&=-257,o=Tm(s,o,f)):o.memoizedState!==null?(Ba(),o.child=s.child,o.flags|=128,o=null):(Ba(),H=g.fallback,v=o.mode,g=U0({mode:"visible",children:g.children},v),H=Zs(H,v,f,null),H.flags|=2,g.return=o,H.return=o,g.sibling=H,o.child=g,Hs(o,s.child,null,f),g=o.child,g.memoizedState=Am(f),g.childLanes=Mm(s,Q,f),o.memoizedState=km,o=bc(null,g));else if(Fa(o),op(H)){if(Q=H.nextSibling&&H.nextSibling.dataset,Q)var le=Q.dgst;Q=le,g=Error(r(419)),g.stack="",g.digest=Q,oc({value:g,source:null,stack:null}),o=Tm(s,o,f)}else if(yn||jl(s,o,f,!1),Q=(f&s.childLanes)!==0,yn||Q){if(Q=Dt,Q!==null&&(g=Pe(Q,f),g!==0&&g!==J.retryLane))throw J.retryLane=g,Qs(s,g),fr(Q,s,g),Sm;lp(H)||a1(),o=Tm(s,o,f)}else lp(H)?(o.flags|=192,o.child=s.child,o=null):(s=J.treeContext,Gt=Yr(H.nextSibling),Nn=o,xt=!0,La=null,Fr=!1,s!==null&&Y6(o,s),o=Cm(o,g.children),o.flags|=4096);return o}return v?(Ba(),H=g.fallback,v=o.mode,J=s.child,le=J.sibling,g=Ui(J,{mode:"hidden",children:g.children}),g.subtreeFlags=J.subtreeFlags&65011712,le!==null?H=Ui(le,H):(H=Zs(H,v,f,null),H.flags|=2),H.return=o,g.return=o,g.sibling=H,o.child=g,bc(null,g),g=o.child,H=s.child.memoizedState,H===null?H=Am(f):(v=H.cachePool,v!==null?(J=On._currentValue,v=v.parent!==J?{parent:J,pool:J}:v):v=K6(),H={baseLanes:H.baseLanes|f,cachePool:v}),g.memoizedState=H,g.childLanes=Mm(s,Q,f),o.memoizedState=km,bc(s.child,g)):(Fa(o),f=s.child,s=f.sibling,f=Ui(f,{mode:"visible",children:g.children}),f.return=o,f.sibling=null,s!==null&&(Q=o.deletions,Q===null?(o.deletions=[s],o.flags|=16):Q.push(s)),o.child=f,o.memoizedState=null,f)}function Cm(s,o){return o=U0({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function U0(s,o){return s=Ar(22,s,null,o),s.lanes=0,s}function Tm(s,o,f){return Hs(o,s.child,null,f),s=Cm(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function fx(s,o,f){s.lanes|=o;var g=s.alternate;g!==null&&(g.lanes|=o),zh(s.return,o,f)}function Em(s,o,f,g,v,w){var Q=s.memoizedState;Q===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:v,treeForkCount:w}:(Q.isBackwards=o,Q.rendering=null,Q.renderingStartTime=0,Q.last=g,Q.tail=f,Q.tailMode=v,Q.treeForkCount=w)}function dx(s,o,f){var g=o.pendingProps,v=g.revealOrder,w=g.tail;g=g.children;var Q=cn.current,H=(Q&2)!==0;if(H?(Q=Q&1|2,o.flags|=128):Q&=1,L(cn,Q),Vn(s,o,g,f),g=xt?lc:0,!H&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&fx(s,f,o);else if(s.tag===19)fx(s,f,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(v){case"forwards":for(f=o.child,v=null;f!==null;)s=f.alternate,s!==null&&L0(s)===null&&(v=f),f=f.sibling;f=v,f===null?(v=o.child,o.child=null):(v=f.sibling,f.sibling=null),Em(o,!1,v,f,w,g);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=o.child,o.child=null;v!==null;){if(s=v.alternate,s!==null&&L0(s)===null){o.child=v;break}s=v.sibling,v.sibling=f,f=v,v=s}Em(o,!0,f,null,w,g);break;case"together":Em(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function na(s,o,f){if(s!==null&&(o.dependencies=s.dependencies),qa|=o.lanes,(f&o.childLanes)===0)if(s!==null){if(jl(s,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,f=Ui(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=Ui(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function $m(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&$0(s)))}function $T(s,o,f){switch(o.tag){case 3:ae(o,o.stateNode.containerInfo),Da(o,On,s.memoizedState.cache),Ns();break;case 27:case 5:re(o);break;case 4:ae(o,o.stateNode.containerInfo);break;case 10:Da(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,tm(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(Fa(o),o.flags|=128,null):(f&o.child.childLanes)!==0?ux(s,o,f):(Fa(o),s=na(s,o,f),s!==null?s.sibling:null);Fa(o);break;case 19:var v=(s.flags&128)!==0;if(g=(f&o.childLanes)!==0,g||(jl(s,o,f,!1),g=(f&o.childLanes)!==0),v){if(g)return dx(s,o,f);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),L(cn,cn.current),g)break;return null;case 22:return o.lanes=0,ix(s,o,f,o.pendingProps);case 24:Da(o,On,s.memoizedState.cache)}return na(s,o,f)}function hx(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps)yn=!0;else{if(!$m(s,f)&&(o.flags&128)===0)return yn=!1,$T(s,o,f);yn=(s.flags&131072)!==0}else yn=!1,xt&&(o.flags&1048576)!==0&&B6(o,lc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(s=_s(o.elementType),o.type=s,typeof s=="function")Nh(s)?(g=zs(s,g),o.tag=1,o=ox(null,o,s,g,f)):(o.tag=0,o=wm(null,o,s,g,f));else{if(s!=null){var v=s.$$typeof;if(v===j){o.tag=11,o=tx(null,o,s,g,f);break e}else if(v===$){o.tag=14,o=nx(null,o,s,g,f);break e}}throw o=I(s)||s,Error(r(306,o,""))}}return o;case 0:return wm(s,o,o.type,o.pendingProps,f);case 1:return g=o.type,v=zs(g,o.pendingProps),ox(s,o,g,v,f);case 3:e:{if(ae(o,o.stateNode.containerInfo),s===null)throw Error(r(387));g=o.pendingProps;var w=o.memoizedState;v=w.element,Uh(s,o),pc(o,g,null,f);var Q=o.memoizedState;if(g=Q.cache,Da(o,On,g),g!==w.cache&&Fh(o,[On],f,!0),mc(),g=Q.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:Q.cache},o.updateQueue.baseState=w,o.memoizedState=w,o.flags&256){o=cx(s,o,g,f);break e}else if(g!==v){v=Hr(Error(r(424)),o),oc(v),o=cx(s,o,g,f);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Gt=Yr(s.firstChild),Nn=o,xt=!0,La=null,Fr=!0,f=i4(o,null,g,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Ns(),g===v){o=na(s,o,f);break e}Vn(s,o,g,f)}o=o.child}return o;case 26:return G0(s,o),s===null?(f=ky(o.type,null,o.pendingProps,null))?o.memoizedState=f:xt||(f=o.type,s=o.pendingProps,g=d1(ee.current).createElement(f),g[Rt]=o,g[ve]=s,Ln(g,f,s),rt(g),o.stateNode=g):o.memoizedState=ky(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return re(o),s===null&&xt&&(g=o.stateNode=vy(o.type,o.pendingProps,ee.current),Nn=o,Fr=!0,v=Gt,Ja(o.type)?(cp=v,Gt=Yr(g.firstChild)):Gt=v),Vn(s,o,o.pendingProps.children,f),G0(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&xt&&((v=g=Gt)&&(g=sE(g,o.type,o.pendingProps,Fr),g!==null?(o.stateNode=g,Nn=o,Gt=Yr(g.firstChild),Fr=!1,v=!0):v=!1),v||_a(o)),re(o),v=o.type,w=o.pendingProps,Q=s!==null?s.memoizedProps:null,g=w.children,ip(v,w)?g=null:Q!==null&&ip(v,Q)&&(o.flags|=32),o.memoizedState!==null&&(v=rm(s,o,vT,null,null,f),Nc._currentValue=v),G0(s,o),Vn(s,o,g,f),o.child;case 6:return s===null&&xt&&((s=f=Gt)&&(f=lE(f,o.pendingProps,Fr),f!==null?(o.stateNode=f,Nn=o,Gt=null,s=!0):s=!1),s||_a(o)),null;case 13:return ux(s,o,f);case 4:return ae(o,o.stateNode.containerInfo),g=o.pendingProps,s===null?o.child=Hs(o,null,g,f):Vn(s,o,g,f),o.child;case 11:return tx(s,o,o.type,o.pendingProps,f);case 7:return Vn(s,o,o.pendingProps,f),o.child;case 8:return Vn(s,o,o.pendingProps.children,f),o.child;case 12:return Vn(s,o,o.pendingProps.children,f),o.child;case 10:return g=o.pendingProps,Da(o,o.type,g.value),Vn(s,o,g.children,f),o.child;case 9:return v=o.type._context,g=o.pendingProps.children,Vs(o),v=Rn(v),g=g(v),o.flags|=1,Vn(s,o,g,f),o.child;case 14:return nx(s,o,o.type,o.pendingProps,f);case 15:return rx(s,o,o.type,o.pendingProps,f);case 19:return dx(s,o,f);case 31:return ET(s,o,f);case 22:return ix(s,o,f,o.pendingProps);case 24:return Vs(o),g=Rn(On),s===null?(v=Ih(),v===null&&(v=Dt,w=Bh(),v.pooledCache=w,w.refCount++,w!==null&&(v.pooledCacheLanes|=f),v=w),o.memoizedState={parent:g,cache:v},Gh(o),Da(o,On,v)):((s.lanes&f)!==0&&(Uh(s,o),pc(o,null,null,f),mc()),v=s.memoizedState,w=o.memoizedState,v.parent!==g?(v={parent:g,cache:g},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Da(o,On,g)):(g=w.cache,Da(o,On,g),g!==v.cache&&Fh(o,[On],f,!0))),Vn(s,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ra(s){s.flags|=4}function jm(s,o,f,g,v){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(v&335544128)===v)if(s.stateNode.complete)s.flags|=8192;else if(Dx())s.flags|=8192;else throw Ds=Z0,qh}else s.flags&=-16777217}function mx(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Ey(o))if(Dx())s.flags|=8192;else throw Ds=Z0,qh}function W0(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Tn():536870912,s.lanes|=o,zl|=o)}function vc(s,o){if(!xt)switch(s.tailMode){case"hidden":o=s.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Ut(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,g=0;if(o)for(var v=s.child;v!==null;)f|=v.lanes|v.childLanes,g|=v.subtreeFlags&65011712,g|=v.flags&65011712,v.return=s,v=v.sibling;else for(v=s.child;v!==null;)f|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=s,v=v.sibling;return s.subtreeFlags|=g,s.childLanes=f,o}function jT(s,o,f){var g=o.pendingProps;switch(_h(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(o),null;case 1:return Ut(o),null;case 3:return f=o.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),Ji(On),Y(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&($l(o)?ra(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Hh())),Ut(o),null;case 26:var v=o.type,w=o.memoizedState;return s===null?(ra(o),w!==null?(Ut(o),mx(o,w)):(Ut(o),jm(o,v,null,g,f))):w?w!==s.memoizedState?(ra(o),Ut(o),mx(o,w)):(Ut(o),o.flags&=-16777217):(s=s.memoizedProps,s!==g&&ra(o),Ut(o),jm(o,v,s,g,f)),null;case 27:if(he(o),f=ee.current,v=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==g&&ra(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return Ut(o),null}s=V.current,$l(o)?I6(o):(s=vy(v,g,f),o.stateNode=s,ra(o))}return Ut(o),null;case 5:if(he(o),v=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==g&&ra(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return Ut(o),null}if(w=V.current,$l(o))I6(o);else{var Q=d1(ee.current);switch(w){case 1:w=Q.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:w=Q.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":w=Q.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":w=Q.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":w=Q.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof g.is=="string"?Q.createElement("select",{is:g.is}):Q.createElement("select"),g.multiple?w.multiple=!0:g.size&&(w.size=g.size);break;default:w=typeof g.is=="string"?Q.createElement(v,{is:g.is}):Q.createElement(v)}}w[Rt]=o,w[ve]=g;e:for(Q=o.child;Q!==null;){if(Q.tag===5||Q.tag===6)w.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===o)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===o)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}o.stateNode=w;e:switch(Ln(w,v,g),v){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ra(o)}}return Ut(o),jm(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,f),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==g&&ra(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(s=ee.current,$l(o)){if(s=o.stateNode,f=o.memoizedProps,g=null,v=Nn,v!==null)switch(v.tag){case 27:case 5:g=v.memoizedProps}s[Rt]=o,s=!!(s.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||uy(s.nodeValue,f)),s||_a(o,!0)}else s=d1(s).createTextNode(g),s[Rt]=o,o.stateNode=s}return Ut(o),null;case 31:if(f=o.memoizedState,s===null||s.memoizedState!==null){if(g=$l(o),f!==null){if(s===null){if(!g)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Rt]=o}else Ns(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ut(o),s=!1}else f=Hh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=f),s=!0;if(!s)return o.flags&256?(Cr(o),o):(Cr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Ut(o),null;case 13:if(g=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(v=$l(o),g!==null&&g.dehydrated!==null){if(s===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Rt]=o}else Ns(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ut(o),v=!1}else v=Hh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(Cr(o),o):(Cr(o),null)}return Cr(o),(o.flags&128)!==0?(o.lanes=f,o):(f=g!==null,s=s!==null&&s.memoizedState!==null,f&&(g=o.child,v=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(v=g.alternate.memoizedState.cachePool.pool),w=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(w=g.memoizedState.cachePool.pool),w!==v&&(g.flags|=2048)),f!==s&&f&&(o.child.flags|=8192),W0(o,o.updateQueue),Ut(o),null);case 4:return Y(),s===null&&Jm(o.stateNode.containerInfo),Ut(o),null;case 10:return Ji(o.type),Ut(o),null;case 19:if(P(cn),g=o.memoizedState,g===null)return Ut(o),null;if(v=(o.flags&128)!==0,w=g.rendering,w===null)if(v)vc(g,!1);else{if(sn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(w=L0(s),w!==null){for(o.flags|=128,vc(g,!1),s=w.updateQueue,o.updateQueue=s,W0(o,s),o.subtreeFlags=0,s=f,f=o.child;f!==null;)X6(f,s),f=f.sibling;return L(cn,cn.current&1|2),xt&&Wi(o,g.treeForkCount),o.child}s=s.sibling}g.tail!==null&&ct()>n1&&(o.flags|=128,v=!0,vc(g,!1),o.lanes=4194304)}else{if(!v)if(s=L0(w),s!==null){if(o.flags|=128,v=!0,s=s.updateQueue,o.updateQueue=s,W0(o,s),vc(g,!0),g.tail===null&&g.tailMode==="hidden"&&!w.alternate&&!xt)return Ut(o),null}else 2*ct()-g.renderingStartTime>n1&&f!==536870912&&(o.flags|=128,v=!0,vc(g,!1),o.lanes=4194304);g.isBackwards?(w.sibling=o.child,o.child=w):(s=g.last,s!==null?s.sibling=w:o.child=w,g.last=w)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ct(),s.sibling=null,f=cn.current,L(cn,v?f&1|2:f&1),xt&&Wi(o,g.treeForkCount),s):(Ut(o),null);case 22:case 23:return Cr(o),em(),g=o.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(f&536870912)!==0&&(o.flags&128)===0&&(Ut(o),o.subtreeFlags&6&&(o.flags|=8192)):Ut(o),f=o.updateQueue,f!==null&&W0(o,f.retryQueue),f=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==f&&(o.flags|=2048),s!==null&&P(Ls),null;case 24:return f=null,s!==null&&(f=s.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Ji(On),Ut(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function PT(s,o){switch(_h(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Ji(On),Y(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return he(o),null;case 31:if(o.memoizedState!==null){if(Cr(o),o.alternate===null)throw Error(r(340));Ns()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Cr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Ns()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return P(cn),null;case 4:return Y(),null;case 10:return Ji(o.type),null;case 22:case 23:return Cr(o),em(),s!==null&&P(Ls),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Ji(On),null;case 25:return null;default:return null}}function px(s,o){switch(_h(o),o.tag){case 3:Ji(On),Y();break;case 26:case 27:case 5:he(o);break;case 4:Y();break;case 31:o.memoizedState!==null&&Cr(o);break;case 13:Cr(o);break;case 19:P(cn);break;case 10:Ji(o.type);break;case 22:case 23:Cr(o),em(),s!==null&&P(Ls);break;case 24:Ji(On)}}function Sc(s,o){try{var f=o.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var v=g.next;f=v;do{if((f.tag&s)===s){g=void 0;var w=f.create,Q=f.inst;g=w(),Q.destroy=g}f=f.next}while(f!==v)}}catch(H){Zt(o,o.return,H)}}function Ya(s,o,f){try{var g=o.updateQueue,v=g!==null?g.lastEffect:null;if(v!==null){var w=v.next;g=w;do{if((g.tag&s)===s){var Q=g.inst,H=Q.destroy;if(H!==void 0){Q.destroy=void 0,v=o;var J=f,le=H;try{le()}catch(de){Zt(v,J,de)}}}g=g.next}while(g!==w)}}catch(de){Zt(o,o.return,de)}}function gx(s){var o=s.updateQueue;if(o!==null){var f=s.stateNode;try{s4(o,f)}catch(g){Zt(s,s.return,g)}}}function Ox(s,o,f){f.props=zs(s.type,s.memoizedProps),f.state=s.memoizedState;try{f.componentWillUnmount()}catch(g){Zt(s,o,g)}}function wc(s,o){try{var f=s.ref;if(f!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof f=="function"?s.refCleanup=f(g):f.current=g}}catch(v){Zt(s,o,v)}}function Ci(s,o){var f=s.ref,g=s.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(v){Zt(s,o,v)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){Zt(s,o,v)}else f.current=null}function xx(s){var o=s.type,f=s.memoizedProps,g=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(v){Zt(s,s.return,v)}}function Pm(s,o,f){try{var g=s.stateNode;eE(g,s.type,f,o),g[ve]=o}catch(v){Zt(s,s.return,v)}}function yx(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ja(s.type)||s.tag===4}function Qm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||yx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ja(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Zm(s,o,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(s,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(s),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=qi));else if(g!==4&&(g===27&&Ja(s.type)&&(f=s.stateNode,o=null),s=s.child,s!==null))for(Zm(s,o,f),s=s.sibling;s!==null;)Zm(s,o,f),s=s.sibling}function K0(s,o,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(g!==4&&(g===27&&Ja(s.type)&&(f=s.stateNode),s=s.child,s!==null))for(K0(s,o,f),s=s.sibling;s!==null;)K0(s,o,f),s=s.sibling}function bx(s){var o=s.stateNode,f=s.memoizedProps;try{for(var g=s.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);Ln(o,g,f),o[Rt]=s,o[ve]=f}catch(w){Zt(s,s.return,w)}}var ia=!1,bn=!1,Nm=!1,vx=typeof WeakSet=="function"?WeakSet:Set,En=null;function QT(s,o){if(s=s.containerInfo,np=y1,s=Q6(s),Th(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var v=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{f.nodeType,w.nodeType}catch{f=null;break e}var Q=0,H=-1,J=-1,le=0,de=0,pe=s,ce=null;t:for(;;){for(var fe;pe!==f||v!==0&&pe.nodeType!==3||(H=Q+v),pe!==w||g!==0&&pe.nodeType!==3||(J=Q+g),pe.nodeType===3&&(Q+=pe.nodeValue.length),(fe=pe.firstChild)!==null;)ce=pe,pe=fe;for(;;){if(pe===s)break t;if(ce===f&&++le===v&&(H=Q),ce===w&&++de===g&&(J=Q),(fe=pe.nextSibling)!==null)break;pe=ce,ce=pe.parentNode}pe=fe}f=H===-1||J===-1?null:{start:H,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(rp={focusedElem:s,selectionRange:f},y1=!1,En=o;En!==null;)if(o=En,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,En=s;else for(;En!==null;){switch(o=En,w=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(f=0;f<s.length;f++)v=s[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&w!==null){s=void 0,f=o,v=w.memoizedProps,w=w.memoizedState,g=f.stateNode;try{var Ce=zs(f.type,v);s=g.getSnapshotBeforeUpdate(Ce,w),g.__reactInternalSnapshotBeforeUpdate=s}catch(Fe){Zt(f,f.return,Fe)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,f=s.nodeType,f===9)sp(s);else if(f===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":sp(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=o.sibling,s!==null){s.return=o.return,En=s;break}En=o.return}}function Sx(s,o,f){var g=f.flags;switch(f.tag){case 0:case 11:case 15:sa(s,f),g&4&&Sc(5,f);break;case 1:if(sa(s,f),g&4)if(s=f.stateNode,o===null)try{s.componentDidMount()}catch(Q){Zt(f,f.return,Q)}else{var v=zs(f.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(v,o,s.__reactInternalSnapshotBeforeUpdate)}catch(Q){Zt(f,f.return,Q)}}g&64&&gx(f),g&512&&wc(f,f.return);break;case 3:if(sa(s,f),g&64&&(s=f.updateQueue,s!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{s4(s,o)}catch(Q){Zt(f,f.return,Q)}}break;case 27:o===null&&g&4&&bx(f);case 26:case 5:sa(s,f),o===null&&g&4&&xx(f),g&512&&wc(f,f.return);break;case 12:sa(s,f);break;case 31:sa(s,f),g&4&&Ax(s,f);break;case 13:sa(s,f),g&4&&Mx(s,f),g&64&&(s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(f=XT.bind(null,f),oE(s,f))));break;case 22:if(g=f.memoizedState!==null||ia,!g){o=o!==null&&o.memoizedState!==null||bn,v=ia;var w=bn;ia=g,(bn=o)&&!w?la(s,f,(f.subtreeFlags&8772)!==0):sa(s,f),ia=v,bn=w}break;case 30:break;default:sa(s,f)}}function wx(s){var o=s.alternate;o!==null&&(s.alternate=null,wx(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&ai(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Kt=null,lr=!1;function aa(s,o,f){for(f=f.child;f!==null;)kx(s,o,f),f=f.sibling}function kx(s,o,f){if(Be&&typeof Be.onCommitFiberUnmount=="function")try{Be.onCommitFiberUnmount(Ae,f)}catch{}switch(f.tag){case 26:bn||Ci(f,o),aa(s,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:bn||Ci(f,o);var g=Kt,v=lr;Ja(f.type)&&(Kt=f.stateNode,lr=!1),aa(s,o,f),Pc(f.stateNode),Kt=g,lr=v;break;case 5:bn||Ci(f,o);case 6:if(g=Kt,v=lr,Kt=null,aa(s,o,f),Kt=g,lr=v,Kt!==null)if(lr)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(f.stateNode)}catch(w){Zt(f,o,w)}else try{Kt.removeChild(f.stateNode)}catch(w){Zt(f,o,w)}break;case 18:Kt!==null&&(lr?(s=Kt,gy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,f.stateNode),Wl(s)):gy(Kt,f.stateNode));break;case 4:g=Kt,v=lr,Kt=f.stateNode.containerInfo,lr=!0,aa(s,o,f),Kt=g,lr=v;break;case 0:case 11:case 14:case 15:Ya(2,f,o),bn||Ya(4,f,o),aa(s,o,f);break;case 1:bn||(Ci(f,o),g=f.stateNode,typeof g.componentWillUnmount=="function"&&Ox(f,o,g)),aa(s,o,f);break;case 21:aa(s,o,f);break;case 22:bn=(g=bn)||f.memoizedState!==null,aa(s,o,f),bn=g;break;default:aa(s,o,f)}}function Ax(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Wl(s)}catch(f){Zt(o,o.return,f)}}}function Mx(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Wl(s)}catch(f){Zt(o,o.return,f)}}function ZT(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new vx),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new vx),o;default:throw Error(r(435,s.tag))}}function J0(s,o){var f=ZT(s);o.forEach(function(g){if(!f.has(g)){f.add(g);var v=zT.bind(null,s,g);g.then(v,v)}})}function or(s,o){var f=o.deletions;if(f!==null)for(var g=0;g<f.length;g++){var v=f[g],w=s,Q=o,H=Q;e:for(;H!==null;){switch(H.tag){case 27:if(Ja(H.type)){Kt=H.stateNode,lr=!1;break e}break;case 5:Kt=H.stateNode,lr=!1;break e;case 3:case 4:Kt=H.stateNode.containerInfo,lr=!0;break e}H=H.return}if(Kt===null)throw Error(r(160));kx(w,Q,v),Kt=null,lr=!1,w=v.alternate,w!==null&&(w.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Cx(o,s),o=o.sibling}var ci=null;function Cx(s,o){var f=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:or(o,s),cr(s),g&4&&(Ya(3,s,s.return),Sc(3,s),Ya(5,s,s.return));break;case 1:or(o,s),cr(s),g&512&&(bn||f===null||Ci(f,f.return)),g&64&&ia&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(f=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=f===null?g:f.concat(g))));break;case 26:var v=ci;if(or(o,s),cr(s),g&512&&(bn||f===null||Ci(f,f.return)),g&4){var w=f!==null?f.memoizedState:null;if(g=s.memoizedState,f===null)if(g===null)if(s.stateNode===null){e:{g=s.type,f=s.memoizedProps,v=v.ownerDocument||v;t:switch(g){case"title":w=v.getElementsByTagName("title")[0],(!w||w[wi]||w[Rt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=v.createElement(g),v.head.insertBefore(w,v.querySelector("head > title"))),Ln(w,g,f),w[Rt]=s,rt(w),g=w;break e;case"link":var Q=Cy("link","href",v).get(g+(f.href||""));if(Q){for(var H=0;H<Q.length;H++)if(w=Q[H],w.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&w.getAttribute("rel")===(f.rel==null?null:f.rel)&&w.getAttribute("title")===(f.title==null?null:f.title)&&w.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){Q.splice(H,1);break t}}w=v.createElement(g),Ln(w,g,f),v.head.appendChild(w);break;case"meta":if(Q=Cy("meta","content",v).get(g+(f.content||""))){for(H=0;H<Q.length;H++)if(w=Q[H],w.getAttribute("content")===(f.content==null?null:""+f.content)&&w.getAttribute("name")===(f.name==null?null:f.name)&&w.getAttribute("property")===(f.property==null?null:f.property)&&w.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&w.getAttribute("charset")===(f.charSet==null?null:f.charSet)){Q.splice(H,1);break t}}w=v.createElement(g),Ln(w,g,f),v.head.appendChild(w);break;default:throw Error(r(468,g))}w[Rt]=s,rt(w),g=w}s.stateNode=g}else Ty(v,s.type,s.stateNode);else s.stateNode=My(v,g,s.memoizedProps);else w!==g?(w===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):w.count--,g===null?Ty(v,s.type,s.stateNode):My(v,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Pm(s,s.memoizedProps,f.memoizedProps)}break;case 27:or(o,s),cr(s),g&512&&(bn||f===null||Ci(f,f.return)),f!==null&&g&4&&Pm(s,s.memoizedProps,f.memoizedProps);break;case 5:if(or(o,s),cr(s),g&512&&(bn||f===null||Ci(f,f.return)),s.flags&32){v=s.stateNode;try{bl(v,"")}catch(Ce){Zt(s,s.return,Ce)}}g&4&&s.stateNode!=null&&(v=s.memoizedProps,Pm(s,v,f!==null?f.memoizedProps:v)),g&1024&&(Nm=!0);break;case 6:if(or(o,s),cr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,f=s.stateNode;try{f.nodeValue=g}catch(Ce){Zt(s,s.return,Ce)}}break;case 3:if(p1=null,v=ci,ci=h1(o.containerInfo),or(o,s),ci=v,cr(s),g&4&&f!==null&&f.memoizedState.isDehydrated)try{Wl(o.containerInfo)}catch(Ce){Zt(s,s.return,Ce)}Nm&&(Nm=!1,Tx(s));break;case 4:g=ci,ci=h1(s.stateNode.containerInfo),or(o,s),cr(s),ci=g;break;case 12:or(o,s),cr(s);break;case 31:or(o,s),cr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,J0(s,g)));break;case 13:or(o,s),cr(s),s.child.flags&8192&&s.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(t1=ct()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,J0(s,g)));break;case 22:v=s.memoizedState!==null;var J=f!==null&&f.memoizedState!==null,le=ia,de=bn;if(ia=le||v,bn=de||J,or(o,s),bn=de,ia=le,cr(s),g&8192)e:for(o=s.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(f===null||J||ia||bn||Fs(s)),f=null,o=s;;){if(o.tag===5||o.tag===26){if(f===null){J=f=o;try{if(w=J.stateNode,v)Q=w.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none";else{H=J.stateNode;var pe=J.memoizedProps.style,ce=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;H.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ce){Zt(J,J.return,Ce)}}}else if(o.tag===6){if(f===null){J=o;try{J.stateNode.nodeValue=v?"":J.memoizedProps}catch(Ce){Zt(J,J.return,Ce)}}}else if(o.tag===18){if(f===null){J=o;try{var fe=J.stateNode;v?Oy(fe,!0):Oy(J.stateNode,!1)}catch(Ce){Zt(J,J.return,Ce)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=s.updateQueue,g!==null&&(f=g.retryQueue,f!==null&&(g.retryQueue=null,J0(s,f))));break;case 19:or(o,s),cr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,J0(s,g)));break;case 30:break;case 21:break;default:or(o,s),cr(s)}}function cr(s){var o=s.flags;if(o&2){try{for(var f,g=s.return;g!==null;){if(yx(g)){f=g;break}g=g.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var v=f.stateNode,w=Qm(s);K0(s,w,v);break;case 5:var Q=f.stateNode;f.flags&32&&(bl(Q,""),f.flags&=-33);var H=Qm(s);K0(s,H,Q);break;case 3:case 4:var J=f.stateNode.containerInfo,le=Qm(s);Zm(s,le,J);break;default:throw Error(r(161))}}catch(de){Zt(s,s.return,de)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function Tx(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;Tx(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function sa(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Sx(s,o.alternate,o),o=o.sibling}function Fs(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:Ya(4,o,o.return),Fs(o);break;case 1:Ci(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&Ox(o,o.return,f),Fs(o);break;case 27:Pc(o.stateNode);case 26:case 5:Ci(o,o.return),Fs(o);break;case 22:o.memoizedState===null&&Fs(o);break;case 30:Fs(o);break;default:Fs(o)}s=s.sibling}}function la(s,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,v=s,w=o,Q=w.flags;switch(w.tag){case 0:case 11:case 15:la(v,w,f),Sc(4,w);break;case 1:if(la(v,w,f),g=w,v=g.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(le){Zt(g,g.return,le)}if(g=w,v=g.updateQueue,v!==null){var H=g.stateNode;try{var J=v.shared.hiddenCallbacks;if(J!==null)for(v.shared.hiddenCallbacks=null,v=0;v<J.length;v++)a4(J[v],H)}catch(le){Zt(g,g.return,le)}}f&&Q&64&&gx(w),wc(w,w.return);break;case 27:bx(w);case 26:case 5:la(v,w,f),f&&g===null&&Q&4&&xx(w),wc(w,w.return);break;case 12:la(v,w,f);break;case 31:la(v,w,f),f&&Q&4&&Ax(v,w);break;case 13:la(v,w,f),f&&Q&4&&Mx(v,w);break;case 22:w.memoizedState===null&&la(v,w,f),wc(w,w.return);break;case 30:break;default:la(v,w,f)}o=o.sibling}}function Rm(s,o){var f=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==f&&(s!=null&&s.refCount++,f!=null&&cc(f))}function Vm(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&cc(s))}function ui(s,o,f,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Ex(s,o,f,g),o=o.sibling}function Ex(s,o,f,g){var v=o.flags;switch(o.tag){case 0:case 11:case 15:ui(s,o,f,g),v&2048&&Sc(9,o);break;case 1:ui(s,o,f,g);break;case 3:ui(s,o,f,g),v&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&cc(s)));break;case 12:if(v&2048){ui(s,o,f,g),s=o.stateNode;try{var w=o.memoizedProps,Q=w.id,H=w.onPostCommit;typeof H=="function"&&H(Q,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Zt(o,o.return,J)}}else ui(s,o,f,g);break;case 31:ui(s,o,f,g);break;case 13:ui(s,o,f,g);break;case 23:break;case 22:w=o.stateNode,Q=o.alternate,o.memoizedState!==null?w._visibility&2?ui(s,o,f,g):kc(s,o):w._visibility&2?ui(s,o,f,g):(w._visibility|=2,Dl(s,o,f,g,(o.subtreeFlags&10256)!==0||!1)),v&2048&&Rm(Q,o);break;case 24:ui(s,o,f,g),v&2048&&Vm(o.alternate,o);break;default:ui(s,o,f,g)}}function Dl(s,o,f,g,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var w=s,Q=o,H=f,J=g,le=Q.flags;switch(Q.tag){case 0:case 11:case 15:Dl(w,Q,H,J,v),Sc(8,Q);break;case 23:break;case 22:var de=Q.stateNode;Q.memoizedState!==null?de._visibility&2?Dl(w,Q,H,J,v):kc(w,Q):(de._visibility|=2,Dl(w,Q,H,J,v)),v&&le&2048&&Rm(Q.alternate,Q);break;case 24:Dl(w,Q,H,J,v),v&&le&2048&&Vm(Q.alternate,Q);break;default:Dl(w,Q,H,J,v)}o=o.sibling}}function kc(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=s,g=o,v=g.flags;switch(g.tag){case 22:kc(f,g),v&2048&&Rm(g.alternate,g);break;case 24:kc(f,g),v&2048&&Vm(g.alternate,g);break;default:kc(f,g)}o=o.sibling}}var Ac=8192;function Hl(s,o,f){if(s.subtreeFlags&Ac)for(s=s.child;s!==null;)$x(s,o,f),s=s.sibling}function $x(s,o,f){switch(s.tag){case 26:Hl(s,o,f),s.flags&Ac&&s.memoizedState!==null&&bE(f,ci,s.memoizedState,s.memoizedProps);break;case 5:Hl(s,o,f);break;case 3:case 4:var g=ci;ci=h1(s.stateNode.containerInfo),Hl(s,o,f),ci=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Ac,Ac=16777216,Hl(s,o,f),Ac=g):Hl(s,o,f));break;default:Hl(s,o,f)}}function jx(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function Mc(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var g=o[f];En=g,Qx(g,s)}jx(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Px(s),s=s.sibling}function Px(s){switch(s.tag){case 0:case 11:case 15:Mc(s),s.flags&2048&&Ya(9,s,s.return);break;case 3:Mc(s);break;case 12:Mc(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,e1(s)):Mc(s);break;default:Mc(s)}}function e1(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var g=o[f];En=g,Qx(g,s)}jx(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:Ya(8,o,o.return),e1(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,e1(o));break;default:e1(o)}s=s.sibling}}function Qx(s,o){for(;En!==null;){var f=En;switch(f.tag){case 0:case 11:case 15:Ya(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var g=f.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:cc(f.memoizedState.cache)}if(g=f.child,g!==null)g.return=f,En=g;else e:for(f=s;En!==null;){g=En;var v=g.sibling,w=g.return;if(wx(g),g===f){En=null;break e}if(v!==null){v.return=w,En=v;break e}En=w}}}var NT={getCacheForType:function(s){var o=Rn(On),f=o.data.get(s);return f===void 0&&(f=s(),o.data.set(s,f)),f},cacheSignal:function(){return Rn(On).controller.signal}},RT=typeof WeakMap=="function"?WeakMap:Map,$t=0,Dt=null,dt=null,pt=0,Qt=0,Tr=null,Ia=!1,Xl=!1,Lm=!1,oa=0,sn=0,qa=0,Bs=0,_m=0,Er=0,zl=0,Cc=null,ur=null,Dm=!1,t1=0,Zx=0,n1=1/0,r1=null,Ga=null,An=0,Ua=null,Fl=null,ca=0,Hm=0,Xm=null,Nx=null,Tc=0,zm=null;function $r(){return($t&2)!==0&&pt!==0?pt&-pt:Z.T!==null?Gm():nn()}function Rx(){if(Er===0)if((pt&536870912)===0||xt){var s=Mt;Mt<<=1,(Mt&3932160)===0&&(Mt=262144),Er=s}else Er=536870912;return s=Mr.current,s!==null&&(s.flags|=32),Er}function fr(s,o,f){(s===Dt&&(Qt===2||Qt===9)||s.cancelPendingCommit!==null)&&(Bl(s,0),Wa(s,pt,Er,!1)),Fn(s,f),(($t&2)===0||s!==Dt)&&(s===Dt&&(($t&2)===0&&(Bs|=f),sn===4&&Wa(s,pt,Er,!1)),Ti(s))}function Vx(s,o,f){if(($t&6)!==0)throw Error(r(327));var g=!f&&(o&127)===0&&(o&s.expiredLanes)===0||It(s,o),v=g?_T(s,o):Bm(s,o,!0),w=g;do{if(v===0){Xl&&!g&&Wa(s,o,0,!1);break}else{if(f=s.current.alternate,w&&!VT(f)){v=Bm(s,o,!1),w=!1;continue}if(v===2){if(w=o,s.errorRecoveryDisabledLanes&w)var Q=0;else Q=s.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){o=Q;e:{var H=s;v=Cc;var J=H.current.memoizedState.isDehydrated;if(J&&(Bl(H,Q).flags|=256),Q=Bm(H,Q,!1),Q!==2){if(Lm&&!J){H.errorRecoveryDisabledLanes|=w,Bs|=w,v=4;break e}w=ur,ur=v,w!==null&&(ur===null?ur=w:ur.push.apply(ur,w))}v=Q}if(w=!1,v!==2)continue}}if(v===1){Bl(s,0),Wa(s,o,0,!0);break}e:{switch(g=s,w=v,w){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Wa(g,o,Er,!Ia);break e;case 2:ur=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=t1+300-ct(),10<v)){if(Wa(g,o,Er,!Ia),Et(g,0,!0)!==0)break e;ca=o,g.timeoutHandle=my(Lx.bind(null,g,f,ur,r1,Dm,o,Er,Bs,zl,Ia,w,"Throttled",-0,0),v);break e}Lx(g,f,ur,r1,Dm,o,Er,Bs,zl,Ia,w,null,-0,0)}}break}while(!0);Ti(s)}function Lx(s,o,f,g,v,w,Q,H,J,le,de,pe,ce,fe){if(s.timeoutHandle=-1,pe=o.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qi},$x(o,w,pe);var Ce=(w&62914560)===w?t1-ct():(w&4194048)===w?Zx-ct():0;if(Ce=vE(pe,Ce),Ce!==null){ca=w,s.cancelPendingCommit=Ce(Yx.bind(null,s,o,w,f,g,v,Q,H,J,de,pe,null,ce,fe)),Wa(s,w,Q,!le);return}}Yx(s,o,w,f,g,v,Q,H,J)}function VT(s){for(var o=s;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var g=0;g<f.length;g++){var v=f[g],w=v.getSnapshot;v=v.value;try{if(!kr(w(),v))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Wa(s,o,f,g){o&=~_m,o&=~Bs,s.suspendedLanes|=o,s.pingedLanes&=~o,g&&(s.warmLanes|=o),g=s.expirationTimes;for(var v=o;0<v;){var w=31-ot(v),Q=1<<w;g[w]=-1,v&=~Q}f!==0&&ri(s,f,o)}function i1(){return($t&6)===0?(Ec(0),!1):!0}function Fm(){if(dt!==null){if(Qt===0)var s=dt.return;else s=dt,Ki=Rs=null,sm(s),Nl=null,fc=0,s=dt;for(;s!==null;)px(s.alternate,s),s=s.return;dt=null}}function Bl(s,o){var f=s.timeoutHandle;f!==-1&&(s.timeoutHandle=-1,rE(f)),f=s.cancelPendingCommit,f!==null&&(s.cancelPendingCommit=null,f()),ca=0,Fm(),Dt=s,dt=f=Ui(s.current,null),pt=o,Qt=0,Tr=null,Ia=!1,Xl=It(s,o),Lm=!1,zl=Er=_m=Bs=qa=sn=0,ur=Cc=null,Dm=!1,(o&8)!==0&&(o|=o&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=o;0<g;){var v=31-ot(g),w=1<<v;o|=s[v],g&=~w}return oa=o,A0(),f}function _x(s,o){nt=null,Z.H=yc,o===Zl||o===Q0?(o=t4(),Qt=3):o===qh?(o=t4(),Qt=4):Qt=o===Sm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Tr=o,dt===null&&(sn=1,I0(s,Hr(o,s.current)))}function Dx(){var s=Mr.current;return s===null?!0:(pt&4194048)===pt?Br===null:(pt&62914560)===pt||(pt&536870912)!==0?s===Br:!1}function Hx(){var s=Z.H;return Z.H=yc,s===null?yc:s}function Xx(){var s=Z.A;return Z.A=NT,s}function a1(){sn=4,Ia||(pt&4194048)!==pt&&Mr.current!==null||(Xl=!0),(qa&134217727)===0&&(Bs&134217727)===0||Dt===null||Wa(Dt,pt,Er,!1)}function Bm(s,o,f){var g=$t;$t|=2;var v=Hx(),w=Xx();(Dt!==s||pt!==o)&&(r1=null,Bl(s,o)),o=!1;var Q=sn;e:do try{if(Qt!==0&&dt!==null){var H=dt,J=Tr;switch(Qt){case 8:Fm(),Q=6;break e;case 3:case 2:case 9:case 6:Mr.current===null&&(o=!0);var le=Qt;if(Qt=0,Tr=null,Yl(s,H,J,le),f&&Xl){Q=0;break e}break;default:le=Qt,Qt=0,Tr=null,Yl(s,H,J,le)}}LT(),Q=sn;break}catch(de){_x(s,de)}while(!0);return o&&s.shellSuspendCounter++,Ki=Rs=null,$t=g,Z.H=v,Z.A=w,dt===null&&(Dt=null,pt=0,A0()),Q}function LT(){for(;dt!==null;)zx(dt)}function _T(s,o){var f=$t;$t|=2;var g=Hx(),v=Xx();Dt!==s||pt!==o?(r1=null,n1=ct()+500,Bl(s,o)):Xl=It(s,o);e:do try{if(Qt!==0&&dt!==null){o=dt;var w=Tr;t:switch(Qt){case 1:Qt=0,Tr=null,Yl(s,o,w,1);break;case 2:case 9:if(J6(w)){Qt=0,Tr=null,Fx(o);break}o=function(){Qt!==2&&Qt!==9||Dt!==s||(Qt=7),Ti(s)},w.then(o,o);break e;case 3:Qt=7;break e;case 4:Qt=5;break e;case 7:J6(w)?(Qt=0,Tr=null,Fx(o)):(Qt=0,Tr=null,Yl(s,o,w,7));break;case 5:var Q=null;switch(dt.tag){case 26:Q=dt.memoizedState;case 5:case 27:var H=dt;if(Q?Ey(Q):H.stateNode.complete){Qt=0,Tr=null;var J=H.sibling;if(J!==null)dt=J;else{var le=H.return;le!==null?(dt=le,s1(le)):dt=null}break t}}Qt=0,Tr=null,Yl(s,o,w,5);break;case 6:Qt=0,Tr=null,Yl(s,o,w,6);break;case 8:Fm(),sn=6;break e;default:throw Error(r(462))}}DT();break}catch(de){_x(s,de)}while(!0);return Ki=Rs=null,Z.H=g,Z.A=v,$t=f,dt!==null?0:(Dt=null,pt=0,A0(),sn)}function DT(){for(;dt!==null&&!Ot();)zx(dt)}function zx(s){var o=hx(s.alternate,s,oa);s.memoizedProps=s.pendingProps,o===null?s1(s):dt=o}function Fx(s){var o=s,f=o.alternate;switch(o.tag){case 15:case 0:o=lx(f,o,o.pendingProps,o.type,void 0,pt);break;case 11:o=lx(f,o,o.pendingProps,o.type.render,o.ref,pt);break;case 5:sm(o);default:px(f,o),o=dt=X6(o,oa),o=hx(f,o,oa)}s.memoizedProps=s.pendingProps,o===null?s1(s):dt=o}function Yl(s,o,f,g){Ki=Rs=null,sm(o),Nl=null,fc=0;var v=o.return;try{if(TT(s,v,o,f,pt)){sn=1,I0(s,Hr(f,s.current)),dt=null;return}}catch(w){if(v!==null)throw dt=v,w;sn=1,I0(s,Hr(f,s.current)),dt=null;return}o.flags&32768?(xt||g===1?s=!0:Xl||(pt&536870912)!==0?s=!1:(Ia=s=!0,(g===2||g===9||g===3||g===6)&&(g=Mr.current,g!==null&&g.tag===13&&(g.flags|=16384))),Bx(o,s)):s1(o)}function s1(s){var o=s;do{if((o.flags&32768)!==0){Bx(o,Ia);return}s=o.return;var f=jT(o.alternate,o,oa);if(f!==null){dt=f;return}if(o=o.sibling,o!==null){dt=o;return}dt=o=s}while(o!==null);sn===0&&(sn=5)}function Bx(s,o){do{var f=PT(s.alternate,s);if(f!==null){f.flags&=32767,dt=f;return}if(f=s.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(s=s.sibling,s!==null)){dt=s;return}dt=s=f}while(s!==null);sn=6,dt=null}function Yx(s,o,f,g,v,w,Q,H,J){s.cancelPendingCommit=null;do l1();while(An!==0);if(($t&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(w=o.lanes|o.childLanes,w|=Qh,ni(s,f,w,Q,H,J),s===Dt&&(dt=Dt=null,pt=0),Fl=o,Ua=s,ca=f,Hm=w,Xm=v,Nx=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,FT(Re,function(){return Wx(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=Z.T,Z.T=null,v=F.p,F.p=2,Q=$t,$t|=4;try{QT(s,o,f)}finally{$t=Q,F.p=v,Z.T=g}}An=1,Ix(),qx(),Gx()}}function Ix(){if(An===1){An=0;var s=Ua,o=Fl,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=Z.T,Z.T=null;var g=F.p;F.p=2;var v=$t;$t|=4;try{Cx(o,s);var w=rp,Q=Q6(s.containerInfo),H=w.focusedElem,J=w.selectionRange;if(Q!==H&&H&&H.ownerDocument&&P6(H.ownerDocument.documentElement,H)){if(J!==null&&Th(H)){var le=J.start,de=J.end;if(de===void 0&&(de=le),"selectionStart"in H)H.selectionStart=le,H.selectionEnd=Math.min(de,H.value.length);else{var pe=H.ownerDocument||document,ce=pe&&pe.defaultView||window;if(ce.getSelection){var fe=ce.getSelection(),Ce=H.textContent.length,Fe=Math.min(J.start,Ce),_t=J.end===void 0?Fe:Math.min(J.end,Ce);!fe.extend&&Fe>_t&&(Q=_t,_t=Fe,Fe=Q);var ie=j6(H,Fe),ne=j6(H,_t);if(ie&&ne&&(fe.rangeCount!==1||fe.anchorNode!==ie.node||fe.anchorOffset!==ie.offset||fe.focusNode!==ne.node||fe.focusOffset!==ne.offset)){var se=pe.createRange();se.setStart(ie.node,ie.offset),fe.removeAllRanges(),Fe>_t?(fe.addRange(se),fe.extend(ne.node,ne.offset)):(se.setEnd(ne.node,ne.offset),fe.addRange(se))}}}}for(pe=[],fe=H;fe=fe.parentNode;)fe.nodeType===1&&pe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<pe.length;H++){var me=pe[H];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}y1=!!np,rp=np=null}finally{$t=v,F.p=g,Z.T=f}}s.current=o,An=2}}function qx(){if(An===2){An=0;var s=Ua,o=Fl,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=Z.T,Z.T=null;var g=F.p;F.p=2;var v=$t;$t|=4;try{Sx(s,o.alternate,o)}finally{$t=v,F.p=g,Z.T=f}}An=3}}function Gx(){if(An===4||An===3){An=0,He();var s=Ua,o=Fl,f=ca,g=Nx;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?An=5:(An=0,Fl=Ua=null,Ux(s,s.pendingLanes));var v=s.pendingLanes;if(v===0&&(Ga=null),Nt(f),o=o.stateNode,Be&&typeof Be.onCommitFiberRoot=="function")try{Be.onCommitFiberRoot(Ae,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=Z.T,v=F.p,F.p=2,Z.T=null;try{for(var w=s.onRecoverableError,Q=0;Q<g.length;Q++){var H=g[Q];w(H.value,{componentStack:H.stack})}}finally{Z.T=o,F.p=v}}(ca&3)!==0&&l1(),Ti(s),v=s.pendingLanes,(f&261930)!==0&&(v&42)!==0?s===zm?Tc++:(Tc=0,zm=s):Tc=0,Ec(0)}}function Ux(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,cc(o)))}function l1(){return Ix(),qx(),Gx(),Wx()}function Wx(){if(An!==5)return!1;var s=Ua,o=Hm;Hm=0;var f=Nt(ca),g=Z.T,v=F.p;try{F.p=32>f?32:f,Z.T=null,f=Xm,Xm=null;var w=Ua,Q=ca;if(An=0,Fl=Ua=null,ca=0,($t&6)!==0)throw Error(r(331));var H=$t;if($t|=4,Px(w.current),Ex(w,w.current,Q,f),$t=H,Ec(0,!1),Be&&typeof Be.onPostCommitFiberRoot=="function")try{Be.onPostCommitFiberRoot(Ae,w)}catch{}return!0}finally{F.p=v,Z.T=g,Ux(s,o)}}function Kx(s,o,f){o=Hr(f,o),o=vm(s.stateNode,o,2),s=za(s,o,2),s!==null&&(Fn(s,2),Ti(s))}function Zt(s,o,f){if(s.tag===3)Kx(s,s,f);else for(;o!==null;){if(o.tag===3){Kx(o,s,f);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ga===null||!Ga.has(g))){s=Hr(f,s),f=J4(2),g=za(o,f,2),g!==null&&(ex(f,g,o,s),Fn(g,2),Ti(g));break}}o=o.return}}function Ym(s,o,f){var g=s.pingCache;if(g===null){g=s.pingCache=new RT;var v=new Set;g.set(o,v)}else v=g.get(o),v===void 0&&(v=new Set,g.set(o,v));v.has(f)||(Lm=!0,v.add(f),s=HT.bind(null,s,o,f),o.then(s,s))}function HT(s,o,f){var g=s.pingCache;g!==null&&g.delete(o),s.pingedLanes|=s.suspendedLanes&f,s.warmLanes&=~f,Dt===s&&(pt&f)===f&&(sn===4||sn===3&&(pt&62914560)===pt&&300>ct()-t1?($t&2)===0&&Bl(s,0):_m|=f,zl===pt&&(zl=0)),Ti(s)}function Jx(s,o){o===0&&(o=Tn()),s=Qs(s,o),s!==null&&(Fn(s,o),Ti(s))}function XT(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),Jx(s,f)}function zT(s,o){var f=0;switch(s.tag){case 31:case 13:var g=s.stateNode,v=s.memoizedState;v!==null&&(f=v.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),Jx(s,f)}function FT(s,o){return ze(s,o)}var o1=null,Il=null,Im=!1,c1=!1,qm=!1,Ka=0;function Ti(s){s!==Il&&s.next===null&&(Il===null?o1=Il=s:Il=Il.next=s),c1=!0,Im||(Im=!0,YT())}function Ec(s,o){if(!qm&&c1){qm=!0;do for(var f=!1,g=o1;g!==null;){if(s!==0){var v=g.pendingLanes;if(v===0)var w=0;else{var Q=g.suspendedLanes,H=g.pingedLanes;w=(1<<31-ot(42|s)+1)-1,w&=v&~(Q&~H),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(f=!0,ry(g,w))}else w=pt,w=Et(g,g===Dt?w:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(w&3)===0||It(g,w)||(f=!0,ry(g,w));g=g.next}while(f);qm=!1}}function BT(){ey()}function ey(){c1=Im=!1;var s=0;Ka!==0&&nE()&&(s=Ka);for(var o=ct(),f=null,g=o1;g!==null;){var v=g.next,w=ty(g,o);w===0?(g.next=null,f===null?o1=v:f.next=v,v===null&&(Il=f)):(f=g,(s!==0||(w&3)!==0)&&(c1=!0)),g=v}An!==0&&An!==5||Ec(s),Ka!==0&&(Ka=0)}function ty(s,o){for(var f=s.suspendedLanes,g=s.pingedLanes,v=s.expirationTimes,w=s.pendingLanes&-62914561;0<w;){var Q=31-ot(w),H=1<<Q,J=v[Q];J===-1?((H&f)===0||(H&g)!==0)&&(v[Q]=qt(H,o)):J<=o&&(s.expiredLanes|=H),w&=~H}if(o=Dt,f=pt,f=Et(s,s===o?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,f===0||s===o&&(Qt===2||Qt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&et(g),s.callbackNode=null,s.callbackPriority=0;if((f&3)===0||It(s,f)){if(o=f&-f,o===s.callbackPriority)return o;switch(g!==null&&et(g),Nt(f)){case 2:case 8:f=Ge;break;case 32:f=Re;break;case 268435456:f=Ie;break;default:f=Re}return g=ny.bind(null,s),f=ze(f,g),s.callbackPriority=o,s.callbackNode=f,o}return g!==null&&g!==null&&et(g),s.callbackPriority=2,s.callbackNode=null,2}function ny(s,o){if(An!==0&&An!==5)return s.callbackNode=null,s.callbackPriority=0,null;var f=s.callbackNode;if(l1()&&s.callbackNode!==f)return null;var g=pt;return g=Et(s,s===Dt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(Vx(s,g,o),ty(s,ct()),s.callbackNode!=null&&s.callbackNode===f?ny.bind(null,s):null)}function ry(s,o){if(l1())return null;Vx(s,o,!0)}function YT(){iE(function(){($t&6)!==0?ze(Oe,BT):ey()})}function Gm(){if(Ka===0){var s=Pl;s===0&&(s=Ue,Ue<<=1,(Ue&261888)===0&&(Ue=256)),Ka=s}return Ka}function iy(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:O0(""+s)}function ay(s,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,s.id&&f.setAttribute("form",s.id),o.parentNode.insertBefore(f,o),s=new FormData(s),f.parentNode.removeChild(f),s}function IT(s,o,f,g,v){if(o==="submit"&&f&&f.stateNode===v){var w=iy((v[ve]||null).action),Q=g.submitter;Q&&(o=(o=Q[ve]||null)?iy(o.formAction):Q.getAttribute("formAction"),o!==null&&(w=o,Q=null));var H=new v0("action","action",null,g,v);s.push({event:H,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ka!==0){var J=Q?ay(v,Q):new FormData(v);pm(f,{pending:!0,data:J,method:v.method,action:w},null,J)}}else typeof w=="function"&&(H.preventDefault(),J=Q?ay(v,Q):new FormData(v),pm(f,{pending:!0,data:J,method:v.method,action:w},w,J))},currentTarget:v}]})}}for(var Um=0;Um<Ph.length;Um++){var Wm=Ph[Um],qT=Wm.toLowerCase(),GT=Wm[0].toUpperCase()+Wm.slice(1);oi(qT,"on"+GT)}oi(R6,"onAnimationEnd"),oi(V6,"onAnimationIteration"),oi(L6,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(fT,"onTransitionRun"),oi(dT,"onTransitionStart"),oi(hT,"onTransitionCancel"),oi(_6,"onTransitionEnd"),Na("onMouseEnter",["mouseout","mouseover"]),Na("onMouseLeave",["mouseout","mouseover"]),Na("onPointerEnter",["pointerout","pointerover"]),Na("onPointerLeave",["pointerout","pointerover"]),Bn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $c="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(" "),UT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($c));function sy(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var g=s[f],v=g.event;g=g.listeners;e:{var w=void 0;if(o)for(var Q=g.length-1;0<=Q;Q--){var H=g[Q],J=H.instance,le=H.currentTarget;if(H=H.listener,J!==w&&v.isPropagationStopped())break e;w=H,v.currentTarget=le;try{w(v)}catch(de){k0(de)}v.currentTarget=null,w=J}else for(Q=0;Q<g.length;Q++){if(H=g[Q],J=H.instance,le=H.currentTarget,H=H.listener,J!==w&&v.isPropagationStopped())break e;w=H,v.currentTarget=le;try{w(v)}catch(de){k0(de)}v.currentTarget=null,w=J}}}}function ht(s,o){var f=o[wn];f===void 0&&(f=o[wn]=new Set);var g=s+"__bubble";f.has(g)||(ly(o,s,2,!1),f.add(g))}function Km(s,o,f){var g=0;o&&(g|=4),ly(f,s,g,o)}var u1="_reactListening"+Math.random().toString(36).slice(2);function Jm(s){if(!s[u1]){s[u1]=!0,Sr.forEach(function(f){f!=="selectionchange"&&(UT.has(f)||Km(f,!1,s),Km(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[u1]||(o[u1]=!0,Km("selectionchange",!1,o))}}function ly(s,o,f,g){switch(Ry(o)){case 2:var v=kE;break;case 8:v=AE;break;default:v=mp}f=v.bind(null,o,f,s),v=void 0,!yh||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),g?v!==void 0?s.addEventListener(o,f,{capture:!0,passive:v}):s.addEventListener(o,f,!0):v!==void 0?s.addEventListener(o,f,{passive:v}):s.addEventListener(o,f,!1)}function ep(s,o,f,g,v){var w=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var Q=g.tag;if(Q===3||Q===4){var H=g.stateNode.containerInfo;if(H===v)break;if(Q===4)for(Q=g.return;Q!==null;){var J=Q.tag;if((J===3||J===4)&&Q.stateNode.containerInfo===v)return;Q=Q.return}for(;H!==null;){if(Q=si(H),Q===null)return;if(J=Q.tag,J===5||J===6||J===26||J===27){g=w=Q;continue e}H=H.parentNode}}g=g.return}d6(function(){var le=w,de=Oh(f),pe=[];e:{var ce=D6.get(s);if(ce!==void 0){var fe=v0,Ce=s;switch(s){case"keypress":if(y0(f)===0)break e;case"keydown":case"keyup":fe=zC;break;case"focusin":Ce="focus",fe=wh;break;case"focusout":Ce="blur",fe=wh;break;case"beforeblur":case"afterblur":fe=wh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=p6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=jC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=YC;break;case R6:case V6:case L6:fe=ZC;break;case _6:fe=qC;break;case"scroll":case"scrollend":fe=EC;break;case"wheel":fe=UC;break;case"copy":case"cut":case"paste":fe=RC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=O6;break;case"toggle":case"beforetoggle":fe=KC}var Fe=(o&4)!==0,_t=!Fe&&(s==="scroll"||s==="scrollend"),ie=Fe?ce!==null?ce+"Capture":null:ce;Fe=[];for(var ne=le,se;ne!==null;){var me=ne;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||ie===null||(me=Ko(ne,ie),me!=null&&Fe.push(jc(ne,me,se))),_t)break;ne=ne.return}0<Fe.length&&(ce=new fe(ce,Ce,null,f,de),pe.push({event:ce,listeners:Fe}))}}if((o&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",fe=s==="mouseout"||s==="pointerout",ce&&f!==gh&&(Ce=f.relatedTarget||f.fromElement)&&(si(Ce)||Ce[tt]))break e;if((fe||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,fe?(Ce=f.relatedTarget||f.toElement,fe=le,Ce=Ce?si(Ce):null,Ce!==null&&(_t=a(Ce),Fe=Ce.tag,Ce!==_t||Fe!==5&&Fe!==27&&Fe!==6)&&(Ce=null)):(fe=null,Ce=le),fe!==Ce)){if(Fe=p6,me="onMouseLeave",ie="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(Fe=O6,me="onPointerLeave",ie="onPointerEnter",ne="pointer"),_t=fe==null?ce:_e(fe),se=Ce==null?ce:_e(Ce),ce=new Fe(me,ne+"leave",fe,f,de),ce.target=_t,ce.relatedTarget=se,me=null,si(de)===le&&(Fe=new Fe(ie,ne+"enter",Ce,f,de),Fe.target=se,Fe.relatedTarget=_t,me=Fe),_t=me,fe&&Ce)t:{for(Fe=WT,ie=fe,ne=Ce,se=0,me=ie;me;me=Fe(me))se++;me=0;for(var De=ne;De;De=Fe(De))me++;for(;0<se-me;)ie=Fe(ie),se--;for(;0<me-se;)ne=Fe(ne),me--;for(;se--;){if(ie===ne||ne!==null&&ie===ne.alternate){Fe=ie;break t}ie=Fe(ie),ne=Fe(ne)}Fe=null}else Fe=null;fe!==null&&oy(pe,ce,fe,Fe,!1),Ce!==null&&_t!==null&&oy(pe,_t,Ce,Fe,!0)}}e:{if(ce=le?_e(le):window,fe=ce.nodeName&&ce.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ce.type==="file")var Ct=A6;else if(w6(ce))if(M6)Ct=oT;else{Ct=sT;var Qe=aT}else fe=ce.nodeName,!fe||fe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&ph(le.elementType)&&(Ct=A6):Ct=lT;if(Ct&&(Ct=Ct(s,le))){k6(pe,Ct,f,de);break e}Qe&&Qe(s,ce,le),s==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&mh(ce,"number",ce.value)}switch(Qe=le?_e(le):window,s){case"focusin":(w6(Qe)||Qe.contentEditable==="true")&&(kl=Qe,Eh=le,sc=null);break;case"focusout":sc=Eh=kl=null;break;case"mousedown":$h=!0;break;case"contextmenu":case"mouseup":case"dragend":$h=!1,Z6(pe,f,de);break;case"selectionchange":if(uT)break;case"keydown":case"keyup":Z6(pe,f,de)}var it;if(Ah)e:{switch(s){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else wl?v6(s,f)&&(gt="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(gt="onCompositionStart");gt&&(x6&&f.locale!=="ko"&&(wl||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&wl&&(it=h6()):(Ra=de,bh="value"in Ra?Ra.value:Ra.textContent,wl=!0)),Qe=f1(le,gt),0<Qe.length&&(gt=new g6(gt,s,null,f,de),pe.push({event:gt,listeners:Qe}),it?gt.data=it:(it=S6(f),it!==null&&(gt.data=it)))),(it=eT?tT(s,f):nT(s,f))&&(gt=f1(le,"onBeforeInput"),0<gt.length&&(Qe=new g6("onBeforeInput","beforeinput",null,f,de),pe.push({event:Qe,listeners:gt}),Qe.data=it)),IT(pe,s,le,f,de)}sy(pe,o)})}function jc(s,o,f){return{instance:s,listener:o,currentTarget:f}}function f1(s,o){for(var f=o+"Capture",g=[];s!==null;){var v=s,w=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||w===null||(v=Ko(s,f),v!=null&&g.unshift(jc(s,v,w)),v=Ko(s,o),v!=null&&g.push(jc(s,v,w))),s.tag===3)return g;s=s.return}return[]}function WT(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function oy(s,o,f,g,v){for(var w=o._reactName,Q=[];f!==null&&f!==g;){var H=f,J=H.alternate,le=H.stateNode;if(H=H.tag,J!==null&&J===g)break;H!==5&&H!==26&&H!==27||le===null||(J=le,v?(le=Ko(f,w),le!=null&&Q.unshift(jc(f,le,J))):v||(le=Ko(f,w),le!=null&&Q.push(jc(f,le,J)))),f=f.return}Q.length!==0&&s.push({event:o,listeners:Q})}var KT=/\r\n?/g,JT=/\u0000|\uFFFD/g;function cy(s){return(typeof s=="string"?s:""+s).replace(KT,`
|
|
49
|
+
`).replace(JT,"")}function uy(s,o){return o=cy(o),cy(s)===o}function Lt(s,o,f,g,v,w){switch(f){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||bl(s,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&bl(s,""+g);break;case"className":xl(s,"class",g);break;case"tabIndex":xl(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":xl(s,f,g);break;case"style":u6(s,g,w);break;case"data":if(o!=="object"){xl(s,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||f!=="href")){s.removeAttribute(f);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(f);break}g=O0(""+g),s.setAttribute(f,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(f,"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 w=="function"&&(f==="formAction"?(o!=="input"&&Lt(s,o,"name",v.name,v,null),Lt(s,o,"formEncType",v.formEncType,v,null),Lt(s,o,"formMethod",v.formMethod,v,null),Lt(s,o,"formTarget",v.formTarget,v,null)):(Lt(s,o,"encType",v.encType,v,null),Lt(s,o,"method",v.method,v,null),Lt(s,o,"target",v.target,v,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(f);break}g=O0(""+g),s.setAttribute(f,g);break;case"onClick":g!=null&&(s.onclick=qi);break;case"onScroll":g!=null&&ht("scroll",s);break;case"onScrollEnd":g!=null&&ht("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}f=O0(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,""+g):s.removeAttribute(f);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":g===!0?s.setAttribute(f,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,g):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(f,g):s.removeAttribute(f);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(f):s.setAttribute(f,g);break;case"popover":ht("beforetoggle",s),ht("toggle",s),Ol(s,"popover",g);break;case"xlinkActuate":li(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":li(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":li(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":li(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":li(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":li(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":li(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":li(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":li(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Ol(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=CC.get(f)||f,Ol(s,f,g))}}function tp(s,o,f,g,v,w){switch(f){case"style":u6(s,g,w);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof g=="string"?bl(s,g):(typeof g=="number"||typeof g=="bigint")&&bl(s,""+g);break;case"onScroll":g!=null&&ht("scroll",s);break;case"onScrollEnd":g!=null&&ht("scrollend",s);break;case"onClick":g!=null&&(s.onclick=qi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Za.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),o=f.slice(2,v?f.length-7:void 0),w=s[ve]||null,w=w!=null?w[f]:null,typeof w=="function"&&s.removeEventListener(o,w,v),typeof g=="function")){typeof w!="function"&&w!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(o,g,v);break e}f in s?s[f]=g:g===!0?s.setAttribute(f,""):Ol(s,f,g)}}}function Ln(s,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",s),ht("load",s);var g=!1,v=!1,w;for(w in f)if(f.hasOwnProperty(w)){var Q=f[w];if(Q!=null)switch(w){case"src":g=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Lt(s,o,w,Q,f,null)}}v&&Lt(s,o,"srcSet",f.srcSet,f,null),g&&Lt(s,o,"src",f.src,f,null);return;case"input":ht("invalid",s);var H=w=Q=v=null,J=null,le=null;for(g in f)if(f.hasOwnProperty(g)){var de=f[g];if(de!=null)switch(g){case"name":v=de;break;case"type":Q=de;break;case"checked":J=de;break;case"defaultChecked":le=de;break;case"value":w=de;break;case"defaultValue":H=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,o));break;default:Lt(s,o,g,de,f,null)}}Es(s,w,H,J,le,Q,v,!1);return;case"select":ht("invalid",s),g=Q=w=null;for(v in f)if(f.hasOwnProperty(v)&&(H=f[v],H!=null))switch(v){case"value":w=H;break;case"defaultValue":Q=H;break;case"multiple":g=H;default:Lt(s,o,v,H,f,null)}o=w,f=Q,s.multiple=!!g,o!=null?yl(s,!!g,o,!1):f!=null&&yl(s,!!g,f,!0);return;case"textarea":ht("invalid",s),w=v=g=null;for(Q in f)if(f.hasOwnProperty(Q)&&(H=f[Q],H!=null))switch(Q){case"value":g=H;break;case"defaultValue":v=H;break;case"children":w=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(91));break;default:Lt(s,o,Q,H,f,null)}o6(s,g,v,w);return;case"option":for(J in f)if(f.hasOwnProperty(J)&&(g=f[J],g!=null))switch(J){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Lt(s,o,J,g,f,null)}return;case"dialog":ht("beforetoggle",s),ht("toggle",s),ht("cancel",s),ht("close",s);break;case"iframe":case"object":ht("load",s);break;case"video":case"audio":for(g=0;g<$c.length;g++)ht($c[g],s);break;case"image":ht("error",s),ht("load",s);break;case"details":ht("toggle",s);break;case"embed":case"source":case"link":ht("error",s),ht("load",s);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 f)if(f.hasOwnProperty(le)&&(g=f[le],g!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Lt(s,o,le,g,f,null)}return;default:if(ph(o)){for(de in f)f.hasOwnProperty(de)&&(g=f[de],g!==void 0&&tp(s,o,de,g,f,void 0));return}}for(H in f)f.hasOwnProperty(H)&&(g=f[H],g!=null&&Lt(s,o,H,g,f,null))}function eE(s,o,f,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,w=null,Q=null,H=null,J=null,le=null,de=null;for(fe in f){var pe=f[fe];if(f.hasOwnProperty(fe)&&pe!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":J=pe;default:g.hasOwnProperty(fe)||Lt(s,o,fe,null,g,pe)}}for(var ce in g){var fe=g[ce];if(pe=f[ce],g.hasOwnProperty(ce)&&(fe!=null||pe!=null))switch(ce){case"type":w=fe;break;case"name":v=fe;break;case"checked":le=fe;break;case"defaultChecked":de=fe;break;case"value":Q=fe;break;case"defaultValue":H=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,o));break;default:fe!==pe&&Lt(s,o,ce,fe,g,pe)}}ki(s,Q,H,J,le,de,w,v);return;case"select":fe=Q=H=ce=null;for(w in f)if(J=f[w],f.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":fe=J;default:g.hasOwnProperty(w)||Lt(s,o,w,null,g,J)}for(v in g)if(w=g[v],J=f[v],g.hasOwnProperty(v)&&(w!=null||J!=null))switch(v){case"value":ce=w;break;case"defaultValue":H=w;break;case"multiple":Q=w;default:w!==J&&Lt(s,o,v,w,g,J)}o=H,f=Q,g=fe,ce!=null?yl(s,!!f,ce,!1):!!g!=!!f&&(o!=null?yl(s,!!f,o,!0):yl(s,!!f,f?[]:"",!1));return;case"textarea":fe=ce=null;for(H in f)if(v=f[H],f.hasOwnProperty(H)&&v!=null&&!g.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Lt(s,o,H,null,g,v)}for(Q in g)if(v=g[Q],w=f[Q],g.hasOwnProperty(Q)&&(v!=null||w!=null))switch(Q){case"value":ce=v;break;case"defaultValue":fe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==w&&Lt(s,o,Q,v,g,w)}l6(s,ce,fe);return;case"option":for(var Ce in f)if(ce=f[Ce],f.hasOwnProperty(Ce)&&ce!=null&&!g.hasOwnProperty(Ce))switch(Ce){case"selected":s.selected=!1;break;default:Lt(s,o,Ce,null,g,ce)}for(J in g)if(ce=g[J],fe=f[J],g.hasOwnProperty(J)&&ce!==fe&&(ce!=null||fe!=null))switch(J){case"selected":s.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Lt(s,o,J,ce,g,fe)}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 Fe in f)ce=f[Fe],f.hasOwnProperty(Fe)&&ce!=null&&!g.hasOwnProperty(Fe)&&Lt(s,o,Fe,null,g,ce);for(le in g)if(ce=g[le],fe=f[le],g.hasOwnProperty(le)&&ce!==fe&&(ce!=null||fe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,o));break;default:Lt(s,o,le,ce,g,fe)}return;default:if(ph(o)){for(var _t in f)ce=f[_t],f.hasOwnProperty(_t)&&ce!==void 0&&!g.hasOwnProperty(_t)&&tp(s,o,_t,void 0,g,ce);for(de in g)ce=g[de],fe=f[de],!g.hasOwnProperty(de)||ce===fe||ce===void 0&&fe===void 0||tp(s,o,de,ce,g,fe);return}}for(var ie in f)ce=f[ie],f.hasOwnProperty(ie)&&ce!=null&&!g.hasOwnProperty(ie)&&Lt(s,o,ie,null,g,ce);for(pe in g)ce=g[pe],fe=f[pe],!g.hasOwnProperty(pe)||ce===fe||ce==null&&fe==null||Lt(s,o,pe,ce,g,fe)}function fy(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tE(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,f=performance.getEntriesByType("resource"),g=0;g<f.length;g++){var v=f[g],w=v.transferSize,Q=v.initiatorType,H=v.duration;if(w&&H&&fy(Q)){for(Q=0,H=v.responseEnd,g+=1;g<f.length;g++){var J=f[g],le=J.startTime;if(le>H)break;var de=J.transferSize,pe=J.initiatorType;de&&fy(pe)&&(J=J.responseEnd,Q+=de*(J<H?1:(H-le)/(J-le)))}if(--g,o+=8*(w+Q)/(v.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var np=null,rp=null;function d1(s){return s.nodeType===9?s:s.ownerDocument}function dy(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hy(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function ip(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var ap=null;function nE(){var s=window.event;return s&&s.type==="popstate"?s===ap?!1:(ap=s,!0):(ap=null,!1)}var my=typeof setTimeout=="function"?setTimeout:void 0,rE=typeof clearTimeout=="function"?clearTimeout:void 0,py=typeof Promise=="function"?Promise:void 0,iE=typeof queueMicrotask=="function"?queueMicrotask:typeof py<"u"?function(s){return py.resolve(null).then(s).catch(aE)}:my;function aE(s){setTimeout(function(){throw s})}function Ja(s){return s==="head"}function gy(s,o){var f=o,g=0;do{var v=f.nextSibling;if(s.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(g===0){s.removeChild(v),Wl(o);return}g--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")g++;else if(f==="html")Pc(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,Pc(f);for(var w=f.firstChild;w;){var Q=w.nextSibling,H=w.nodeName;w[wi]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&w.rel.toLowerCase()==="stylesheet"||f.removeChild(w),w=Q}}else f==="body"&&Pc(s.ownerDocument.body);f=v}while(f);Wl(o)}function Oy(s,o){var f=s;s=0;do{var g=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),g&&g.nodeType===8)if(f=g.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=g}while(f)}function sp(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":sp(f),ai(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function sE(s,o,f,g){for(;s.nodeType===1;){var v=f;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[wi])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(w=s.getAttribute("rel"),w==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(w!==v.rel||s.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||s.getAttribute("title")!==(v.title==null?null:v.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(w=s.getAttribute("src"),(w!==(v.src==null?null:v.src)||s.getAttribute("type")!==(v.type==null?null:v.type)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&w&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var w=v.name==null?null:""+v.name;if(v.type==="hidden"&&s.getAttribute("name")===w)return s}else return s;if(s=Yr(s.nextSibling),s===null)break}return null}function lE(s,o,f){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Yr(s.nextSibling),s===null))return null;return s}function xy(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=Yr(s.nextSibling),s===null))return null;return s}function lp(s){return s.data==="$?"||s.data==="$~"}function op(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function oE(s,o){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||f.readyState!=="loading")o();else{var g=function(){o(),f.removeEventListener("DOMContentLoaded",g)};f.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Yr(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var cp=null;function yy(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(o===0)return Yr(s.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}s=s.nextSibling}return null}function by(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return s;o--}else f!=="/$"&&f!=="/&"||o++}s=s.previousSibling}return null}function vy(s,o,f){switch(o=d1(f),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Pc(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);ai(s)}var Ir=new Map,Sy=new Set;function h1(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ua=F.d;F.d={f:cE,r:uE,D:fE,C:dE,L:hE,m:mE,X:gE,S:pE,M:OE};function cE(){var s=ua.f(),o=i1();return s||o}function uE(s){var o=ye(s);o!==null&&o.tag===5&&o.type==="form"?_4(o):ua.r(s)}var ql=typeof document>"u"?null:document;function wy(s,o,f){var g=ql;if(g&&typeof o=="string"&&o){var v=kn(o);v='link[rel="'+s+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),Sy.has(v)||(Sy.add(v),s={rel:s,crossOrigin:f,href:o},g.querySelector(v)===null&&(o=g.createElement("link"),Ln(o,"link",s),rt(o),g.head.appendChild(o)))}}function fE(s){ua.D(s),wy("dns-prefetch",s,null)}function dE(s,o){ua.C(s,o),wy("preconnect",s,o)}function hE(s,o,f){ua.L(s,o,f);var g=ql;if(g&&s&&o){var v='link[rel="preload"][as="'+kn(o)+'"]';o==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+kn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+kn(f.imageSizes)+'"]')):v+='[href="'+kn(s)+'"]';var w=v;switch(o){case"style":w=Gl(s);break;case"script":w=Ul(s)}Ir.has(w)||(s=O({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:s,as:o},f),Ir.set(w,s),g.querySelector(v)!==null||o==="style"&&g.querySelector(Qc(w))||o==="script"&&g.querySelector(Zc(w))||(o=g.createElement("link"),Ln(o,"link",s),rt(o),g.head.appendChild(o)))}}function mE(s,o){ua.m(s,o);var f=ql;if(f&&s){var g=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+kn(g)+'"][href="'+kn(s)+'"]',w=v;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ul(s)}if(!Ir.has(w)&&(s=O({rel:"modulepreload",href:s},o),Ir.set(w,s),f.querySelector(v)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Zc(w)))return}g=f.createElement("link"),Ln(g,"link",s),rt(g),f.head.appendChild(g)}}}function pE(s,o,f){ua.S(s,o,f);var g=ql;if(g&&s){var v=ft(g).hoistableStyles,w=Gl(s);o=o||"default";var Q=v.get(w);if(!Q){var H={loading:0,preload:null};if(Q=g.querySelector(Qc(w)))H.loading=5;else{s=O({rel:"stylesheet",href:s,"data-precedence":o},f),(f=Ir.get(w))&&up(s,f);var J=Q=g.createElement("link");rt(J),Ln(J,"link",s),J._p=new Promise(function(le,de){J.onload=le,J.onerror=de}),J.addEventListener("load",function(){H.loading|=1}),J.addEventListener("error",function(){H.loading|=2}),H.loading|=4,m1(Q,o,g)}Q={type:"stylesheet",instance:Q,count:1,state:H},v.set(w,Q)}}}function gE(s,o){ua.X(s,o);var f=ql;if(f&&s){var g=ft(f).hoistableScripts,v=Ul(s),w=g.get(v);w||(w=f.querySelector(Zc(v)),w||(s=O({src:s,async:!0},o),(o=Ir.get(v))&&fp(s,o),w=f.createElement("script"),rt(w),Ln(w,"link",s),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(v,w))}}function OE(s,o){ua.M(s,o);var f=ql;if(f&&s){var g=ft(f).hoistableScripts,v=Ul(s),w=g.get(v);w||(w=f.querySelector(Zc(v)),w||(s=O({src:s,async:!0,type:"module"},o),(o=Ir.get(v))&&fp(s,o),w=f.createElement("script"),rt(w),Ln(w,"link",s),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(v,w))}}function ky(s,o,f,g){var v=(v=ee.current)?h1(v):null;if(!v)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=Gl(f.href),f=ft(v).hoistableStyles,g=f.get(o),g||(g={type:"style",instance:null,count:0,state:null},f.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=Gl(f.href);var w=ft(v).hoistableStyles,Q=w.get(s);if(Q||(v=v.ownerDocument||v,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(s,Q),(w=v.querySelector(Qc(s)))&&!w._p&&(Q.instance=w,Q.state.loading=5),Ir.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Ir.set(s,f),w||xE(v,s,f,Q.state))),o&&g===null)throw Error(r(528,""));return Q}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Ul(f),f=ft(v).hoistableScripts,g=f.get(o),g||(g={type:"script",instance:null,count:0,state:null},f.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Gl(s){return'href="'+kn(s)+'"'}function Qc(s){return'link[rel="stylesheet"]['+s+"]"}function Ay(s){return O({},s,{"data-precedence":s.precedence,precedence:null})}function xE(s,o,f,g){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=s.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),Ln(o,"link",f),rt(o),s.head.appendChild(o))}function Ul(s){return'[src="'+kn(s)+'"]'}function Zc(s){return"script[async]"+s}function My(s,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var g=s.querySelector('style[data-href~="'+kn(f.href)+'"]');if(g)return o.instance=g,rt(g),g;var v=O({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),rt(g),Ln(g,"style",v),m1(g,f.precedence,s),o.instance=g;case"stylesheet":v=Gl(f.href);var w=s.querySelector(Qc(v));if(w)return o.state.loading|=4,o.instance=w,rt(w),w;g=Ay(f),(v=Ir.get(v))&&up(g,v),w=(s.ownerDocument||s).createElement("link"),rt(w);var Q=w;return Q._p=new Promise(function(H,J){Q.onload=H,Q.onerror=J}),Ln(w,"link",g),o.state.loading|=4,m1(w,f.precedence,s),o.instance=w;case"script":return w=Ul(f.src),(v=s.querySelector(Zc(w)))?(o.instance=v,rt(v),v):(g=f,(v=Ir.get(w))&&(g=O({},f),fp(g,v)),s=s.ownerDocument||s,v=s.createElement("script"),rt(v),Ln(v,"link",g),s.head.appendChild(v),o.instance=v);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,m1(g,f.precedence,s));return o.instance}function m1(s,o,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=g.length?g[g.length-1]:null,w=v,Q=0;Q<g.length;Q++){var H=g[Q];if(H.dataset.precedence===o)w=H;else if(w!==v)break}w?w.parentNode.insertBefore(s,w.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(s,o.firstChild))}function up(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function fp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var p1=null;function Cy(s,o,f){if(p1===null){var g=new Map,v=p1=new Map;v.set(f,g)}else v=p1,g=v.get(f),g||(g=new Map,v.set(f,g));if(g.has(s))return g;for(g.set(s,null),f=f.getElementsByTagName(s),v=0;v<f.length;v++){var w=f[v];if(!(w[wi]||w[Rt]||s==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var Q=w.getAttribute(o)||"";Q=s+Q;var H=g.get(Q);H?H.push(w):g.set(Q,[w])}}return g}function Ty(s,o,f){s=s.ownerDocument||s,s.head.insertBefore(f,o==="title"?s.querySelector("head > title"):null)}function yE(s,o,f){if(f===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Ey(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function bE(s,o,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=Gl(g.href),w=o.querySelector(Qc(v));if(w){o=w._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=g1.bind(s),o.then(s,s)),f.state.loading|=4,f.instance=w,rt(w);return}w=o.ownerDocument||o,g=Ay(g),(v=Ir.get(v))&&up(g,v),w=w.createElement("link"),rt(w);var Q=w;Q._p=new Promise(function(H,J){Q.onload=H,Q.onerror=J}),Ln(w,"link",g),f.instance=w}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=g1.bind(s),o.addEventListener("load",f),o.addEventListener("error",f))}}var dp=0;function vE(s,o){return s.stylesheets&&s.count===0&&x1(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var g=setTimeout(function(){if(s.stylesheets&&x1(s,s.stylesheets),s.unsuspend){var w=s.unsuspend;s.unsuspend=null,w()}},6e4+o);0<s.imgBytes&&dp===0&&(dp=62500*tE());var v=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&x1(s,s.stylesheets),s.unsuspend)){var w=s.unsuspend;s.unsuspend=null,w()}},(s.imgBytes>dp?50:800)+o);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(v)}}:null}function g1(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)x1(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var O1=null;function x1(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,O1=new Map,o.forEach(SE,s),O1=null,g1.call(s))}function SE(s,o){if(!(o.state.loading&4)){var f=O1.get(s);if(f)var g=f.get(null);else{f=new Map,O1.set(s,f);for(var v=s.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<v.length;w++){var Q=v[w];(Q.nodeName==="LINK"||Q.getAttribute("media")!=="not all")&&(f.set(Q.dataset.precedence,Q),g=Q)}g&&f.set(null,g)}v=o.instance,Q=v.getAttribute("data-precedence"),w=f.get(Q)||g,w===g&&f.set(null,v),f.set(Q,v),this.count++,g=g1.bind(this),v.addEventListener("load",g),v.addEventListener("error",g),w?w.parentNode.insertBefore(v,w.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(v,s.firstChild)),o.state.loading|=4}}var Nc={$$typeof:T,Provider:null,Consumer:null,_currentValue:_,_currentValue2:_,_threadCount:0};function wE(s,o,f,g,v,w,Q,H,J){this.tag=1,this.containerInfo=s,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=Zn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zn(0),this.hiddenUpdates=Zn(null),this.identifierPrefix=g,this.onUncaughtError=v,this.onCaughtError=w,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function $y(s,o,f,g,v,w,Q,H,J,le,de,pe){return s=new wE(s,o,f,Q,J,le,de,pe,H),o=1,w===!0&&(o|=24),w=Ar(3,null,null,o),s.current=w,w.stateNode=s,o=Bh(),o.refCount++,s.pooledCache=o,o.refCount++,w.memoizedState={element:g,isDehydrated:f,cache:o},Gh(w),s}function jy(s){return s?(s=Cl,s):Cl}function Py(s,o,f,g,v,w){v=jy(v),g.context===null?g.context=v:g.pendingContext=v,g=Xa(o),g.payload={element:f},w=w===void 0?null:w,w!==null&&(g.callback=w),f=za(s,g,o),f!==null&&(fr(f,s,o),hc(f,s,o))}function Qy(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function hp(s,o){Qy(s,o),(s=s.alternate)&&Qy(s,o)}function Zy(s){if(s.tag===13||s.tag===31){var o=Qs(s,67108864);o!==null&&fr(o,s,67108864),hp(s,67108864)}}function Ny(s){if(s.tag===13||s.tag===31){var o=$r();o=jt(o);var f=Qs(s,o);f!==null&&fr(f,s,o),hp(s,o)}}var y1=!0;function kE(s,o,f,g){var v=Z.T;Z.T=null;var w=F.p;try{F.p=2,mp(s,o,f,g)}finally{F.p=w,Z.T=v}}function AE(s,o,f,g){var v=Z.T;Z.T=null;var w=F.p;try{F.p=8,mp(s,o,f,g)}finally{F.p=w,Z.T=v}}function mp(s,o,f,g){if(y1){var v=pp(g);if(v===null)ep(s,o,g,b1,f),Vy(s,g);else if(CE(v,s,o,f,g))g.stopPropagation();else if(Vy(s,g),o&4&&-1<ME.indexOf(s)){for(;v!==null;){var w=ye(v);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var Q=bt(w.pendingLanes);if(Q!==0){var H=w;for(H.pendingLanes|=2,H.entangledLanes|=2;Q;){var J=1<<31-ot(Q);H.entanglements[1]|=J,Q&=~J}Ti(w),($t&6)===0&&(n1=ct()+500,Ec(0))}}break;case 31:case 13:H=Qs(w,2),H!==null&&fr(H,w,2),i1(),hp(w,2)}if(w=pp(g),w===null&&ep(s,o,g,b1,f),w===v)break;v=w}v!==null&&g.stopPropagation()}else ep(s,o,g,null,f)}}function pp(s){return s=Oh(s),gp(s)}var b1=null;function gp(s){if(b1=null,s=si(s),s!==null){var o=a(s);if(o===null)s=null;else{var f=o.tag;if(f===13){if(s=l(o),s!==null)return s;s=null}else if(f===31){if(s=c(o),s!==null)return s;s=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return b1=s,null}function Ry(s){switch(s){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(yt()){case Oe:return 2;case Ge:return 8;case Re:case qe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Op=!1,es=null,ts=null,ns=null,Rc=new Map,Vc=new Map,rs=[],ME="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 Vy(s,o){switch(s){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Rc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vc.delete(o.pointerId)}}function Lc(s,o,f,g,v,w){return s===null||s.nativeEvent!==w?(s={blockedOn:o,domEventName:f,eventSystemFlags:g,nativeEvent:w,targetContainers:[v]},o!==null&&(o=ye(o),o!==null&&Zy(o)),s):(s.eventSystemFlags|=g,o=s.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),s)}function CE(s,o,f,g,v){switch(o){case"focusin":return es=Lc(es,s,o,f,g,v),!0;case"dragenter":return ts=Lc(ts,s,o,f,g,v),!0;case"mouseover":return ns=Lc(ns,s,o,f,g,v),!0;case"pointerover":var w=v.pointerId;return Rc.set(w,Lc(Rc.get(w)||null,s,o,f,g,v)),!0;case"gotpointercapture":return w=v.pointerId,Vc.set(w,Lc(Vc.get(w)||null,s,o,f,g,v)),!0}return!1}function Ly(s){var o=si(s.target);if(o!==null){var f=a(o);if(f!==null){if(o=f.tag,o===13){if(o=l(f),o!==null){s.blockedOn=o,Jn(s.priority,function(){Ny(f)});return}}else if(o===31){if(o=c(f),o!==null){s.blockedOn=o,Jn(s.priority,function(){Ny(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function v1(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=pp(s.nativeEvent);if(f===null){f=s.nativeEvent;var g=new f.constructor(f.type,f);gh=g,f.target.dispatchEvent(g),gh=null}else return o=ye(f),o!==null&&Zy(o),s.blockedOn=f,!1;o.shift()}return!0}function _y(s,o,f){v1(s)&&f.delete(o)}function TE(){Op=!1,es!==null&&v1(es)&&(es=null),ts!==null&&v1(ts)&&(ts=null),ns!==null&&v1(ns)&&(ns=null),Rc.forEach(_y),Vc.forEach(_y)}function S1(s,o){s.blockedOn===o&&(s.blockedOn=null,Op||(Op=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,TE)))}var w1=null;function Dy(s){w1!==s&&(w1=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){w1===s&&(w1=null);for(var o=0;o<s.length;o+=3){var f=s[o],g=s[o+1],v=s[o+2];if(typeof g!="function"){if(gp(g||f)===null)continue;break}var w=ye(f);w!==null&&(s.splice(o,3),o-=3,pm(w,{pending:!0,data:v,method:f.method,action:g},g,v))}}))}function Wl(s){function o(J){return S1(J,s)}es!==null&&S1(es,s),ts!==null&&S1(ts,s),ns!==null&&S1(ns,s),Rc.forEach(o),Vc.forEach(o);for(var f=0;f<rs.length;f++){var g=rs[f];g.blockedOn===s&&(g.blockedOn=null)}for(;0<rs.length&&(f=rs[0],f.blockedOn===null);)Ly(f),f.blockedOn===null&&rs.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(g=0;g<f.length;g+=3){var v=f[g],w=f[g+1],Q=v[ve]||null;if(typeof w=="function")Q||Dy(f);else if(Q){var H=null;if(w&&w.hasAttribute("formAction")){if(v=w,Q=w[ve]||null)H=Q.formAction;else if(gp(v)!==null)continue}else H=Q.action;typeof H=="function"?f[g+1]=H:(f.splice(g,3),g-=3),Dy(f)}}}function Hy(){function s(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(Q){return v=Q})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),g||setTimeout(f,20)}function f(){if(!g&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,v=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function xp(s){this._internalRoot=s}k1.prototype.render=xp.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,g=$r();Py(f,g,s,o,null,null)},k1.prototype.unmount=xp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;Py(s.current,2,null,s,null,null),i1(),o[tt]=null}};function k1(s){this._internalRoot=s}k1.prototype.unstable_scheduleHydration=function(s){if(s){var o=nn();s={blockedOn:null,target:s,priority:o};for(var f=0;f<rs.length&&o!==0&&o<rs[f].priority;f++);rs.splice(f,0,s),f===0&&Ly(s)}};var Xy=e.version;if(Xy!=="19.2.6")throw Error(r(527,Xy,"19.2.6"));F.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=h(o),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var EE={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var A1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!A1.isDisabled&&A1.supportsFiber)try{Ae=A1.inject(EE),Be=A1}catch{}}return Dc.createRoot=function(s,o){if(!i(s))throw Error(r(299));var f=!1,g="",v=G4,w=U4,Q=W4;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(Q=o.onRecoverableError)),o=$y(s,1,!1,null,null,f,g,null,v,w,Q,Hy),s[tt]=o.current,Jm(s),new xp(o)},Dc.hydrateRoot=function(s,o,f){if(!i(s))throw Error(r(299));var g=!1,v="",w=G4,Q=U4,H=W4,J=null;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(w=f.onUncaughtError),f.onCaughtError!==void 0&&(Q=f.onCaughtError),f.onRecoverableError!==void 0&&(H=f.onRecoverableError),f.formState!==void 0&&(J=f.formState)),o=$y(s,1,!0,o,f??null,g,v,J,w,Q,H,Hy),o.context=jy(null),f=o.current,g=$r(),g=jt(g),v=Xa(g),v.callback=null,za(f,v,g),f=g,o.current.lanes=f,Fn(o,f),Ti(o),s[tt]=o.current,Jm(s),new k1(o)},Dc.version="19.2.6",Dc}var Jy;function HE(){if(Jy)return vp.exports;Jy=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(),vp.exports=DE(),vp.exports}var XE=HE();const e5="hyperframes-studio:anonymousId",zE="hyperframes-studio:telemetryDisabled",IS="hyperframes-studio:telemetryNoticeShown";function Nd(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function FE(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`anon-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function BE(){const t=Nd();if(!t)return"anonymous";const e=t.getItem(e5);if(e)return e;const n=FE();try{t.setItem(e5,n)}catch{}return n}function YE(){var t;return((t=Nd())==null?void 0:t.getItem(zE))==="1"}function IE(){var t;return((t=Nd())==null?void 0:t.getItem(IS))==="1"}function qE(){var t;try{(t=Nd())==null||t.setItem(IS,"1")}catch{}}const qS="hyperframes-studio:sessionStartFired";function GS(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}function GE(){var t;return((t=GS())==null?void 0:t.getItem(qS))==="1"}function UE(){var t;try{(t=GS())==null||t.setItem(qS,"1")}catch{}}const WE={user_agent:"",language:"",screen_width:0,screen_height:0,device_pixel_ratio:0,timezone_offset_minutes:0,is_mobile:!1,studio_version:"dev"};let Kl=null;function KE(){if(Kl)return Kl;if(typeof navigator>"u"||typeof window>"u")return Kl=WE,Kl;const t=navigator.userAgent,e=window.screen;return Kl={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.6.91"},Kl}const US="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",JE="https://us.i.posthog.com",e$=1e3;let Cf=[],Ap=null,C1=null;function t$(){return typeof navigator<"u"&&navigator.doNotTrack==="1"}function n$(){return US.startsWith("phc_")}function r$(){try{return!1}catch{return!1}}function i$(){try{return!1}catch{return!1}}function a$(){return C1!==null||(C1=n$()&&!r$()&&!i$()&&!YE()&&!t$()),C1}function V8(t,e={}){if(!a$())return;const n=KE();Cf.push({event:t,properties:{...e,...n},timestamp:new Date().toISOString()}),Ap===null&&(Ap=setTimeout(()=>{Ap=null,rg()},e$)),l$()}function rg(){if(Cf.length===0)return;const t=BE(),e=Cf.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:t,timestamp:n.timestamp}));Cf=[],s$(`${JE}/batch/`,JSON.stringify({api_key:US,batch:e}))}function s$(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 l$(){IE()||(qE(),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",()=>rg(),{capture:!0}),window.addEventListener("visibilitychange",()=>{typeof document<"u"&&document.visibilityState==="hidden"&&rg()}));function o$(t){V8("studio_session_start",{has_project:t.has_project})}function c$(t){V8("studio_render_start",{fps:t.fps,quality:t.quality,format:t.format,resolution:t.resolution,composition:t.composition})}function u$(){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 f$(t){V8("survey sent",{$survey_id:"studio_experience",$survey_response:t.rating,...t.comment?{$survey_response_2:t.comment}:{},doctor_summary:u$(),source:"studio"})}function d$(t){const[e,n]=d.useState([]),r=d.useRef(null),i=d.useRef(null),a=d.useCallback(async()=>{if(t)try{const h=await fetch(`/api/projects/${t}/renders`);if(!h.ok)return;const p=await h.json();Array.isArray(p.renders)&&n(O=>{const x=new Set(O.map(b=>b.id)),y=p.renders.filter(b=>!x.has(b.id)).map(b=>({id:b.id,status:b.status==="failed"?"failed":"complete",progress:100,filename:b.filename,createdAt:b.createdAt,durationMs:b.durationMs}));return[...O,...y]})}catch{}},[t]);d.useEffect(()=>{a()},[a]);const l=d.useCallback(async(h={})=>{if(!t)return;const p=h.fps??30,O=h.quality??"standard",x=h.format??"mp4",y=h.resolution,b=h.composition;c$({fps:p,quality:O,format:x,resolution:y,composition:b});const S=Date.now(),k={fps:p,quality:O,format:x};y&&y!=="auto"&&(k.resolution=y),b&&(k.composition=b);let A;try{A=await fetch(`/api/projects/${t}/render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})}catch{const $={id:crypto.randomUUID(),status:"failed",progress:0,error:"Could not reach render server. Use `hyperframes render` from the CLI instead.",filename:"Export failed",createdAt:S};n(N=>[...N,$]);return}if(!A.ok){const $={id:crypto.randomUUID(),status:"failed",progress:0,error:`Server error (${A.status}). Check the terminal for details.`,filename:"Export failed",createdAt:S};n(N=>[...N,$]);return}const{jobId:C}=await A.json(),j={mp4:".mp4",webm:".webm",mov:".mov"}[x]??".mp4",M={id:C,status:"rendering",progress:0,filename:`${C}${j}`,createdAt:S};n($=>[...$,M]),i.current=C;const E=new EventSource(`/api/render/${C}/progress`);return r.current=E,E.addEventListener("progress",$=>{try{const N=JSON.parse($.data);n(D=>D.map(z=>z.id===C?{...z,progress:N.progress??z.progress,stage:N.stage??N.message??z.stage,status:N.status==="complete"?"complete":N.status==="failed"?"failed":z.status,durationMs:N.status==="complete"?Date.now()-S:void 0,error:N.error??z.error}:z)),(N.status==="complete"||N.status==="failed")&&(E.close(),i.current=null)}catch{}}),E.onerror=()=>{E.close(),n($=>$.map(N=>N.id===C&&N.status==="rendering"?{...N,status:"failed",error:"Connection lost. Is the render server running?"}:N)),i.current=null},C},[t]),c=d.useCallback(async h=>{try{await fetch(`/api/render/${h}`,{method:"DELETE"})}catch{}n(p=>p.filter(O=>O.id!==h))},[]),u=d.useCallback(()=>{n(h=>h.filter(p=>p.status==="rendering"))},[]);return d.useEffect(()=>()=>{var h;(h=r.current)==null||h.close(),r.current=null},[t]),{jobs:e,startRender:l,deleteRender:c,clearCompleted:u,isRendering:e.some(h=>h.status==="rendering")}}const h$="modulepreload",m$=function(t){return"/"+t},t5={},WS=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(O=>({status:"fulfilled",value:O}),O=>({status:"rejected",reason:O}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=l(n.map(h=>{if(h=m$(h),h in t5)return;t5[h]=!0;const p=h.endsWith(".css"),O=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${O}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":h$,p||(x.as="script"),x.crossOrigin="",x.href=h,u&&x.setAttribute("nonce",u),document.head.appendChild(x),p)return new Promise((y,b)=>{x.addEventListener("load",y),x.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};function p$(t){if(typeof t!="object"||t===null)return!0;const e=t;return e.isLoaded===!0||typeof e.totalFrames=="number"&&e.totalFrames>0}function Wt(t){d.useEffect(t,[])}const KS={primary:["bg-white text-neutral-950 font-medium","shadow-btn-primary","hover:bg-neutral-200","active:scale-[0.97]"].join(" "),secondary:["bg-transparent text-neutral-300 font-medium","border border-border","hover:bg-surface-hover hover:text-white hover:border-border-strong","active:scale-[0.98]"].join(" "),danger:["bg-accent-red text-white font-medium","hover:bg-red-600","active:scale-[0.97]"].join(" "),ghost:["bg-transparent text-neutral-400","hover:bg-surface-hover hover:text-white","active:scale-[0.98]"].join(" ")},g$={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"},O$=d.forwardRef(({variant:t="secondary",size:e="md",loading:n,icon:r,children:i,className:a="",disabled:l,...c},u)=>m.jsxs("button",{ref:u,disabled:l||n,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:pointer-events-none","select-none cursor-pointer",KS[t],g$[e],a].join(" "),...c,children:[n?m.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):r?m.jsx("span",{className:"flex-shrink-0",children:r}):null,i&&m.jsx("span",{children:i})]}));O$.displayName="Button";const x$={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"},y$=d.forwardRef(({icon:t,size:e="md",variant:n="ghost",className:r="",...i},a)=>m.jsx("button",{ref:a,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:pointer-events-none","select-none cursor-pointer",KS[n],x$[e],r].join(" "),...i,children:t}));y$.displayName="IconButton";function n5({title:t,detail:e,mono:n,size:r=64,progress:i}){const a=typeof i=="number"&&Number.isFinite(i)?Math.min(1,Math.max(0,i)):void 0,l=Math.round(r*1.16);return m.jsxs("div",{className:"hf-loader",draggable:!1,children:[m.jsx("div",{className:"hf-loader-mark-frame",style:{width:l,height:l},draggable:!1,children:m.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:[m.jsx("g",{className:"hf-loader-mark__mark",transform:"translate(50 50)",children:m.jsx("g",{className:"hf-loader-mark__core",transform:"scale(1)",opacity:".92",children:m.jsxs("g",{transform:"translate(-50 -50)",children:[m.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)"}),m.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)"})]})})}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"hf-loader-grad-left",x1:"48.5676",y1:"25",x2:"44.7804",y2:"71.9384",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),m.jsxs("linearGradient",{id:"hf-loader-grad-right",x1:"54.8282",y1:"73.8392",x2:"72.0989",y2:"32.8932",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]})]})}),m.jsx("div",{className:"hf-loader-title",children:t}),e&&m.jsx("div",{className:"hf-loader-detail",children:e}),a!==void 0&&m.jsx("div",{className:"hf-loader-progress","aria-hidden":"true",children:m.jsx("div",{className:"hf-loader-progress__fill",style:{transform:`scaleX(${a})`}})}),n&&m.jsx("div",{className:"hf-loader-mono",children:n})]})}var L8=YS();function Xt({label:t,children:e,delay:n=400,side:r="top"}){const[i,a]=d.useState(!1),[l,c]=d.useState({x:0,y:0}),u=d.useRef(null),h=d.useRef(null),p=d.useCallback(()=>{u.current=setTimeout(()=>{const x=h.current;if(!x)return;const b=(x.firstElementChild??x).getBoundingClientRect();b.width===0&&b.height===0||(c({x:b.left+b.width/2,y:r==="top"?b.top-6:b.bottom+6}),a(!0))},n)},[n,r]),O=d.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),a(!1)},[]);return m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:h,onPointerEnter:p,onPointerLeave:O,className:"contents",children:e}),i&&L8.createPortal(m.jsx("div",{className:"fixed z-[200] pointer-events-none",style:{left:l.x,top:l.y,transform:r==="top"?"translate(-50%, -100%)":"translate(-50%, 0)"},children:m.jsx("div",{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 b$=3,v$=3;function r5(t){return typeof t=="object"&&t!==null}function S$(t){if(!(t instanceof CustomEvent))return null;const e=t.detail;if(!r5(e))return null;const n=e.state;return r5(n)?n.loading===!0&&n.ready!==!0:null}const w$=400;function k$(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 A$(t){const e=t.tagName.toLowerCase();return e==="video"||e==="audio"}function i5(t,e){try{const n=t.contentWindow,r=t.contentDocument;if(!n||!r)return e;for(const a of r.querySelectorAll("video, audio"))if(A$(a)&&!a.error&&a.networkState!==v$&&a.readyState<b$)return!0;const i=n.__hfLottie;if(i!=null&&i.length){for(const a of i)if(!p$(a))return!0}return!1}catch{return e}}const ig=d.forwardRef(({projectId:t,directUrl:e,onLoad:n,onCompositionLoadingChange:r,portrait:i,style:a,suppressLoadingOverlay:l},c)=>{const u=d.useRef(null),h=d.useRef(0),p=d.useRef(null),O=d.useRef(null),[x,y]=d.useState(!1),[b,S]=d.useState(!1),[k,A]=d.useState(!1),[C,T]=d.useState(!1),[j,M]=d.useState(!0),[E,$]=d.useState(!0);d.useEffect(()=>{if(!j){$(!0);return}const z=setTimeout(()=>$(!1),w$);return()=>clearTimeout(z)},[j]),Wt(()=>{const z=u.current;if(!z)return;let B=!1,X;return WS(()=>import("./hyperframes-player-0esDKGRk.js"),[]).then(()=>{if(B)return;const U=document.createElement("hyperframes-player"),I=e||`/api/projects/${t}/preview`;if(U.setAttribute("shader-capture-scale","1"),U.setAttribute("shader-loading","player"),U.setAttribute("src",I),U.setAttribute("width",String(i?1080:1920)),U.setAttribute("height",String(i?1920:1080)),U.style.width="100%",U.style.height="100%",U.style.display="block",U.style.background="transparent",z.appendChild(U),U.shadowRoot){const R=document.createElement("style");R.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)}",U.shadowRoot.appendChild(R)}k$(U);const K=U.iframeElement;typeof c=="function"?c(K):c&&(c.current=K);const Z=R=>R.stopImmediatePropagation();U.addEventListener("click",Z,{capture:!0});const F=R=>{const P=S$(R);P!==null&&T(P)};U.addEventListener("shadertransitionstate",F);const _=()=>{M(!1)},q=()=>{M(!1)};U.addEventListener("ready",_),U.addEventListener("error",q);const G=()=>{if(h.current++,T(!1),M(!0),h.current>1){z.classList.remove("preview-revealing"),z.offsetWidth,z.classList.add("preview-revealing");const L=()=>z.classList.remove("preview-revealing");z.addEventListener("animationend",L,{once:!0})}n(),p.current&&clearInterval(p.current);let P=h.current>1?!1:i5(K,!1);if(P){y(!0);let L=0;p.current=setInterval(()=>{L+=1,P=i5(K,P),(!P||L>100)&&(p.current&&clearInterval(p.current),p.current=null,y(!1),P&&console.debug("[Player] Asset-loading overlay timed out after 10s; hiding anyway. Check network or asset integrity."))},100)}else y(!1)};K.addEventListener("load",G),X=()=>{if(K.removeEventListener("load",G),U.removeEventListener("click",Z,{capture:!0}),U.removeEventListener("shadertransitionstate",F),U.removeEventListener("ready",_),U.removeEventListener("error",q),p.current&&clearInterval(p.current),p.current=null,z.removeChild(U),typeof c!="function"){if(c){const R=c;R.current===K&&(R.current=null)}}}}),()=>{B=!0,X==null||X()}}),d.useEffect(()=>{if(O.current&&(clearTimeout(O.current),O.current=null),x){S(!0),A(!1);return}return A(!0),O.current=setTimeout(()=>{S(!1),A(!1),O.current=null},240),()=>{O.current&&(clearTimeout(O.current),O.current=null)}},[x]);const N=!l&&!E&&j,D=b&&!C&&!N;return d.useEffect(()=>{r==null||r(N||D)},[r,N,D]),m.jsxs("div",{className:"relative w-full h-full max-w-full max-h-full overflow-hidden flex items-center justify-center",style:a,children:[m.jsx("div",{ref:u,className:"w-full h-full"}),N&&m.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:z=>z.preventDefault(),onMouseDown:z=>z.preventDefault(),onPointerDown:z=>z.preventDefault(),children:m.jsx(n5,{title:"Loading composition",detail:"Preparing the Studio preview.",size:56})}),D&&m.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-20 select-none","data-hyperframes-ignore":"",draggable:!1,style:{opacity:k?0:1,pointerEvents:k?"none":"auto",transition:"opacity 240ms ease-out"},onDragStart:z=>z.preventDefault(),onMouseDown:z=>z.preventDefault(),onPointerDown:z=>z.preventDefault(),children:m.jsx(n5,{title:"Preparing preview assets",detail:"Waiting for media and motion assets before playback starts.",size:56})})]})});ig.displayName="Player";const Bu=30;function Cn(t){if(!Number.isFinite(t)||t<0)return"0:00";const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n.toString().padStart(2,"0")}`}function ag(t,e=Bu){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:Math.round(t*e)}function JS(t,e=Bu){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:t/e}function sg(t,e,n=Bu){const r=ag(t,n),i=Math.max(0,r+e);return JS(i,n)}function e7(t,e,n=Bu){const r=ag(t,n),i=ag(e,n);return`${r}f / ${i}f`}function t7(t){return Number.isFinite(t)&&t>0}function a5(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 Mp(t){if(!t)return 0;try{const e=Number(t.getDuration());return t7(e)?e:0}catch{return 0}}function M$(t){return{now:()=>t.performance.now(),requestAnimationFrame:e=>t.requestAnimationFrame(e),cancelAnimationFrame:e=>t.cancelAnimationFrame(e)}}function C$(t,e,n,r=()=>1){var y;const i=Math.max(0,Number.isFinite(e)?e:0);let a=a5(Number(((y=t.getTime)==null?void 0:y.call(t))??0),i),l=!1,c=0,u=a,h=n.now();const p=b=>{var S;if(a=a5(b,i),typeof t.renderSeek=="function"){t.renderSeek(a);return}(S=t.seek)==null||S.call(t,a)},O=()=>{c&&(n.cancelAnimationFrame(c),c=0)},x=b=>{if(!l)return;const S=Math.max(.1,Number(r())||1),k=(b-h)/1e3*S;if(p(u+k),a>=i){l=!1,c=0;return}c=n.requestAnimationFrame(x)};return{play:()=>{l||i<=0||(a>=i&&p(0),l=!0,u=a,h=n.now(),O(),c=n.requestAnimationFrame(x))},pause:()=>{l=!1,O()},seek:(b,S)=>{if(p(b),S!=null&&S.keepPlaying){l&&(u=a,h=n.now());return}l=!1,O()},getTime:()=>a,getDuration:()=>i,isPlaying:()=>l}}function s5(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 l5(t){if(!t)return 0;const e=Number.parseFloat(t.getAttribute("data-duration")??"")||Number.parseFloat(t.getAttribute("data-hf-authored-duration")??"");return t7(e)?e:0}function T$(t){if(!t)return 0;const e=l5(t.querySelector("[data-composition-id]"));if(e>0)return e;let n=0;for(const r of Array.from(t.querySelectorAll("[data-start]"))){const i=Number.parseFloat(r.getAttribute("data-start")??""),a=l5(r);!Number.isFinite(i)||i<0||a<=0||(n=Math.max(n,i+a))}return n}function lg(t){var n;const e=((n=t.ownerDocument.defaultView)==null?void 0:n.HTMLElement)??globalThis.HTMLElement;return typeof e<"u"&&t instanceof e}function n7(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 r7(t,e){const n=e.getAttribute("data-playback-start")?"playback-start":e.getAttribute("data-media-start")?"media-start":void 0,r=e.getAttribute("data-playback-start")??e.getAttribute("data-media-start");if(r!=null){const O=parseFloat(r);Number.isFinite(O)&&(t.playbackStart=O)}n&&(t.playbackStartAttr=n);const i=n7(e);if(!i)return;t.tag=i.tagName.toLowerCase();const a=i.getAttribute("src");a&&(t.src=a);const c=(i.ownerDocument.defaultView??window).HTMLMediaElement??globalThis.HTMLMediaElement;if(typeof c>"u"||!(i instanceof c))return;const u=e.getAttribute("data-source-duration")??i.getAttribute("data-source-duration"),h=u?parseFloat(u):i.duration;Number.isFinite(h)&&h>0&&(t.sourceDuration=h);const p=i.defaultPlaybackRate;Number.isFinite(p)&&p>0&&(t.playbackRate=p)}function Yu(t){var i,a,l;const e=(i=t.label)==null?void 0:i.trim();if(e)return e;const n=(a=t.id)==null?void 0:a.trim();if(n)return n;const r=(l=t.tag)==null?void 0:l.trim().toLowerCase();return r?`${r} clip`:"Timeline clip"}const E$=new Set(["base","link","meta","noscript","script","style","template"]);function o5(t){return t.trim().replace(/[_-]+/g," ").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function $$(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 o5(t.id);const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];return r?o5(r):Yu({tag:t.tagName})}function al(t){if(lg(t)&&t.id)return`#${t.id}`;const e=t.getAttribute("data-composition-id");if(e)return`[data-composition-id="${e}"]`;if(lg(t)){const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];if(r)return`.${r}`}}function Ou(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 xu(t,e,n){if(!(!n||n.startsWith("#")||n.startsWith("[data-composition-id=")))try{const i=Array.from(t.querySelectorAll(n)).indexOf(e);return i>=0?i:void 0}catch{return}}function og(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 yu(t){var r;const e=((r=t.preferredId)==null?void 0:r.trim())||og({id:t.label,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile}),n=og({id:e,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile});return{id:e,key:n}}function cg(t){return t.key??t.id}function j$(t){const e=t.querySelector("[data-composition-id]");return Array.from(t.querySelectorAll("[data-start]")).filter(n=>n!==e)}function c5(t,e){return Math.abs(t-e)<.001}function P$(t,e){var l;const n=(l=e.tagName)==null?void 0:l.toLowerCase();if(n&&t.tagName.toLowerCase()!==n)return!1;const r=Number.parseFloat(t.getAttribute("data-start")??"");if(Number.isFinite(r)&&!c5(r,e.start))return!1;const i=Number.parseFloat(t.getAttribute("data-duration")??"");if(Number.isFinite(i)&&!c5(i,e.duration))return!1;const a=Number.parseInt(t.getAttribute("data-track-index")??"",10);return!(Number.isFinite(a)&&a!==e.track)}function Q$(t,e){return t.getElementById(e)??t.querySelector(`[data-composition-id="${e}"]`)??t.querySelector(`.${e}`)??null}function Z$(t,e,n,r=new Set){const i=e.id?Q$(t,e.id):null;if(i&&!r.has(i))return i;const a=j$(t).filter(c=>!r.has(c)),l=a.find(c=>P$(c,e));return l||(a[n]??null)}function N$(t,e){if(!lg(e)||e.parentElement!==t)return!1;const n=e.tagName.toLowerCase();return E$.has(n)||e.hasAttribute("data-start")||e.hasAttribute("data-track-index")?!1:!!al(e)}function R$(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 V$(t){const e=/data-composition-id=["']([^"']+)["']/gi,n=new Set,r=Array.from(t.querySelectorAll("style, script"));for(const l of r){const c=l.textContent||"";if(!c)continue;let u;for(;(u=e.exec(c))!==null;){const h=(u[1]||"").trim();h&&n.add(h)}}if(n.size===0)return;const i=new Set,a=Array.from(t.querySelectorAll("[data-composition-id]"));for(const l of a){const c=l.getAttribute("data-composition-id");c&&i.add(c)}for(const l of n){if(l==="root"||i.has(l))continue;const c=t.getElementById(`${l}-layer`)||t.getElementById(`${l}-comp`)||t.getElementById(l);c&&(c.getAttribute("data-composition-id")||c.setAttribute("data-composition-id",l))}}function L$(t){return t instanceof HTMLElement}function i7(t){const e=t.getRootNode();return typeof ShadowRoot<"u"&&e instanceof ShadowRoot&&L$(e.host)?e.host:null}function a7(t,e,n){var r;(r=t.contentWindow)==null||r.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}function s7(t,e){return t||e>1}function _$(t,e){if(t)try{const n=i7(t);if(n&&typeof n.muted=="boolean"){n.muted=e;return}a7(t,"set-muted",{muted:e})}catch(n){console.warn("[useTimelinePlayer] Failed to set preview media mute state",n)}}function D$(t,e){if(!t)return;const n=Number.isFinite(e)&&e>0?e:1;try{const r=i7(t);if(r&&typeof r.playbackRate=="number"){r.playbackRate=n;return}a7(t,"set-playback-rate",{playbackRate:n})}catch(r){console.warn("[useTimelinePlayer] Failed to set preview playback rate",r)}}function H$(t,e,n,r){const i=new Set(n.map(O=>O.id)),a=t.querySelector("[data-composition-id]"),l=a==null?void 0:a.getAttribute("data-composition-id"),c=t.querySelectorAll("[data-composition-id][data-start]"),u=[];c.forEach(O=>{var z,B,X,U,I,K,Z,F,_;const x=O,y=x.getAttribute("data-composition-id");if(!y||y===l||i.has(x.id)||i.has(y))return;const b=x.getAttribute("data-start")??"0";let S=parseFloat(b);if(isNaN(S)){const q=t.getElementById(b)||t.querySelector(`[data-composition-id="${b}"]`);if(q){const G=q.getAttribute("data-start")??"0";let R=parseFloat(G);if(isNaN(R)){const V=t.getElementById(G)||t.querySelector(`[data-composition-id="${G}"]`),W=parseFloat((V==null?void 0:V.getAttribute("data-start"))??"0")||0,ee=V==null?void 0:V.getAttribute("data-composition-id"),ue=parseFloat((V==null?void 0:V.getAttribute("data-duration"))??"")||(ee?((X=(B=(z=e.__timelines)==null?void 0:z[ee])==null?void 0:B.duration)==null?void 0:X.call(B))??0:0);R=W+ue}const P=q.getAttribute("data-composition-id"),L=parseFloat(q.getAttribute("data-duration")??"")||(P?((K=(I=(U=e.__timelines)==null?void 0:U[P])==null?void 0:I.duration)==null?void 0:K.call(I))??0:0);S=R+L}else S=0}let k=parseFloat(x.getAttribute("data-duration")??"");if((isNaN(k)||k<=0)&&(k=((_=(F=(Z=e.__timelines)==null?void 0:Z[y])==null?void 0:F.duration)==null?void 0:_.call(F))??0),!Number.isFinite(k)||k<=0||(Number.isFinite(S)||(S=0),Number.isFinite(r)&&r>0&&(S>=r||(k=Math.min(k,Math.max(0,r-S)),k<=0))))return;const A=x.getAttribute("data-track-index"),C=A!=null?parseInt(A,10):0,T=x.getAttribute("data-composition-src")||x.getAttribute("data-composition-file"),j=al(x),M=Ou(x),E=xu(t,x,j),$=Yu({id:x.id||y||null,label:x.getAttribute("data-timeline-label")??x.getAttribute("data-label"),tag:x.tagName}),N=yu({preferredId:x.id||y||null,label:$,fallbackIndex:u.length,domId:x.id||void 0,selector:j,selectorIndex:E,sourceFile:M}),D={id:N.id,label:$,key:N.key,tag:x.tagName.toLowerCase(),start:S,duration:k,track:isNaN(C)?0:C,domId:x.id||void 0,hfId:x.getAttribute("data-hf-id")||void 0,selector:j,selectorIndex:E,sourceFile:M};if(T)D.compositionSrc=T;else{const q=x.querySelector("video[src]");q&&(D.src=q.getAttribute("src")||void 0,D.tag="video")}u.push(D)});let h=!1;const p=n.map(O=>{if(O.compositionSrc)return O;const x=t.getElementById(O.id)??t.querySelector(`[data-composition-id="${O.id}"]`);if(!x)return O;const y=x.getAttribute("data-composition-src")||x.getAttribute("data-composition-file");return y?(h=!0,{...O,compositionSrc:y}):O});return{missing:u,updatedEls:p,patched:h}}const u5=t=>{let e;const n=new Set,r=(h,p)=>{const O=typeof h=="function"?h(e):h;if(!Object.is(O,e)){const x=e;e=p??(typeof O!="object"||O===null)?O:Object.assign({},e,O),n.forEach(y=>y(e,x))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h))},u=e=t(r,i,c);return c},X$=(t=>t?u5(t):u5),z$=t=>t;function F$(t,e=z$){const n=M1.useSyncExternalStore(t.subscribe,M1.useCallback(()=>e(t.getState()),[t,e]),M1.useCallback(()=>e(t.getInitialState()),[t,e]));return M1.useDebugValue(n),n}const f5=t=>{const e=X$(t),n=r=>F$(e,r);return Object.assign(n,e),n},l7=(t=>t?f5(t):f5),o7="hf-studio-ui-preferences";function d5(t){return typeof t=="object"&&t!==null}function c7(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function u7(t){if(!t)return{};try{const e=t.getItem(o7);if(!e)return{};const n=JSON.parse(e);if(!d5(n))return{};const r={};if(typeof n.leftCollapsed=="boolean"&&(r.leftCollapsed=n.leftCollapsed),typeof n.timelineVisible=="boolean"&&(r.timelineVisible=n.timelineVisible),typeof n.playbackRate=="number"&&Number.isFinite(n.playbackRate)&&(r.playbackRate=n.playbackRate),typeof n.audioMuted=="boolean"&&(r.audioMuted=n.audioMuted),d5(n.previewZoom)){const{zoomPercent:i,panX:a,panY:l}=n.previewZoom;typeof i=="number"&&Number.isFinite(i)&&typeof a=="number"&&Number.isFinite(a)&&typeof l=="number"&&Number.isFinite(l)&&(r.previewZoom={zoomPercent:i,panX:a,panY:l})}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),r}catch{return{}}}function gs(t=c7()){return u7(t)}function wo(t,e=c7()){if(e)try{const n={...u7(e),...t};e.setItem(o7,JSON.stringify(n))}catch{}}const Cp=new Set,pr={notify:t=>Cp.forEach(e=>e(t)),subscribe:t=>(Cp.add(t),()=>Cp.delete(t))},oe=l7(t=>({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null,playbackRate:gs().playbackRate??1,audioMuted:gs().audioMuted??!1,loopEnabled:!1,zoomMode:"fit",manualZoomPercent:100,inPoint:null,outPoint:null,activeTool:"select",setActiveTool:e=>t({activeTool:e}),selectedKeyframes:new Set,toggleSelectedKeyframe:e=>t(n=>{const r=new Set(n.selectedKeyframes);return r.has(e)?r.delete(e):r.add(e),{selectedKeyframes:r}}),clearSelectedKeyframes:()=>t({selectedKeyframes:new Set}),keyframeClipboard:null,setKeyframeClipboard:e=>t({keyframeClipboard:e}),selectedElementIds:new Set,toggleSelectedElementId:e=>t(n=>{const r=new Set(n.selectedElementIds);return r.has(e)?r.delete(e):r.add(e),{selectedElementIds:r}}),clearSelectedElementIds:()=>t({selectedElementIds:new Set}),expandedTimelineElements:new Set,toggleExpandedElement:e=>t(n=>{const r=new Set(n.expandedTimelineElements);return r.has(e)?r.delete(e):r.add(e),{expandedTimelineElements:r}}),keyframeCache:new Map,setKeyframeCache:(e,n)=>t(r=>{const i=new Map(r.keyframeCache);return n?i.set(e,n):i.delete(e),{keyframeCache:i}}),requestedSeekTime:null,requestSeek:e=>t({requestedSeekTime:e}),clearSeekRequest:()=>t({requestedSeekTime:null}),autoKeyframeEnabled:!0,setAutoKeyframeEnabled:e=>t({autoKeyframeEnabled:e}),lintFindingsByElement:new Map,setLintFindingsByElement:e=>t({lintFindingsByElement:e}),setIsPlaying:e=>t({isPlaying:e}),setPlaybackRate:e=>{wo({playbackRate:e}),t({playbackRate:e})},setAudioMuted:e=>{wo({audioMuted:e}),t({audioMuted:e})},setLoopEnabled:e=>t({loopEnabled:e}),setZoomMode:e=>t({zoomMode:e}),setInPoint:e=>t(n=>{const r=e!==null&&Number.isFinite(e)?e:null;return{inPoint:r,outPoint:r!==null&&n.outPoint!==null&&r>=n.outPoint?null:n.outPoint,loopEnabled:r!==null?!0:n.loopEnabled}}),setOutPoint:e=>t(n=>{const r=e!==null&&Number.isFinite(e)?e:null;return{outPoint:r,inPoint:r!==null&&n.inPoint!==null&&r<=n.inPoint?null:n.inPoint,loopEnabled:r!==null?!0:n.loopEnabled}}),setManualZoomPercent:e=>t({manualZoomPercent:Math.max(10,Math.min(2e3,Math.round(e)))}),setCurrentTime:e=>t({currentTime:Number.isFinite(e)?e:0}),setDuration:e=>t({duration:Number.isFinite(e)?e:0}),setTimelineReady:e=>t({timelineReady:e}),setElements:e=>t({elements:e}),setSelectedElementId:e=>t({selectedElementId:e}),updateElement:(e,n)=>t(r=>({elements:r.elements.map(i=>(i.key??i.id)===e?{...i,...n}:i)})),reset:()=>t({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null,inPoint:null,outPoint:null,activeTool:"select",selectedKeyframes:new Set,selectedElementIds:new Set,expandedTimelineElements:new Set,keyframeCache:new Map})})),f7="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",d7="https://us.i.posthog.com",B$=3e4,Y$=5e3;let rl=[],su=null,Jl=null;function h7(){if(Jl)return Jl;try{const t=localStorage.getItem("hf-studio-anon-id");if(t)return Jl=t,t}catch{}Jl=crypto.randomUUID();try{localStorage.setItem("hf-studio-anon-id",Jl)}catch{}return Jl}function I$(){try{return localStorage.getItem("hf-studio-telemetry-opt-out")!=="1"}catch{return!0}}function q$(){var t,e;return{studio_version:"0.6.91",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\//,"")}}function Yt(t,e={}){I$()&&(rl.push({event:`studio:${t}`,properties:{...q$(),...e},timestamp:new Date().toISOString()}),su||(su=setInterval(G$,B$)))}async function G$(){if(rl.length===0)return;const t=rl.map(r=>({event:r.event,properties:{...r.properties,$ip:null},distinct_id:h7(),timestamp:r.timestamp}));rl=[];const e=new AbortController,n=setTimeout(()=>e.abort(),Y$);try{await fetch(`${d7}/batch/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:f7,batch:t}),signal:e.signal})}catch{}finally{clearTimeout(n)}}typeof window<"u"&&window.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){if(su&&(clearInterval(su),su=null),rl.length===0)return;const t=rl.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:h7(),timestamp:n.timestamp}));rl=[];const e=JSON.stringify({api_key:f7,batch:t});try{navigator.sendBeacon(`${d7}/batch/`,e)}catch{}}});const U$=[{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",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:"Del",label:"Delete selected element"}]},{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:"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"}]}],W$=d.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,setInPoint:a,setOutPoint:l,onSeek:c}){const[u,h]=d.useState(!1),[p,O]=d.useState(""),x=d.useRef(null);d.useEffect(()=>{if(!u)return;const k=A=>{x.current&&!x.current.contains(A.target)&&h(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[u]);const y=d.useCallback(()=>{if(e)return;const k=Number.parseInt(p,10);!Number.isFinite(k)||n<=0||c(Math.min(n,JS(Math.max(0,k))))},[e,n,p,c]),b=d.useCallback(k=>{k.preventDefault(),y()},[y]),S=d.useCallback(k=>{k.key==="Enter"&&(k.preventDefault(),y())},[y]);return m.jsxs("div",{ref:x,className:"relative flex-shrink-0",children:[m.jsx(Xt,{label:"Shortcuts and tools",children:m.jsx("button",{type:"button",onClick:()=>h(k=>!k),className:`w-6 h-6 flex items-center justify-center rounded border transition-colors ${u?"border-neutral-600 text-neutral-200 bg-neutral-800":"border-neutral-800 text-neutral-600 hover:text-neutral-300 hover:border-neutral-600"}`,"aria-label":"Shortcuts and tools","aria-expanded":u,children:m.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:[m.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),m.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"})]})})}),u&&m.jsxs("div",{className:"absolute bottom-full right-0 mb-2 z-50 rounded-lg shadow-xl min-w-[220px] overflow-y-auto",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)",maxHeight:"min(280px, calc(100vh - 80px))"},children:[m.jsxs("div",{className:"px-3 pt-3 pb-2.5",children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Jump to frame"}),m.jsxs("form",{onSubmit:b,className:"flex items-center gap-1.5",children:[m.jsx("input",{value:p,onChange:k=>O(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:S,onBlur:y}),m.jsx(Xt,{label:"Jump to frame",children:m.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"})})]})]}),m.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),m.jsxs("div",{className:"px-3 pt-2.5 pb-2",children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Work area"}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.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"}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:"In-point"})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:r!==null?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:Cn(r)}),m.jsx(Xt,{label:"Clear in-point",children:m.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 in-point",children:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):m.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]}),m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.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"}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:"Out-point"})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:i!==null?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:Cn(i)}),m.jsx(Xt,{label:"Clear out-point",children:m.jsx("button",{type:"button",onClick:()=>l(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:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):m.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]})]})]}),m.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),m.jsx("div",{className:"px-3 pt-2.5 pb-3 flex flex-col gap-3",children:U$.map(k=>m.jsxs("div",{children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:k.title}),m.jsx("div",{className:"flex flex-col gap-1",children:k.hints.map(A=>m.jsxs("div",{className:"flex items-center gap-3",children:[m.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:A.key}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:A.label})]},A.key))})]},k.title))})]})]})}),K$=[.25,.5,1,1.5,2],J$=d.memo(function({playbackRate:e,setPlaybackRate:n,disabled:r}){const[i,a]=d.useState(!1),l=d.useRef(null);return d.useEffect(()=>{if(!i)return;const c=u=>{l.current&&!l.current.contains(u.target)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[i]),m.jsxs("div",{ref:l,className:"relative flex-shrink-0",children:[m.jsx(Xt,{label:"Playback speed",children:m.jsx("button",{type:"button",onClick:()=>a(c=>!c),disabled:r,className:"w-10 px-2 py-1 rounded-md text-[10px] font-mono tabular-nums transition-colors",style:{color:"#71717A",background:"rgba(255,255,255,0.04)"},children:e===1?"1x":`${e}x`})}),i&&m.jsx("div",{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:K$.map(c=>m.jsxs("button",{onClick:()=>{Yt("playback",{action:"speed_change",rate:c}),n(c),a(!1)},className:"block w-full px-3 py-1.5 text-[11px] text-left font-mono tabular-nums transition-colors",style:{color:c===e?"#FAFAFA":"#71717A",background:c===e?"rgba(255,255,255,0.06)":"transparent"},onMouseEnter:u=>{c!==e&&(u.currentTarget.style.background="rgba(255,255,255,0.04)")},onMouseLeave:u=>{c!==e&&(u.currentTarget.style.background="transparent")},children:[c,"x"]},c))})]})}),ej=8;function h5(t,e,n){if(!Number.isFinite(n)||n<=0)return 0;const r=(t-e)/n,i=Math.max(0,Math.min(1,r)),a=Math.min(.5,ej/n);return i<=a?0:i>=1-a?1:i}function T1(t,e,n){t.current&&(t.current.style.width=`${n}%`),e.current&&(e.current.style.left=`${n}%`)}function tj(t,e,n,r){const i=d.useCallback(l=>{if(n)return;const c=t.seekBarRef.current;if(!c||r<=0)return;const u=c.getBoundingClientRect(),h=h5(l,u.left,u.width);T1(t.progressFillRef,t.progressThumbRef,h*100),e(h*r)},[n,r,e,t]),a=d.useCallback(l=>{if(l.button!==0)return;l.preventDefault(),l.currentTarget.focus(),t.isDraggingRef.current=!0;const c=l.currentTarget,u=l.pointerId;try{c.setPointerCapture(u)}catch{}i(l.clientX);let h=0,p=l.clientX;const O=S=>{if(S.pointerId!==u||!t.isDraggingRef.current)return;p=S.clientX;const k=t.seekBarRef.current,A=t.durationRef.current;if(k&&A>0){const C=k.getBoundingClientRect(),T=h5(S.clientX,C.left,C.width)*100;T1(t.progressFillRef,t.progressThumbRef,T)}h||(h=requestAnimationFrame(()=>{h=0,t.isDraggingRef.current&&i(p)}))},x=()=>{t.isDraggingRef.current=!1,h&&(cancelAnimationFrame(h),h=0),i(p);try{c.releasePointerCapture(u)}catch{}c.removeEventListener("pointermove",O),c.removeEventListener("pointerup",y),c.removeEventListener("pointercancel",y),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.removeEventListener("visibilitychange",b),window.removeEventListener("blur",x),c.blur()},y=S=>{S.pointerId===u&&x()},b=()=>{document.visibilityState==="hidden"&&x()};c.addEventListener("pointermove",O),c.addEventListener("pointerup",y),c.addEventListener("pointercancel",y),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),document.addEventListener("visibilitychange",b),window.addEventListener("blur",x)},[i,t]);return Wt(()=>{const l=h=>{t.currentTimeRef.current=h;const p=t.durationRef.current,O=p>0?Math.min(100,h/p*100):0;T1(t.progressFillRef,t.progressThumbRef,O),t.timeDisplayRef.current&&(t.timeDisplayRef.current.textContent=t.timeDisplayModeRef.current==="frame"?e7(h,p):Cn(h)),t.sliderRef.current&&t.sliderRef.current.setAttribute("aria-valuenow",String(Math.round(h)))},c=pr.subscribe(l);l(oe.getState().currentTime);const u=setInterval(()=>{const h=oe.getState().currentTime,p=oe.getState().duration;p>0&&h>0&&T1(t.progressFillRef,t.progressThumbRef,Math.min(100,h/p*100))},500);return()=>{c(),clearInterval(u)}}),{handlePointerDown:a}}function nj(){return m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:m.jsx("polygon",{points:"6,3 20,12 6,21"})})}function rj(){return m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:[m.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),m.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})}const ij=d.memo(function({audioMuted:e,audioAutoMuted:n,effectiveAudioMuted:r,controlsDisabled:i,setAudioMuted:a}){const l=n?"Audio muted above 1x speed":e?"Unmute audio":"Mute audio";return m.jsx(Xt,{label:l,children:m.jsx("button",{type:"button",onClick:()=>{n||(Yt("playback",{action:"mute_toggle",muted:!e}),a(!e))},disabled:i||n,"aria-label":l,"aria-pressed":r,className:`h-7 w-7 flex-shrink-0 flex items-center justify-center rounded-md border transition-colors disabled:pointer-events-none ${r?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"} ${n?"opacity-70":""}`,children:m.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:[m.jsx("path",{d:"M11 5 6 9H3v6h3l5 4V5Z"}),r?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"m19 9-6 6"}),m.jsx("path",{d:"m13 9 6 6"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),m.jsx("path",{d:"M18.5 5.5a9 9 0 0 1 0 13"})]})]})})})}),aj=d.memo(function({loopEnabled:e,disabled:n,setLoopEnabled:r}){return m.jsx(Xt,{label:"Loop playback",children:m.jsx("button",{type:"button",onClick:()=>{Yt("playback",{action:"loop_toggle",enabled:!e}),r(!e)},disabled:n,className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${e?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"}`,"aria-label":e?"Disable loop playback":"Enable loop playback","aria-pressed":e,children:m.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:[m.jsx("path",{d:"M17 2l4 4-4 4"}),m.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),m.jsx("path",{d:"M7 22l-4-4 4-4"}),m.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})})})}),sj=d.memo(function({isFullscreen:e,onToggleFullscreen:n}){return m.jsx(Xt,{label:e?"Exit fullscreen (F)":"Enter fullscreen (F)",children:m.jsx("button",{type:"button",onClick:()=>{Yt("playback",{action:"fullscreen_toggle",active:!e}),n()},className:`h-7 w-7 flex-shrink-0 flex items-center justify-center rounded-md border transition-colors ${e?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"}`,"aria-label":e?"Exit fullscreen":"Enter fullscreen",children:m.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?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),m.jsx("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),m.jsx("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),m.jsx("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),m.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),m.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),m.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})})})});function m5({position:t,duration:e}){return e<=0?null:m.jsx("div",{className:"absolute z-[3] pointer-events-none",style:{left:`${Math.min(100,t/e*100)}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"10px",background:"#3CE6AC",borderRadius:"1px"}})}function lj({inPoint:t,outPoint:e,duration:n}){return t===null&&e===null||n<=0?null:m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${t!==null?Math.min(100,t/n*100):0}%`,right:`${e!==null?100-Math.min(100,e/n*100):0}%`,background:"rgba(60,230,172,0.15)"}}),t!==null&&m.jsx(m5,{position:t,duration:n}),e!==null&&m.jsx(m5,{position:e,duration:n})]})}const oj=d.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,progressFillRef:a,progressThumbRef:l,seekBarRef:c,sliderRef:u,onPointerDown:h,onKeyDown:p}){return m.jsx("div",{ref:O=>{c.current=O,u.current=O},role:"slider",tabIndex:e?-1:0,"aria-label":"Seek","aria-disabled":e||void 0,"aria-valuemin":0,"aria-valuemax":Math.round(n),"aria-valuenow":0,className:`min-w-[96px] flex-1 h-6 flex items-center group outline-none focus-visible:ring-1 focus-visible:ring-white/30 focus-visible:rounded ${e?"cursor-not-allowed opacity-50":"cursor-pointer"}`,style:{touchAction:"none"},onPointerDown:h,onKeyDown:p,children:m.jsxs("div",{className:"w-full rounded-full relative",style:{background:"rgba(255,255,255,0.15)",height:"3px"},children:[m.jsx(lj,{inPoint:r,outPoint:i,duration:n}),m.jsx("div",{ref:a,className:"absolute top-0 bottom-0 left-0 z-[1] rounded-full",style:{background:"linear-gradient(90deg, var(--hf-accent, #3CE6AC), #2BBFA0)"}}),m.jsx("div",{ref:l,className:"absolute top-1/2 z-[4] w-3 h-3 rounded-full -translate-y-1/2 -translate-x-1/2 transition-transform group-hover:scale-125",style:{background:"var(--hf-accent, #3CE6AC)",boxShadow:"0 0 6px rgba(60,230,172,0.4), 0 1px 4px rgba(0,0,0,0.4)"}})]})})}),cj=d.memo(function({onTogglePlay:e,onSeek:n,disabled:r=!1,isFullscreen:i=!1,onToggleFullscreen:a}){const l=oe(q=>q.isPlaying),c=oe(q=>q.duration),u=oe(q=>q.timelineReady),h=oe(q=>q.playbackRate),p=oe(q=>q.audioMuted),O=oe(q=>q.loopEnabled),x=oe.getState().setPlaybackRate,y=oe.getState().setAudioMuted,b=oe.getState().setLoopEnabled,S=oe(q=>q.inPoint),k=oe(q=>q.outPoint),A=oe.getState().setInPoint,C=oe.getState().setOutPoint,[T,j]=d.useState("time"),M=d.useRef(null),E=d.useRef(null),$=d.useRef(null),N=d.useRef(null),D=d.useRef(null),z=d.useRef(!1),B=d.useRef(0),X=d.useRef(T);X.current=T;const U=d.useRef(c);U.current=c;const I=r||!u,K=h>1,Z=s7(p,h);d.useEffect(()=>{if(!$.current)return;const q=B.current;$.current.textContent=T==="frame"?e7(q,c):Cn(q)},[c,T]);const{handlePointerDown:F}=tj({seekBarRef:N,progressFillRef:M,progressThumbRef:E,sliderRef:D,timeDisplayRef:$,isDraggingRef:z,durationRef:U,currentTimeRef:B,timeDisplayModeRef:X},n,r,c),_=d.useCallback(q=>{if(r||!u||c<=0)return;const G=q.shiftKey?10:1;q.key==="ArrowLeft"?(q.preventDefault(),n(sg(B.current,-G))):q.key==="ArrowRight"&&(q.preventDefault(),n(Math.min(c,sg(B.current,G))))},[r,u,c,n]);return m.jsxs("div",{className:"px-4 py-2 flex flex-wrap items-center gap-x-2 gap-y-1","aria-disabled":r||void 0,style:{borderTop:"1px solid rgba(255,255,255,0.04)",paddingBottom:"calc(0.5rem + env(safe-area-inset-bottom))"},children:[m.jsx(Xt,{label:l?"Pause":"Play",children:m.jsx("button",{type:"button","aria-label":l?"Pause":"Play",onClick:()=>{Yt("playback",{action:l?"pause":"play"}),e()},disabled:I,className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg disabled:opacity-30 disabled:pointer-events-none transition-colors",style:{background:"rgba(255,255,255,0.06)"},children:l?m.jsx(rj,{}):m.jsx(nj,{})})}),m.jsx(Xt,{label:T==="time"?"Switch to frame display":"Switch to time display",children:m.jsxs("button",{type:"button",onClick:()=>j(q=>q==="time"?"frame":"time"),disabled:r,className:"font-mono text-[11px] tabular-nums flex-shrink-0 w-[118px] text-left transition-colors disabled:pointer-events-none hover:opacity-80",style:{color:"#A1A1AA",cursor:"pointer"},children:[m.jsx("span",{ref:$,children:Cn(0)}),T==="time"?m.jsxs(m.Fragment,{children:[m.jsx("span",{style:{color:"#3F3F46",margin:"0 2px"},children:"/"}),m.jsx("span",{style:{color:"#52525B"},children:Cn(c)})]}):null]})}),m.jsx(oj,{disabled:r,duration:c,inPoint:S,outPoint:k,progressFillRef:M,progressThumbRef:E,seekBarRef:N,sliderRef:D,onPointerDown:F,onKeyDown:_}),m.jsx(ij,{audioMuted:p,audioAutoMuted:K,effectiveAudioMuted:Z,controlsDisabled:I,setAudioMuted:y}),m.jsx(J$,{playbackRate:h,setPlaybackRate:x,disabled:r}),m.jsx(aj,{loopEnabled:O,disabled:r,setLoopEnabled:b}),a&&m.jsx(sj,{isFullscreen:i,onToggleFullscreen:a}),m.jsx(W$,{disabled:r,duration:c,inPoint:S,outPoint:k,setInPoint:A,setOutPoint:C,onSeek:n})]})}),p5=100;function ao(t){return Math.round(t*p5)/p5}function bu(t,e,n){return Math.min(Math.max(t,e),n)}const g5=.55,E1=40,O5=12;function x5(t,e,n){const r=(i,a,l)=>{if(l<i+E1){const c=Math.max(0,1-(l-i)/E1);return-Math.round(O5*c)}if(l>a-E1){const c=Math.max(0,1-(a-l)/E1);return Math.round(O5*c)}return 0};return{x:r(t.left,t.right,e),y:r(t.top,t.bottom,n)}}function uj(t,e,n){const r=(t.currentScrollLeft??0)-(t.originScrollLeft??0),i=(t.currentScrollTop??0)-(t.originScrollTop??0),a=(e-t.originClientX+r)/Math.max(t.pixelsPerSecond,1),l=(n-t.originClientY+i)/Math.max(t.trackHeight,1),c=Math.round(l),u=Math.max(0,t.trackOrder.indexOf(t.track)),h=u+c,p=bu(h,0,Math.max(0,t.trackOrder.length-1)),O=Math.min(...t.trackOrder),x=Math.max(...t.trackOrder);let y=t.trackOrder[p]??t.track;const b=u===0,S=u===t.trackOrder.length-1;return b&&h<0&&u+l<=-g5?y=O-1:S&&h>t.trackOrder.length-1&&u+l>=t.trackOrder.length-1+g5&&(y=x+1),{start:bu(ao(t.start+a),0,Math.max(0,t.maxStart)),track:y}}function fj(t,e,n){const r=Math.max(.05,t.minDuration??.1),i=(n-t.originClientX)/Math.max(t.pixelsPerSecond,1);if(e==="end"){const y=bu(ao(t.duration+i),r,Math.max(r,t.maxEnd-t.start));return{start:t.start,duration:y,playbackStart:t.playbackStart}}const a=Math.max(.1,t.playbackRate??1),l=t.playbackStart!=null?t.playbackStart/a:Number.POSITIVE_INFINITY,c=-Math.min(t.start-t.minStart,l),u=t.duration-r,h=bu(i,c,u),p=ao(t.start+h),O=ao(t.duration-h),x=t.playbackStart!=null?ao(Math.max(0,t.playbackStart+h*a)):void 0;return{start:p,duration:O,playbackStart:x}}function dj(t){if(t.compositionSrc||t.playbackStartAttr!=null||t.sourceDuration!=null&&Number.isFinite(t.sourceDuration)&&t.sourceDuration>0)return!0;const e=t.tag.toLowerCase();return["video","audio","img"].includes(e)}function hj(t){return!!(t.domId||t.selector)}function y5(t){if(t.timingSource==="implicit"||t.timelineLocked)return{canMove:!1,canTrimStart:!1,canTrimEnd:!1};const e=hj(t),n=Number.isFinite(t.duration)&&t.duration>0,r=dj(t);return{canMove:e&&(r||n),canTrimEnd:e&&n,canTrimStart:e&&n}}function mj(t){if(t.capabilities.canMove)return null;const e=Math.max(0,t.width),n=bu(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 pj(t,e){return{start:t.start,end:t.start+t.duration,anchorX:e.anchorX,anchorY:e.anchorY}}function gj({rangeStart:t,rangeEnd:e,elements:n,prompt:r}){const i=Math.min(t,e),a=Math.max(t,e),l=n.map(c=>`- #${c.id} (${c.tag}) — ${Cn(c.start)} to ${Cn(c.start+c.duration)}, track ${c.track}`).join(`
|
|
50
|
+
`);return`Edit the following HyperFrames composition:
|
|
51
|
+
|
|
52
|
+
Time range: ${Cn(i)} — ${Cn(a)}
|
|
53
|
+
|
|
54
|
+
Elements in range:
|
|
55
|
+
${l||"(none)"}
|
|
56
|
+
|
|
57
|
+
User request:
|
|
58
|
+
${r.trim()||"(no prompt provided)"}
|
|
59
|
+
|
|
60
|
+
Instructions:
|
|
61
|
+
Modify only the elements listed above within the specified time range.
|
|
62
|
+
The composition uses HyperFrames data attributes (data-start, data-duration, data-track-index) and GSAP for animations.
|
|
63
|
+
Preserve all other elements and timing outside this range.`}function b5(t){return t.trim()}function In(t){return Number(ao(t).toFixed(2)).toString()}function v5(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{document.body.removeChild(e)}}function Oj(){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 vu(t){const e=Oj();if(e&&v5(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&&v5(t)}function xj({rangeStart:t,rangeEnd:e,anchorX:n,anchorY:r,onClose:i}){const a=oe(M=>M.elements),[l,c]=d.useState(""),[u,h]=d.useState(!1),[p,O]=d.useState(!1),x=d.useRef(null),y=d.useRef(null),b=Math.min(t,e),S=Math.max(t,e),k=d.useMemo(()=>a.filter(M=>{const E=M.start+M.duration;return M.start<S&&E>b}),[a,b,S]);Wt(()=>{setTimeout(()=>{var M;return(M=y.current)==null?void 0:M.focus()},50)}),Wt(()=>{const M=E=>{E.key==="Escape"&&i()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)}),Wt(()=>{const M=E=>{x.current&&!x.current.contains(E.target)&&i()};return setTimeout(()=>window.addEventListener("mousedown",M),100),()=>window.removeEventListener("mousedown",M)});const A=d.useCallback(()=>gj({rangeStart:b,rangeEnd:S,elements:k,prompt:l}),[b,S,k,l]),C=d.useCallback(async()=>{await vu(A())&&(h(!0),setTimeout(()=>{h(!1),i()},800))},[A,i]),T=d.useCallback(async()=>{const M=b5(l);!M||!await vu(M)||(O(!0),setTimeout(()=>{O(!1)},800))},[l]),j={position:"fixed",left:Math.max(8,Math.min(n-160,window.innerWidth-336)),top:Math.max(8,r-280),zIndex:200};return m.jsx("div",{ref:x,style:j,children:m.jsxs("div",{className:"w-80 bg-neutral-900 border border-neutral-700/60 rounded-xl shadow-2xl shadow-black/40 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-neutral-800/60",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-studio-accent"}),m.jsxs("span",{className:"text-[11px] font-medium text-neutral-300",children:[Cn(b)," — ",Cn(S)]})]}),m.jsxs("span",{className:"text-[10px] text-neutral-600",children:[k.length," element",k.length!==1?"s":""]})]}),k.length>0&&m.jsx("div",{className:"px-4 py-2 border-b border-neutral-800/40 max-h-24 overflow-y-auto",children:k.map(M=>m.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[m.jsxs("span",{className:"text-[10px] font-mono text-studio-accent/80",children:["#",M.id]}),m.jsx("span",{className:"text-[10px] text-neutral-600",children:M.tag})]},M.id))}),m.jsx("div",{className:"p-3",children:m.jsx("textarea",{ref:y,value:l,onChange:M=>c(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),C())},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"})}),m.jsxs("div",{className:"grid grid-cols-2 gap-2 px-3 pb-3",children:[m.jsx("button",{onClick:T,disabled:!b5(l),className:`py-1.5 text-[11px] font-medium rounded-lg transition-all border ${p?"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:p?"Prompt Copied!":"Copy Prompt"}),m.jsxs("button",{onClick:C,className:`py-1.5 text-[11px] font-medium rounded-lg transition-all ${u?"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:[u?"Copied!":"Copy to Agent",!u&&m.jsx("span",{className:"text-[9px] text-studio-accent/50 ml-1.5",children:"Cmd+Enter"})]})]})]})})}const yj={clip:"#1c2028",accent:"#3CE6AC",label:"#dde1e8",iconBackground:"rgba(255,255,255,0.06)"},m7={shellBackground:"#0A0A0B",shellBorder:"rgba(255,255,255,0.05)",rulerBorder:"rgba(255,255,255,0.045)",rowBackground:"#0A0A0B",rowBorder:"rgba(255,255,255,0.05)",gutterBackground:"#0A0A0B",gutterBorder:"rgba(255,255,255,0.05)",textPrimary:"#E8EDF5",textSecondary:"#8391A8",tickText:"rgba(131,145,168,0.92)",tickMajor:"rgba(255,255,255,0.13)",tickMinor:"rgba(255,255,255,0.08)",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:"6px"};function bj(t){return yj}function vj({isHovered:t,isSelected:e,isDragging:n}){return n?.95:e?.82:t?.76:0}function Sj({element:t,draggedElementId:e,previewStart:n,previewTrack:r}){return(t.key??t.id)!==e||n===null||r===null?t:{...t,start:n,track:r}}const dn=32,mo=48,ko=24,Tp=3,wj=18,kj=20;function Aj(t,e){const n=[.25,.5,1,2,5,10,15,30,60,120,300,600];if(Number.isFinite(e)&&(e??0)>0)return n.find(l=>l*(e??0)>=128)??600;const r=[.25,.5,1,2,5,10,15,30,60],i=t/6;return r.find(a=>a>=i)??60}function Mj(t,e){let n=t/2;return t>=30?n=t/6:t>=15?n=t/3:t>=5?n=t/5:t>=1&&(n=t/4),Number.isFinite(e)&&(e??0)>0&&n*(e??0)<20?Math.max(.25,t/2):Math.max(.25,n)}function Cj(t,e){if(t<=0||!Number.isFinite(t)||t>7200)return{major:[],minor:[]};const n=Aj(t,e),r=Mj(n,e),i=[],a=[],l=2e3;for(let c=0;c<=t+.001&&i.length+a.length<l;c+=r){const u=Math.round(c*100)/100;Math.abs(u%n)<.01||Math.abs(u%n-n)<.01?i.push(u):a.push(u)}return{major:i,minor:a}}function Tj(t,e,n){if(!Number.isFinite(t))return"0:00";const r=Math.max(0,t);if(n<1){const i=Math.round(r*10),a=Math.floor(i/10),l=i%10;return`${Cn(a)}.${l}`}if(e>=3600||r>=3600){const i=Math.floor(r),a=Math.floor(i/3600),l=Math.floor(i%3600/60),c=i%60;return`${a}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`}return Cn(r)}function S5(t,e,n){return t==="fit"||!Number.isFinite(e)||!Number.isFinite(n)?!1:e-n>1}function Ej(t,e,n){return t==="manual"&&e==="fit"?0:n}function $j(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,t.currentScrollLeft+t.pointerX-t.gutter),i=Math.max(0,Math.min(t.duration,r/e));return Math.max(0,t.gutter+i*n-t.pointerX)}function w5(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?dn:dn+Math.max(0,t)*Math.max(0,e)}function jj(t){return ko+Math.max(0,t)*mo+kj}function Pj(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?!0:t-e<=1}function Qj(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 Ep(t,e,n){const r=e-t.rectLeft+t.scrollLeft-dn,i=n-t.rectTop+t.scrollTop-ko,a=Math.max(0,Math.min(t.duration,Math.round(r/Math.max(t.pixelsPerSecond,1)*100)/100)),l=Math.floor(i/Math.max(t.trackHeight,1));return{start:a,track:Qj(t.trackOrder,l)}}function Zj({scrollRef:t,ppsRef:e,effectiveDuration:n,pps:r,onSeek:i,seekFromX:a,autoScrollDuringDrag:l,dragScrollRaf:c,isDragging:u,setShowPopover:h}){const p=d.useRef(!1),O=d.useRef(0),[x,y]=d.useState(null),b=d.useRef(null),S=d.useRef(0),k=d.useRef(0),A=d.useCallback(j=>{var M,E;if(j.button===0){if(j.shiftKey){j.currentTarget.setPointerCapture(j.pointerId),p.current=!0,h(!1);const $=(M=t.current)==null?void 0:M.getBoundingClientRect();if($){const N=j.clientX-$.left+(((E=t.current)==null?void 0:E.scrollLeft)??0)-dn,D=Math.max(0,N/r);O.current=D,y({start:D,end:D,anchorX:j.clientX,anchorY:j.clientY})}return}b.current=null,!j.target.closest("[data-clip]")&&(j.currentTarget.setPointerCapture(j.pointerId),u.current=!0,y(null),h(!1),a(j.clientX))}},[a,r,t,u,h]),C=d.useCallback(j=>{var E,$;if(p.current){const N=(E=t.current)==null?void 0:E.getBoundingClientRect();if(N){const D=j.clientX-N.left+((($=t.current)==null?void 0:$.scrollLeft)??0)-dn;y(z=>z?{...z,end:Math.max(0,D/r),anchorX:j.clientX,anchorY:j.clientY}:null)}return}if(!u.current)return;k.current=j.clientX;const M=t.current;if(M){const N=M.getBoundingClientRect(),D=j.clientX-N.left+M.scrollLeft-dn;if(D>=0){const z=M.scrollWidth/r;pr.notify(Math.max(0,Math.min(z,D/r)))}}S.current||(S.current=requestAnimationFrame(()=>{S.current=0,u.current&&(a(k.current),l(k.current))}))},[a,l,r,t,u]),T=d.useCallback(()=>{if(p.current){p.current=!1;const j=b.current;b.current=null,y(M=>M&&j&&Math.abs(M.end-M.start)<=.2?(h(!0),pj(j.element,j)):M&&Math.abs(M.end-M.start)>.2?(h(!0),M):null);return}S.current&&(cancelAnimationFrame(S.current),S.current=0),a(k.current),u.current=!1,cancelAnimationFrame(c.current)},[u,c,h,a]);return{rangeSelection:x,setRangeSelection:y,shiftClickClipRef:b,handlePointerDown:A,handlePointerMove:C,handlePointerUp:T}}const Nj=10,Rj=2e3,Vj=.8,Lj=1.25,_j=.0035;function _8(t){return Number.isFinite(t)?Math.max(Nj,Math.min(Rj,Math.round(t))):100}function Rd(t,e){return t==="fit"?100:_8(e)}function Dj(t,e,n){if(!Number.isFinite(t)||t<=0)return 100;const r=Rd(e,n);return e==="fit"?t:t*(r/100)}function k5(t,e,n){const r=Rd(e,n),i=t==="in"?r*Lj:r*Vj;return _8(i)}function Hj(t,e,n){const r=Rd(e,n);return!Number.isFinite(t)||t===0?r:_8(r*Math.exp(-t*_j))}function Xj({playheadRef:t,scrollRef:e,ppsRef:n,durationRef:r,isDragging:i,currentTime:a,zoomMode:l,zoomModeRef:c,manualZoomPercentRef:u,fitPps:h,fitPpsRef:p,effectiveDuration:O,pps:x,timelineReady:y,elementsLength:b,setZoomMode:S,setManualZoomPercent:k,onSeek:A}){const C=d.useRef(0),T=d.useRef(l),j=d.useCallback(N=>{!t.current||r.current<=0||(t.current.style.left=`${w5(N,n.current)}px`)},[t,r,n]);d.useEffect(()=>{j(a)},[a,x,j]),d.useEffect(()=>{const N=e.current;if(!N){T.current=l;return}N.scrollLeft=Ej(T.current,l,N.scrollLeft),T.current=l},[l,e]),Wt(()=>pr.subscribe(D=>{if(!t.current||r.current<=0)return;const z=w5(D,n.current);t.current.style.left=`${z}px`;const B=e.current;if(B&&!i.current&&oe.getState().isPlaying&&S5(c.current,B.scrollWidth,B.clientWidth)){const X=B.clientWidth*.12;z>B.scrollLeft+B.clientWidth-X?B.scrollLeft=z-B.clientWidth*.15:z<B.scrollLeft+dn&&(B.scrollLeft=Math.max(0,z-dn))}}));const M=d.useCallback(N=>{const D=e.current;if(!D||O<=0)return;const z=D.getBoundingClientRect(),B=N-z.left+D.scrollLeft-dn;if(B<0)return;const X=Math.max(0,Math.min(O,B/x));pr.notify(X),A==null||A(X)},[e,O,x,A]),E=d.useCallback(N=>{cancelAnimationFrame(C.current);const D=e.current;if(!D||!i.current||!S5(c.current,D.scrollWidth,D.clientWidth))return;const z=D.getBoundingClientRect(),B=40,X=12;let U=0;N<z.left+B?U=-X*Math.max(0,1-(N-z.left)/B):N>z.right-B&&(U=X*Math.max(0,1-(z.right-N)/B)),U!==0&&(D.scrollLeft+=U,M(N),C.current=requestAnimationFrame(()=>E(N)))},[e,i,c,M]),$=d.useCallback(N=>{if(!N.ctrlKey)return;const D=e.current;if(!D||r.current<=0||p.current<=0||n.current<=0)return;N.preventDefault(),N.stopPropagation();const z=D.getBoundingClientRect(),B=Hj(N.deltaY,c.current,u.current);if(B===u.current&&c.current==="manual")return;const X=p.current*(B/100),U=$j({pointerX:N.clientX-z.left,currentScrollLeft:D.scrollLeft,gutter:dn,currentPixelsPerSecond:n.current,nextPixelsPerSecond:X,duration:r.current});S("manual"),k(B),requestAnimationFrame(()=>{const I=Math.max(0,D.scrollWidth-D.clientWidth);D.scrollLeft=Math.min(I,U)})},[e,r,p,n,c,u,k,S]);return d.useEffect(()=>{const N=e.current;if(N)return N.addEventListener("wheel",$,{passive:!1,capture:!0}),()=>{N.removeEventListener("wheel",$,{capture:!0})}},[$,e,y,b]),{seekFromX:M,autoScrollDuringDrag:E,dragScrollRaf:C}}const Xo="/icons/timeline";function zo({src:t}){return m.jsx("img",{src:t,alt:"",width:12,height:12,style:{filter:"brightness(0) invert(1)"},draggable:!1})}const zj=m.jsx(zo,{src:`${Xo}/captions.svg`}),A5=m.jsx(zo,{src:`${Xo}/image.svg`}),Fj=m.jsx(zo,{src:`${Xo}/music.svg`}),M5=m.jsx(zo,{src:`${Xo}/text.svg`}),ug=m.jsx(zo,{src:`${Xo}/composition.svg`}),Bj=m.jsx(zo,{src:`${Xo}/audio.svg`}),C5={video:A5,audio:Fj,img:A5,div:ug,span:zj,p:M5,h1:M5,section:ug,sfx:Bj};function T5(t){const e=bj(),n=t.toLowerCase(),r=n.startsWith("h")&&n.length===2&&"123456".includes(n[1]??"")?C5.h1:C5[n]??ug;return{...e,icon:r}}function p7(){const t=oe(i=>i.zoomMode),e=oe(i=>i.manualZoomPercent),n=oe(i=>i.setZoomMode),r=oe(i=>i.setManualZoomPercent);return{zoomMode:t,manualZoomPercent:e,setZoomMode:n,setManualZoomPercent:r}}const Su=/\.(jpg|jpeg|png|gif|webp|svg|ico)$/i,D8=/\.(mp4|webm|mov)$/i,H8=/\.(mp3|wav|ogg|m4a|aac)$/i,Tf=/\.(woff|woff2|ttf|ttc|otf|eot)$/i,g7=/\.(mp4|webm|mov|mp3|wav|ogg|m4a|aac|jpg|jpeg|png|gif|webp|svg|ico)$/i;function O7(t){return g7.test(t)}const fg="application/x-hyperframes-asset",Xf="application/x-hyperframes-block",Yj=5;function E5(t){return Su.test(t)?"image":D8.test(t)?"video":H8.test(t)?"audio":null}function Ij(t,e){const i=(t.split("/").pop()??"asset").replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase()||"asset",a=new Set(e);if(!a.has(i))return i;let l=2;for(;a.has(`${i}_${l}`);)l+=1;return`${i}_${l}`}function qj(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";if(!n)return e;const r=n.split("/").filter(Boolean),i=e.split("/").filter(Boolean);for(;r.length>0&&i.length>0&&r[0]===i[0];)r.shift(),i.shift();return[...r.map(()=>".."),...i].join("/")||e.split("/").pop()||e}function Gj(t,e,n=[]){let r=Math.round(Math.max(0,t.start)*100)/100;const i=r,a=e.map(h=>Number.isFinite(h)&&h>0?h:Yj),l=a.reduce((h,p)=>Math.round((h+p)*100)/100,i),u=n.some(h=>{if(h.track!==t.track)return!1;const p=Math.max(0,h.start),O=p+Math.max(0,h.duration);return i<O&&l>p})?Math.max(t.track,...n.map(h=>h.track))+1:t.track;return a.map(h=>{const p=r;return r=Math.round((r+h)*100)/100,{start:p,track:u}})}function x7(t){var r,i;const e=Number.parseFloat(((r=t.match(/\bdata-width=(["'])([^"']+)\1/i))==null?void 0:r[2])??""),n=Number.parseFloat(((i=t.match(/\bdata-height=(["'])([^"']+)\1/i))==null?void 0:i[2])??"");return{left:0,top:0,width:Number.isFinite(e)&&e>0?Math.round(e):640,height:Number.isFinite(n)&&n>0?Math.round(n):360}}function Uj(t){const e=`id="${t.id}" class="clip" src="${t.assetPath}" data-start="${t.start}" data-duration="${t.duration}" data-track-index="${t.track}"`,n=t.geometry??{left:0,top:0,width:640,height:360},r=`position: absolute; left: ${n.left}px; top: ${n.top}px; width: ${n.width}px; height: ${n.height}px; object-fit: contain; z-index: ${t.zIndex}`;return t.kind==="image"?`<img ${e} style="${r}" />`:t.kind==="video"?`<video ${e} muted playsinline style="${r}"></video>`:`<audio ${e} style="z-index: ${t.zIndex}"></audio>`}function X8(t,e){var h;const r=/<[^>]*data-composition-id="[^"]+"[^>]*>/i.exec(t);if(!r||r.index==null)throw new Error("No composition root found in target source");const i=r.index+r[0].length,a=t.lastIndexOf(`
|
|
64
|
+
`,r.index),c=(((h=t.slice(a+1,r.index).match(/^(\s*)/))==null?void 0:h[1])??"")+" ",u=e.split(`
|
|
65
|
+
`).map((p,O)=>O===0?p:c+p).join(`
|
|
66
|
+
`);return`${t.slice(0,i)}
|
|
67
|
+
${c}${u}${t.slice(i)}`}function Wj({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,onFileDrop:i,onAssetDrop:a,onBlockDrop:l}){const[c,u]=d.useState(!1),h=d.useCallback(O=>{const x=O.dataTransfer.files.length>0,y=Array.from(O.dataTransfer.types),b=y.includes(fg),S=y.includes(Xf);!x&&!b&&!S||(O.preventDefault(),(b||S)&&(O.dataTransfer.dropEffect="copy"),u(!0))},[]),p=d.useCallback(O=>{O.preventDefault(),u(!1);const x=t.current,y=x==null?void 0:x.getBoundingClientRect(),b={rectLeft:(y==null?void 0:y.left)??0,rectTop:(y==null?void 0:y.top)??0,scrollLeft:(x==null?void 0:x.scrollLeft)??0,scrollTop:(x==null?void 0:x.scrollTop)??0,pixelsPerSecond:e.current,duration:n.current,trackHeight:mo,trackOrder:r.current};if(i&&O.dataTransfer.files.length>0){i(Array.from(O.dataTransfer.files),x&&y?Ep(b,O.clientX,O.clientY):void 0);return}const S=O.dataTransfer.getData(fg);if(S&&a&&x&&y){try{const A=JSON.parse(S);A.path&&a(A.path,Ep(b,O.clientX,O.clientY))}catch{}return}const k=O.dataTransfer.getData(Xf);if(k&&l&&x&&y)try{const A=JSON.parse(k);A.name&&l(A.name,Ep(b,O.clientX,O.clientY))}catch{}},[a,l,i,t,e,n,r]);return{isDragOver:c,setIsDragOver:u,handleAssetDragOver:h,handleAssetDrop:p}}function Kj({isDragOver:t,onFileDrop:e,onDragOver:n,onDragLeave:r,onDrop:i}){return m.jsxs("div",{className:`h-full border-t bg-[#0a0a0b] flex flex-col select-none transition-colors duration-150 ${t?"border-studio-accent/50 bg-studio-accent/[0.03]":"border-neutral-800/50"}`,onDragOver:n,onDragLeave:r,onDrop:i,children:[m.jsx("div",{className:"flex-shrink-0 border-b border-neutral-800/40 flex items-end relative",style:{height:ko,paddingLeft:dn},children:[0,10,20,30,40,50].map(a=>m.jsxs("div",{className:"flex flex-col items-center",style:{position:"absolute",left:dn+a*14},children:[m.jsx("span",{className:"text-[9px] text-neutral-600 font-mono tabular-nums leading-none mb-0.5",children:`${Math.floor(a/60)}:${(a%60).toString().padStart(2,"0")}`}),m.jsx("div",{className:"w-px h-[5px] bg-neutral-700/40"})]},a))}),m.jsx("div",{className:"flex-1 flex items-center justify-center",children:m.jsx("div",{className:`flex items-center gap-3 px-6 py-3 border border-dashed rounded-lg transition-colors duration-150 ${t?"border-studio-accent/60 bg-studio-accent/[0.06]":"border-neutral-700/50"}`,children:t?m.jsxs(m.Fragment,{children:[m.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-studio-accent flex-shrink-0",children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsx("span",{className:"text-[13px] text-studio-accent",children:"Drop media files to import"})]}):m.jsxs(m.Fragment,{children:[m.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-600 flex-shrink-0",children:[m.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2"}),m.jsx("path",{d:"M7 2v20"}),m.jsx("path",{d:"M17 2v20"}),m.jsx("path",{d:"M2 7h20"}),m.jsx("path",{d:"M2 17h20"})]}),m.jsx("span",{className:"text-[13px] text-neutral-500",children:e?"Drop media here or describe your video to start":"Describe your video to start creating"})]})})})]})}const $5=d.memo(function({el:e,pps:n,clipY:r,isSelected:i,isHovered:a,isDragging:l=!1,hasCustomContent:c,capabilities:u,theme:h=m7,trackStyle:p,isComposition:O,onHoverStart:x,onHoverEnd:y,onPointerDown:b,onResizeStart:S,onClick:k,onDoubleClick:A,onContextMenu:C,children:T}){const j=e.start*n,M=Math.max(e.duration*n,4),E=vj({isHovered:a,isSelected:i,isDragging:l}),$=i?p.accent:a?h.clipBorderHover:h.clipBorder,N=l?h.clipShadowDragging:i?`0 0 0 1px ${p.accent}80, 0 0 8px ${p.accent}25`:a?h.clipShadowHover:h.clipShadow,D=e.label||e.id||e.tag,z=E>.01;return m.jsxs("div",{"data-clip":"true",className:c?"absolute overflow-visible":"absolute flex items-center overflow-visible",style:{left:j,width:M,top:r,bottom:r,borderRadius:h.clipRadius,background:p.clip,border:`1px solid ${$}`,boxShadow:N,transition:"border-color 100ms, box-shadow 100ms",zIndex:l?20:i?10:a?5:1,cursor:u.canMove?"grab":"default",transform:l?"translateY(-1px)":void 0,opacity:l?.92:1},title:O?`${e.compositionSrc} • Double-click to open`:`${D} • ${e.start.toFixed(1)}s – ${(e.start+e.duration).toFixed(1)}s`,onPointerEnter:x,onPointerLeave:y,onPointerDown:b,onClick:k,onDoubleClick:A,onContextMenu:C,children:[m.jsx("div",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,bottom:0,width:3,background:p.accent,opacity:i?.7:.3,borderRadius:`${h.clipRadius} 0 0 ${h.clipRadius}`,zIndex:2,pointerEvents:"none"}}),z&&u.canTrimStart&&m.jsx("div",{"aria-hidden":"true",onPointerDown:B=>S==null?void 0:S("start",B),style:{position:"absolute",left:0,top:0,bottom:0,width:14,cursor:"col-resize",zIndex:4},children:m.jsx("div",{style:{position:"absolute",left:4,top:6,bottom:6,width:2,borderRadius:1,background:p.accent,opacity:E*.6}})}),z&&u.canTrimEnd&&m.jsx("div",{"aria-hidden":"true",onPointerDown:B=>S==null?void 0:S("end",B),style:{position:"absolute",right:0,top:0,bottom:0,width:14,cursor:"col-resize",zIndex:4},children:m.jsx("div",{style:{position:"absolute",right:4,top:6,bottom:6,width:2,borderRadius:1,background:p.accent,opacity:E*.6}})}),T]})}),Jj=.8,eP=d.memo(function({keyframesData:e,clipWidthPx:n,clipHeightPx:r,accentColor:i,isSelected:a,currentPercentage:l,elementId:c,selectedKeyframes:u,onClickKeyframe:h,onShiftClickKeyframe:p,onDragKeyframe:O,onContextMenuKeyframe:x}){const y=d.useRef(null);if(n<20)return null;const b=Math.round(r*Jj),S=b/2,k=e.keyframes.slice().sort((M,E)=>M.percentage-E.percentage),A=a?i:"#a3a3a3",C=a?.4:.25,T=(M,E)=>{M.stopPropagation(),M.shiftKey?p==null||p(c,E):h==null||h(E)},j=(M,E)=>{if(M.button!==0)return;M.stopPropagation();const $=M.clientX,N=z=>{const B=z.clientX-$;Math.abs(B)>4&&(y.current={startX:$,startPct:E})},D=z=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",D);const B=y.current;if(y.current=null,!B)return;const U=(z.clientX-B.startX)/n*100,I=Math.max(0,Math.min(100,Math.round(B.startPct+U)));Math.abs(I-B.startPct)>.5&&(O==null||O(B.startPct,I))};document.addEventListener("pointermove",N),document.addEventListener("pointerup",D)};return m.jsxs("div",{className:"absolute inset-0",style:{zIndex:3,pointerEvents:"none"},children:[k.map((M,E)=>{if(E===0)return null;const $=k[E-1],N=$.percentage/100*n,D=M.percentage/100*n;return m.jsx("div",{className:"absolute",style:{left:N,top:"50%",width:D-N,height:2,transform:"translateY(-1px)",background:A,opacity:C,borderRadius:1}},`line-${E}-${$.percentage}-${M.percentage}`)}),k.map((M,E)=>{const $=M.percentage/100*n-S,N=`${c}:${M.percentage}`,D=u.has(N),z=a&&Math.abs(M.percentage-l)<.5,B=D||z?i:"#a3a3a3";return m.jsx("button",{type:"button",className:"absolute",style:{left:$,top:"50%",transform:"translateY(-50%)",width:b,height:b,pointerEvents:"auto",background:"none",border:"none",cursor:"pointer",padding:0},onClick:X=>T(X,M.percentage),onPointerDown:X=>j(X,M.percentage),onContextMenu:X=>{X.preventDefault(),X.stopPropagation(),x==null||x(X,c,M.percentage)},title:`${M.percentage}%`,children:m.jsxs("svg",{width:b,height:b,viewBox:"0 0 10 10",children:[D&&m.jsx("path",{d:"M5 0L10 5L5 10L0 5Z",fill:"none",stroke:i,strokeWidth:"0.8",opacity:.5}),m.jsx("path",{d:"M5 1L9 5L5 9L1 5Z",fill:B,opacity:D||z?1:.55})]})},`${E}-${M.percentage}`)})]})}),tP=d.memo(function({major:e,minor:n,pps:r,trackContentWidth:i,totalH:a,effectiveDuration:l,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:p}){return m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"absolute pointer-events-none",style:{left:dn,width:i},height:a,children:e.map(O=>{const x=O*r;return m.jsx("line",{x1:x,y1:ko,x2:x,y2:a,stroke:p.tickMinor,strokeWidth:"1"},`g-${O}`)})}),m.jsxs("div",{className:"relative overflow-hidden",style:{height:ko,marginLeft:dn,width:i},children:[u&&!h&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none z-10",children:m.jsx("span",{className:"text-[9px] font-medium",style:{color:p.textSecondary},children:"Drag or click a clip to edit range"})}),n.map(O=>m.jsx("div",{className:"absolute bottom-0",style:{left:O*r},children:m.jsx("div",{className:"w-px h-[3px]",style:{background:p.tickMinor}})},`m-${O}`)),e.map(O=>m.jsxs("div",{className:"absolute bottom-0 flex flex-col items-center",style:{left:O*r},children:[m.jsx("span",{className:"text-[9px] font-mono tabular-nums leading-none mb-0.5",style:{color:p.tickText},children:Tj(O,l,c)}),m.jsx("div",{className:"w-px h-[5px]",style:{background:p.tickMajor}})]},`M-${O}`))]})]})});function nP({color:t="var(--hf-accent, #3CE6AC)",glowColor:e="rgba(60,230,172,0.5)"}){return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"absolute top-0 bottom-0",style:{left:"50%",width:2,marginLeft:-1,background:t,boxShadow:`0 0 8px ${e}`}}),m.jsx("div",{className:"absolute",style:{left:"50%",top:0,transform:"translateX(-50%)"},children:m.jsx("div",{style:{width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${t}`,filter:"drop-shadow(0 1px 3px rgba(0,0,0,0.6))"}})})]})}const rP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},iP="VITE_STUDIO_ENABLE_PREVIEW_MANUAL_DRAGGING",aP="VITE_STUDIO_ENABLE_INSPECTOR_PANELS",sP="VITE_STUDIO_ENABLE_MOTION_PANEL",lP=new Set(["1","true","yes","on","enabled"]),oP=new Set(["0","false","no","off","disabled"]);function Ms(t,e,n){for(const r of e){const i=t[r];if(typeof i=="boolean")return i;if(typeof i!="string")continue;const a=i.trim().toLowerCase();if(a){if(lP.has(a))return!0;if(oP.has(a))return!1}}return n}const cP=typeof window<"u"?window.__HF_STUDIO_ENV__??{}:{},Cs={...rP??{},...cP},uP=Ms(Cs,[iP,"VITE_STUDIO_PREVIEW_MANUAL_EDITING_ENABLED"],!0),$p=Ms(Cs,["VITE_STUDIO_ENABLE_GSAP_DRAG_INTERCEPT"],!1),Pn=Ms(Cs,[aP,"VITE_STUDIO_INSPECTOR_PANELS_ENABLED"],!0),z8=Ms(Cs,[sP,"VITE_STUDIO_MOTION_PANEL_ENABLED"],!1),jp=Ms(Cs,["VITE_STUDIO_ENABLE_BLOCKS_PANEL","VITE_STUDIO_BLOCKS_PANEL_ENABLED"],!0),dg=Ms(Cs,["VITE_STUDIO_ENABLE_GSAP_PANEL","VITE_STUDIO_GSAP_PANEL_ENABLED"],!0),mi=Ms(Cs,["VITE_STUDIO_ENABLE_KEYFRAMES","VITE_STUDIO_KEYFRAMES_ENABLED"],!0),y7=Ms(Cs,["VITE_STUDIO_ENABLE_RAZOR_TOOL","VITE_STUDIO_RAZOR_TOOL_ENABLED"],!1),hg=Pn,j5="Manual editing is temporarily disabled";function nr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P5(t,e){return e==='"'?t.replace(/"/g,"""):t.replace(/'/g,"'")}function F8(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function fP(t){return t.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function dP(t){const e=[];let n="",r=null,i=!1,a=0;for(const l of t){if(i){n+=l,l===";"&&(i=!1);continue}if(l==="&"){i=!0,n+=l;continue}if(r){n+=l,l===r&&(r=null);continue}if(l==='"'||l==="'"){r=l,n+=l;continue}if(l==="("){a+=1,n+=l;continue}if(l===")"){a=Math.max(0,a-1),n+=l;continue}if(l===";"&&a===0){e.push(n),n="";continue}n+=l}return n&&e.push(n),e}function hP(t,e,n,r){const a=new RegExp(`(<[^>]*\\bid=(["'])${nr(e)}\\2[^>]*)>`,"i").exec(t);if(!a)return t;const l=a[1];return b7(t,l,n,r)}function b7(t,e,n,r){if(!e)return t;const i=/\bstyle=(["'])([\s\S]*?)\1/.exec(e);if(i){const a=i[2],l=i[1],c=new Map;for(const p of dP(a)){const O=p.indexOf(":");if(O<0)continue;const x=p.slice(0,O).trim(),y=p.slice(O+1).trim();x&&c.set(x,y)}r===null?c.delete(n):c.set(n,r);const u=Array.from(c.entries()).map(([p,O])=>`${p}: ${P5(O,l)}`).join("; "),h=e.replace(i[0],`style=${l}${u}${l}`);return t.replace(e,h)}else{if(r===null)return t;const a=/\s*\/$/.test(e),c=`${a?e.replace(/\s*\/$/,""):e} style="${n}: ${P5(r,'"')}"${a?" /":""}`;return t.replace(e,c)}}function mP(t,e,n,r){const i=Os(t,e);if(!i)return t;const a=b7(i.tag,i.tag,n,r);return lu(t,i,a)}function lu(t,e,n){return`${t.slice(0,e.start)}${n}${t.slice(e.end)}`}function Pp(t,e,n){const i=new RegExp(`(<[^>]*\\b${e}=(["'])${nr(n)}\\2[^>]*)>`,"i").exec(t);if((i==null?void 0:i.index)==null)return null;const a=t.match(new RegExp(`<[^>]*\\b${e}=(["'])${nr(n)}\\1[^>]*>`,"gi"));return a&&a.length>1&&console.warn(`sourcePatcher: ${e}="${n}" matched ${a.length} elements; patching the first. ids/attrs must be unique per document.`),{tag:i[1],start:i.index,end:i.index+i[1].length}}function pP(t,e){var u;const n=(u=e.selector)==null?void 0:u.match(/^\.([a-zA-Z0-9_-]+)$/);if(!n)return null;const r=n[1],i=new RegExp(`(<[^>]*\\bclass=(["'])[^"']*\\b${nr(r)}\\b[^"']*\\2[^>]*)>`,"gi"),a=e.selectorIndex??0;let l,c=0;for(;(l=i.exec(t))!==null;){if(c===a&&l.index!=null)return{tag:l[1],start:l.index,end:l.index+l[1].length};c+=1}return null}function Os(t,e){if(e.hfId){const r=Pp(t,"data-hf-id",e.hfId);if(r)return r}if(e.id){const r=Pp(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=Pp(t,"data-composition-id",n[1]);if(r)return r}return pP(t,e)}function Q5(t,e,n){const r=Os(t,e);if(!r)return;const i=n.startsWith("data-")?n:`data-${n}`,a=new RegExp(`\\b${i}=(["'])([^"']*)\\1`).exec(r.tag);return(a==null?void 0:a[2])!=null?fP(a[2]):void 0}function gP(t,e){const n=Os(t,e);return n==null?void 0:n.tag}function OP(t,e,n,r){const i=Os(t,e);if(!i)return t;const a=n.startsWith("data-")?n:`data-${n}`,l=new RegExp(`\\b${nr(a)}=(["'])([^"']*)\\1`),c=i.tag;if(r===null){if(!l.test(c))return t;const p=new RegExp(`\\s+${nr(a)}=(["'])[^"']*\\1`),O=c.replace(p,"");return lu(t,i,O)}const u=F8(r);if(l.test(c)){const p=c.replace(l,`${a}="${u}"`);return lu(t,i,p)}const h=c+` ${a}="${u}"`;return lu(t,i,h)}function xP(t,e,n,r){const a=new RegExp(`(<[^>]*\\bid=(["'])${nr(e)}\\2[^>]*)>`,"i").exec(t);if(!a)return t;const l=a[1],c=n.startsWith("data-")?n:`data-${n}`,u=new RegExp(`\\b${nr(c)}=(["'])([^"']*)\\1`);if(r===null){if(!u.test(l))return t;const p=new RegExp(`\\s+${nr(c)}=(["'])[^"']*\\1`),O=l.replace(p,"");return t.replace(l,O)}const h=F8(r);if(u.test(l)){const p=l.replace(u,`${c}="${h}"`);return t.replace(l,p)}else{const p=l+` ${c}="${h}"`;return t.replace(l,p)}}function yP(t,e,n){const i=new RegExp(`(<([a-z0-9-]+)[^>]*\\bid=(["'])${nr(e)}\\3[^>]*>)`,"i").exec(t);if(!i||i.index==null)return t;const a=i[1],l=i[2],c=i.index+a.length,u=v7(t,l,c);return u<0?t:`${t.slice(0,c)}${n}${t.slice(u)}`}function v7(t,e,n){const r=new RegExp(`</?${nr(e)}\\b[^>]*>`,"gi");r.lastIndex=n;let i=1,a;for(;(a=r.exec(t))!==null;){const l=a[0];if(l.startsWith("</")){if(i-=1,i===0)return a.index;continue}l.endsWith("/>")||(i+=1)}return-1}const bP=new Set(["loop","muted","autoplay","playsinline","controls","default","defer","disabled","hidden","nomodule","open","readonly","required","reversed","selected"]);function S7(t,e,n,r){if(!e)return t;if(bP.has(n)){const u=nr(n),h=new RegExp(`(?:^|\\s)${u}(?:\\s|=|$)`).test(e);if(r===null||r===""||r==="false"){if(!h)return t;const O=new RegExp(`\\s+${u}(?:=(["'])[^"']*\\1)?`),x=e.replace(O,"");return t.replace(e,x)}if(h)return t;const p=e+` ${n}`;return t.replace(e,p)}const a=new RegExp(`\\b${nr(n)}=(["'])([^"']*)\\1`);if(r===null){if(!a.test(e))return t;const u=new RegExp(`\\s+${nr(n)}=(["'])[^"']*\\1`),h=e.replace(u,"");return t.replace(e,h)}const l=F8(r);if(a.test(e)){const u=e.replace(a,`${n}="${l}"`);return t.replace(e,u)}const c=e+` ${n}="${l}"`;return t.replace(e,c)}function vP(t,e,n,r){const a=new RegExp(`(<[^>]*\\bid=(["'])${nr(e)}\\2[^>]*)>`,"i").exec(t);return a?S7(t,a[1],n,r):t}function SP(t,e,n,r){const i=Os(t,e);if(!i)return t;const a=S7(i.tag,i.tag,n,r);return lu(t,i,a)}function wP(t,e,n){const r=Os(t,e);if(!r)return t;const i=/^<([a-z0-9-]+)/i.exec(r.tag),a=i==null?void 0:i[1];if(!a)return t;const l=v7(t,a,r.end+1);return l<0?t:`${t.slice(0,r.end+1)}${n}${t.slice(l)}`}function kP(t,e,n){switch(n.type){case"inline-style":return hP(t,e,n.property,n.value);case"attribute":return xP(t,e,n.property,n.value);case"html-attribute":return vP(t,e,n.property,n.value);case"text-content":return n.value!==null?yP(t,e,n.value):t;default:return t}}function Hc(t,e,n){if(e.id){const r=kP(t,e.id,n);if(r!==t||!e.selector)return r}switch(n.type){case"inline-style":return mP(t,e,n.property,n.value);case"attribute":return OP(t,e,n.property,n.value);case"html-attribute":return SP(t,e,n.property,n.value);case"text-content":return n.value!==null?wP(t,e,n.value):t;default:return t}}async function xs({label:t,kind:e,coalesceKey:n,files:r,readFile:i,writeFile:a,recordEdit:l}){const c={};for(const[p,O]of Object.entries(r)){const x=await i(p);x!==O&&(c[p]={before:x,after:O})}const u=Object.keys(c);if(u.length===0)return[];const h=[];try{for(const p of u)await a(p,c[p].after),h.push(p);await l({label:t,kind:e,coalesceKey:n,files:c})}catch(p){try{for(const O of h.reverse())await a(O,c[O].before)}catch(O){throw new AggregateError([p,O],"Failed to save project files and rollback did not complete")}throw p}return u}function B8(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 Z5(t,e,n){try{const r=t==null?void 0:t.contentDocument;if(!r)return;const i=e.domId?r.getElementById(e.domId):e.selector?r.querySelectorAll(e.selector)[e.selectorIndex??0]??null:null;if(!i)return;for(const[a,l]of n)i.setAttribute(a,l)}catch{}}function AP(t,e,n,r){if(r.playbackStart!=null)return{attrName:n.playbackStartAttr==="playback-start"?"playback-start":"media-start",value:r.playbackStart};const i=r.start-n.start;if(i===0)return null;const a=Q5(t,e,"playback-start")??Q5(t,e,"media-start"),l=a!=null?parseFloat(a):void 0;return l==null||!Number.isFinite(l)?null:{attrName:n.playbackStartAttr==="playback-start"?"playback-start":"media-start",value:Math.max(0,l+i*Math.max(n.playbackRate??1,.1))}}async function MP(t){const e=t.element.sourceFile||t.activeCompPath||"index.html",n=await Ao(t.projectId,e),r=B8(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 xs({projectId:t.projectId,label:t.label,kind:"timeline",files:{[e]:i},readFile:async()=>n,writeFile:t.writeProjectFile,recordEdit:t.recordEdit}),t.domEditSaveTimestampRef.current=Date.now()}async function Ao(t,e){if(e.includes("\0")||e.includes(".."))throw new Error(`Unsafe path: ${e}`);const n=await fetch(`/api/projects/${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}const zf=.03;function wu(t){return!t.timelineLocked&&t.timingSource!=="implicit"&&!t.compositionSrc&&!!t.duration&&Number.isFinite(t.duration)}function CP({element:t,color:e}){const n=oe(r=>r.lintFindingsByElement.get(t.key??t.id));return m.jsxs("span",{className:"flex items-center gap-1 truncate text-[10px] font-medium leading-none",style:{color:e},children:[t.label||t.id||t.tag,n&&n.count>0&&m.jsx("span",{className:"flex-shrink-0 w-1.5 h-1.5 rounded-full bg-amber-400",title:n.messages.join(`
|
|
68
|
+
`)})]})}const TP=d.memo(function({major:e,minor:n,pps:r,trackContentWidth:i,totalH:a,effectiveDuration:l,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:p,displayTrackOrder:O,trackOrder:x,tracks:y,trackStyles:b,selectedElementId:S,hoveredClip:k,draggedClip:A,resizingClip:C,blockedClipRef:T,suppressClickRef:j,scrollRef:M,renderClipContent:E,renderClipOverlay:$,playheadRef:N,onResizeElement:D,onMoveElement:z,onDrillDown:B,onSelectElement:X,setHoveredClip:U,setShowPopover:I,setRangeSelection:K,setResizingClip:Z,setDraggedClip:F,setSelectedElementId:_,syncClipDragAutoScroll:q,shiftClickClipRef:G,getPreviewElement:R,getTrackStyle:P,keyframeCache:L,selectedKeyframes:V,currentTime:W,onClickKeyframe:ee,onShiftClickKeyframe:ue,onDragKeyframe:ae,onContextMenuKeyframe:Y,onContextMenuClip:re,onToggleKeyframeAtPlayhead:he,onRazorSplit:xe,onRazorSplitAll:ke}){const be=(A==null?void 0:A.element)??null,Se=(A==null?void 0:A.started)===!0&&be?Sj({element:be,draggedElementId:be.key??be.id,previewStart:A.previewStart,previewTrack:A.previewTrack}):null,Ve=(A==null?void 0:A.started)===!0&&Se&&M.current?{left:A.pointerClientX-M.current.getBoundingClientRect().left+M.current.scrollLeft-A.pointerOffsetX,top:A.pointerClientY-M.current.getBoundingClientRect().top+M.current.scrollTop-A.pointerOffsetY}:null,Te=(Ze,Xe)=>m.jsxs(m.Fragment,{children:[$==null?void 0:$(Ze),m.jsx("div",{className:E?"absolute inset-0 overflow-hidden":"flex items-center overflow-hidden flex-1 min-w-0 px-3 gap-2",children:(E==null?void 0:E(Ze,Xe))??m.jsx(CP,{element:Ze,color:Xe.label})})]});return m.jsxs("div",{className:"relative",style:{height:a,width:dn+i},children:[m.jsx(tP,{major:e,minor:n,pps:r,trackContentWidth:i,totalH:a,effectiveDuration:l,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:p}),O.map(Ze=>{var Ot;const Xe=((Ot=y.find(([He])=>He===Ze))==null?void 0:Ot[1])??[],ze=b.get(Ze)??P(""),et=(A==null?void 0:A.started)===!0&&!x.includes(Ze)&&Xe.length===0;return m.jsxs("div",{className:"relative flex",style:{height:mo,background:p.rowBackground,borderBottom:`1px solid ${p.rowBorder}`},children:[m.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:dn,background:p.gutterBackground,borderRight:`1px solid ${p.gutterBorder}`},children:m.jsx("div",{className:"flex items-center justify-center",style:{width:18,height:18,borderRadius:6,backgroundColor:ze.iconBackground,border:`1px solid ${p.gutterBorder}`,color:"#fff"},children:ze.icon})}),m.jsxs("div",{style:{width:i},className:"relative",children:[et&&m.jsx("div",{className:"absolute inset-0 flex items-center",style:{paddingLeft:16,color:ze.label,fontSize:11,letterSpacing:"0.06em",textTransform:"uppercase",opacity:.5},children:"New track"}),Xe.map((He,ct)=>{const yt=P(He.tag),Oe=He.key??He.id,Ge=y5(He),Re=S===Oe,qe=!!He.compositionSrc,Ie=`${Oe}-${ct}`;if((A==null?void 0:A.started)===!0&&((be==null?void 0:be.key)??(be==null?void 0:be.id))===Oe)return null;const ut=R(He);return m.jsxs($5,{onContextMenu:Ae=>{Ae.preventDefault(),re==null||re(Ae,He)},el:ut,pps:r,clipY:Tp,isSelected:Re,isHovered:k===Ie,isDragging:!1,hasCustomContent:!!E,capabilities:Ge,theme:p,trackStyle:yt,isComposition:qe,onHoverStart:()=>U(Ie),onHoverEnd:()=>U(null),onResizeStart:(Ae,Be)=>{Be.button!==0||Be.shiftKey||!D||Ae==="start"&&!Ge.canTrimStart||Ae==="end"&&!Ge.canTrimEnd||(Be.stopPropagation(),T.current=null,I(!1),K(null),Z({element:He,edge:Ae,originClientX:Be.clientX,previewStart:He.start,previewDuration:He.duration,previewPlaybackStart:He.playbackStart,started:!1}))},onPointerDown:Ae=>{var gn,at;if(Ae.button!==0||oe.getState().activeTool==="razor")return;if(Ae.shiftKey){G.current={element:He,anchorX:Ae.clientX,anchorY:Ae.clientY};return}const lt=Ae.currentTarget.getBoundingClientRect(),ot=mj({width:lt.width,offsetX:Ae.clientX-lt.left,handleWidth:wj,capabilities:Ge});if(ot&&(ot==="move"&&z||ot!=="move"&&D)){T.current={element:He,intent:ot,originClientX:Ae.clientX,originClientY:Ae.clientY,started:!1};return}!z||!Ge.canMove||(T.current=null,I(!1),K(null),F({element:He,originClientX:Ae.clientX,originClientY:Ae.clientY,originScrollLeft:((gn=M.current)==null?void 0:gn.scrollLeft)??0,originScrollTop:((at=M.current)==null?void 0:at.scrollTop)??0,pointerClientX:Ae.clientX,pointerClientY:Ae.clientY,pointerOffsetX:Ae.clientX-lt.left,pointerOffsetY:Ae.clientY-lt.top,previewStart:He.start,previewTrack:He.track,started:!1}),q(Ae.clientX,Ae.clientY))},onClick:Ae=>{if(Ae.stopPropagation(),j.current)return;const{activeTool:Be}=oe.getState();if(Be==="razor"&&xe){const ot=Ae.currentTarget.getBoundingClientRect(),gn=Ae.clientX-ot.left,at=ut.start+gn/r,Le=Math.max(ut.start+zf,Math.min(ut.start+ut.duration-zf,at));Ae.shiftKey&&ke?ke(Le):xe(He,Le);return}const lt=Re?null:He;_(lt?Oe:null),X==null||X(lt)},onDoubleClick:Ae=>{Ae.stopPropagation(),!j.current&&qe&&B&&B(He)},children:[Te(ut,yt),mi&&(L==null?void 0:L.get(Oe))&&m.jsx(eP,{keyframesData:L.get(Oe),clipWidthPx:Math.max(ut.duration*r,4),clipHeightPx:mo-2*Tp,accentColor:yt.accent,isSelected:Re,currentPercentage:ut.duration>0?(W-ut.start)/ut.duration*100:0,elementId:Oe,selectedKeyframes:V,onClickKeyframe:Ae=>ee==null?void 0:ee(ut,Ae),onShiftClickKeyframe:ue,onDragKeyframe:(Ae,Be)=>ae==null?void 0:ae(ut,Ae,Be),onContextMenuKeyframe:Y})]},Ie)})]})]},Ze)}),Se&&Ve&&m.jsx("div",{className:"absolute pointer-events-none",style:{top:Ve.top,left:Ve.left,width:Math.max(Se.duration*r,4),height:mo-Tp*2,zIndex:40},children:m.jsx($5,{el:{...Se,start:0},pps:r,clipY:0,isSelected:S===(Se.key??Se.id),isHovered:!1,isDragging:!0,hasCustomContent:!!E,capabilities:y5(Se),theme:p,trackStyle:P(Se.tag),isComposition:!!Se.compositionSrc,onHoverStart:()=>{},onHoverEnd:()=>{},onResizeStart:()=>{},onClick:()=>{},onDoubleClick:()=>{},children:Te(Se,P(Se.tag))})}),h&&m.jsx("div",{className:"absolute pointer-events-none",style:{left:dn+Math.min(h.start,h.end)*r,width:Math.abs(h.end-h.start)*r,top:ko,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}}),m.jsx("div",{ref:N,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${dn}px`,zIndex:100},children:m.jsx(nP,{})})]})}),mg=".hyperframes/studio-motion.json",Qp="studio-motion",ys="data-hf-studio-motion",Mo="data-hf-studio-motion-original-transform",ku="data-hf-studio-motion-original-opacity",Au="data-hf-studio-motion-original-visibility",$1=["none","power1.in","power1.out","power1.inOut","power2.in","power2.out","power2.inOut","power3.in","power3.out","power3.inOut","power4.in","power4.out","power4.inOut","sine.in","sine.out","sine.inOut","expo.in","expo.out","expo.inOut","circ.in","circ.out","circ.inOut","back.in(1.7)","back.out(1.7)","back.inOut(1.7)","elastic.out(1, 0.45)","bounce.out"],Jc={x1:.215,y1:.61,x2:.355,y2:1},EP={none:{x1:0,y1:0,x2:1,y2:1},"power1.in":{x1:.55,y1:.085,x2:.68,y2:.53},"power1.out":{x1:.25,y1:.46,x2:.45,y2:.94},"power1.inOut":{x1:.455,y1:.03,x2:.515,y2:.955},"power2.in":{x1:.55,y1:.055,x2:.675,y2:.19},"power2.out":{x1:.215,y1:.61,x2:.355,y2:1},"power2.inOut":{x1:.645,y1:.045,x2:.355,y2:1},"power3.in":{x1:.895,y1:.03,x2:.685,y2:.22},"power3.out":{x1:.165,y1:.84,x2:.44,y2:1},"power3.inOut":{x1:.77,y1:0,x2:.175,y2:1},"power4.in":{x1:.755,y1:.05,x2:.855,y2:.06},"power4.out":{x1:.23,y1:1,x2:.32,y2:1},"power4.inOut":{x1:.86,y1:0,x2:.07,y2:1},"sine.in":{x1:.47,y1:0,x2:.745,y2:.715},"sine.out":{x1:.39,y1:.575,x2:.565,y2:1},"sine.inOut":{x1:.445,y1:.05,x2:.55,y2:.95},"expo.in":{x1:.95,y1:.05,x2:.795,y2:.035},"expo.out":{x1:.19,y1:1,x2:.22,y2:1},"expo.inOut":{x1:1,y1:0,x2:0,y2:1},"circ.in":{x1:.6,y1:.04,x2:.98,y2:.335},"circ.out":{x1:.075,y1:.82,x2:.165,y2:1},"circ.inOut":{x1:.785,y1:.135,x2:.15,y2:.86},"back.in(1.7)":{x1:.6,y1:-.28,x2:.735,y2:.045},"back.out(1.7)":{x1:.175,y1:.885,x2:.32,y2:1.275},"back.inOut(1.7)":{x1:.68,y1:-.55,x2:.265,y2:1.55},"elastic.out(1, 0.45)":{x1:.16,y1:1.32,x2:.28,y2:.86},"bounce.out":{x1:.34,y1:1.56,x2:.64,y2:.74}},$P=/^M\s*0\s*,\s*0\s*C\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s+1\s*,\s*1\s*$/i;function N5(t,e){return Number.isFinite(t)&&t>0?t:e}function jP(t,e){return Number.isFinite(t)&&t>=0?t:e}function PP(t){return t.trim()||"none"}function eu(t){return Math.round(t*1e3)/1e3}function j1(t,e,n,r){return Number.isFinite(t)?Math.min(n,Math.max(e,t)):r}function P1(t){const e=eu(t);return Object.is(e,-0)?"0":`${e}`}function pg(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Y8(t){return{x1:eu(j1(t.x1??Jc.x1,0,1,.215)),y1:eu(j1(t.y1??Jc.y1,-.6,1.6,.61)),x2:eu(j1(t.x2??Jc.x2,0,1,.355)),y2:eu(j1(t.y2??Jc.y2,-.6,1.6,1))}}function R5(t){if(!t)return null;const e=t.trim().match($P);if(!e)return null;const n={x1:Number.parseFloat(e[1]??""),y1:Number.parseFloat(e[2]??""),x2:Number.parseFloat(e[3]??""),y2:Number.parseFloat(e[4]??"")};return Object.values(n).every(Number.isFinite)?Y8(n):null}function w7(t){const e=Y8(t);return`M0,0 C${P1(e.x1)},${P1(e.y1)} ${P1(e.x2)},${P1(e.y2)} 1,1`}function Mu(t){return EP[t]??Jc}function QP(t,e){const n=jP(e.start,0),r=N5(e.duration,.6),i=N5(e.distance,32),a=PP(e.ease),l=e.direction??"up",c={start:n,duration:r,ease:a,customEase:e.customEase};if(t==="pop")return{...c,from:{scale:.88,autoAlpha:0},to:{scale:1,autoAlpha:1}};if(t==="slide"){const u=l==="right"?-i:l==="left"?i:0,h=l==="down"?-i:l==="up"?i:0;return{...c,from:{x:u,y:h,autoAlpha:0},to:{x:0,y:0,autoAlpha:1}}}return{...c,from:{y:l==="down"?-i:i,autoAlpha:0},to:{y:0,autoAlpha:1}}}function V5(t){if(!t||typeof t!="object")return null;const e=t,n={};for(const r of["x","y","scale","rotation","opacity","autoAlpha"]){const i=pg(e[r]);i!=null&&(n[r]=i)}return Object.keys(n).length>0?n:null}function ZP(t){if(!t||typeof t!="object")return;const e=t,n=typeof e.id=="string"?e.id.trim():"",r=typeof e.data=="string"?e.data.trim():"";if(!(!n||!r))return{id:n,data:r}}function k7(t){const e=t.getAttribute(ys);if(!e||e==="true")return null;try{const n=JSON.parse(e);if(!n||typeof n!="object")return null;const r=n,i=pg(r.start),a=pg(r.duration);if(i==null||a==null||i<0||a<=0)return null;const l=typeof r.ease=="string"&&r.ease.trim()?r.ease.trim():"none",c=V5(r.from),u=V5(r.to);return!c||!u?null:{start:i,duration:a,ease:l,customEase:ZP(r.customEase),from:c,to:u}}catch{return null}}function NP(t,e){t.getAttribute(Mo)||(t.setAttribute(Mo,t.style.transform),t.setAttribute(ku,t.style.opacity),t.setAttribute(Au,t.style.visibility));const n={start:e.start,duration:e.duration,ease:e.ease,from:e.from,to:e.to};e.customEase&&(n.customEase=e.customEase),t.setAttribute(ys,JSON.stringify(n))}function RP(t,e){var n;t.hasAttribute(ys)&&((n=e==null?void 0:e.set)==null||n.call(e,t,{clearProps:"transform,opacity,visibility"}),t.style.transform=t.getAttribute(Mo)??"",t.style.opacity=t.getAttribute(ku)??"",t.style.visibility=t.getAttribute(Au)??"",t.removeAttribute(ys),t.removeAttribute(Mo),t.removeAttribute(ku),t.removeAttribute(Au))}function VP(t,e){var n,r,i,a;try{const l=(r=(n=t.__player)==null?void 0:n.getTime)==null?void 0:r.call(n);if(typeof l=="number"&&Number.isFinite(l))return Math.max(0,l)}catch{}try{const l=(a=(i=t.__timeline)==null?void 0:i.time)==null?void 0:a.call(i);if(typeof l=="number"&&Number.isFinite(l))return Math.max(0,l)}catch{}return 0}function gg(t,e){var h,p,O,x,y,b;const n=t.defaultView;if(!n)return 0;const r=n.gsap;n.__timelines=n.__timelines??{},(p=(h=n.__timelines[Qp])==null?void 0:h.kill)==null||p.call(h),delete n.__timelines[Qp];const i=(O=t.defaultView)==null?void 0:O.HTMLElement;if(!i)return 0;const a=[];for(const S of Array.from(t.querySelectorAll(`[${ys}]`))){if(!(S instanceof i))continue;const k=k7(S);k&&a.push({element:S,motion:k})}if(!(r!=null&&r.timeline)||a.length===0)return 0;const l=r.timeline({paused:!0,defaults:{overwrite:"auto"}});let c=0;for(const{element:S,motion:k}of a){if(!l.fromTo)continue;const A={...k.from},C=LP(n,k),T={...k.to,duration:k.duration,ease:C,overwrite:"auto",immediateRender:!1};l.fromTo(S,A,T,k.start),c+=1}if(c===0)return(x=l.kill)==null||x.call(l),0;n.__timelines[Qp]=l,(y=l.pause)==null||y.call(l);const u=VP(n);return l.totalTime?l.totalTime(u,!1):(b=l.time)==null||b.call(l,u),c}function LP(t,e){var i,a;const n=e.customEase;if(!n)return e.ease;const r=t.CustomEase;if(typeof(r==null?void 0:r.create)!="function")return e.ease;try{return(a=(i=t.gsap)==null?void 0:i.registerPlugin)==null||a.call(i,r),r.create(n.id,n.data),n.id}catch{return e.ease}}const _P={set:"Set",to:"Animate",from:"Animate In",fromTo:"From → To"},A7={set:"Instantly snap to these values — no transition",to:"Smoothly animate the element to these target values",from:"Element starts at these values and transitions to its normal state",fromTo:"Animate from one state to another"},ms={x:"Move X",y:"Move Y",width:"Width",height:"Height",rotation:"Rotate",opacity:"Opacity",scale:"Scale",scaleX:"Scale X",scaleY:"Scale Y",autoAlpha:"Visibility",visibility:"Visible",scaleX_alias:"Stretch X",filter:"Filter",clipPath:"Clip Path",color:"Color",backgroundColor:"Background",borderColor:"Border Color",borderRadius:"Radius",fontSize:"Font Size",letterSpacing:"Tracking",skewX:"Skew X",skewY:"Skew Y",innerText:"Counter Value"},M7={x:"px",y:"px",width:"px",height:"px",rotation:"°",opacity:"%",scale:"×",scaleX:"×",scaleY:"×",autoAlpha:"%",visibility:""},DP={x:"Move left/right (negative = left, positive = right)",y:"Move up/down (negative = up, positive = down)",opacity:"How visible (0 = invisible, 1 = fully visible)",scale:"Size multiplier (1 = normal, 2 = double, 0.5 = half)",scaleX:"Horizontal stretch (1 = normal)",scaleY:"Vertical stretch (1 = normal)",rotation:"Spin angle (360 = full rotation)",width:"Element width",height:"Element height",autoAlpha:"Like opacity but hides element completely at 0",visibility:"Show or hide the element",innerText:"End value for a number roll-up (the number it counts up/down to)"},sl={none:"Constant speed","power1.out":"Gentle slowdown","power2.out":"Smooth slowdown","power3.out":"Snappy slowdown","power4.out":"Sharp slowdown","power1.in":"Gentle speedup","power2.in":"Smooth speedup","power3.in":"Strong speedup","power4.in":"Sharp speedup","power1.inOut":"Gentle ease","power2.inOut":"Smooth ease","power3.inOut":"Strong ease","power4.inOut":"Sharp ease","back.out":"Overshoot & settle","back.in":"Pull back & go","back.inOut":"Pull & overshoot","elastic.out":"Springy bounce","elastic.in":"Wind up spring","elastic.inOut":"Full spring","bounce.out":"Drop & bounce","bounce.in":"Reverse bounce","bounce.inOut":"Double bounce","expo.out":"Very snappy stop","expo.in":"Very slow start","expo.inOut":"Dramatic ease","spring-gentle":"Gentle spring","spring-bouncy":"Bouncy spring","spring-stiff":"Stiff spring","spring-wobbly":"Wobbly spring","spring-heavy":"Heavy spring"},C7={none:[0,0,1,1],"power1.out":[0,0,.58,1],"power2.out":[.16,1,.3,1],"power3.out":[.08,.82,.17,1],"power4.out":[.06,.73,.09,1],"power1.in":[.42,0,1,1],"power2.in":[.55,.06,.68,.19],"power3.in":[.6,.04,.98,.34],"power4.in":[.7,0,.84,0],"power1.inOut":[.42,0,.58,1],"power2.inOut":[.45,.05,.55,.95],"power3.inOut":[.65,.05,.35,1],"power4.inOut":[.76,0,.24,1],"back.out":[.34,1.56,.64,1],"back.in":[.36,0,.66,-.56],"back.inOut":[.68,-.55,.27,1.55],"expo.out":[.16,1,.3,1],"expo.in":[.7,0,.84,0],"expo.inOut":[.87,0,.13,1]};function HP(t){var i;const e=t.match(/^custom\((.+)\)$/);if(!e)return Mu("power2.out");const r=(i=e[1].match(/[\d.]+/g))==null?void 0:i.map(Number);return!r||r.length<6?Mu("power2.out"):{x1:r[2],y1:r[3],x2:r[4],y2:r[5]}}const T7=new Set(["opacity","autoAlpha"]),E7={opacity:{min:0,max:1,step:.01},autoAlpha:{min:0,max:1,step:.01},scale:{min:-10,max:10,step:.01},scaleX:{min:-10,max:10,step:.01},scaleY:{min:-10,max:10,step:.01},rotation:{step:1},skewX:{min:-90,max:90,step:1},skewY:{min:-90,max:90,step:1},width:{min:0,step:1},height:{min:0,step:1},borderRadius:{min:0,step:1},x:{step:1},y:{step:1},fontSize:{min:1,step:1},letterSpacing:{step:.1},innerText:{step:1}};function L5(t,e){const n=E7[t];if(!n)return e;let r=e;return n.min!==void 0&&(r=Math.max(n.min,r)),n.max!==void 0&&(r=Math.min(n.max,r)),r}const XP=["to","from","fromTo","set"],zP={to:"Animate",from:"Animate In",fromTo:"From → To",set:"Set Instantly"};function $7(t){const e=d.useRef(null),n=d.useCallback(r=>{var i;r instanceof KeyboardEvent&&r.key!=="Escape"||r instanceof MouseEvent&&((i=e.current)!=null&&i.contains(r.target))||t()},[t]);return d.useEffect(()=>(document.addEventListener("mousedown",n),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",n)}),[n]),e}const FP=["none","power1.out","power2.out","power3.out","power1.in","power2.in","power1.inOut","power2.inOut","back.out","elastic.out","bounce.out","expo.out"],BP=d.memo(function({state:e,onClose:n,onDelete:r,onDeleteAll:i,onChangeEase:a,onCopyProperties:l}){const c=$7(n),u=d.useRef(null),h=Math.min(e.x,window.innerWidth-200),p=Math.min(e.y,window.innerHeight-300),O=e.currentEase?sl[e.currentEase]??e.currentEase:"Default";return m.jsxs("div",{ref:c,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:h,top:p},children:[m.jsxs("div",{className:"relative group",children:[m.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",children:[m.jsxs("span",{children:["Ease: ",m.jsx("span",{className:"text-neutral-500",children:O})]}),m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"text-neutral-500 ml-2",children:m.jsx("path",{d:"M3 1l4 3-4 3",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})})]}),m.jsx("div",{ref:u,className:"absolute left-full top-0 ml-0.5 hidden group-hover:block bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[160px] max-h-[300px] overflow-y-auto",children:FP.map(x=>m.jsxs("button",{type:"button",className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs hover:bg-neutral-800 cursor-pointer text-left ${x===e.currentEase?"text-white font-medium":"text-neutral-300"}`,onClick:()=>{a(e.elementId,e.percentage,x),n()},children:[x===e.currentEase&&m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"text-green-400 flex-shrink-0",children:m.jsx("path",{d:"M1 4l2 2 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})}),m.jsx("span",{className:x===e.currentEase?"":"ml-[16px]",children:sl[x]??x})]},x))})]}),m.jsx("div",{className:"my-1 border-t border-neutral-700/60"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{r(e.elementId,e.percentage),n()},children:"Delete Keyframe"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{i(e.elementId),n()},children:"Delete All Keyframes"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{l(e.elementId,e.percentage),n()},children:"Copy Properties"})]})});function YP({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,onMoveElement:i,onResizeElement:a,onBlockedEditAttempt:l,setShowPopover:c,setRangeSelectionRef:u}){const h=oe(U=>U.updateElement),[p,O]=d.useState(null),x=d.useRef(null);x.current=p;const[y,b]=d.useState(null),S=d.useRef(null);S.current=y;const k=d.useRef(null),A=d.useRef(!1),C=d.useRef(i);C.current=i;const T=d.useRef(a);T.current=a;const j=d.useRef(0),M=d.useRef(null),E=d.useCallback((U,I,K)=>{const Z=t.current,F=uj({start:U.element.start,track:U.element.track,duration:U.element.duration,originClientX:U.originClientX,originClientY:U.originClientY,originScrollLeft:U.originScrollLeft,originScrollTop:U.originScrollTop,currentScrollLeft:(Z==null?void 0:Z.scrollLeft)??U.originScrollLeft,currentScrollTop:(Z==null?void 0:Z.scrollTop)??U.originScrollTop,pixelsPerSecond:e.current,trackHeight:mo,maxStart:Math.max(0,n.current-U.element.duration),trackOrder:r.current},I,K);return{...U,started:!0,pointerClientX:I,pointerClientY:K,previewStart:F.start,previewTrack:F.track}},[t,e,n,r]),$=d.useCallback(()=>{M.current=null,j.current&&(cancelAnimationFrame(j.current),j.current=0)},[]),N=d.useCallback(()=>{j.current=0;const U=x.current,I=M.current,K=t.current;if(!U||!I||!K)return;const Z=K.getBoundingClientRect(),F=x5(Z,I.clientX,I.clientY);if(F.x===0&&F.y===0)return;const _=Math.max(0,K.scrollWidth-K.clientWidth),q=Math.max(0,K.scrollHeight-K.clientHeight),G=Math.max(0,Math.min(_,K.scrollLeft+F.x)),R=Math.max(0,Math.min(q,K.scrollTop+F.y));G===K.scrollLeft&&R===K.scrollTop||(K.scrollLeft=G,K.scrollTop=R,O(P=>P&&E(P,I.clientX,I.clientY)),j.current=requestAnimationFrame(N))},[t,E]),D=d.useCallback((U,I)=>{M.current={clientX:U,clientY:I};const K=t.current;if(!K)return;const Z=K.getBoundingClientRect(),F=x5(Z,U,I);if(F.x===0&&F.y===0){j.current&&(cancelAnimationFrame(j.current),j.current=0);return}j.current||(j.current=requestAnimationFrame(N))},[t,N]),z=d.useRef(E);z.current=E;const B=d.useRef(D);B.current=D;const X=d.useRef($);return X.current=$,Wt(()=>{const U=()=>{requestAnimationFrame(()=>{A.current=!1})},I=Z=>{var R,P,L;const F=x.current,_=S.current,q=k.current;if(_){const V=Math.abs(Z.clientX-_.originClientX);if(!_.started&&V<2)return;c(!1),(R=u.current)==null||R.call(u,null);const W=_.element.sourceDuration!=null?Math.max(0,(_.element.sourceDuration-(_.element.playbackStart??0))/Math.max(_.element.playbackRate??1,.1)):Number.POSITIVE_INFINITY,ee=_.element.tag.toLowerCase(),ue=ee==="audio"||ee==="video",ae=fj({start:_.element.start,duration:_.element.duration,originClientX:_.originClientX,pixelsPerSecond:e.current,minStart:0,maxEnd:Math.min(n.current,_.element.start+W),playbackStart:_.edge==="start"&&ue?_.element.playbackStart??0:_.element.playbackStart,playbackRate:_.element.playbackRate},_.edge,Z.clientX);b(Y=>Y&&{...Y,started:!0,previewStart:ae.start,previewDuration:ae.duration,previewPlaybackStart:ae.playbackStart});return}if(q){const V=Math.hypot(Z.clientX-q.originClientX,Z.clientY-q.originClientY),W=q.intent==="move"?4:2;if(!q.started&&V<W)return;q.started||(q.started=!0,k.current=q,A.current=!0,c(!1),(P=u.current)==null||P.call(u,null),l==null||l(q.element,q.intent));return}if(!F)return;const G=Math.hypot(Z.clientX-F.originClientX,Z.clientY-F.originClientY);!F.started&&G<4||(c(!1),(L=u.current)==null||L.call(u,null),O(V=>V&&z.current(V,Z.clientX,Z.clientY)),B.current(Z.clientX,Z.clientY))},K=()=>{var G,R;X.current();const Z=S.current;if(Z){if(S.current=null,b(null),!Z.started||(A.current=!0,U(),!(Z.previewStart!==Z.element.start||Z.previewDuration!==Z.element.duration||Z.previewPlaybackStart!==Z.element.playbackStart)))return;h(Z.element.key??Z.element.id,{start:Z.previewStart,duration:Z.previewDuration,playbackStart:Z.previewPlaybackStart}),Promise.resolve((G=T.current)==null?void 0:G.call(T,Z.element,{start:Z.previewStart,duration:Z.previewDuration,playbackStart:Z.previewPlaybackStart})).catch(L=>{h(Z.element.key??Z.element.id,{start:Z.element.start,duration:Z.element.duration,playbackStart:Z.element.playbackStart}),console.error("[Timeline] Failed to persist clip resize",L)});return}const F=k.current;if(F){if(k.current=null,!F.started)return;U();return}const _=x.current;!_||(x.current=null,O(null),!_.started)||(A.current=!0,U(),!(_.previewStart!==_.element.start||_.previewTrack!==_.element.track))||(h(_.element.key??_.element.id,{start:_.previewStart,track:_.previewTrack}),Promise.resolve((R=C.current)==null?void 0:R.call(C,_.element,{start:_.previewStart,track:_.previewTrack})).catch(P=>{h(_.element.key??_.element.id,{start:_.element.start,track:_.element.track}),console.error("[Timeline] Failed to persist clip move",P)}))};return window.addEventListener("pointermove",I),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{X.current(),window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K)}}),{draggedClip:p,setDraggedClip:O,resizingClip:y,setResizingClip:b,blockedClipRef:k,suppressClickRef:A,syncClipDragAutoScroll:D,stopClipDragAutoScroll:$}}const IP=d.memo(function({x:e,y:n,element:r,currentTime:i,onClose:a,onSplit:l,onDelete:c}){const u=$7(a),h=Math.min(e,window.innerWidth-200),p=Math.min(n,window.innerHeight-200),O=wu(r)&&["video","audio","img"].includes(r.tag),x=O&&i>r.start&&i<r.start+r.duration,y=O?x?`Split at ${i.toFixed(2)}s`:"Split (move playhead inside clip)":null;return m.jsxs("div",{ref:u,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:h,top:p},children:[y&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left ${x?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!x,onClick:()=>{x&&(l(r,i),a())},children:[m.jsx("span",{children:y}),m.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"S"})]}),m.jsx("div",{className:"my-1 border-t border-neutral-700/60"})]}),m.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",onClick:()=>{c(r),a()},children:[m.jsx("span",{children:"Delete"}),m.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]})}),qP=d.memo(function({onSeek:e,onDrillDown:n,renderClipContent:r,renderClipOverlay:i,onFileDrop:a,onAssetDrop:l,onBlockDrop:c,onDeleteElement:u,onMoveElement:h,onResizeElement:p,onBlockedEditAttempt:O,onSplitElement:x,onRazorSplit:y,onRazorSplitAll:b,onSelectElement:S,onDeleteKeyframe:k,onDeleteAllKeyframes:A,onChangeKeyframeEase:C,onMoveKeyframe:T,onToggleKeyframeAtPlayhead:j,theme:M}={}){const E=d.useMemo(()=>({...m7,...M}),[M]),$=oe(ye=>ye.elements),N=oe(ye=>ye.duration),D=oe(ye=>ye.timelineReady),z=oe(ye=>ye.selectedElementId),B=oe(ye=>ye.setSelectedElementId),X=oe(ye=>ye.currentTime),{zoomMode:U,manualZoomPercent:I,setZoomMode:K,setManualZoomPercent:Z}=p7(),F=d.useRef(null),_=d.useRef(null),q=d.useRef(null),G=oe(ye=>ye.activeTool),[R,P]=d.useState(null),L=d.useRef(!1),[V,W]=d.useState(!1),[ee,ue]=d.useState(null);Wt(()=>{const ye=rt=>rt.key==="Shift"&&W(!0),_e=rt=>rt.key==="Shift"&&W(!1),ft=()=>W(!1);return window.addEventListener("keydown",ye),window.addEventListener("keyup",_e),window.addEventListener("blur",ft),()=>{window.removeEventListener("keydown",ye),window.removeEventListener("keyup",_e),window.removeEventListener("blur",ft)}});const[ae,Y]=d.useState(!1),[re,he]=d.useState(!0),[xe,ke]=d.useState(null),[be,Se]=d.useState(null),[Ve,Te]=d.useState(0),Ze=d.useRef(null),Xe=d.useRef(0),ze=d.useCallback(()=>{const ye=q.current;he(ye?Pj(ye.scrollHeight,ye.clientHeight):!0)},[]),et=d.useCallback(()=>{Xe.current&&cancelAnimationFrame(Xe.current),Xe.current=requestAnimationFrame(()=>{Xe.current=0,ze()})},[ze]),Ot=d.useCallback(ye=>{Ze.current&&(Ze.current.disconnect(),Ze.current=null),_.current=ye,ye&&(Te(ye.clientWidth),et(),Ze.current=new ResizeObserver(([_e])=>{Te(_e.contentRect.width),et()}),Ze.current.observe(ye))},[et]);Wt(()=>()=>{var ye;(ye=Ze.current)==null||ye.disconnect(),Xe.current&&cancelAnimationFrame(Xe.current)});const He=d.useMemo(()=>{const ye=Number.isFinite(N)?N:0;if($.length===0)return ye;const _e=Math.max(...$.map(rt=>rt.start+rt.duration)),ft=Math.max(ye,_e);return Number.isFinite(ft)?ft:ye},[$,N]),ct=d.useMemo(()=>{const ye=new Map;for(const _e of $){const ft=ye.get(_e.track)??[];ft.push(_e),ye.set(_e.track,ft)}return Array.from(ye.entries()).sort(([_e],[ft])=>_e-ft)},[$]),yt=d.useMemo(()=>{var _e;const ye=new Map;for(const[ft,rt]of ct)ye.set(ft,T5(((_e=rt[0])==null?void 0:_e.tag)??""));return ye},[ct]),Oe=d.useMemo(()=>ct.map(([ye])=>ye),[ct]),Ge=d.useRef(Oe);Ge.current=Oe;const Re=d.useRef(100),qe=d.useRef(He);qe.current=He;const Ie=d.useRef(null),{draggedClip:$e,setDraggedClip:ut,resizingClip:Ae,setResizingClip:Be,blockedClipRef:lt,suppressClickRef:ot,syncClipDragAutoScroll:gn}=YP({scrollRef:q,ppsRef:Re,durationRef:qe,trackOrderRef:Ge,onMoveElement:h,onResizeElement:p,onBlockedEditAttempt:O,setShowPopover:Y,setRangeSelectionRef:Ie}),at=d.useMemo(()=>!($e!=null&&$e.started)||Oe.length===0||Oe.includes($e.previewTrack)?Oe:[...Oe,$e.previewTrack].sort((ye,_e)=>ye-_e),[$e,Oe]),Le=jj(at.length),Ue=oe(ye=>ye.keyframeCache),Mt=oe(ye=>ye.selectedKeyframes),We=oe(ye=>ye.toggleSelectedKeyframe),bt=d.useMemo(()=>$.find(ye=>(ye.key??ye.id)===z)??null,[$,z]),Et=d.useRef(bt);Et.current=bt;const It=Ve>dn&&He>0?(Ve-dn-2)/He:100,qt=Dj(It,U,I);Re.current=qt;const Tn=Math.max(0,He*qt),Zn=d.useRef(U);Zn.current=U;const Fn=d.useRef(I);Fn.current=I;const ni=d.useRef(It);ni.current=It;const{seekFromX:ri,autoScrollDuringDrag:ii,dragScrollRaf:Pe}=Xj({playheadRef:F,scrollRef:q,ppsRef:Re,durationRef:qe,isDragging:L,currentTime:X,zoomMode:U,zoomModeRef:Zn,manualZoomPercentRef:Fn,fitPps:It,fitPpsRef:ni,effectiveDuration:He,pps:qt,timelineReady:D,elementsLength:$.length,setZoomMode:K,setManualZoomPercent:Z,onSeek:e}),{rangeSelection:jt,setRangeSelection:Nt,shiftClickClipRef:nn,handlePointerDown:Jn,handlePointerMove:Sn,handlePointerUp:Rt}=Zj({scrollRef:q,ppsRef:Re,effectiveDuration:He,pps:qt,onSeek:e,seekFromX:ri,autoScrollDuringDrag:ii,dragScrollRaf:Pe,isDragging:L,setShowPopover:Y});Ie.current=Nt;const ve=d.useRef(Et.current);d.useEffect(()=>{const ye=ve.current,_e=Et.current;ve.current=_e,ye&&!_e&&(Y(!1),Nt(null))});const{major:tt,minor:wn}=d.useMemo(()=>Cj(He,qt),[He,qt]),vr=tt.length>=2?Math.max(.25,tt[1]-tt[0]):He;d.useEffect(()=>{ze()},[ze,D,$.length,Le]);const Yi=d.useCallback(ye=>Ae&&(Ae.element.key??Ae.element.id)===(ye.key??ye.id)?{...ye,start:Ae.previewStart,duration:Ae.previewDuration,playbackStart:Ae.previewPlaybackStart}:ye,[Ae]),{isDragOver:Ii,setIsDragOver:wi,handleAssetDragOver:ai,handleAssetDrop:si}=Wj({scrollRef:q,ppsRef:Re,durationRef:qe,trackOrderRef:Ge,onFileDrop:a,onAssetDrop:l,onBlockDrop:c});return!D||$.length===0?m.jsx(Kj,{isDragOver:Ii,onFileDrop:!!a,onDragOver:ai,onDragLeave:()=>wi(!1),onDrop:si}):m.jsxs("div",{ref:Ot,"aria-label":"Timeline",className:`relative border-t select-none h-full overflow-hidden ${G==="razor"||V?"cursor-crosshair":"cursor-default"}`,onMouseMove:ye=>{if(G==="razor"&&q.current){const _e=q.current.getBoundingClientRect();ue(ye.clientX-_e.left+q.current.scrollLeft)}},onMouseLeave:()=>ue(null),style:{touchAction:"pan-x pan-y",background:E.shellBackground,borderColor:E.shellBorder},children:[m.jsxs("div",{ref:q,tabIndex:-1,className:`${U==="fit"?"overflow-x-hidden":"overflow-x-auto"} overflow-y-auto h-full outline-none`,onDragOver:ai,onDragLeave:()=>wi(!1),onDrop:si,onPointerDown:ye=>{if(G==="razor"&&ye.shiftKey&&ye.button===0&&q.current){const _e=q.current.getBoundingClientRect(),ft=ye.clientX-_e.left+q.current.scrollLeft-dn,rt=Math.max(0,ft/qt);b==null||b(rt);return}Jn(ye)},onPointerMove:Sn,onPointerUp:Rt,onLostPointerCapture:Rt,children:[m.jsx(TP,{major:tt,minor:wn,pps:qt,trackContentWidth:Tn,totalH:Le,effectiveDuration:He,majorTickInterval:vr,shiftHeld:V,rangeSelection:jt,theme:E,displayTrackOrder:at,trackOrder:Oe,tracks:ct,trackStyles:yt,selectedElementId:z,hoveredClip:R,draggedClip:$e,resizingClip:Ae,blockedClipRef:lt,suppressClickRef:ot,scrollRef:q,renderClipContent:r,renderClipOverlay:i,playheadRef:F,onResizeElement:p,onMoveElement:h,onDrillDown:n,onSelectElement:S,setHoveredClip:P,setShowPopover:Y,setRangeSelection:Nt,setResizingClip:Be,setDraggedClip:ut,setSelectedElementId:B,syncClipDragAutoScroll:gn,shiftClickClipRef:nn,getPreviewElement:Yi,getTrackStyle:T5,keyframeCache:Ue,selectedKeyframes:Mt,currentTime:X,onToggleKeyframeAtPlayhead:j,onClickKeyframe:(ye,_e)=>{oe.getState().clearSelectedKeyframes();const ft=ye.key??ye.id;B(ft),S==null||S(ye);const rt=ye.start+_e/100*ye.duration;e==null||e(rt)},onShiftClickKeyframe:(ye,_e)=>{We(`${ye}:${_e}`)},onDragKeyframe:(ye,_e,ft)=>{T==null||T(ye,_e,ft)},onContextMenuKeyframe:(ye,_e,ft)=>{const rt=$.find(Bn=>(Bn.key??Bn.id)===_e);if(rt){B(_e),S==null||S(rt);const Bn=rt.start+ft/100*rt.duration;e==null||e(Bn)}const Sr=Ue.get(_e),Za=Sr==null?void 0:Sr.keyframes.find(Bn=>Bn.percentage===ft);ke({x:ye.clientX,y:ye.clientY,elementId:_e,percentage:ft,currentEase:(Za==null?void 0:Za.ease)??(Sr==null?void 0:Sr.ease)})},onContextMenuClip:(ye,_e)=>{ye.preventDefault(),B(_e.key??_e.id),S==null||S(_e),Se({x:ye.clientX,y:ye.clientY,element:_e})},onRazorSplit:y,onRazorSplitAll:b}),G==="razor"&&ee!==null&&m.jsx("div",{className:"absolute top-0 bottom-0 pointer-events-none z-10",style:{left:ee,width:1,background:"rgba(239,68,68,0.7)"}})]}),re&&!ae&&!jt&&m.jsx("div",{className:"absolute bottom-2 right-3 pointer-events-none z-20",children:m.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:E.gutterBorder},children:[m.jsx("kbd",{className:"text-[9px] font-mono px-1 py-0.5 rounded",style:{color:E.textSecondary,background:"rgba(255,255,255,0.06)"},children:"Shift"}),m.jsx("span",{className:"text-[9px]",style:{color:E.textSecondary},children:"+ drag/click to edit range"})]})}),ae&&jt&&m.jsx(xj,{rangeStart:jt.start,rangeEnd:jt.end,anchorX:jt.anchorX,anchorY:jt.anchorY,onClose:()=>{Y(!1),Nt(null)}}),xe&&m.jsx(BP,{state:xe,onClose:()=>ke(null),onDelete:(ye,_e)=>k==null?void 0:k(ye,_e),onDeleteAll:ye=>A==null?void 0:A(ye),onChangeEase:(ye,_e,ft)=>C==null?void 0:C(ye,_e,ft),onCopyProperties:(ye,_e)=>{const ft=Ue.get(ye),rt=ft==null?void 0:ft.keyframes.find(Sr=>Sr.percentage===_e);rt&&navigator.clipboard.writeText(JSON.stringify(rt.properties,null,2))}}),be&&m.jsx(IP,{x:be.x,y:be.y,element:be.element,currentTime:X,onClose:()=>Se(null),onSplit:(ye,_e)=>x==null?void 0:x(ye,_e),onDelete:ye=>u==null?void 0:u(ye)})]})}),_5=66,D5=6,GP=d.memo(function({videoSrc:e,label:n,labelColor:r,duration:i=5}){const[a,l]=d.useState(0),[c,u]=d.useState(!1),[h,p]=d.useState([]),[O,x]=d.useState(16/9),y=d.useRef(null),b=d.useRef(null),S=d.useRef(!1),k=d.useCallback(T=>{var E,$,N;if((E=y.current)==null||E.disconnect(),($=b.current)==null||$.disconnect(),!T)return;const j=((N=T.parentElement)==null?void 0:N.clientWidth)||T.clientWidth;l(j),y.current=new IntersectionObserver(([D])=>{var z;D.isIntersecting&&(u(!0),(z=y.current)==null||z.disconnect())},{rootMargin:"200px"}),y.current.observe(T);const M=T.parentElement||T;b.current=new ResizeObserver(([D])=>{l(D.contentRect.width)}),b.current.observe(M)},[]);Wt(()=>()=>{var T,j;(T=y.current)==null||T.disconnect(),(j=b.current)==null||j.disconnect()}),d.useEffect(()=>{if(!c||S.current)return;S.current=!0;const T=document.createElement("video");T.crossOrigin="anonymous",T.muted=!0,T.preload="auto";const j=document.createElement("canvas"),M=j.getContext("2d");if(!M){S.current=!1;return}const E=[],$=Math.min(.4,i*.05);for(let B=0;B<D5;B++){const X=B/(D5-1)*i;E.push(Math.max(X,$))}let N=0,D=!1;const z=()=>{if(D||N>=E.length){D||(T.src="",T.load());return}T.currentTime=E[N]};return T.addEventListener("loadedmetadata",()=>{if(T.videoWidth>0&&T.videoHeight>0){x(T.videoWidth/T.videoHeight);const B=_5*2,X=Math.round(B*(T.videoWidth/T.videoHeight));j.width=X,j.height=B}z()}),T.addEventListener("seeked",()=>{if(D)return;M.drawImage(T,0,0,j.width,j.height);const B=j.toDataURL("image/jpeg",.6);p(X=>[...X,B]),N++,z()}),T.addEventListener("error",()=>{}),T.src=e,T.load(),()=>{D=!0,S.current=!1,p([]),T.src="",T.load()}},[c,e,i]);const A=Math.round(_5*O),C=a>0?Math.max(1,Math.ceil(a/A)):1;return m.jsxs("div",{ref:k,className:"absolute inset-0 overflow-hidden",children:[c&&h.length>0&&m.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:C}).map((T,j)=>{const M=h[j%h.length];return m.jsx("div",{className:"flex-shrink-0 h-full relative overflow-hidden bg-neutral-900",style:{width:A},children:m.jsx("img",{src:M,alt:"",draggable:!1,className:"absolute inset-0 w-full h-full object-cover"})},j)})}),c&&h.length===0&&m.jsx("div",{className:"absolute inset-0 animate-pulse",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%)"}}),m.jsx("div",{className:"absolute bottom-0 left-0 right-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:m.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})}),UP=66,WP="v3";function KP({previewUrl:t,seekTime:e=2,duration:n=5,selector:r,selectorIndex:i,origin:a}){const l=t.replace("/preview/comp/","/thumbnail/").replace(/\/preview$/,"/thumbnail/index.html"),c=e+n/2,u=new URL(l,a);return u.searchParams.set("t",c.toFixed(2)),u.searchParams.set("v",WP),r&&(u.searchParams.set("selector",r),i!=null&&i>0&&u.searchParams.set("selectorIndex",String(i))),u.toString()}const Zp=d.memo(function({previewUrl:e,label:n,labelColor:r,selector:i,selectorIndex:a,seekTime:l=2,duration:c=5}){const[u,h]=d.useState(0),[p,O]=d.useState(!1),[x,y]=d.useState(16/9),b=d.useRef(null),S=d.useCallback(T=>{var E,$;if((E=b.current)==null||E.disconnect(),!T)return;const j=(($=T.parentElement)==null?void 0:$.clientWidth)||T.clientWidth;h(j);const M=T.parentElement||T;b.current=new ResizeObserver(([N])=>{h(N.contentRect.width)}),b.current.observe(M)},[]);Wt(()=>()=>{var T;(T=b.current)==null||T.disconnect()});const k=KP({previewUrl:e,seekTime:l,duration:c,selector:i,selectorIndex:a,origin:window.location.origin}),A=Math.max(48,Math.round(UP*x)),C=u>0?Math.max(1,Math.ceil(u/A)):1;return m.jsxs("div",{ref:S,className:"absolute inset-0 overflow-hidden",children:[m.jsx("img",{src:k,alt:"",draggable:!1,loading:"eager",onLoad:T=>{const j=T.currentTarget;j.naturalWidth>0&&j.naturalHeight>0&&y(j.naturalWidth/j.naturalHeight),O(!0)},className:"hidden"}),p&&m.jsx("div",{className:"absolute inset-0 flex",style:{animation:"hf-thumb-fade 200ms ease-out",mixBlendMode:"lighten"},children:Array.from({length:C}).map((T,j)=>m.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden",style:{width:A},children:m.jsx("img",{src:k,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover",style:{opacity:.7}})},j))}),m.jsx("div",{className:"absolute left-3 top-0 bottom-0 flex items-center",style:{zIndex:10},children:m.jsx("span",{className:"block max-w-full truncate text-[10px] font-semibold leading-none",style:{color:r,textShadow:p?"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6)":"none"},children:n})})]})});let JP=0;const H5={isEditMode:!1,model:null,selectedSegmentIds:new Set,selectedGroupId:null,sourceFilePath:null},kt=l7(t=>({...H5,setEditMode:e=>t({isEditMode:e}),setModel:e=>t({model:e}),setSourceFilePath:e=>t({sourceFilePath:e}),selectSegment:(e,n=!1)=>t(r=>{if(n){const i=new Set(r.selectedSegmentIds);return i.has(e)?i.delete(e):i.add(e),{selectedSegmentIds:i,selectedGroupId:null}}return{selectedSegmentIds:new Set([e]),selectedGroupId:null}}),selectGroup:e=>t(n=>{var i;const r=(i=n.model)==null?void 0:i.groups.get(e);return r?{selectedSegmentIds:new Set(r.segmentIds),selectedGroupId:e}:{}}),selectAll:()=>t(e=>e.model?{selectedSegmentIds:new Set(e.model.segments.keys()),selectedGroupId:null}:{}),clearSelection:()=>t({selectedSegmentIds:new Set,selectedGroupId:null}),updateSegmentStyle:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.segments.get(e);if(!i)return{};const a=new Map(r.model.segments);return a.set(e,{...i,style:{...i.style,...n}}),{model:{...r.model,segments:a}}}),updateSegmentText:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.segments.get(e);if(!i)return{};const a=new Map(r.model.segments);return a.set(e,{...i,text:n}),{model:{...r.model,segments:a}}}),updateSegmentTiming:(e,n,r)=>t(i=>{if(!i.model)return{};const a=i.model.segments.get(e);if(!a)return{};const l=new Map(i.model.segments);return l.set(e,{...a,start:n,end:r}),{model:{...i.model,segments:l}}}),updateGroupStyle:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const a=new Map(r.model.groups);return a.set(e,{...i,style:{...i.style,...n}}),{model:{...r.model,groups:a}}}),updateGroupContainer:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const a=new Map(r.model.groups);return a.set(e,{...i,containerStyle:{...i.containerStyle,...n}}),{model:{...r.model,groups:a}}}),updateGroupAnimation:(e,n,r)=>t(i=>{if(!i.model)return{};const a=i.model.groups.get(e);if(!a)return{};const l=new Map(i.model.groups),c=a.animation[n],u=c!==null?{...c,...r}:r;return l.set(e,{...a,animation:{...a.animation,[n]:u}}),{model:{...i.model,groups:l}}}),splitGroup:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const a=i.segmentIds.indexOf(n);if(a<=0)return{};const l=i.segmentIds.slice(0,a),c=i.segmentIds.slice(a),u=`group-split-${JP++}`,h=new Map(r.model.groups);h.set(e,{...i,segmentIds:l}),h.set(u,{...i,id:u,segmentIds:c});const p=r.model.groupOrder.indexOf(e),O=[...r.model.groupOrder];O.splice(p+1,0,u);const x=new Map(r.model.segments);return c.forEach((y,b)=>{const S=x.get(y);S&&x.set(y,{...S,groupIndex:b})}),{model:{...r.model,groups:h,segments:x,groupOrder:O}}}),mergeGroups:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e),a=r.model.groups.get(n);if(!i||!a)return{};const l=[...i.segmentIds,...a.segmentIds],c=new Map(r.model.groups);c.set(e,{...i,segmentIds:l}),c.delete(n);const u=r.model.groupOrder.filter(O=>O!==n),h=new Map(r.model.segments);a.segmentIds.forEach((O,x)=>{const y=h.get(O);y&&h.set(O,{...y,groupIndex:i.segmentIds.length+x})});const p=r.selectedGroupId===n?null:r.selectedGroupId;return{model:{...r.model,groups:c,segments:h,groupOrder:u},selectedGroupId:p}}),updateSelectedStyle:e=>t(n=>{if(!n.model||n.selectedSegmentIds.size===0)return{};const r=new Map(n.model.segments);for(const i of n.selectedSegmentIds){const a=r.get(i);a&&r.set(i,{...a,style:{...a.style,...e}})}return{model:{...n.model,segments:r}}}),applyAnimationToAll:e=>t(n=>{if(!n.model)return{};const r=new Map(n.model.groups);for(const[i,a]of r)r.set(i,{...a,animation:e});return{model:{...n.model,groups:r}}}),reset:()=>t({...H5,selectedSegmentIds:new Set})})),eQ=new Set(["ArrowLeft","ArrowRight"]),tQ=["input","textarea","select","button","a[href]","[contenteditable='true']","[role='button']","[role='checkbox']","[role='combobox']","[role='menuitem']","[role='radio']","[role='slider']","[role='spinbutton']","[role='switch']","[role='textbox']"].join(",");function nQ(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.closest!="function"?!1:e.closest.call(t,tQ)!==null}function rQ(t,e={isCaptionEditMode:!1,selectedCaptionSegmentCount:0}){return t.metaKey||t.ctrlKey||t.altKey||nQ(t.target)?!0:eQ.has(t.code)&&e.isCaptionEditMode&&e.selectedCaptionSegmentCount>0}const X5=[1,2,4];function iQ({iframeRef:t,shuttleDirectionRef:e,shuttleSpeedIndexRef:n,iframeShortcutCleanupRef:r,getAdapter:i,play:a,playBackward:l,pause:c,seek:u}){const h=d.useRef(new Set),p=d.useRef(()=>{}),O=d.useRef(()=>{}),x=d.useCallback(C=>{const T=i(),j=(T==null?void 0:T.getTime())??oe.getState().currentTime;u(sg(j,C,Bu))},[i,u]),y=d.useCallback(C=>{e.current===C?n.current=Math.min(n.current+1,X5.length-1):n.current=0;const T=X5[n.current];oe.getState().setPlaybackRate(T),C==="forward"?a():l(T)},[a,l,e,n]),b=d.useCallback(()=>{oe.getState().isPlaying?c():a()},[a,c]),S=d.useCallback(C=>{var M,E,$;if(C.defaultPrevented)return;const T=kt.getState();if(rQ(C,{isCaptionEditMode:T.isEditMode,selectedCaptionSegmentCount:T.selectedSegmentIds.size}))return;const j=C.key.toLowerCase();if(h.current.add(j),C.code==="Space"){C.preventDefault(),b();return}if(C.code==="ArrowLeft"){C.preventDefault(),x(C.shiftKey?-10:-1);return}if(C.code==="ArrowRight"){C.preventDefault(),x(C.shiftKey?10:1);return}if(!C.repeat){if(j==="m"){C.preventDefault();const N=oe.getState();N.playbackRate<=1&&N.setAudioMuted(!N.audioMuted);return}if(j==="l"&&C.shiftKey){C.preventDefault();const N=oe.getState();N.setLoopEnabled(!N.loopEnabled);return}if(j==="k"){C.preventDefault(),c();return}if(j==="j"){if(C.preventDefault(),h.current.has("k")){x(-1);return}y("backward");return}if(j==="l"){if(C.preventDefault(),h.current.has("k")){x(1);return}y("forward");return}if(j==="i"){C.preventDefault();const N=((M=i())==null?void 0:M.getTime())??oe.getState().currentTime;oe.getState().setInPoint(C.shiftKey?null:N);return}if(j==="o"){C.preventDefault();const N=((E=i())==null?void 0:E.getTime())??oe.getState().currentTime;oe.getState().setOutPoint(C.shiftKey?null:N);return}if(j==="a"){C.preventDefault(),u(oe.getState().inPoint??0,{keepPlaying:!0});return}if(j==="e"){C.preventDefault();const{outPoint:N}=oe.getState();u(N??(($=i())==null?void 0:$.getDuration())??oe.getState().duration,{keepPlaying:!0});return}}},[c,y,x,b,i,u]),k=d.useCallback(C=>{h.current.delete(C.key.toLowerCase())},[]);p.current=S,O.current=k;const A=d.useCallback(()=>{var E,$,N;(E=r.current)==null||E.call(r),r.current=null;let C=null,T=null;try{C=(($=t.current)==null?void 0:$.contentWindow)??null,T=((N=t.current)==null?void 0:N.contentDocument)??null}catch{return}if(!C&&!T)return;const j=D=>p.current(D),M=D=>O.current(D);try{C==null||C.addEventListener("keydown",j,!0),C==null||C.addEventListener("keyup",M,!0)}catch{}T==null||T.addEventListener("keydown",j,!0),T==null||T.addEventListener("keyup",M,!0),r.current=()=>{try{C==null||C.removeEventListener("keydown",j,!0),C==null||C.removeEventListener("keyup",M,!0)}catch{}T==null||T.removeEventListener("keydown",j,!0),T==null||T.removeEventListener("keyup",M,!0)}},[t,r]);return{playbackKeyDownRef:p,playbackKeyUpRef:O,attachIframeShortcutListeners:A,togglePlay:b}}function aQ(t){const{clip:e,fallbackIndex:n,doc:r}=t;let i=t.hostEl??null;const a=Yu({id:e.id,label:e.label,tag:e.tagName||e.kind});let l,c,u,h,p;i&&(l=i.id||void 0,p=i.getAttribute("data-hf-id")||void 0,c=al(i),u=r&&c?xu(r,i,c):void 0,h=Ou(i));const O=yu({preferredId:e.id,label:a,fallbackIndex:n,domId:l,selector:c,selectorIndex:u,sourceFile:h}),x={id:O.id,label:a,key:O.key,tag:e.tagName||e.kind,start:e.start,duration:e.duration,track:e.track,domId:l,hfId:p,selector:c,selectorIndex:u,sourceFile:h};if(i&&r7(x,i),e.assetUrl&&(x.src=e.assetUrl),e.kind==="composition"&&e.compositionId){let y=e.compositionSrc;if(y||(i=(r==null?void 0:r.querySelector(`[data-composition-id="${e.compositionId}"]`))??i,y=(i==null?void 0:i.getAttribute("data-composition-src"))??(i==null?void 0:i.getAttribute("data-composition-file"))??null),y)x.compositionSrc=y;else if(i){const b=i.querySelector("video[src]");b&&(x.src=b.getAttribute("src")||void 0,x.tag="video")}if(i){x.domId=i.id||void 0,x.hfId=i.getAttribute("data-hf-id")||void 0,x.selector=al(i),x.selectorIndex=r&&x.selector?xu(r,i,x.selector):void 0,x.sourceFile=Ou(i);const b=yu({preferredId:e.id,label:a,fallbackIndex:n,domId:x.domId,selector:x.selector,selectorIndex:x.selectorIndex,sourceFile:x.sourceFile});x.id=b.id,x.key=b.key}}return x}function j7(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(cg)),a=n.reduce((c,u)=>Math.max(c,Number.isFinite(u.track)?u.track:0),-1),l=[];for(const c of Array.from(r.children)){if(!N$(r,c))continue;const u=al(c);if(!u)continue;const h=xu(t,c,u),p=Ou(c),O=$$(c),x=yu({preferredId:c.id||null,label:O,fallbackIndex:n.length+l.length,domId:c.id||void 0,selector:u,selectorIndex:h,sourceFile:p});i.has(x.key)||i.has(x.id)||l.push({domId:c.id||void 0,hfId:c.getAttribute("data-hf-id")||void 0,duration:e,id:x.id,key:x.key,label:O,selector:u,selectorIndex:h,sourceFile:p,start:0,tag:c.tagName.toLowerCase(),timingSource:"implicit",track:a+1+l.length})}return l}function P7(t,e){const n=t.querySelector("[data-composition-id]"),r=t.querySelectorAll("[data-start]"),i=[];let a=0;return r.forEach(l=>{if(l===n)return;const c=l,u=c.getAttribute("data-start");if(u==null)return;const h=parseFloat(u);if(isNaN(h)||Number.isFinite(e)&&e>0&&h>=e)return;const p=c.tagName.toLowerCase();let O=0;const x=c.getAttribute("data-duration");if(x!=null&&(O=parseFloat(x)),(isNaN(O)||O<=0)&&(O=Math.max(0,e-h)),Number.isFinite(e)&&e>0&&(O=Math.min(O,Math.max(0,e-h))),!Number.isFinite(O)||O<=0)return;const y=c.getAttribute("data-track-index"),b=y!=null?parseInt(y,10):a++,S=c.getAttribute("data-composition-id"),k=al(c),A=Ou(c),C=xu(t,c,k),T=Yu({id:c.id||S||null,label:c.getAttribute("data-timeline-label")??c.getAttribute("data-label"),tag:p}),j=yu({preferredId:c.id||S||null,label:T,fallbackIndex:i.length,domId:c.id||void 0,selector:k,selectorIndex:C,sourceFile:A}),M={id:j.id,label:T,key:j.key,tag:p,start:h,duration:O,track:isNaN(b)?0:b,domId:c.id||void 0,hfId:c.getAttribute("data-hf-id")||void 0,selector:k,selectorIndex:C,sourceFile:A,timingSource:"authored"},E=n7(c);if(E){E.tagName==="IMG"&&(M.tag="img");const N=E.getAttribute("src");N&&(M.src=N);const D=c.getAttribute("data-volume")??E.getAttribute("data-volume");D&&(M.volume=parseFloat(D)),r7(M,c)}c.hasAttribute("data-timeline-locked")&&(M.timelineLocked=!0);const $=c.getAttribute("data-composition-src")||c.getAttribute("data-composition-file");if($)M.compositionSrc=$;else if(S&&S!==(n==null?void 0:n.getAttribute("data-composition-id"))){const N=c.querySelector("video[src]");N&&(M.src=N.getAttribute("src")||void 0,M.tag="video")}i.push(M)}),[...i,...j7(t,e,i)]}function sQ(t,e,n,r){const i=Number.isFinite(n)?n:0,a=Number.isFinite(r)?r:0;if(t.length===0||e.length>=t.length||a>i)return e;const l=new Set(e.map(cg)),c=t.filter(u=>!l.has(cg(u)));return c.length===0?e:[...e,...c]}function lQ(t){const e=t.match(/\/preview\/comp\/(.+?)(?:\?|$)/);return e?decodeURIComponent(e[1]):void 0}function oQ(t){if(!Number.isFinite(t.rootDuration)||t.rootDuration<=0)return null;const e=lQ(t.iframeSrc);return{id:t.compositionId,label:Yu({id:t.compositionId,tag:t.tagName}),key:og({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 cQ({iframeRef:t,probeIntervalRef:e,pendingSeekRef:n,isRefreshingRef:r,getAdapter:i,syncTimelineElements:a,setDuration:l,setCurrentTime:c,setTimelineReady:u,setIsPlaying:h,attachIframeShortcutListeners:p,applyPreviewAudioState:O}){const x=d.useCallback(C=>{var U;if(!C.clips||C.clips.length===0)return;const T=new Set(C.clips.map(I=>I.compositionId).filter(Boolean)),j=C.clips.filter(I=>!I.parentCompositionId||!T.has(I.parentCompositionId));let M=null;try{M=((U=t.current)==null?void 0:U.contentDocument)??null}catch{M=null}const E=new Set,$=j.map((I,K)=>{const Z=M?Z$(M,I,K,E):null;return Z&&E.add(Z),aQ({clip:I,fallbackIndex:K,doc:M,hostEl:Z})}),N=C.durationInFrames/30,D=Number.isFinite(N)&&N<7200?N:0,z=D>0?D:oe.getState().duration,B=z>0?$.filter(I=>I.start<z).map(I=>({...I,duration:Math.min(I.duration,z-I.start)})).filter(I=>I.duration>0):$,X=M&&z>0?[...B,...j7(M,z,B)]:B;X.length>0&&a(X,D>0?D:void 0)},[t,a]),y=d.useCallback(()=>{try{const C=t.current,T=C==null?void 0:C.contentDocument,j=C==null?void 0:C.contentWindow;if(!T||!j)return;const M=oe.getState().elements,E=oe.getState().duration,{missing:$,updatedEls:N,patched:D}=H$(T,j,M,E);if($.length>0||D){const z=new Set(N.map(X=>X.id)),B=$.filter(X=>!z.has(X.id));a([...N,...B])}}catch(C){console.warn("[useTimelinePlayer] enrichMissingCompositions failed",C)}},[t,a]),b=d.useCallback(()=>{const C=i();if(!C||C.getDuration()<=0)return!1;C.pause();const T=n.current;n.current=null;const j=T!=null?Math.min(T,C.getDuration()):0;C.seek(j),pr.notify(j);const M=C.getDuration();Number.isFinite(M)&&M>0&&M<7200&&M!==oe.getState().duration&&l(M),c(j),r.current||u(!0),r.current=!1,h(!1);try{const E=t.current,$=E==null?void 0:E.contentDocument,N=E==null?void 0:E.contentWindow;$&&N&&(R$($,N),V$($),p());const D=N==null?void 0:N.__clipManifest;if(D&&D.clips.length>0&&x(D),y(),O(),oe.getState().elements.length===0&&$){const z=P7($,C.getDuration());z.length>0&&a(z)}if(oe.getState().elements.length===0&&$){const z=$.querySelector("[data-composition-id]"),B=C.getDuration();if(z&&B>0){const X=oQ({compositionId:z.getAttribute("data-composition-id")||"composition",tagName:z.tagName||"div",rootDuration:B,iframeSrc:(E==null?void 0:E.src)||"",selector:al(z)});X&&a([X])}}}catch(E){console.warn("[useTimelinePlayer] Could not read timeline elements from iframe",E)}return!0},[i,l,c,u,h,x,y,a,p,O,t,r,n]),S=d.useCallback(()=>{if(O(),e.current&&clearInterval(e.current),b())return;const C=t.current;let T=!1;const j=()=>{T||b()&&(T=!0,window.removeEventListener("message",M),e.current&&clearInterval(e.current))},M=E=>{if(E.source&&C&&E.source!==C.contentWindow)return;const $=E.data;($==null?void 0:$.source)==="hf-preview"&&(($==null?void 0:$.type)==="state"||($==null?void 0:$.type)==="timeline")&&j()};window.addEventListener("message",M),e.current=setTimeout(()=>{T||(j(),T||console.warn("[useTimelinePlayer] Runtime did not signal readiness within 5s")),window.removeEventListener("message",M)},5e3)},[b,t,e,O]);return{processTimelineMessage:x,processTimelineMessageRef:{current:x},enrichMissingCompositions:y,enrichMissingCompositionsRef:{current:y},initializeAdapter:b,onIframeLoad:S}}const Og=new Map,Np=new Map;let eo=null;async function uQ(){if(eo===!1)return null;if(eo)return eo;try{return eo=await WS(()=>import("./index-DSLrl2tB.js"),[]),eo}catch{return eo=!1,null}}function Q7(t){try{return new URL(t,window.location.href).href}catch{return t}}async function fQ(t){const e=await uQ();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(),a=await n.getAudioTracks();return{duration:r,width:i==null?void 0:i.displayWidth,height:i==null?void 0:i.displayHeight,hasVideo:i!=null,hasAudio:a.length>0}}catch{return null}finally{n.dispose()}}function dQ(t){return Og.get(Q7(t))}async function hQ(t){const e=Q7(t),n=Og.get(e);if(n)return n;let r=Np.get(e);return r||(r=fQ(e).then(i=>(Np.delete(e),i&&Og.set(e,i),i)),Np.set(e,r),r)}function mQ(t){return t.keepPlaying&&!t.wasReverseShuttle&&t.storeWasPlaying&&(t.duration<=0||t.nextTime<t.duration)}function pQ(t){return!t.keepPlaying||t.wasReverseShuttle}function gQ(){const t=d.useRef(null),e=d.useRef(0),n=d.useRef(void 0),r=d.useRef(null),i=d.useRef(!1),a=d.useRef(0),l=d.useRef(null),c=d.useRef(0),u=d.useRef(null),h=d.useRef(0),p=d.useRef(null),{setIsPlaying:O,setCurrentTime:x,setDuration:y,setTimelineReady:b,setElements:S}=oe.getState(),k=d.useCallback((P,L)=>{const V=oe.getState(),W=L??V.duration,ee=sQ(V.elements,P,V.duration,W);(ee.length!==V.elements.length||ee.some((Y,re)=>{const he=V.elements[re];return!he||Y.id!==he.id||Y.start!==he.start||Y.duration!==he.duration||Y.track!==he.track}))&&S(ee),Number.isFinite(L)&&(L??0)>0&&L!==V.duration&&y(L??0),V.timelineReady||b(!0);const ae=ee.filter(Y=>Y.src&&Y.sourceDuration==null&&["video","audio"].includes(Y.tag.toLowerCase())&&!dQ(Y.src));ae.length>0&&Promise.allSettled(ae.map(async Y=>{const re=await hQ(Y.src);if(!re)return;const he=Y.key??Y.id;oe.setState(xe=>{const ke=xe.elements.findIndex(Se=>(Se.key??Se.id)===he);if(ke===-1||xe.elements[ke].sourceDuration!=null)return{};const be=xe.elements.slice();return be[ke]={...xe.elements[ke],sourceDuration:re.duration},{elements:be}})}))},[S,b,y]),A=d.useCallback(()=>{var P,L;try{const V=t.current,W=V==null?void 0:V.contentWindow;if(!V||!W)return null;const ee=W.__player&&typeof W.__player.play=="function"?W.__player:null,ue=T$(V.contentDocument),ae=Mp(ee);if(ae>0&&ue<=ae)return ee;let Y=null;if(W.__timeline){const xe=s5(W.__timeline),ke=Mp(xe);if(ke>0&&ue<=ke)return xe;ke>0&&(Y??(Y=xe))}if(W.__timelines){const xe=Object.keys(W.__timelines);if(xe.length>0){const ke=(L=(P=V==null?void 0:V.contentDocument)==null?void 0:P.querySelector("[data-composition-id]"))==null?void 0:L.getAttribute("data-composition-id"),be=ke&&ke in W.__timelines?ke:xe[xe.length-1],Se=s5(W.__timelines[be]),Ve=Mp(Se);if(Ve>0&&ue<=Ve)return Se;Ve>0&&(Y??(Y=Se))}}const re=ee??Y,he=Math.max(oe.getState().duration,ue,ae);if(re&&he>0&&("renderSeek"in re||typeof re.seek=="function")){const xe=p.current;if((xe==null?void 0:xe.player)===re&&xe.duration===he)return xe.adapter;xe==null||xe.adapter.pause();const ke=C$(re,he,M$(W),()=>oe.getState().playbackRate);return p.current={player:re,duration:he,adapter:ke},ke}return re}catch(V){return console.warn("[useTimelinePlayer] Could not get playback adapter (cross-origin)",V),null}},[]),C=d.useCallback(()=>{cancelAnimationFrame(a.current)},[]),T=d.useCallback(()=>{const P=()=>{const L=A();if(L){const V=L.getTime(),W=L.getDuration(),ee=W>0?Math.min(V,W):V;pr.notify(ee);const{inPoint:ue,outPoint:ae}=oe.getState(),Y=ae!==null?Math.min(ae,W):W,re=ue!==null?ue:0,he=re<Y?Y:W,xe=re<Y?re:0;if(ee>=he){if(oe.getState().loopEnabled&&W>0){L.seek(xe,{keepPlaying:!0}),pr.notify(xe),L.play(),O(!0),e.current=requestAnimationFrame(P);return}L.isPlaying()&&L.pause(),x(ee),O(!1),cancelAnimationFrame(e.current);return}}e.current=requestAnimationFrame(P)};e.current=requestAnimationFrame(P)},[A,x,O]),j=d.useCallback(()=>{cancelAnimationFrame(e.current)},[]),M=d.useCallback(P=>{const L=t.current;if(L){D$(L,P);try{const V=L.contentWindow;if(V!=null&&V.__timelines)for(const W of Object.values(V.__timelines))W&&typeof W.timeScale=="function"&&W.timeScale(P)}catch(V){console.warn("[useTimelinePlayer] Could not set playback rate (cross-origin)",V)}}},[]),E=d.useCallback(P=>{const{audioMuted:L,playbackRate:V}=oe.getState(),W=P??V;_$(t.current,s7(L,W))},[]),$=d.useCallback(()=>{j(),C();const P=A();P&&(P.getTime()>=P.getDuration()&&P.seek(oe.getState().inPoint??0),M(oe.getState().playbackRate),E(),P.play(),l.current="forward",O(!0),T())},[A,O,T,M,E,j,C]),N=d.useCallback(P=>{j(),C();const L=A();if(!L)return;const V=Math.max(0,L.getDuration()),W=L.getTime()<=0&&V>0?V:L.getTime();L.pause(),W!==L.getTime()&&L.seek(W);const ee=Math.max(.1,Math.min(4,P));M(ee),E(ee);let ue=W,ae=performance.now();const Y=re=>{const he=(re-ae)/1e3*ee;let xe=ue-he;const{inPoint:ke,outPoint:be}=oe.getState(),Se=be!==null?Math.min(be,V):V,Ve=ke!==null?ke:0,Te=Ve<Se?Se:V,Ze=Ve<Se?Ve:0;if(xe<=Ze)if(oe.getState().loopEnabled&&V>0)ue=Te,ae=re,xe=Te;else{L.seek(Ze),pr.notify(Ze),x(Ze),O(!1),l.current=null,a.current=0;return}L.seek(Math.max(0,xe)),pr.notify(Math.max(0,xe)),O(!0),a.current=requestAnimationFrame(Y)};O(!0),l.current="backward",a.current=requestAnimationFrame(Y)},[A,x,O,M,E,j,C]),D=d.useCallback(()=>{C();const P=A();P&&(P.pause(),x(P.getTime()),O(!1),l.current=null,c.current=0,j())},[A,x,O,j,C]),z=d.useCallback((P,L)=>{const V=l.current==="backward";C();const W=A();if(!W)return r.current=Math.max(0,P),!1;const ee=Math.max(0,W.getDuration()),ue=Math.max(0,ee>0?Math.min(ee,P):P),ae=(L==null?void 0:L.keepPlaying)===!0,Y=mQ({keepPlaying:ae,wasReverseShuttle:V,storeWasPlaying:oe.getState().isPlaying,duration:ee,nextTime:ue});return W.seek(ue,L),pr.notify(ue),x(ue),Y?(j(),M(oe.getState().playbackRate),E(),W.play(),O(!0),l.current="forward",c.current=0,T()):pQ({keepPlaying:ae,wasReverseShuttle:V})&&(j(),oe.getState().isPlaying&&O(!1),l.current=null,c.current=0),!0},[A,r,x,O,T,j,C,M,E,l,c]);d.useEffect(()=>oe.subscribe((P,L)=>{P.requestedSeekTime!==null&&P.requestedSeekTime!==L.requestedSeekTime&&(z(P.requestedSeekTime),oe.getState().clearSeekRequest())}),[z]);const{playbackKeyDownRef:B,playbackKeyUpRef:X,attachIframeShortcutListeners:U,togglePlay:I}=iQ({iframeRef:t,shuttleDirectionRef:l,shuttleSpeedIndexRef:c,iframeShortcutCleanupRef:u,getAdapter:A,play:$,playBackward:N,pause:D,seek:z}),{processTimelineMessageRef:K,enrichMissingCompositionsRef:Z,onIframeLoad:F}=cQ({iframeRef:t,probeIntervalRef:n,pendingSeekRef:r,isRefreshingRef:i,getAdapter:A,syncTimelineElements:k,setDuration:y,setCurrentTime:x,setTimelineReady:b,setIsPlaying:O,attachIframeShortcutListeners:U,applyPreviewAudioState:E}),_=d.useCallback(()=>{const P=A();r.current=P?P.getTime():oe.getState().currentTime??0,i.current=!0,j(),C(),O(!1)},[A,j,O,C]),q=d.useCallback(()=>{const P=t.current;if(!P)return;_();const L=P.src,V=new URL(L,window.location.origin);V.searchParams.set("_t",String(Date.now())),P.src=V.toString()},[_]),G=d.useRef(A);G.current=A,Wt(()=>{const P=ee=>B.current(ee),L=ee=>X.current(ee),V=ee=>{const ue=ee.data,ae=t.current;if(!(ee.source&&ae&&ee.source!==ae.contentWindow)){if((ue==null?void 0:ue.source)==="hf-preview"&&(ue==null?void 0:ue.type)==="state")try{if(oe.getState().elements.length===0){const re=ae==null?void 0:ae.contentWindow,he=re==null?void 0:re.__clipManifest;he&&he.clips.length>0&&K.current(he)}Date.now()-h.current>500&&Z.current()}catch(Y){console.warn("[useTimelinePlayer] Could not read clip manifest from iframe",Y)}if((ue==null?void 0:ue.source)==="hf-preview"&&(ue==null?void 0:ue.type)==="timeline"&&Array.isArray(ue.clips)&&(h.current=Date.now(),K.current(ue),Z.current(),oe.getState().elements.length===0))try{const Y=ae==null?void 0:ae.contentDocument,re=A();if(Y&&re){const he=P7(Y,re.getDuration());he.length>0&&k(he)}}catch(Y){console.warn("[useTimelinePlayer] Could not read timeline elements on navigate (cross-origin)",Y)}}},W=()=>{var ee;if(document.hidden&&oe.getState().isPlaying){const ue=(ee=G.current)==null?void 0:ee.call(G);ue&&(ue.pause(),O(!1),j())}};return window.addEventListener("keydown",P,!0),window.addEventListener("keyup",L,!0),window.addEventListener("message",V),document.addEventListener("visibilitychange",W),()=>{var ee;window.removeEventListener("keydown",P,!0),window.removeEventListener("keyup",L,!0),(ee=u.current)==null||ee.call(u),u.current=null,window.removeEventListener("message",V),document.removeEventListener("visibilitychange",W),j(),C(),n.current&&clearInterval(n.current)}});const R=d.useCallback(()=>{j(),C(),n.current&&clearInterval(n.current),oe.getState().reset()},[j,C]);return d.useEffect(()=>oe.subscribe((P,L)=>{const V=P.playbackRate!==L.playbackRate,W=P.audioMuted!==L.audioMuted;!V&&!W||(V&&M(P.playbackRate),E())}),[M,E]),{iframeRef:t,play:$,pause:D,togglePlay:I,seek:z,onIframeLoad:F,refreshPlayer:q,saveSeekPosition:_,resetPlayer:R}}const OQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),xQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),yQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),bQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232,128,128,232,24,128,128,24Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),vQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),SQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),d.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),wQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),kQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),AQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),MQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),CQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),TQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),EQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),$Q=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),jQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),PQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),QQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),ZQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),NQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),RQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),VQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),LQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),_Q=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),DQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),HQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),XQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),zQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),FQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),BQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),YQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),IQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),qQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),GQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),UQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),WQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),KQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),JQ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,184a40,40,0,1,1-40-40A40,40,0,0,1,128,184Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),eZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),tZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),nZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),rZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),iZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),aZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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"}),d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),sZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),lZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,56V184a16,16,0,0,1-16,16H72a16,16,0,0,1-16-16V56Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),oZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),cZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),uZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,96v64H48V96Z",opacity:"0.2"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),fZ=new Map([["bold",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}),d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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",d.createElement(d.Fragment,null,d.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"}))]]),dZ=d.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Ye=d.forwardRef((t,e)=>{const{alt:n,color:r,size:i,weight:a,mirrored:l,children:c,weights:u,...h}=t,{color:p="currentColor",size:O,weight:x="regular",mirrored:y=!1,...b}=d.useContext(dZ);return d.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:i??O,height:i??O,fill:r??p,viewBox:"0 0 256 256",transform:l||y?"scale(-1, 1)":void 0,...b,...h},!!n&&d.createElement("title",null,n),c,u.get(a??x))});Ye.displayName="IconBase";const Z7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:OQ}));Z7.displayName="ArrowClockwiseIcon";const hZ=Z7,N7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:xQ}));N7.displayName="ArrowCounterClockwiseIcon";const mZ=N7,R7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:yQ}));R7.displayName="ArrowLeftIcon";const pZ=R7,V7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:bQ}));V7.displayName="ArrowsOutCardinalIcon";const gZ=V7,L7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:vQ}));L7.displayName="CameraIcon";const OZ=L7,_7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:SQ}));_7.displayName="CaretDownIcon";const xZ=_7,Ff=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:wQ}));Ff.displayName="CaretRightIcon";const D7=Ff,H7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:kQ}));H7.displayName="CheckIcon";const yZ=H7,X7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:AQ}));X7.displayName="CheckCircleIcon";const z7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:MQ}));z7.displayName="ClipboardTextIcon";const bZ=z7,F7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:CQ}));F7.displayName="ClockIcon";const vZ=F7,B7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:TQ}));B7.displayName="CopyIcon";const SZ=B7,Y7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:EQ}));Y7.displayName="EyeIcon";const wZ=Y7,I7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:$Q}));I7.displayName="FileIcon";const kZ=I7,q7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:jQ}));q7.displayName="FileCodeIcon";const AZ=q7,G7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:PQ}));G7.displayName="FileCssIcon";const MZ=G7,U7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:QQ}));U7.displayName="FileHtmlIcon";const CZ=U7,W7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:ZQ}));W7.displayName="FileJpgIcon";const TZ=W7,K7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:NQ}));K7.displayName="FileJsIcon";const EZ=K7,J7=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:RQ}));J7.displayName="FileJsxIcon";const $Z=J7,ew=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:VQ}));ew.displayName="FileMdIcon";const jZ=ew,tw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:LQ}));tw.displayName="FilePlusIcon";const z5=tw,nw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:_Q}));nw.displayName="FilePngIcon";const PZ=nw,rw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:DQ}));rw.displayName="FileSvgIcon";const QZ=rw,iw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:HQ}));iw.displayName="FileTsIcon";const ZZ=iw,aw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:XQ}));aw.displayName="FileTsxIcon";const NZ=aw,sw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:zQ}));sw.displayName="FileTxtIcon";const RZ=sw,lw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:FQ}));lw.displayName="FileVideoIcon";const VZ=lw,ow=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:BQ}));ow.displayName="FilmStripIcon";const LZ=ow,cw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:YQ}));cw.displayName="FolderSimpleIcon";const _Z=cw,uw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:IQ}));uw.displayName="FolderSimplePlusIcon";const fw=uw,dw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:qQ}));dw.displayName="GearIcon";const DZ=dw,hw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:GQ}));hw.displayName="GridFourIcon";const HZ=hw,mw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:UQ}));mw.displayName="ImageIcon";const XZ=mw,pw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:WQ}));pw.displayName="LightningIcon";const zZ=pw,gw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:KQ}));gw.displayName="MagnetStraightIcon";const FZ=gw,Ow=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:JQ}));Ow.displayName="MusicNoteIcon";const BZ=Ow,xw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:eZ}));xw.displayName="PaletteIcon";const YZ=xw,yw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:tZ}));yw.displayName="PencilSimpleIcon";const IZ=yw,bw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:nZ}));bw.displayName="PlusIcon";const vw=bw,Sw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:rZ}));Sw.displayName="ScissorsIcon";const qZ=Sw,ww=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:iZ}));ww.displayName="SquareIcon";const GZ=ww,kw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:aZ}));kw.displayName="StackIcon";const UZ=kw,Aw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:sZ}));Aw.displayName="TextAaIcon";const WZ=Aw,Mw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:lZ}));Mw.displayName="TextTIcon";const KZ=Mw,Cw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:oZ}));Cw.displayName="TrashIcon";const JZ=Cw,Ef=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:cZ}));Ef.displayName="WarningIcon";const Tw=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:uZ}));Tw.displayName="WaveformIcon";const eN=Tw,I8=d.forwardRef((t,e)=>d.createElement(Ye,{ref:e,...t,weights:fZ}));I8.displayName="XIcon";const tN=I8;function F5({findings:t,projectId:e,onClose:n}){const r=t.filter(h=>h.severity==="error"),i=t.filter(h=>h.severity==="warning"),a=t.length>0,[l,c]=d.useState(!1),u=async()=>{const h=t.map(x=>{let y=`[${x.severity}] ${x.message}`;return x.file&&(y+=`
|
|
69
|
+
File: ${x.file}`),x.fixHint&&(y+=`
|
|
70
|
+
Fix: ${x.fixHint}`),y}),p=`Fix these HyperFrames lint issues for project "${e}":
|
|
71
|
+
|
|
72
|
+
Project path: ${window.location.href}
|
|
73
|
+
|
|
74
|
+
${h.join(`
|
|
75
|
+
|
|
76
|
+
`)}`;await vu(p)&&(c(!0),setTimeout(()=>c(!1),2e3))};return m.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:n,children:m.jsxs("div",{className:"bg-neutral-950 border border-neutral-800 rounded-xl shadow-2xl w-full max-w-xl max-h-[80vh] flex flex-col overflow-hidden",onClick:h=>h.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[a?m.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500/10 flex items-center justify-center",children:m.jsx(Ef,{size:18,className:"text-red-400",weight:"fill"})}):m.jsx("div",{className:"w-8 h-8 rounded-full bg-studio-accent/10 flex items-center justify-center",children:m.jsx(X7,{size:18,className:"text-studio-accent",weight:"fill"})}),m.jsxs("div",{children:[m.jsx("h2",{className:"text-sm font-semibold text-neutral-200",children:a?`${r.length} error${r.length!==1?"s":""}, ${i.length} warning${i.length!==1?"s":""}`:"All checks passed"}),m.jsx("p",{className:"text-xs text-neutral-500",children:"HyperFrame Lint Results"})]})]}),m.jsx("button",{onClick:n,className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800 transition-colors",children:m.jsx(I8,{size:16})})]}),a&&m.jsx("div",{className:"flex items-center justify-end px-5 py-2 border-b border-neutral-800/50",children:m.jsx("button",{onClick:u,className:`px-3 py-1 text-xs font-medium rounded-lg transition-colors ${l?"bg-green-600 text-white":"bg-studio-accent hover:bg-studio-accent/80 text-white"}`,children:l?"Copied!":"Copy to Agent"})}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-3",children:[!a&&m.jsx("div",{className:"py-8 text-center text-neutral-500 text-sm",children:"No errors or warnings found. Your composition looks good!"}),r.map((h,p)=>m.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(Ef,{size:14,className:"text-red-400 flex-shrink-0 mt-0.5",weight:"fill"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"text-sm text-neutral-200",children:h.message}),h.file&&m.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:h.file}),h.fixHint&&m.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[m.jsx(Ff,{size:10,className:"text-studio-accent flex-shrink-0 mt-0.5"}),m.jsx("p",{className:"text-xs text-studio-accent",children:h.fixHint})]})]})]})},`e-${p}`)),i.map((h,p)=>m.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(Ef,{size:14,className:"text-amber-400 flex-shrink-0 mt-0.5"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"text-sm text-neutral-300",children:h.message}),h.file&&m.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:h.file}),h.fixHint&&m.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[m.jsx(Ff,{size:10,className:"text-studio-accent flex-shrink-0 mt-0.5"}),m.jsx("p",{className:"text-xs text-studio-accent",children:h.fixHint})]})]})]})},`w-${p}`))]})]})})}function nN(t){const e=[];let n=0;for(const r of t.groupOrder){const i=t.groups.get(r);if(i)for(const a of i.segmentIds){const l=t.segments.get(a);if(l&&Object.keys(l.style).length>0){const c={wordIndex:n};l.wordId&&(c.wordId=l.wordId);const u=l.style;u.x!==void 0&&(c.x=u.x),u.y!==void 0&&(c.y=u.y),u.scaleX!==void 0&&(c.scale=u.scaleX),u.rotation!==void 0&&(c.rotation=u.rotation),u.activeColor!==void 0&&(c.activeColor=u.activeColor),u.dimColor!==void 0&&(c.dimColor=u.dimColor),u.opacity!==void 0&&(c.opacity=u.opacity),u.fontSize!==void 0&&(c.fontSize=u.fontSize),u.fontWeight!==void 0&&(c.fontWeight=u.fontWeight),u.fontFamily!==void 0&&(c.fontFamily=u.fontFamily),e.push(c)}n++}}return e}function rN(t){const e=d.useRef(t);e.current=t;const n=d.useRef(null),r=d.useRef(!1),i=d.useCallback(()=>{const l=kt.getState();if(!l.model||!l.sourceFilePath||!l.isEditMode)return;const c=e.current;if(!c)return;const u=nN(l.model);fetch(`/api/projects/${c}/files/${encodeURIComponent("caption-overrides.json")}`,{method:"PUT",headers:{"Content-Type":"text/plain"},body:JSON.stringify(u,null,2)}).catch(h=>console.warn("[captions] auto-save failed:",h))},[]);Wt(()=>{let l=kt.getState().model;const c=kt.subscribe(u=>{if(!(!u.isEditMode||u.model===l||!u.model)){if(l=u.model,r.current){r.current=!1;return}n.current&&clearTimeout(n.current),n.current=setTimeout(i,800)}});return()=>{c(),n.current&&clearTimeout(n.current)}});const a=d.useCallback(async()=>{const l=kt.getState();if(!l.model||!l.sourceFilePath)return;const c=e.current;if(c)try{const u=await fetch(`/api/projects/${c}/files/${encodeURIComponent("caption-overrides.json")}`);if(!u.ok)return;const h=await u.json();if(!h.content)return;const p=JSON.parse(h.content);if(!Array.isArray(p))return;const O=l.model,x=[],y=new Map;for(const S of O.groupOrder){const k=O.groups.get(S);if(k)for(const A of k.segmentIds){x.push(A);const C=O.segments.get(A);C!=null&&C.wordId&&y.set(C.wordId,A)}}const b=new Map(O.segments);for(const S of p){const k=(S.wordId?y.get(S.wordId):void 0)??x[S.wordIndex];if(!k)continue;const A=b.get(k);if(!A)continue;const C={...A.style};S.x!==void 0&&(C.x=S.x),S.y!==void 0&&(C.y=S.y),S.scale!==void 0&&(C.scaleX=S.scale,C.scaleY=S.scale),S.rotation!==void 0&&(C.rotation=S.rotation),S.activeColor!==void 0&&(C.activeColor=S.activeColor),S.dimColor!==void 0&&(C.dimColor=S.dimColor),S.opacity!==void 0&&(C.opacity=S.opacity),S.fontSize!==void 0&&(C.fontSize=S.fontSize),S.fontWeight!==void 0&&(C.fontWeight=S.fontWeight),S.fontFamily!==void 0&&(C.fontFamily=S.fontFamily),b.set(k,{...A,style:C})}r.current=!0,kt.getState().setModel({...O,segments:b})}catch{}},[]);return{save:i,loadOverrides:a}}const iN=100,aN=300;function xg(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function yg(t){return{version:1,updatedAt:0,undo:[],redo:[]}}function sN(t){const e={};for(const[n,r]of Object.entries(t.files))r.before!==r.after&&(e[n]={before:r.before,after:r.after,beforeHash:xg(r.before),afterHash:xg(r.after)});return{id:t.id,projectId:t.projectId,label:t.label,kind:t.kind??"manual",coalesceKey:t.coalesceKey,createdAt:t.now,files:e}}function lN(t,e,n){if(Object.keys(e.files).length===0)return t;const r=aN,i=iN,a=t.undo[t.undo.length-1];let l=t.undo;if(a&&a.coalesceKey&&a.coalesceKey===e.coalesceKey&&e.createdAt-a.createdAt<=r){const c={};for(const[u,h]of Object.entries(e.files)){const p=a.files[u];c[u]=p?{before:p.before,after:h.after,beforeHash:p.beforeHash,afterHash:h.afterHash}:h}l=[...t.undo.slice(0,-1),{...e,files:c}]}else l=[...t.undo,e];return{version:1,updatedAt:e.createdAt,undo:l.slice(Math.max(0,l.length-i)),redo:[]}}function Ew(t,e,n){for(const[r,i]of Object.entries(t.files)){const a=e==="undo"?i.afterHash:i.beforeHash;if(n[r]!==a)return{ok:!1,reason:"content-mismatch",path:r}}return{ok:!0}}function oN(t,e,n){const r=t.undo[t.undo.length-1];if(!r)return{ok:!1,reason:"empty",state:t,filesToWrite:{}};const i=Ew(r,"undo",e);return i.ok?{ok:!0,entry:r,filesToWrite:Object.fromEntries(Object.entries(r.files).map(([a,l])=>[a,l.before])),state:{version:1,updatedAt:n,undo:t.undo.slice(0,-1),redo:[...t.redo,r]}}:{ok:!1,reason:i.reason,path:i.path,state:t,filesToWrite:{}}}function cN(t,e,n){const r=t.redo[t.redo.length-1];if(!r)return{ok:!1,reason:"empty",state:t,filesToWrite:{}};const i=Ew(r,"redo",e);return i.ok?{ok:!0,entry:r,filesToWrite:Object.fromEntries(Object.entries(r.files).map(([a,l])=>[a,l.after])),state:{version:1,updatedAt:n,undo:[...t.undo,r],redo:t.redo.slice(0,-1)}}:{ok:!1,reason:i.reason,path:i.path,state:t,filesToWrite:{}}}const uN="hyperframes-studio-edit-history",fN=1,Bf="project-history";function dN(){return new Promise((t,e)=>{if(!globalThis.indexedDB){e(new Error("IndexedDB is not available"));return}const n=globalThis.indexedDB.open(uN,fN);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(Bf)||r.createObjectStore(Bf)},n.onerror=()=>e(n.error??new Error("Failed to open edit history db")),n.onsuccess=()=>t(n.result)})}function Rp(t,e){return dN().then(n=>new Promise((r,i)=>{const a=n.transaction(Bf,t),l=e(a.objectStore(Bf));l.onerror=()=>i(l.error??new Error("IndexedDB request failed")),l.onsuccess=()=>r(l.result),a.oncomplete=()=>n.close(),a.onerror=()=>{n.close(),i(a.error??new Error("IndexedDB transaction failed"))}}))}function hN(){return{async get(t){return await Rp("readonly",e=>e.get(t))??null},async set(t,e){await Rp("readwrite",n=>n.put(e,t))},async delete(t){await Rp("readwrite",e=>e.delete(t))}}}async function mN(t,e){return await t.get(e)??yg()}async function pN(t,e,n){await t.set(e,n)}function gN(t){return`edit-${t.toString(36)}-${Math.random().toString(36).slice(2,10)}`}function $w(t){const e=t.undo[t.undo.length-1]??null,n=t.redo[t.redo.length-1]??null;return{canUndo:!!e,canRedo:!!n,undoLabel:(e==null?void 0:e.label)??null,redoLabel:(n==null?void 0:n.label)??null,undoPaths:e?Object.keys(e.files):[],redoPaths:n?Object.keys(n.files):[],state:t}}async function B5(t,e){const n={},r={};for(const i of t){const a=await e(i);n[i]=a,r[i]=xg(a)}return{currentFiles:n,currentHashes:r}}async function Y5({files:t,rollbackFiles:e,writeFile:n}){const r=[];try{for(const[i,a]of Object.entries(t))await n(i,a),r.push(i)}catch(i){try{for(const a of r.reverse())await n(a,e[a])}catch(a){throw new AggregateError([i,a],"Failed to apply edit history and rollback did not complete")}throw i}}function I5({projectId:t,storage:e,initialState:n,now:r=Date.now,onChange:i}){let a=n,l=Promise.resolve();const c=async h=>{a=h,i(h);try{await pN(e,t,h)}catch{}},u=async h=>{const p=l.then(async()=>{const{state:O,result:x}=await h(a);return O!==a&&await c(O),x});return l=p.then(()=>{},()=>{}),p};return{snapshot:()=>$w(a),async recordEdit(h){await u(async p=>{const O=r(),x=sN({...h,id:gN(O),projectId:t,now:O});return{state:lN(p,x),result:void 0}})},async undo(h){return u(async p=>{const O=p.undo[p.undo.length-1];if(!O)return{state:p,result:{ok:!1,reason:"empty"}};const{currentFiles:x,currentHashes:y}=await B5(Object.keys(O.files),h.readFile),b=oN(p,y,r());return b.ok?(await Y5({files:b.filesToWrite,rollbackFiles:x,writeFile:h.writeFile}),{state:b.state,result:{ok:!0,label:b.entry.label,paths:Object.keys(b.entry.files)}}):{state:p,result:{ok:!1,reason:b.reason}}})},async redo(h){return u(async p=>{const O=p.redo[p.redo.length-1];if(!O)return{state:p,result:{ok:!1,reason:"empty"}};const{currentFiles:x,currentHashes:y}=await B5(Object.keys(O.files),h.readFile),b=cN(p,y,r());return b.ok?(await Y5({files:b.filesToWrite,rollbackFiles:x,writeFile:h.writeFile}),{state:b.state,result:{ok:!0,label:b.entry.label,paths:Object.keys(b.entry.files)}}):{state:p,result:{ok:!1,reason:b.reason}}})}}}function ON(t){const e=d.useMemo(()=>t.storage??hN(),[t.storage]),n=t.now??Date.now,[r,i]=d.useState(()=>yg()),[a,l]=d.useState(!1),c=t.projectId,u=d.useRef(null);d.useEffect(()=>{let x=!1;const y=yg();if(u.current=null,i(y),l(!1),!c){l(!0);return}return mN(e,c).then(b=>{x||(u.current=I5({projectId:c,storage:e,initialState:b,now:n,onChange:i}),i(b))}).catch(()=>{x||(u.current=I5({projectId:c,storage:e,initialState:y,now:n,onChange:i}),i(y))}).finally(()=>{x||l(!0)}),()=>{x=!0}},[n,c,e]);const h=d.useCallback(async x=>{var y;await((y=u.current)==null?void 0:y.recordEdit(x))},[]),p=d.useCallback(async x=>{var y;return((y=u.current)==null?void 0:y.undo(x))??{ok:!1,reason:"empty"}},[]),O=d.useCallback(async x=>{var y;return((y=u.current)==null?void 0:y.redo(x))??{ok:!1,reason:"empty"}},[]);return{loaded:a,...$w(r),recordEdit:h,undo:p,redo:O}}function xN(t){const[e,n]=d.useState(240),[r,i]=d.useState(400),[a,l]=d.useState(()=>gs().leftCollapsed??!1),[c,u]=d.useState((t==null?void 0:t.rightCollapsed)??!0),[h,p]=d.useState((t==null?void 0:t.rightPanelTab)??"renders"),O=d.useRef(null),x=d.useCallback(()=>{l(A=>(wo({leftCollapsed:!A}),Yt("panel_toggle",{panel:"left_sidebar",collapsed:!A}),!A))},[]),y=d.useCallback((A,C)=>{C.preventDefault(),C.target.setPointerCapture(C.pointerId),O.current={side:A,startX:C.clientX,startW:A==="left"?e:r}},[e,r]),b=d.useCallback(A=>{const C=O.current;if(!C)return;const T=A.clientX-C.startX,j=Math.floor(window.innerWidth*.5),M=Math.max(160,Math.min(C.side==="left"?j:600,C.startW+(C.side==="left"?T:-T)));C.side==="left"?n(M):i(M)},[]),S=d.useCallback(()=>{O.current=null},[]),k=d.useCallback(A=>{p(A),Yt("tab_switch",{panel:"right_panel",tab:A})},[p]);return{leftWidth:e,setLeftWidth:n,rightWidth:r,leftCollapsed:a,setLeftCollapsed:l,rightCollapsed:c,setRightCollapsed:u,rightPanelTab:h,setRightPanelTab:k,toggleLeftSidebar:x,handlePanelResizeStart:y,handlePanelResizeMove:b,handlePanelResizeEnd:S}}const yN=/\.(eot|otf|ttc|ttf|woff2?)$/i,q5=/\s+(thin|extralight|extra light|light|regular|roman|medium|semibold|semi bold|bold|extrabold|extra bold|black|italic|oblique|variable)$/i;function G5(t){return JSON.stringify(t)}function Co(t){const e=decodeURIComponent(t.split(/[\\/]/).pop()??t).replace(yN,"");let n=e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim();for(;q5.test(n);)n=n.replace(q5,"").trim();return n||e}function q8(t,e=t.url){return`@font-face { font-family: ${G5(t.family)}; src: url(${G5(e)}); font-display: swap; }`}function bN({projectId:t,showToast:e,recordEdit:n,domEditSaveTimestampRef:r,setRefreshKey:i}){const[a,l]=d.useState(null),[c,u]=d.useState(null),[h,p]=d.useState([]),[O,x]=d.useState([]),[y,b]=d.useState(!1),[S,k]=d.useState(null),A=d.useRef(a==null?void 0:a.path);A.current=a==null?void 0:a.path;const C=d.useRef(t);C.current=t;const T=d.useRef(null),j=d.useRef(null),M=d.useRef([]);d.useEffect(()=>{if(!t){b(!1);return}let ae=!1;return b(!1),fetch(`/api/projects/${t}`).then(Y=>Y.json()).then(Y=>{!ae&&Y.files&&p(Y.files),!ae&&Y.compositions&&x(Y.compositions),ae||u(typeof Y.dir=="string"?Y.dir:null)}).catch(()=>{ae||u(null)}).finally(()=>{ae||b(!0)}),()=>{ae=!0}},[t]);const E=d.useCallback(async ae=>{const Y=C.current;if(!Y)throw new Error("No active project");const re=await fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae)}`);if(!re.ok)throw new Error(`Failed to read ${ae}`);const he=await re.json();if(typeof he.content!="string")throw new Error(`Missing file contents for ${ae}`);return he.content},[]),$=d.useCallback(async(ae,Y)=>{const re=C.current;if(!re)throw new Error("No active project");if(!(await fetch(`/api/projects/${re}/files/${encodeURIComponent(ae)}`,{method:"PUT",headers:{"Content-Type":"text/plain"},body:Y})).ok)throw new Error(`Failed to save ${ae}`);A.current===ae&&l({path:ae,content:Y})},[]),N=d.useCallback((ae,Y)=>{A.current===ae&&l({path:ae,content:Y})},[]),D=d.useCallback(async ae=>{const Y=C.current;if(!Y)throw new Error("No active project");const re=await fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae)}?optional=1`);if(!re.ok)throw new Error(`Failed to read ${ae}`);const he=await re.json();return typeof he.content=="string"?he.content:""},[]),z=d.useCallback(ae=>{var re;const Y=C.current;if(Y){if((re=U.current)==null||re.abort(),U.current=null,X.current++,O7(ae)){l({path:ae,content:null});return}fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae)}`).then(he=>he.json()).then(he=>{he.content!=null&&l({path:ae,content:he.content})}).catch(()=>{})}},[]),B=d.useCallback(ae=>{const Y=C.current;if(!Y)return;const re=A.current;re&&(T.current!=null&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{r.current=Date.now(),xs({projectId:Y,label:"Edit source",kind:"source",coalesceKey:`source:${re}`,files:{[re]:ae},readFile:E,writeFile:$,recordEdit:n}).then(()=>{j.current!=null&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(()=>i(he=>he+1))}).catch(he=>{Yt("save_failure",{source:"code_editor",error_message:he instanceof Error?he.message:"unknown"})})}))},[r,E,n,i,$]),X=d.useRef(0),U=d.useRef(null),I=d.useCallback((ae,Y)=>{var ke;const re=C.current;if(!re||!ae)return;if((ke=U.current)==null||ke.abort(),U.current=null,A.current===ae&&(a==null?void 0:a.content)!=null){const be=Os(a.content,Y);k(be?be.start:null);return}const he=++X.current,xe=new AbortController;U.current=xe,fetch(`/api/projects/${re}/files/${encodeURIComponent(ae)}`,{signal:xe.signal}).then(be=>be.json()).then(be=>{if(he===X.current&&be.content!=null){l({path:ae,content:be.content});const Se=Os(be.content,Y);k(Se?Se.start:null)}}).catch(()=>{})},[a==null?void 0:a.content]),K=d.useCallback(async()=>{const ae=C.current;if(!ae)return;const re=await(await fetch(`/api/projects/${ae}`)).json();re.files&&p(re.files)},[]),Z=d.useCallback(async(ae,Y)=>{var be,Se;const re=C.current,he=Array.from(ae);if(!re||he.length===0)return[];const xe=new FormData;for(const Ve of he)xe.append("file",Ve);const ke=Y?`?dir=${encodeURIComponent(Y)}`:"";try{const Ve=await fetch(`/api/projects/${re}/upload${ke}`,{method:"POST",body:xe});if(Ve.ok){const Te=await Ve.json();if((be=Te.skipped)!=null&&be.length&&e(`Skipped (too large): ${Te.skipped.join(", ")}`),(Se=Te.invalid)!=null&&Se.length){const Ze=Te.invalid.map(Xe=>Xe.name).join(", ");e(`Unsupported media skipped: ${Ze}`)}return await K(),i(Ze=>Ze+1),Array.isArray(Te.files)?Te.files:[]}else Ve.status===413?e("Upload rejected: payload too large"):e(`Upload failed (${Ve.status})`)}catch{e("Upload failed: network error")}return[]},[K,i,e]),F=d.useCallback(async ae=>{const Y=C.current;if(!Y)return;let re="";ae.endsWith(".html")&&(re=`<!DOCTYPE html>
|
|
77
|
+
<html>
|
|
78
|
+
<head>
|
|
79
|
+
<meta charset="UTF-8">
|
|
80
|
+
</head>
|
|
81
|
+
<body>
|
|
82
|
+
|
|
83
|
+
</body>
|
|
84
|
+
</html>
|
|
85
|
+
`);const he=await fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae)}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:re});if(he.ok)await K(),z(ae);else{const xe=await he.json().catch(()=>({error:"unknown"}));console.error(`Create file failed: ${xe.error}`)}},[K,z]),_=d.useCallback(async ae=>{const Y=C.current;if(!Y)return;const re=await fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae+"/.gitkeep")}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:""});if(re.ok)await K();else{const he=await re.json().catch(()=>({error:"unknown"}));console.error(`Create folder failed: ${he.error}`)}},[K]),q=d.useCallback(async ae=>{const Y=C.current;if(!Y)return;const re=await fetch(`/api/projects/${Y}/files/${encodeURIComponent(ae)}`,{method:"DELETE"});if(re.ok)A.current===ae&&l(null),await K();else{const he=await re.json().catch(()=>({error:"unknown"}));console.error(`Delete failed: ${he.error}`)}},[K]),G=d.useCallback(async(ae,Y)=>{const re=C.current;if(!re)return;const he=await fetch(`/api/projects/${re}/files/${encodeURIComponent(ae)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPath:Y})});if(he.ok)A.current===ae&&z(Y),await K(),i(xe=>xe+1);else{const xe=await he.json().catch(()=>({error:"unknown"}));console.error(`Rename failed: ${xe.error}`)}},[K,z,i]),R=d.useCallback(async ae=>{const Y=C.current;if(!Y)return;const re=await fetch(`/api/projects/${Y}/duplicate-file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ae})});if(re.ok){const he=await re.json();await K(),he.path&&z(he.path)}else{const he=await re.json().catch(()=>({error:"unknown"}));console.error(`Duplicate failed: ${he.error}`)}},[K,z]),P=G,L=d.useCallback(async(ae,Y)=>Z(Array.from(ae),Y),[Z]),V=d.useCallback(async ae=>{const Y=await Z(Array.from(ae).filter(xe=>Tf.test(xe.name)),"assets/fonts"),re=C.current,he=Y.filter(xe=>Tf.test(xe)).map(xe=>({family:Co(xe),path:xe,url:`/api/projects/${re}/preview/${xe}`}));return M.current=[...he,...M.current.filter(xe=>!he.some(ke=>ke.family.toLowerCase()===xe.family.toLowerCase()))],he},[Z]),W=O,ee=d.useMemo(()=>h.filter(ae=>!ae.endsWith(".html")&&!ae.endsWith(".md")&&!ae.endsWith(".json")),[h]),ue=d.useMemo(()=>ee.filter(ae=>Tf.test(ae)).map(ae=>({family:Co(ae),path:ae,url:`/api/projects/${t}/preview/${ae}`})),[ee,t]);return{editingFile:a,setEditingFile:l,projectDir:c,fileTree:h,fileTreeLoaded:y,setFileTree:p,editingPathRef:A,projectIdRef:C,saveRafRef:T,importedFontAssetsRef:M,readProjectFile:E,writeProjectFile:$,readOptionalProjectFile:D,updateEditingFileContent:N,revealSourceOffset:S,openSourceForSelection:I,handleFileSelect:z,handleContentChange:B,refreshFileTree:K,uploadProjectFiles:Z,handleCreateFile:F,handleCreateFolder:_,handleDeleteFile:q,handleRenameFile:G,handleDuplicateFile:R,handleMoveFile:P,handleImportFiles:L,handleImportFonts:V,compositions:W,assets:ee,fontAssets:ue}}const Jr="--hf-studio-offset-x",ei="--hf-studio-offset-y",ja="--hf-studio-width",Pa="--hf-studio-height",To="data-hf-studio-manual-edit-gesture",bi="--hf-studio-rotation",va="data-hf-studio-path-offset",Sa="data-hf-studio-box-size",wa="data-hf-studio-rotation",ka="data-hf-studio-original-translate",Aa="data-hf-studio-original-inline-translate",Iu="data-hf-studio-original-width",qu="data-hf-studio-original-height",Gu="data-hf-studio-original-min-width",Uu="data-hf-studio-original-min-height",Wu="data-hf-studio-original-max-width",Ku="data-hf-studio-original-max-height",Ju="data-hf-studio-original-flex-basis",e0="data-hf-studio-original-flex-grow",t0="data-hf-studio-original-flex-shrink",n0="data-hf-studio-original-box-sizing",Oa="data-hf-studio-original-scale",ll="data-hf-studio-original-transform-origin",r0="data-hf-studio-original-display",Ma="data-hf-studio-original-rotate",Ca="data-hf-studio-original-inline-rotate",Fi="data-hf-studio-original-rotation-transform-origin",dl="data-hf-studio-rotation-draft",Ta="data-hf-studio-original-transform-display",vN="__hfStudioManualEditsApply",bg="__hfStudioManualEditsWrapped",Q1="__hfStudioManualEditsPlaybackFrame",SN="center center";function wN(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function jw(t){return Math.round(t*10)/10}function Z1(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\//,"")}function vg(t){if(typeof t=="string"){const n=t.trim();if(!n)return null;if(n.startsWith("{"))try{return vg(JSON.parse(n))}catch{return Z1(n)}return Z1(n)}if(!t||typeof t!="object")return null;const e=t;return typeof e.path=="string"?Z1(e.path):typeof e.filePath=="string"?Z1(e.filePath):"data"in e?vg(e.data):null}function kN(t){return vg(t)}function G8(t,...e){const n=t.ownerDocument.defaultView;if(!(n!=null&&n.__timelines))return!1;const r=new Set(e);for(const i of Object.values(n.__timelines))if(i!=null&&i.getChildren)try{for(const a of i.getChildren(!0)){if(!a.targets||!a.vars)continue;let l=!1;for(const u of a.targets())if(u===t||t.id&&u.id===t.id){l=!0;break}if(!l)continue;const c=a.vars;for(const u of r)if(u in c)return!0;if(c.keyframes&&typeof c.keyframes=="object"){for(const u of Object.values(c.keyframes))if(u&&typeof u=="object"){for(const h of r)if(h in u)return!0}}}}catch{}return!1}function Cu(t,e,n){for(const r of e){const i=t.style.getPropertyValue(r);i&&n.push({type:"inline-style",property:r,value:i})}}function Tu(t,e,n){for(const r of e){const i=t.getAttribute(r);i!==null&&n.push({type:"attribute",property:r,value:i})}}function Pw(t,e){const n=t.getAttribute(Ta);n!==null&&(e.push({type:"inline-style",property:"display",value:n||null}),e.push({type:"attribute",property:Ta,value:null}))}function U5(t){const e=[];return Cu(t,[Jr,ei,"translate"],e),e.push({type:"attribute",property:va,value:"true"}),Tu(t,[ka,Aa],e),Cu(t,["display"],e),Tu(t,[Ta],e),e}function AN(t){const e=t.getAttribute(Aa),n=[{type:"inline-style",property:Jr,value:null},{type:"inline-style",property:ei,value:null},{type:"inline-style",property:"translate",value:e||null},{type:"attribute",property:va,value:null},{type:"attribute",property:ka,value:null},{type:"attribute",property:Aa,value:null}];return Pw(t,n),n}const MN=["width","height","min-width","min-height","max-width","max-height","flex-basis","flex-grow","flex-shrink","box-sizing","scale","transform-origin","display"],Qw=[[Iu,"width"],[qu,"height"],[Gu,"min-width"],[Uu,"min-height"],[Wu,"max-width"],[Ku,"max-height"],[Ju,"flex-basis"],[e0,"flex-grow"],[t0,"flex-shrink"],[n0,"box-sizing"],[Oa,"scale"],[ll,"transform-origin"],[r0,"display"],[Ta,""]];function CN(t){const e=[];return Cu(t,[ja,Pa],e),Cu(t,MN,e),e.push({type:"attribute",property:Sa,value:"true"}),Tu(t,Qw.map(([n])=>n),e),e}function TN(t){const e=[{type:"inline-style",property:ja,value:null},{type:"inline-style",property:Pa,value:null},{type:"attribute",property:Sa,value:null}];for(const[n,r]of Qw){const i=t.getAttribute(n);i!==null&&r&&e.push({type:"inline-style",property:r,value:i||null}),e.push({type:"attribute",property:n,value:null})}return e}const EN=[bi,"rotate","transform-origin","display"],$N=[Ma,Ca,Fi,Ta];function jN(t){const e=[];return Cu(t,EN,e),e.push({type:"attribute",property:wa,value:"true"}),Tu(t,$N,e),e}function PN(t){const e=t.getAttribute(Ca),n=t.getAttribute(Fi),r=[{type:"inline-style",property:bi,value:null},{type:"inline-style",property:"rotate",value:e||null},{type:"inline-style",property:"transform-origin",value:n!==null&&n||null},{type:"attribute",property:wa,value:null},{type:"attribute",property:dl,value:null},{type:"attribute",property:Ma,value:null},{type:"attribute",property:Ca,value:null},{type:"attribute",property:Fi,value:null}];return Pw(t,r),r}const QN=[Mo,ku,Au];function ZN(t){const e=t.getAttribute(ys);if(!e)return[];const n=[{type:"attribute",property:ys,value:e}];return Tu(t,QN,n),n}function NN(t){return[{type:"attribute",property:ys,value:null},{type:"attribute",property:Mo,value:null},{type:"attribute",property:ku,value:null},{type:"attribute",property:Au,value:null}]}let W5=0;function Zw(t){W5+=1;const e=`gesture-${W5}`;return t.setAttribute(To,e),e}function Qi(t,e){e&&t.getAttribute(To)!==e||t.removeAttribute(To)}function Nw(t){return t.hasAttribute(To)}function N1(t,e){return t.getAttribute(To)===e}function Eo(t,e){const n=Number.parseFloat(t.style.getPropertyValue(e));return Number.isFinite(n)?n:0}function Sg(t){return{x:Eo(t,Jr),y:Eo(t,ei)}}function Yf(t){return{width:Eo(t,ja),height:Eo(t,Pa)}}function Rw(t){const e=Number.parseFloat(t.style.getPropertyValue(bi));return{angle:Number.isFinite(e)?e:0}}function U8(t,e){var n;try{return((n=t.ownerDocument.defaultView)==null?void 0:n.getComputedStyle(t).getPropertyValue(e))??""}catch{return""}}function wg(t,e){return t.style.getPropertyValue(e)||U8(t,e)}function Vw(t,e){const n=wg(t,e).trim();return n==="none"?"":n}function kg(t){return t.includes(Jr)||t.includes(ei)}function K5(t){return t.includes(ja)||t.includes(Pa)}function Ag(t){return t.includes(bi)}function J5(t){return t.replace(/\s+/g,"").toLowerCase()}function RN(t,e){if(!t.hasAttribute(dl))return!1;const n=t.style.getPropertyValue(bi).trim();return!n||!e.trim()?!1:J5(e)===J5(J8(t,n))}function Fo(t){U8(t,"display")==="inline"&&(t.hasAttribute(Ta)||t.setAttribute(Ta,t.style.getPropertyValue("display")),t.style.setProperty("display","inline-block"))}function W8(t){const e=t.getAttribute(Ta);e!=null&&(e===""?t.style.removeProperty("display"):t.style.setProperty("display",e),t.removeAttribute(Ta))}function VN(t){const e=[];let n=0,r="";for(const i of t.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&e.push(r),r=""):r+=i;return r&&e.push(r),e}function Lw(t,e,n){var a;const r=(a=t.getAttribute(ka))==null?void 0:a.trim();if(!r||r==="none")return`${e} ${n}`;const i=VN(r);return i.length===1?`calc(${i[0]} + ${e}) ${n}`:i.length===2?`calc(${i[0]} + ${e}) calc(${i[1]} + ${n})`:i.length===3?`calc(${i[0]} + ${e}) calc(${i[1]} + ${n}) ${i[2]}`:`${e} ${n}`}function LN(t,e){const n=t.style.getPropertyValue("translate"),r=Vw(t,"translate"),i=t.hasAttribute(va),a=!kg(r);i?e&&a&&!Nw(t)&&t.setAttribute(ka,r):(t.setAttribute(Aa,kg(n)?"":n),t.setAttribute(ka,a?r:""))}function _w(t,e,n={}){LN(t,n.updateBase??!0),t.setAttribute(va,"true"),t.style.setProperty(Jr,`${Math.round(e.x)}px`),t.style.setProperty(ei,`${Math.round(e.y)}px`)}function _N(t){return t.is2D&&t.a===1&&t.b===0&&t.c===0&&t.d===1}function Dw(t){var r;if(t.hasAttribute(To))return;const e=t.style.getPropertyValue("transform");if(!e||e==="none")return;const n=(r=t.ownerDocument.defaultView)==null?void 0:r.DOMMatrix;if(n)try{const i=new n(e);if(i.m41===0&&i.m42===0)return;const a=Eo(t,Jr),l=Eo(t,ei),c=Math.atan2(i.b,i.a),u=Math.cos(c),h=Math.sin(c);i.m41-=a*u-l*h,i.m42-=a*h+l*u,Math.abs(i.m41)<.01&&Math.abs(i.m42)<.01&&_N(i)?t.style.removeProperty("transform"):t.style.setProperty("transform",i.toString())}catch{}}function If(t,e,n={}){Fo(t),_w(t,e,{updateBase:n.updateBase??!0}),t.style.setProperty("translate",Lw(t,`var(${Jr}, 0px)`,`var(${ei}, 0px)`)),Dw(t)}function $f(t,e){var r;if(Fo(t),_w(t,e,{updateBase:!1}),G8(t,"x","y")){t.style.setProperty("translate","none");const i=t.ownerDocument.defaultView;(r=i==null?void 0:i.gsap)==null||r.set(t,{x:e.x,y:e.y})}else t.style.setProperty("translate",Lw(t,`${Math.round(e.x)}px`,`${Math.round(e.y)}px`)),Dw(t)}function DN(t,e){const n=t.parentElement;if(!n)return null;const r=wg(n,"display").trim();if(r!=="flex"&&r!=="inline-flex")return null;const i=wg(n,"flex-direction").trim();return Math.round(Math.max(1,i.startsWith("column")?e.height:e.width))}function HN(t){if(!t.hasAttribute(Oa))return;const e=t.getAttribute(Oa);e==null||e===""?t.style.removeProperty("scale"):t.style.setProperty("scale",e),t.removeAttribute(Oa);const n=t.getAttribute(ll);n==null||n===""?t.style.removeProperty("transform-origin"):t.style.setProperty("transform-origin",n),t.removeAttribute(ll)}function XN(t,e){t.hasAttribute(Sa)||(t.setAttribute(Iu,t.style.getPropertyValue("width")),t.setAttribute(qu,t.style.getPropertyValue("height")),t.setAttribute(Gu,t.style.getPropertyValue("min-width")),t.setAttribute(Uu,t.style.getPropertyValue("min-height")),t.setAttribute(Wu,t.style.getPropertyValue("max-width")),t.setAttribute(Ku,t.style.getPropertyValue("max-height")),t.setAttribute(Ju,t.style.getPropertyValue("flex-basis")),t.setAttribute(e0,t.style.getPropertyValue("flex-grow")),t.setAttribute(t0,t.style.getPropertyValue("flex-shrink")),t.setAttribute(n0,t.style.getPropertyValue("box-sizing")),t.setAttribute(Oa,t.style.getPropertyValue("scale")),t.setAttribute(ll,t.style.getPropertyValue("transform-origin")),t.setAttribute(r0,t.style.getPropertyValue("display"))),t.setAttribute(Sa,"true"),t.style.setProperty(ja,`${Math.round(Math.max(1,e.width))}px`),t.style.setProperty(Pa,`${Math.round(Math.max(1,e.height))}px`)}function Hw(t,e){XN(t,e),HN(t);const n=Math.round(Math.max(1,e.width)),r=Math.round(Math.max(1,e.height));t.style.setProperty("box-sizing","border-box"),t.style.setProperty("width",`${n}px`),t.style.setProperty("height",`${r}px`),t.style.setProperty("min-width","0px"),t.style.setProperty("min-height","0px"),t.style.setProperty("max-width","none"),t.style.setProperty("max-height","none");const i=DN(t,e);i!=null&&(t.style.setProperty("flex-basis",`${i}px`),t.style.setProperty("flex-grow","0"),t.style.setProperty("flex-shrink","0")),U8(t,"display")==="inline"&&t.style.setProperty("display","inline-block")}function K8(t,e){Fo(t),Hw(t,e)}function zN(t,e){Fo(t),Hw(t,e)}function FN(t){return/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:deg|rad|turn|grad)$/.test(t.trim())}function J8(t,e){var r;const n=(r=t.getAttribute(Ma))==null?void 0:r.trim();return!n||n==="none"||!FN(n)?e:`calc(${n} + ${e})`}function BN(t,e){const n=t.style.getPropertyValue("rotate"),r=Vw(t,"rotate"),i=t.hasAttribute(wa),a=!Ag(r)&&!RN(t,r);i?e&&a&&!Nw(t)&&t.setAttribute(Ma,r):(t.setAttribute(Ca,Ag(n)?"":n),t.setAttribute(Ma,a?r:"")),t.hasAttribute(Fi)||t.setAttribute(Fi,t.style.getPropertyValue("transform-origin"))}function Xw(t,e,n={}){BN(t,n.updateBase??!0),t.setAttribute(wa,"true"),t.style.setProperty(bi,`${jw(e.angle)}deg`),t.style.setProperty("transform-origin",SN)}function eO(t,e){Fo(t),Xw(t,e),t.removeAttribute(dl),t.style.setProperty("rotate",J8(t,`var(${bi}, 0deg)`))}function YN(t,e){Fo(t),Xw(t,e,{updateBase:!1}),t.setAttribute(dl,"true"),t.style.setProperty("rotate",J8(t,`${jw(e.angle)}deg`))}function tO(t,e){var a;const n=(a=t.defaultView)==null?void 0:a.HTMLElement;if(!n)return[];const r=Array.from(t.querySelectorAll(`[${e}="true"]`)).filter(l=>l instanceof n),i=`data-${e}`;for(const l of t.querySelectorAll(`[${i}="true"]`))l instanceof n&&!l.hasAttribute(e)&&(l.setAttribute(e,"true"),l.removeAttribute(i),r.push(l));return r}function IN(t){for(const e of tO(t,va)){const n=G8(e,"x","y"),r=e.style.getPropertyValue(Jr),i=e.style.getPropertyValue(ei);n||(r||i)&&If(e,{x:Number.parseFloat(r)||0,y:Number.parseFloat(i)||0},{updateBase:!1})}}function qN(t){for(const e of tO(t,Sa)){if(G8(e,"width","height"))continue;const n=Number.parseFloat(e.style.getPropertyValue(ja)),r=Number.parseFloat(e.style.getPropertyValue(Pa));Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0&&K8(e,{width:n,height:r})}}function GN(t){for(const e of tO(t,wa)){const n=Number.parseFloat(e.style.getPropertyValue(bi));Number.isFinite(n)&&eO(e,{angle:n})}}function ou(t){IN(t),qN(t),GN(t),gg(t)}function UN(t){return{width:t.style.getPropertyValue("width"),height:t.style.getPropertyValue("height"),minWidth:t.style.getPropertyValue("min-width"),minHeight:t.style.getPropertyValue("min-height"),maxWidth:t.style.getPropertyValue("max-width"),maxHeight:t.style.getPropertyValue("max-height"),flexBasis:t.style.getPropertyValue("flex-basis"),flexGrow:t.style.getPropertyValue("flex-grow"),flexShrink:t.style.getPropertyValue("flex-shrink"),boxSizing:t.style.getPropertyValue("box-sizing"),scale:t.style.getPropertyValue("scale"),transformOrigin:t.style.getPropertyValue("transform-origin"),display:t.style.getPropertyValue("display"),studioWidth:t.style.getPropertyValue(ja),studioHeight:t.style.getPropertyValue(Pa),marker:t.getAttribute(Sa),originalWidth:t.getAttribute(Iu),originalHeight:t.getAttribute(qu),originalMinWidth:t.getAttribute(Gu),originalMinHeight:t.getAttribute(Uu),originalMaxWidth:t.getAttribute(Wu),originalMaxHeight:t.getAttribute(Ku),originalFlexBasis:t.getAttribute(Ju),originalFlexGrow:t.getAttribute(e0),originalFlexShrink:t.getAttribute(t0),originalBoxSizing:t.getAttribute(n0),originalScale:t.getAttribute(Oa),originalTransformOrigin:t.getAttribute(ll),originalDisplay:t.getAttribute(r0)}}function WN(t){return{rotate:t.style.getPropertyValue("rotate"),transformOrigin:t.style.getPropertyValue("transform-origin"),studioRotation:t.style.getPropertyValue(bi),marker:t.getAttribute(wa),draftMarker:t.getAttribute(dl),originalRotate:t.getAttribute(Ma),originalInlineRotate:t.getAttribute(Ca),originalTransformOrigin:t.getAttribute(Fi)}}function nO(t){return{translate:t.style.getPropertyValue("translate"),x:t.style.getPropertyValue(Jr),y:t.style.getPropertyValue(ei),marker:t.getAttribute(va),originalTranslate:t.getAttribute(ka),originalInlineTranslate:t.getAttribute(Aa)}}function ln(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function $n(t,e,n){n?t.style.setProperty(e,n):t.style.removeProperty(e)}function Vp(t,e){$n(t,"width",e.width),$n(t,"height",e.height),$n(t,"min-width",e.minWidth),$n(t,"min-height",e.minHeight),$n(t,"max-width",e.maxWidth),$n(t,"max-height",e.maxHeight),$n(t,"flex-basis",e.flexBasis),$n(t,"flex-grow",e.flexGrow),$n(t,"flex-shrink",e.flexShrink),$n(t,"box-sizing",e.boxSizing),$n(t,"scale",e.scale),$n(t,"transform-origin",e.transformOrigin),$n(t,"display",e.display),$n(t,ja,e.studioWidth),$n(t,Pa,e.studioHeight),ln(t,Sa,e.marker),ln(t,Iu,e.originalWidth),ln(t,qu,e.originalHeight),ln(t,Gu,e.originalMinWidth),ln(t,Uu,e.originalMinHeight),ln(t,Wu,e.originalMaxWidth),ln(t,Ku,e.originalMaxHeight),ln(t,Ju,e.originalFlexBasis),ln(t,e0,e.originalFlexGrow),ln(t,t0,e.originalFlexShrink),ln(t,n0,e.originalBoxSizing),ln(t,Oa,e.originalScale),ln(t,ll,e.originalTransformOrigin),ln(t,r0,e.originalDisplay)}function Lp(t,e){$n(t,"rotate",e.rotate),$n(t,"transform-origin",e.transformOrigin),$n(t,bi,e.studioRotation),ln(t,wa,e.marker),ln(t,dl,e.draftMarker),ln(t,Ma,e.originalRotate),ln(t,Ca,e.originalInlineRotate),ln(t,Fi,e.originalTransformOrigin)}function so(t,e){e.translate?t.style.setProperty("translate",e.translate):t.style.removeProperty("translate"),e.x?t.style.setProperty(Jr,e.x):t.style.removeProperty(Jr),e.y?t.style.setProperty(ei,e.y):t.style.removeProperty(ei),ln(t,va,e.marker),ln(t,ka,e.originalTranslate),ln(t,Aa,e.originalInlineTranslate)}function jr(t,e,n){const r=t.getAttribute(n);r==null||r===""?t.style.removeProperty(e):t.style.setProperty(e,r),t.removeAttribute(n)}function KN(t){const e=t.getAttribute(Ca);e==null||e===""?t.style.removeProperty("rotate"):t.style.setProperty("rotate",e),t.removeAttribute(Ca),t.removeAttribute(Ma);const n=t.getAttribute(Fi);n!=null&&(n===""?t.style.removeProperty("transform-origin"):t.style.setProperty("transform-origin",n)),t.removeAttribute(Fi)}function JN(t){const e=t.getAttribute(Aa);e==null||e===""?t.style.removeProperty("translate"):t.style.setProperty("translate",e),t.removeAttribute(Aa),t.removeAttribute(ka)}function eR(t){(t.hasAttribute(va)||kg(t.style.getPropertyValue("translate")))&&JN(t),W8(t),t.style.removeProperty(Jr),t.style.removeProperty(ei),t.removeAttribute(va),t.removeAttribute(ka),t.removeAttribute(Aa)}function tR(t){(t.hasAttribute(wa)||Ag(t.style.getPropertyValue("rotate")))&&KN(t),W8(t),t.style.removeProperty(bi),t.removeAttribute(wa),t.removeAttribute(dl),t.removeAttribute(Ma),t.removeAttribute(Ca),t.removeAttribute(Fi)}function nR(t){(t.hasAttribute(Sa)||K5(t.style.getPropertyValue("width"))||K5(t.style.getPropertyValue("height"))||t.hasAttribute(Oa))&&(jr(t,"width",Iu),jr(t,"height",qu),jr(t,"min-width",Gu),jr(t,"min-height",Uu),jr(t,"max-width",Wu),jr(t,"max-height",Ku),jr(t,"flex-basis",Ju),jr(t,"flex-grow",e0),jr(t,"flex-shrink",t0),jr(t,"box-sizing",n0),jr(t,"scale",Oa),jr(t,"transform-origin",ll),jr(t,"display",r0)),W8(t),t.style.removeProperty(ja),t.style.removeProperty(Pa),t.removeAttribute(Sa)}function rO(t){try{Object.defineProperty(t,bg,{configurable:!1,enumerable:!1,value:!0})}catch{try{t[bg]=!0}catch{}}}function iO(t){return!!t[bg]}function fa(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(iO(i))return!0;const a=function(...l){var u;const c=i.apply(this,l);return(u=t.__hfStudioManualEditsApply)==null||u.call(t),c};rO(a);try{e[n]=a}catch{return!1}return!0}function Xc(t,e){const n=t[e];if(typeof n!="function")return null;try{return wN(n.call(t))}catch{return null}}function rR(t){const e=Xc(t,"duration")??Xc(t,"getDuration");if(e==null)return!0;if(e<=0)return!1;const n=Xc(t,"time")??Xc(t,"totalTime")??Xc(t,"getTime");return n==null?!0:n<e}function _p(t){if(!t)return!1;const e=t.isPlaying;if(typeof e=="function")try{return!!e.call(t)}catch{return!1}const n=t.paused;if(typeof n=="function"){try{if(n.call(t))return!1}catch{return!1}const i=t.isActive;if(typeof i=="function")try{if(i.call(t))return!0}catch{return!1}return rR(t)}const r=t.isActive;if(typeof r=="function")try{return!!r.call(t)}catch{return!1}return!1}function zw(t){return _p(t.__player)||_p(t.__timeline)?!0:Object.values(t.__timelines??{}).some(_p)}function Fw(t){var n;if((n=t.__hfStudioManualEditsApply)==null||n.call(t),t[Q1]!=null)return;const e=()=>{var r;if((r=t.__hfStudioManualEditsApply)==null||r.call(t),!zw(t)){t[Q1]=null;return}t[Q1]=t.requestAnimationFrame(e)};t[Q1]=t.requestAnimationFrame(e)}function R1(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(iO(i))return!0;const a=function(...l){const c=i.apply(this,l);return Fw(t),c};rO(a);try{e[n]=a}catch{return!1}return!0}function V1(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(iO(i))return!0;const a=function(...l){var u;const c=i.apply(this,l);return(u=t.__hfStudioManualEditsApply)==null||u.call(t),c};rO(a);try{e[n]=a}catch{return!1}return!0}function iR(t,e){const n=t;n[vN]=e;const r=fa(n,n.__hf,"seek"),i=fa(n,n.__player,"seek"),a=fa(n,n.__player,"renderSeek"),l=fa(n,n.__timeline,"seek");fa(n,n.__timeline,"totalTime");const c=R1(n,n.__player,"play"),u=R1(n,n.__timeline,"play"),h=V1(n,n.__player,"pause"),p=V1(n,n.__timeline,"pause");let O=!1,x=!1,y=!1;for(const b of Object.values(n.__timelines??{}))O=fa(n,b,"seek")||O,fa(n,b,"totalTime"),x=R1(n,b,"play")||x,y=V1(n,b,"pause")||y;if(n.__timelines&&!n.__timelines.__proxied){const b=n.__timelines;n.__timelines=new Proxy(b,{set(S,k,A){var C;if(S[k]=A,typeof A=="object"&&A!==null){const T=A;fa(n,T,"seek"),fa(n,T,"totalTime"),R1(n,T,"play"),V1(n,T,"pause"),(C=n.__hfStudioManualEditsApply)==null||C.call(n)}return!0}}),n.__timelines.__proxied=!0}return zw(n)&&Fw(n),r||i||a||l||c||u||h||p||O||x||y}function aR({projectId:t,showToast:e,readOptionalProjectFile:n,writeProjectFile:r,recordEdit:i,previewIframeRef:a,activeCompPathRef:l,domEditSaveTimestampRef:c,reloadPreview:u,pendingTimelineEditPathRef:h}){const p=d.useRef(0),O=d.useRef(Promise.resolve()),x=d.useRef(async()=>{}),y=d.useRef(t);y.current=t;const b=d.useCallback(T=>{const j=O.current.catch(()=>{}).then(T);return O.current=j.then(()=>{},()=>{}),j},[]),S=d.useCallback(async()=>{await O.current.catch(()=>{})},[]),k=d.useCallback((T=a.current)=>{var N,D,z,B,X,U;if(!T)return;let j=null;try{j=T.contentDocument}catch{return}if(!j)return;const M=()=>{let I=null;try{I=T.contentDocument}catch{return}I&&ou(I)},E=()=>{M(),T.contentWindow&&iR(T.contentWindow,M)},$=T.contentWindow;E(),(N=$==null?void 0:$.requestAnimationFrame)==null||N.call($,E),(D=$==null?void 0:$.setTimeout)==null||D.call($,E,80),(z=$==null?void 0:$.setTimeout)==null||z.call($,E,250),(B=$==null?void 0:$.setTimeout)==null||B.call($,E,500),(X=$==null?void 0:$.setTimeout)==null||X.call($,E,1e3),(U=$==null?void 0:$.setTimeout)==null||U.call($,E,2e3)},[a]),A=d.useCallback(async(T=a.current)=>{k(T)},[k,a]);x.current=A;const C=d.useCallback(async T=>{u()},[u]);return Wt(()=>{n(mg).then(T=>{if(T){try{const j=JSON.parse(T);if(!Array.isArray(j.motions)||j.motions.length===0)return}catch{return}return r(mg,JSON.stringify({version:1,motions:[]}))}}).catch(()=>{})}),Wt(()=>{const T=M=>{const E=kN(M);if(!E)return;const $=Date.now()-c.current<4e3;if(h!=null&&h.current.has(E)){h.current.delete(E);return}$||u()},j=new EventSource("/api/events");return j.addEventListener("file-change",T),()=>j.close()}),{domTextCommitVersionRef:p,domEditSaveQueueRef:O,applyStudioManualEditsToPreviewRef:x,queueDomEditSave:b,waitForPendingDomEditSaves:S,applyCurrentStudioManualEditsToPreview:k,applyStudioManualEditsToPreview:A,syncHistoryPreviewAfterApply:C}}function qs(t){return t.label||t.id||t.tag}function eb(t){const e=t.trim(),n=/^[a-z]+:\/\//i.test(e)?new URL(e).pathname:e;return decodeURIComponent(n).replace(/\\/g,"/").replace(/^\.?\//,"")}function sR(t,e){const n=eb(t).split("/").filter(Boolean),r=eb(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 lR(t){return/^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(t)}function oR(t,e){const n=e.trim();if(!n)return;const r=n.replace(/\\/g,"/");if(lR(r))return r;const i=t==null?void 0:t.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(i)return`${i}/${r.replace(/^\.?\//,"")}`}function Dp(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 tb(t){return/^url\(/i.test(t.trim())}function cR(t){return t==="left"||t==="top"||t==="width"||t==="height"}function aO(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 nb(t){const e=aO(t);return e?!!e.closest("input, textarea, select, [contenteditable='true'], [role='textbox'], .cm-editor"):!1}function L1(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 Mg(t,e){const n=t.sourceFile||"index.html";for(const r of e){const i=r.sourceFile||"index.html";if(t.id&&r.domId===t.id&&i===n||t.isCompositionHost&&t.compositionSrc&&r.compositionSrc===t.compositionSrc||t.selector&&r.selector===t.selector&&(r.selectorIndex??0)===(t.selectorIndex??0)&&(r.sourceFile??"index.html")===t.sourceFile)return r.key??r.id}return null}function uR(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 Eu(i,n,r)}function Eu(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function Vd(t){return Array.from(t.matchAll(/\bid="([^"]+)"/g),e=>e[1]??"")}const _1={image:3,video:5,audio:5};async function rb(t,e,n){if(n==="image")return _1.image;const r=document.createElement(n==="video"?"video":"audio");r.preload="metadata",r.src=`/api/projects/${t}/preview/${e}`;const i=await new Promise(a=>{const l=window.setTimeout(()=>a(_1[n]),3e3),c=u=>{window.clearTimeout(l),a(u)};r.addEventListener("loadedmetadata",()=>{const u=Number(r.duration);c(Number.isFinite(u)&&u>0?Math.round(u*100)/100:_1[n])},{once:!0}),r.addEventListener("error",()=>c(_1[n]),{once:!0})});return r.src="",r.load(),i}function fR(t,e){let n=`${e}-split`,r=2;for(;t.includes(n);)n=`${e}-split-${r++}`;return n}async function dR(t,e,n,r,i){const a=await fetch(`/api/projects/${t}/file-mutations/split-element/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:n,splitTime:r,newId:i})});if(!a.ok)throw new Error("Split request failed");return await a.json()}async function hR(t,e,n,r,i,a,l){const c=await fetch(`/api/projects/${t}/gsap-mutations/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"split-animations",originalId:n,newId:r,splitTime:i,elementStart:a,elementDuration:l})});if(!c.ok){const h=await c.json().catch(()=>null);if((h==null?void 0:h.error)==="no GSAP script found in file")return{content:null};throw new Error((h==null?void 0:h.error)??`GSAP animation split failed (${c.status})`)}const u=await c.json();return{content:u.ok&&u.after?u.after:null,skippedSelectors:u.skippedSelectors}}async function ib(t,e,n,r,i){var x;const a=B8(e);if(!a)throw new Error("Clip is missing a patchable target.");const l=e.sourceFile||r||"index.html",c=await Ao(t,l),u=fR(Vd(c),e.domId||"clip"),h=await dR(t,l,a,n,u);if(!h.ok)throw new Error("Failed to split clip.");if(!h.changed)return{targetPath:l,originalContent:c,patchedContent:c,changed:!1};let p=typeof h.content=="string"?h.content:c,O;if(e.domId)try{const y=await hR(t,l,e.domId,u,n,e.start,e.duration);y.content&&(p=y.content),(x=y.skippedSelectors)!=null&&x.length&&(O=y.skippedSelectors)}catch(y){throw await i(l,c),y}return{targetPath:l,originalContent:c,patchedContent:p,changed:!0,skippedSelectors:O}}function mR({projectId:t,activeCompPath:e,showToast:n,writeProjectFile:r,recordEdit:i,domEditSaveTimestampRef:a,reloadPreview:l,isRecordingRef:c}){const u=d.useRef(t);u.current=t;const h=d.useCallback(async(O,x)=>{if(c!=null&&c.current){n("Cannot edit timeline while recording","error");return}const y=u.current;if(!y||!wu(O))return;const b=O.start,S=O.start+O.duration;if(!(x<=b+zf||x>=S-zf))try{const{targetPath:k,originalContent:A,patchedContent:C,changed:T,skippedSelectors:j}=await ib(y,O,x,e,r);if(!T){n("Failed to split clip — playhead may be outside the clip","error");return}a.current=Date.now(),await xs({projectId:y,label:"Split timeline clip",kind:"timeline",files:{[k]:C},readFile:async()=>A,writeFile:r,recordEdit:i}),l(),n(`Split ${qs(O)} at ${x.toFixed(2)}s`,"info"),j!=null&&j.length&&n(`Some animations use non-ID selectors (${j.join(", ")}) and were not retargeted`,"info")}catch(k){const A=k instanceof Error?k.message:"Failed to split timeline clip";n(A,"error")}},[e,i,n,r,a,l,c]),p=d.useCallback(async O=>{if(c!=null&&c.current){n("Cannot edit timeline while recording","error");return}const x=u.current;if(!x)return;const{elements:y}=oe.getState(),b=y.filter(S=>wu(S)&&O>S.start&&O<S.start+S.duration);if(b.length!==0)try{const S=new Map;for(const C of b){const T=C.sourceFile||e||"index.html";S.has(T)||S.set(T,await Ao(x,T))}let k=0;const A=new Map;for(const C of b){const T=await ib(x,C,O,e,r);T.changed&&(A.set(T.targetPath,T.patchedContent),await r(T.targetPath,T.patchedContent),k++)}if(k===0)return;a.current=Date.now(),await i({label:`Split ${k} clips at ${O.toFixed(2)}s`,kind:"timeline",files:Object.fromEntries([...A].map(([C,T])=>[C,{before:S.get(C)??"",after:T}]))}),l(),n(`Split ${k} clips at ${O.toFixed(2)}s`,"info")}catch(S){const k=S instanceof Error?S.message:"Failed to split clips";n(k,"error")}},[e,i,n,r,a,l,c]);return{handleRazorSplit:h,handleRazorSplitAll:p}}function pR({projectId:t,activeCompPath:e,timelineElements:n,showToast:r,writeProjectFile:i,recordEdit:a,domEditSaveTimestampRef:l,reloadPreview:c,previewIframeRef:u,pendingTimelineEditPathRef:h,uploadProjectFiles:p,isRecordingRef:O}){const x=d.useRef(t);x.current=t;const y=d.useRef(Promise.resolve()),b=d.useRef(0),S=d.useCallback((N,D,z)=>{if(O!=null&&O.current)return r("Cannot edit timeline while recording","error"),Promise.resolve();const B=x.current;if(!B)return Promise.resolve();const X=y.current.then(()=>MP({projectId:B,element:N,activeCompPath:e,label:D,buildPatches:z,writeProjectFile:i,recordEdit:a,domEditSaveTimestampRef:l,pendingTimelineEditPathRef:h}));return y.current=X.catch(U=>{console.error(`[Timeline] Failed to persist: ${D}`,U)}),X},[e,a,i,l,h,r,O]),k=d.useCallback((N,D)=>(Z5(u.current,N,[["data-start",In(D.start)],["data-track-index",String(D.track)]]),S(N,"Move timeline clip",(z,B)=>{let X=Hc(z,B,{type:"attribute",property:"start",value:In(D.start)});return Hc(X,B,{type:"attribute",property:"track-index",value:String(D.track)})})),[u,S]),A=d.useCallback((N,D)=>(Z5(u.current,N,[["data-start",In(D.start)],["data-duration",In(D.duration)]]),S(N,"Resize timeline clip",(z,B)=>{const X=AP(z,B,N,D);let U=Hc(z,B,{type:"attribute",property:"start",value:In(D.start)});return U=Hc(U,B,{type:"attribute",property:"duration",value:In(D.duration)}),X&&(U=Hc(U,B,{type:"attribute",property:X.attrName,value:In(X.value)})),U})),[u,S]),C=d.useCallback(async N=>{if(O!=null&&O.current){r("Cannot edit timeline while recording","error");return}const D=x.current;if(!D)throw new Error("No active project");const z=qs(N),B=N.sourceFile||e||"index.html";try{const X=await Ao(D,B),U=B8(N);if(!U)throw new Error(`Timeline element ${N.id} is missing a patchable target`);const I=await fetch(`/api/projects/${D}/file-mutations/remove-element/${encodeURIComponent(B)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:U})});if(!I.ok)throw new Error(`Failed to delete ${N.id} from ${B}`);const K=await I.json(),Z=typeof K.content=="string"?K.content:X;l.current=Date.now(),await xs({projectId:D,label:"Delete timeline clip",kind:"timeline",files:{[B]:Z},readFile:async()=>X,writeFile:i,recordEdit:a}),oe.getState().setElements(n.filter(F=>(F.key??F.id)!==(N.key??N.id))),oe.getState().setSelectedElementId(null),c(),r(`Deleted ${z}. Use Undo to restore it.`,"info")}catch(X){const U=X instanceof Error?X.message:"Failed to delete timeline clip";r(U)}},[e,a,r,n,i,l,c,O]),T=d.useCallback(async(N,D,z)=>{if(O!=null&&O.current){r("Cannot edit timeline while recording","error");return}const B=x.current;if(!B)throw new Error("No active project");const X=E5(N);if(!X){r("Only image, video, and audio assets can be dropped onto the timeline.");return}const U=e||"index.html";try{const I=await Ao(B,U),K=Number(In(D.start)),Z=Number.isFinite(z)&&z!=null&&z>0?z:await rb(B,N,X),F=Number(In(Z)),_=Ij(N,Vd(I)),q=qj(U,N),G=U||"index.html",R=n.filter(V=>(V.sourceFile||e||"index.html")===G),P=Math.max(1,R.length+1),L=X8(I,Uj({id:_,assetPath:q,kind:X,start:K,duration:F,track:D.track,zIndex:P,geometry:x7(I)}));l.current=Date.now(),await xs({projectId:B,label:"Add timeline asset",kind:"timeline",files:{[U]:L},readFile:async()=>I,writeFile:i,recordEdit:a}),c()}catch(I){const K=I instanceof Error?I.message:"Failed to drop asset onto timeline";r(K)}},[e,a,r,n,i,l,c,O]),j=d.useCallback(async(N,D)=>{if(O!=null&&O.current){r("Cannot edit timeline while recording","error");return}const z=x.current;if(!z)return;const B=await p(N);if(B.length===0)return;const X=[];for(const I of B){const K=E5(I),Z=K?await rb(z,I,K):0;X.push(Number(In(Z)))}const U=Gj(D??{start:0,track:0},X,n.filter(I=>(I.sourceFile||e||"index.html")===(e||"index.html")).map(I=>({start:I.start,duration:I.duration,track:I.track})));for(const[I,K]of B.entries())await T(K,U[I]??U[0],X[I])},[e,T,n,p,O,r]),M=d.useCallback(N=>{const D=Date.now();D-b.current<1500||(b.current=D,r("This clip can't be moved or resized from the timeline yet.","info"))},[r]),{handleRazorSplit:E,handleRazorSplitAll:$}=mR({projectId:t,activeCompPath:e,showToast:r,writeProjectFile:i,recordEdit:a,domEditSaveTimestampRef:l,reloadPreview:c,isRecordingRef:O});return{handleTimelineElementMove:k,handleTimelineElementResize:A,handleTimelineElementDelete:C,handleTimelineElementSplit:E,handleRazorSplit:E,handleRazorSplitAll:$,handleTimelineAssetDrop:T,handleTimelineFileDrop:j,handleBlockedTimelineEdit:M}}const Bw=["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 Gr(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"&&t.nodeType===1}function as(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 gR(t){const e=(t??"none").trim();if(!e||e==="none")return!0;const n=e.match(/^matrix\(([^)]+)\)$/i);if(n){const l=n[1].split(",").map(c=>Number.parseFloat(c.trim()));return l.length!==6||l.some(c=>!Number.isFinite(c))?!1:Math.abs(l[0]-1)<1e-4&&Math.abs(l[1])<1e-4&&Math.abs(l[2])<1e-4&&Math.abs(l[3]-1)<1e-4&&Math.abs(l[4])<1e-4&&Math.abs(l[5])<1e-4}const r=e.match(/^matrix3d\(([^)]+)\)$/i);if(!r)return!1;const i=r[1].split(",").map(l=>Number.parseFloat(l.trim()));if(i.length!==16||i.some(l=>!Number.isFinite(l)))return!1;const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return i.every((l,c)=>Math.abs(l-a[c])<1e-4)}function OR(t){return["div","span","p","strong","h1","h2","h3","h4","h5","h6"].includes(t)}function Yw(t){var r;const e={},n=(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t);if(!n)return e;for(const i of Bw){const a=n.getPropertyValue(i);a&&(e[i]=a)}return e}function Iw(t){const e={};for(const n of Bw){const r=t.style.getPropertyValue(n);r&&(e[n]=r)}return e}function xR(t){const e={};for(const n of t.attributes)n.name.startsWith("data-")&&(e[n.name.slice(5)]=n.value);return e}function Cg(t,e){let n=t;for(;n;){const r=n;if(e.some(i=>r.hasAttribute(i)))return r;n=n.parentElement}return null}function il(t,e){const n=Cg(t,["data-composition-file","data-composition-src"]),r=Cg(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"))??e??"index.html";return{sourceFile:i,compositionPath:i}}function ab(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 qw(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]??"",a=i.charCodeAt(0);if(a===0){n+="�";continue}const l=a>=48&&a<=57,c=a>=65&&a<=90,u=a>=97&&a<=122,h=a>=1&&a<=31||a===127,p=r===0&&l,O=r===1&&t.startsWith("-")&&l;if(h||p||O){n+=`\\${a.toString(16)} `;continue}if(c||u||l||i==="-"||i==="_"||a>=128){n+=i;continue}n+=`\\${i}`}return n}function Tg(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}function Eg(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function D1(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 Gw(t){if(t.id)return`#${qw(t.id)}`;const e=t.getAttribute("data-composition-id");return e?`[data-composition-id="${Tg(e)}"]`:Uw(t)}function Uw(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?`.${qw(n)}`:void 0}function Ww(t,e,n,r,i){if(!(n!=null&&n.startsWith(".")))return;const l=Eg(t,n).filter(c=>Gr(c)&&il(c,i).sourceFile===r).indexOf(e);return l>=0?l:void 0}function Ld(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)return!1;n=n.parentElement}return!0}const sb=new Set(["img","video","canvas","svg","audio"]);function yR(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 bR(t){const e=t.tagName.toLowerCase();if(sb.has(e)||yR(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(Gr(i)&&(sb.has(i.tagName.toLowerCase())||Ld(i)))return!1}return!0}function vR(t){const e=t.getBoundingClientRect();return!(e.width<=1||e.height<=1||!Ld(t)||bR(t))}const SR=new Set(["base","br","canvas","link","meta","script","source","style","template","track","wbr"]);function wR(t){var r;const e=t.tagName.toLowerCase();if(SR.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 i0(t,e){if(!wR(t)||t.hasAttribute("data-composition-id"))return null;const n=Gw(t);if(!n)return null;const{sourceFile:r}=il(t,e);return{id:t.id||void 0,hfId:t.getAttribute("data-hf-id")||void 0,selector:n,selectorIndex:Ww(t.ownerDocument,t,n,r,e),sourceFile:r}}function kR(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 AR(t,e){if(e.preferClipAncestor){const n=kR(t);if(n)return n}return t}function MR(t,e){return Kw(t,e)[0]??null}function Kw(t,e){const n=[];for(const a of t)Gr(a)&&vR(a)&&i0(a,e.activeCompositionPath)&&n.push(a);if(n.length===0)return[];const r=[];let i=n[0];for(let a=1;a<n.length;a++){const l=n[a];i.contains(l)||r.push(i),i=l}return r.push(i),r}function mr(t,e,n=null){if(e.hfId){const i=t.querySelector(`[data-hf-id="${e.hfId}"]`);if(Gr(i))return i}if(e.id){const i=t.getElementById(e.id);if(Gr(i)&&(!e.sourceFile||il(i,n).sourceFile===e.sourceFile))return i}return e.selector?e.selector.startsWith(".")&&e.selectorIndex!=null?Eg(t,e.selector).filter(a=>Gr(a)&&(!e.sourceFile||il(a,n).sourceFile===e.sourceFile))[e.selectorIndex]??null:Eg(t,e.selector).filter(i=>Gr(i)&&(!e.sourceFile||il(i,n).sourceFile===e.sourceFile))[0]??null:null}function CR(t,e,n){var O;const r=typeof e.id=="string"?e.id:"",i=ab(e.compositionSrc)??((O=n.compIdToSrc)==null?void 0:O.get(r)),a=i??ab(e.sourceFile)??n.activeCompositionPath??"index.html",l=Tg(r),c=i?Tg(i):null,u=e.selector??(i?`[data-composition-src="${c}"],[data-composition-file="${c}"],[data-composition-id="${l}"]`:l?`[data-composition-id="${l}"]`:void 0);if(u||e.domId){const x=mr(t,{id:e.domId??void 0,selector:u,selectorIndex:e.selectorIndex,sourceFile:a},n.activeCompositionPath);if(x)return x}const h=!!(e.domId||e.selector||i);if(n.isMasterView||h||!n.activeCompositionPath)return null;const p=t.querySelector("[data-composition-id]");return Gr(p)&&il(p,n.activeCompositionPath).sourceFile===a?p:null}function TR(t,e){return Array.from(t.children).filter(n=>Gr(n)&&i0(n,e.activeCompositionPath)!==null)}function Hp(t){return OR(t.tagName.toLowerCase())&&t.children.length===0}function ER(t,e,n,r){return r==="self"||n===1?"Content":`Text ${e+1}`}function Xp(t,e,n,r){const i=t.tagName.toLowerCase();return{key:t.getAttribute("data-hf-text-key")??`${r}:${e}:${i}`,label:ER(i,e,n,r),value:t.textContent??"",tagName:i,attributes:Array.from(t.attributes).filter(l=>l.name!=="style").map(l=>({name:l.name,value:l.value})),inlineStyles:Iw(t),computedStyles:Yw(t),source:r}}function $R(t){const e=Array.from(t.children).filter(Gr).filter(Hp);if(e.length>0){if(Array.from(t.childNodes).some(r=>{var i;return r.nodeType===3&&((i=r.textContent)==null?void 0:i.trim())})){const r=[];let i=0;for(const a of t.childNodes)if(a.nodeType===3){const l=a.textContent??"";if(!l.trim())continue;r.push({key:`text-node:${i}`,label:`Text ${i+1}`,value:l,tagName:"#text",attributes:[],inlineStyles:{},computedStyles:{},source:"text-node"}),i++}else Gr(a)&&Hp(a)&&(r.push(Xp(a,i,e.length,"child")),i++);return r}return e.map((r,i)=>Xp(r,i,e.length,"child"))}return Hp(t)?[Xp(t,0,1,"self")]:[]}function lb(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function jR(t){const e=Object.entries(t.inlineStyles).filter(([,n])=>!!n);return e.length===0?"":e.map(([n,r])=>`${n}: ${r}`).join("; ")}function ob(t){return t.filter(e=>e.source==="child"||e.source==="text-node").map(e=>{if(e.source==="text-node")return lb(e.value);const n=[...e.attributes.filter(a=>a.name!=="data-hf-text-key"),{name:"data-hf-text-key",value:e.key}].map(a=>` ${a.name}="${a.value.replace(/"/g,""")}"`).join(""),r=jR(e),i=r?` style="${r.replace(/"/g,""")}"`:"";return`<${e.tagName}${n}${i}>${lb(e.value)}</${e.tagName}>`}).join("")}function PR(t){var e,n,r,i;return{key:`child:new:${Date.now()}`,label:"Text",value:"New text",tagName:"span",attributes:[],inlineStyles:{"font-family":((e=t==null?void 0:t.computedStyles)==null?void 0:e["font-family"])??"inherit","font-size":((n=t==null?void 0:t.computedStyles)==null?void 0:n["font-size"])??"16px","font-weight":((r=t==null?void 0:t.computedStyles)==null?void 0:r["font-weight"])??"400",color:((i=t==null?void 0:t.computedStyles)==null?void 0:i.color)??"inherit"},computedStyles:{},source:"child"}}function QR(t){if(!t.selector&&!t.hfId||t.isInsideLockedComposition)return{canSelect:!t.isInsideLockedComposition,canEditStyles:!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===!1)return{canSelect:!0,canEditStyles:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:"This element is generated by a script and cannot be edited visually."};const e=t.computedStyles.position,n=as(t.inlineStyles.left)??as(t.computedStyles.left),r=as(t.inlineStyles.top)??as(t.computedStyles.top),i=as(t.inlineStyles.width)??as(t.computedStyles.width),a=as(t.inlineStyles.height)??as(t.computedStyles.height),l=!gR(t.computedStyles.transform),c=(e==="absolute"||e==="fixed")&&n!=null&&r!=null&&!l,u=c&&(i!=null||a!=null),h=!t.isCompositionHost,p=h,O=h,x=h,y=h?void 0:"Select an internal layer to transform it.";return t.isCompositionHost&&t.isMasterView?{canSelect:!0,canEditStyles:!1,canMove:c,canResize:u,canApplyManualOffset:p,canApplyManualSize:O,canApplyManualRotation:x,reasonIfDisabled:y}:{canSelect:!0,canEditStyles:!0,canMove:c,canResize:u,canApplyManualOffset:p,canApplyManualSize:O,canApplyManualRotation:x,reasonIfDisabled:y}}function Jw(t){const e=t.getAttribute("data-composition-id");if(e&&e!=="main")return D1(e);const n=t.getAttribute("data-composition-src")??t.getAttribute("data-composition-file");if(n)return D1(n);if(t.id)return D1(t.id);const r=Uw(t);if(r)return D1(r.replace(/^\./,""));const i=(t.textContent??"").trim().replace(/\s+/g," ");return i?i.length>40?`${i.slice(0,39)}…`:i:t.tagName.toLowerCase()}async function ZR(t,e,n){try{const r=await fetch(`/api/projects/${t}/file-mutations/probe-element/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:n})});return r.ok?(await r.json()).exists!==!1:!0}catch{return!0}}async function e9(t,e){var i;if(!t)return null;const n=t.ownerDocument;let r=AR(t,e);for(;r&&r!==n.body&&r!==n.documentElement;){const a=Gw(r),l=n9(r);if(!a&&!l){r=r.parentElement;continue}const{sourceFile:c,compositionPath:u}=il(r,e.activeCompositionPath),h=a?Ww(n,r,a,c,e.activeCompositionPath):void 0,p=r.getAttribute("data-composition-src")??r.getAttribute("data-composition-file")??void 0,O=Iw(r),x=Yw(r),y=$R(r),b=!!Cg(r,["data-timeline-locked"]);let S;if(!e.skipSourceProbe&&e.projectId&&(r.id||a||l)){const C={};r.id&&(C.id=r.id),l&&(C.hfId=l),a&&(C.selector=a),h!=null&&(C.selectorIndex=h),S=await ZR(e.projectId,c,C)}const k=QR({selector:a,hfId:l,tagName:r.tagName.toLowerCase(),className:r.className,inlineStyles:O,computedStyles:x,isCompositionHost:!!p,isInsideLockedComposition:b,isMasterView:e.isMasterView,existsInSource:S}),A=r.getBoundingClientRect();return{element:r,id:r.id||void 0,hfId:l,selector:a,selectorIndex:h,sourceFile:c,compositionPath:u,compositionSrc:p,isCompositionHost:!!p,isInsideLockedComposition:b,label:Jw(r),tagName:r.tagName.toLowerCase(),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:((i=r.textContent)==null?void 0:i.trim())||null,dataAttributes:xR(r),inlineStyles:O,computedStyles:x,textFields:y,capabilities:k}}return null}function t9(t){const e=t.selectorIndex??0;return`${t.sourceFile}:${t.id??t.selector??"layer"}:${e}`}function NR(t,e,n=80){if(!t)return[];const r=[],i=(a,l)=>{if(r.length>=n)return;const c=i0(a,e.activeCompositionPath);c&&r.push({key:t9(c),element:a,label:Jw(a),tagName:a.tagName.toLowerCase(),depth:l,childCount:TR(a,e).length,id:c.id??void 0,hfId:c.hfId??void 0,selector:c.selector??void 0,selectorIndex:c.selectorIndex,sourceFile:c.sourceFile});const u=c?l+1:l;for(const h of Array.from(a.children))if(Gr(h)&&(i(h,u),r.length>=n))return};return i(t,0),r}function H1(t,e){return{type:"inline-style",property:t,value:e}}function cb(t){return{type:"text-content",property:"text",value:t}}function di(t){return[t.sourceFile||"index.html",t.hfId??"",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function sO(t){return t.textFields.length>0&&!t.isCompositionHost&&!t.isInsideLockedComposition}function n9(t){var e;return((e=t.getAttribute("data-hf-id"))==null?void 0:e.trim())||void 0}function ub(t){return{id:t.id,hfId:t.hfId,selector:t.selector,selectorIndex:t.selectorIndex}}function RR(t){return`x=${Math.round(t.x)}, y=${Math.round(t.y)}, width=${Math.round(t.width)}, height=${Math.round(t.height)}`}function fb(t){return Object.entries(t).filter(([,e])=>e&&e!=="initial").map(([e,n])=>`${e}: ${n}`).join(`
|
|
86
|
+
`)}function VR(t){return t.map(e=>`- key=${e.key}; tag=<${e.tagName}>; source=${e.source}; text=${JSON.stringify(e.value)}`).join(`
|
|
87
|
+
`)}function LR({selection:t,currentTime:e,tagSnippet:n,selectionContext:r,userInstruction:i,sourceFilePath:a}){const l=(a==null?void 0:a.trim())||t.sourceFile,c=["## HyperFrames element edit request v1","Schema version: 1","",(i==null?void 0:i.trim())||"Edit this selected HyperFrames element.","",`Composition: ${t.compositionPath}`,`Playback time: ${Cn(e)}`,`Source file: ${l}`,`DOM id: ${t.id??"(none)"}`,`Selector: ${t.selector??"(none)"}`,`Selector index: ${t.selectorIndex??0}`,`Tag: <${t.tagName}>`,`Bounds: ${RR(t.boundingBox)}`];t.textContent&&c.push(`Text: ${t.textContent}`);const u=r==null?void 0:r.trim();u&&c.push("","Selection context:",u);const h=VR(t.textFields);h&&c.push("","Text fields:",h);const p=fb(t.inlineStyles);p&&c.push("","Inline styles:",p);const O=fb(t.computedStyles);return O&&c.push("","Computed styles (browser-resolved):",O),n&&c.push("","Target HTML:",n),c.push("","Guardrails:","- Make a targeted change to this element only.","- Preserve the rest of the composition and its timing.","- Do not modify other elements' data-* attributes or positioning.","- Prefer existing inline styles or existing CSS rules for this element over adding unrelated selectors."),c.join(`
|
|
88
|
+
`)}function _R(t,e){return[`Composition: ${t.compositionPath}`,`Source: ${t.sourceFile||e||"index.html"}`,`Selector: ${t.selector??"(none)"} Tag: <${t.tagName}>`,t.textContent?`Text: ${t.textContent}`:""].filter(Boolean).join(`
|
|
89
|
+
`)}function DR({previewIframe:t,activeCompPath:e,captionEditMode:n,domEditSelectionRef:r,domEditSelection:i,applyDomSelection:a,buildDomSelectionFromTarget:l,refreshPreviewDocumentVersion:c,syncPreviewHistoryHotkey:u,applyStudioManualEditsToPreviewRef:h,openSourceForSelection:p,getSidebarTab:O}){d.useEffect(()=>{if(!t)return;const y=async()=>{if(!Pn||n)return;const S=r.current;if(!S)return;let k=null;try{k=t.contentDocument}catch{return}if(!k)return;ou(k);const A=mr(k,S,e);if(!A){a(null,{revealPanel:!1});return}const C=await l(A);C&&a(C,{revealPanel:!1,preserveGroup:!0})};u(t),h.current(t),y(),c();const b=()=>{u(t),h.current(t),y(),c()};return t.addEventListener("load",b),()=>{t.removeEventListener("load",b)}},[e,a,l,n,r,t,c,u,h]);const x=d.useRef(p);x.current=p,d.useEffect(()=>{!i||!x.current||!O||i.sourceFile&&O()==="code"&&x.current(i.sourceFile,{id:i.id,selector:i.selector,selectorIndex:i.selectorIndex})},[i,O])}function HR({activeCompPath:t,projectDir:e,projectIdRef:n,showToast:r,domEditSelectionRef:i,domEditSelection:a}){const[l,c]=d.useState(),[u,h]=d.useState(),[p,O]=d.useState(null),[x,y]=d.useState(!1),[b,S]=d.useState(!1),k=d.useRef(null),A=d.useCallback(async j=>{const M=n.current;if(!M)return;const E=j.sourceFile||t||"index.html";try{const $=await fetch(`/api/projects/${M}/files/${encodeURIComponent(E)}`);if(!$.ok)return;const D=(await $.json()).content,z=typeof D=="string"?gP(D,j):void 0;c(B=>i.current!==j?B:z)}catch{}},[t,i,n]),C=d.useCallback(()=>{a&&(c(void 0),h(void 0),O(null),A(a),S(!0))},[a,A]),T=d.useCallback(async j=>{if(!a)return;const M=a.sourceFile||t||"index.html",E=l??a.element.outerHTML,$=LR({selection:a,currentTime:oe.getState().currentTime,tagSnippet:E,selectionContext:u,userInstruction:j,sourceFilePath:oR(e,M)});if(!await vu($)){r("Could not copy prompt to clipboard.","error");return}S(!1),h(void 0),O(null),k.current&&clearTimeout(k.current),y(!0),k.current=setTimeout(()=>y(!1),1600)},[t,u,l,a,e,r]);return d.useEffect(()=>{c(void 0),h(void 0),O(null),y(!1)},[a]),d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]),{agentModalOpen:b,agentModalAnchorPoint:p,copiedAgentPrompt:x,agentPromptSelectionContext:u,setAgentModalOpen:S,setAgentPromptSelectionContext:h,setAgentModalAnchorPoint:O,preloadAgentPromptSnippet:A,handleAskAgent:C,handleAgentModalSubmit:T}}function r9(t,e,n,r,i){const a=t.getBoundingClientRect(),l=e.querySelector("[data-composition-id]")??e.documentElement??null,c=l==null?void 0:l.getBoundingClientRect(),u=(c==null?void 0:c.width)||n.innerWidth,h=(c==null?void 0:c.height)||n.innerHeight;if(!u||!h)return null;const p=a.width/u,O=a.height/h;return{x:(r-a.left)/p,y:(i-a.top)/O,viewport:{width:u,height:h}}}const XR="__hf_studio_pointer_events_override__";function i9(t){try{const e=t.createElement("style");return e.id=XR,e.textContent="* { pointer-events: auto !important; }",t.head.appendChild(e),e}catch{return null}}function a9(t){try{t==null||t.remove()}catch{}}function zR(t,e,n,r){let i=null,a=null;try{i=t.contentDocument,a=t.contentWindow}catch{return null}if(!i||!a)return null;const l=r9(t,i,a,e,n);if(!l)return null;const c=i9(i);try{if(typeof i.elementsFromPoint=="function"){const h=MR(i.elementsFromPoint(l.x,l.y),{activeCompositionPath:r});if(h)return h}const u=aO(i.elementFromPoint(l.x,l.y));return!u||!i0(u,r)||!Ld(u)?null:u}finally{a9(c)}}function FR(t,e,n,r){let i=null,a=null;try{i=t.contentDocument,a=t.contentWindow}catch{return[]}if(!i||!a)return[];const l=r9(t,i,a,e,n);if(!l)return[];const c=i9(i);try{if(typeof i.elementsFromPoint=="function")return Kw(i.elementsFromPoint(l.x,l.y),{activeCompositionPath:r});const u=aO(i.elementFromPoint(l.x,l.y));return!u||!i0(u,r)?[]:Ld(u)?[u]:[]}finally{a9(c)}}function X1(t){return t&&(typeof t=="object"||typeof t=="function")?t:null}function zp(t,e){const n=t?Reflect.get(t,e):null;if(typeof n=="function")try{n.call(t)}catch{}}function Fp(t,e){const n=t?Reflect.get(t,e):null;if(typeof n!="function")return null;try{const r=n.call(t);return typeof r=="number"&&Number.isFinite(r)?r:null}catch{return null}}function BR(t){const e=t==null?void 0:t.contentWindow;if(!e)return null;try{const n=X1(Reflect.get(e,"__player")),r=Fp(n,"getTime");if(typeof(n?Reflect.get(n,"pause"):null)=="function")return zp(n,"pause"),r;let a=null;const l=X1(Reflect.get(e,"__timeline"));a=a??Fp(l,"time"),zp(l,"pause");const c=X1(Reflect.get(e,"__timelines"));if(c)for(const u of Object.values(c)){const h=X1(u);a=a??Fp(h,"time"),zp(h,"pause")}return a}catch{return null}}function Ws(t,e){return t===e?!0:!t||!e?!1:di(t)===di(e)}function cu(t,e){return e?t.some(n=>Ws(n,e)):!1}function YR(t,e){return cu(t,e)?t.filter(n=>!Ws(n,e)):[...t,e]}function IR(t,e){let n=!1;const r=t.map(i=>Ws(i,e)?(n=!0,e):i);return n?r:[...t,e]}function qR(t,e){return!e||cu(t,e)?t:[e,...t]}function GR({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,previewIframeRef:a,timelineElements:l,setSelectedTimelineElementId:c,setRightCollapsed:u,setRightPanelTab:h,previewIframe:p,refreshKey:O,rightPanelTab:x}){const[y,b]=d.useState(null),[S,k]=d.useState([]),[A,C]=d.useState(null),T=d.useRef(y),j=d.useRef(S),M=d.useRef(A);T.current=y,j.current=S,M.current=A;const E=d.useCallback((Z,F)=>{if(!Z){T.current=null,j.current=[],b(null),k([]),c(null);return}if(!Pn){T.current=null,j.current=[],b(null),k([]),c(null);return}const _=!!(F!=null&&F.additive),q=T.current,G=j.current,R=_?qR(G,q):G,P=cu(R,Z),L=F!=null&&F.preserveGroup?IR(R,Z):_?YR(R,Z):[Z],V=F!=null&&F.preserveGroup?Z:_&&P?Ws(q,Z)?L[0]??null:cu(L,q)?q:L[0]??null:Z;if(T.current=V,j.current=L,b(V),k(L),V){(F==null?void 0:F.revealPanel)!==!1&&(u(!1),x!=="layers"&&h("design"));const W=Mg(V,l);c(W);return}c(null)},[c,l,u,h,x]),$=d.useCallback(()=>{E(null,{revealPanel:!1})},[E]),N=d.useCallback((Z,F)=>e9(Z,{activeCompositionPath:e,isMasterView:n,preferClipAncestor:F==null?void 0:F.preferClipAncestor,skipSourceProbe:F==null?void 0:F.skipSourceProbe,projectId:t}),[e,n,t]),D=d.useCallback(async(Z,F,_)=>{const q=a.current;if(!q||i)return null;try{q.contentDocument&&ou(q.contentDocument)}catch{}const G=zR(q,Z,F,e);return G?N(G,{preferClipAncestor:_==null?void 0:_.preferClipAncestor,skipSourceProbe:_==null?void 0:_.skipSourceProbe}):null},[e,N,i,a]),z=d.useCallback(async(Z,F)=>{const _=a.current;if(!_||i)return[];try{_.contentDocument&&ou(_.contentDocument)}catch{}const q=FR(_,Z,F,e),G=[];for(const R of q){const P=await N(R,{skipSourceProbe:!0});P&&G.push(P)}return G},[e,N,i,a]),B=d.useCallback(Z=>{Ws(M.current,Z)||(M.current=Z,C(Z))},[]),X=d.useCallback(async Z=>{const F=a.current;let _=null;try{_=(F==null?void 0:F.contentDocument)??null}catch{return null}if(!_)return null;ou(_);const q=CR(_,Z,{activeCompositionPath:e,compIdToSrc:r,isMasterView:n});return q?N(q,{preferClipAncestor:!1}):null},[e,N,r,n,a]),U=d.useCallback(async Z=>{if(!Pn)return;if(!Z){E(null,{revealPanel:!1});return}const F=await X(Z);F&&E(F)},[E,X]),I=d.useCallback(async Z=>{const F=a.current;let _=null;try{_=(F==null?void 0:F.contentDocument)??null}catch{return}if(!_)return;const q=mr(_,Z,e);if(!q)return;const G=await N(q);G&&E(G,{revealPanel:!1,preserveGroup:!0})},[e,E,N,a]),K=d.useCallback(async Z=>{const F=a.current;let _=null;try{_=(F==null?void 0:F.contentDocument)??null}catch{return}if(!_)return;const q=[];for(const P of Z){const L=mr(_,P,e);if(!L)continue;const V=await N(L);V&&q.push(V)}if(q.length===0)return;const G=T.current,R=q.find(P=>Ws(P,G))??q[0]??null;T.current=R,j.current=q,b(R),k(q),c(R?Mg(R,l):null)},[e,N,c,l,a]);return d.useEffect(()=>{i&&B(null)},[i,B]),d.useEffect(()=>{B(null)},[e,t,p,O,B]),d.useEffect(()=>{if(!A)return;const Z=Ws(A,y),F=cu(S,A);!Z&&!F||B(null)},[S,A,y,B]),d.useEffect(()=>{A&&(A.element.isConnected||B(null))},[A,B]),d.useEffect(()=>{i&&E(null,{revealPanel:!1})},[E,i]),d.useEffect(()=>{Pn||(B(null),E(null,{revealPanel:!1}),x!=="renders"&&h("renders"))},[E,x,B,h]),{domEditSelection:y,domEditGroupSelections:S,domEditHoverSelection:A,domEditSelectionRef:T,domEditGroupSelectionsRef:j,domEditHoverSelectionRef:M,setDomEditSelection:b,setDomEditGroupSelections:k,applyDomSelection:E,clearDomSelection:$,buildDomSelectionFromTarget:N,resolveDomSelectionFromPreviewPoint:D,resolveAllDomSelectionsFromPreviewPoint:z,updateDomEditHoverSelection:B,buildDomSelectionForTimelineElement:X,handleTimelineElementSelect:U,refreshDomEditSelectionFromPreview:I,refreshDomEditGroupSelectionsFromPreview:K}}const UR=6,WR=600;function KR({captionEditMode:t,compositionLoading:e,previewIframeRef:n,showToast:r,applyDomSelection:i,resolveDomSelectionFromPreviewPoint:a,resolveAllDomSelectionsFromPreviewPoint:l,updateDomEditHoverSelection:c,onClickToSource:u}){const h=d.useRef(null),p=d.useCallback(async(S,k)=>{if(!hg||t||e)return;const A=Date.now(),C=h.current,T=C?S.clientX-C.x:1/0,j=C?S.clientY-C.y:1/0,M=C!==null&&Math.sqrt(T*T+j*j)<UR&&A-C.at<WR;if(S.shiftKey){h.current=null;const N=await a(S.clientX,S.clientY,{preferClipAncestor:(k==null?void 0:k.preferClipAncestor)??!1});if(!N)return;S.preventDefault(),S.stopPropagation(),i(N,{additive:!0});return}if(M&&C){const N=(C.index+1)%C.candidates.length,D=C.candidates[N];h.current={...C,index:N,at:A},S.preventDefault(),S.stopPropagation(),i(D);return}const E=await a(S.clientX,S.clientY,{preferClipAncestor:(k==null?void 0:k.preferClipAncestor)??!1});if(!E){h.current=null,i(null,{revealPanel:!1});return}S.preventDefault(),S.stopPropagation(),i(E),!S.shiftKey&&S.altKey&&u&&u(E);const $=await l(S.clientX,S.clientY);h.current=$.length>1?{x:S.clientX,y:S.clientY,candidates:$,index:0,at:A}:null},[i,t,e,u,l,a]),O=d.useCallback(async(S,k)=>{if(!hg||t||e)return c(null),null;const A=await a(S.clientX,S.clientY,{preferClipAncestor:(k==null?void 0:k.preferClipAncestor)??!1,skipSourceProbe:!0});return c(A),A},[t,e,a,c]),x=d.useCallback(()=>{c(null)},[c]),y=d.useCallback(S=>{r(S.capabilities.reasonIfDisabled??"This element can't be adjusted directly from the preview.","info")},[r]),b=d.useCallback(()=>{const S=BR(n.current),k=oe.getState();k.setIsPlaying(!1),S!=null&&(k.setCurrentTime(S),pr.notify(S))},[n]);return{handlePreviewCanvasMouseDown:p,handlePreviewCanvasPointerMove:O,handlePreviewCanvasPointerLeave:x,handleBlockedDomMove:y,handleDomManualDragStart:b}}const s9={inter:"inter",montserrat:"montserrat",outfit:"outfit",nunito:"nunito",oswald:"oswald","league gothic":"league-gothic","archivo black":"archivo-black","space mono":"space-mono","ibm plex mono":"ibm-plex-mono","jetbrains mono":"jetbrains-mono","eb garamond":"eb-garamond","playfair display":"playfair-display","source code pro":"source-code-pro","noto sans jp":"noto-sans-jp",roboto:"roboto","open sans":"open-sans",lato:"lato",poppins:"poppins","helvetica neue":"inter",helvetica:"inter",arial:"inter","helvetica bold":"inter",futura:"montserrat","din alternate":"montserrat","arial black":"montserrat","bebas neue":"league-gothic","courier new":"jetbrains-mono",courier:"jetbrains-mono",garamond:"eb-garamond","noto sans japanese":"noto-sans-jp","segoe ui":"roboto","sf pro":"inter","sf pro display":"inter","sf pro text":"inter","sf pro rounded":"inter",avenir:"inter","avenir next":"inter","lucida grande":"inter",geneva:"inter",optima:"inter",verdana:"inter",tahoma:"inter","trebuchet ms":"inter",calibri:"inter",candara:"inter",corbel:"inter","lucida sans":"inter","lucida sans unicode":"inter","noto sans":"inter","dejavu sans":"inter","liberation sans":"inter","sf mono":"jetbrains-mono",menlo:"jetbrains-mono",monaco:"jetbrains-mono",consolas:"jetbrains-mono","lucida console":"jetbrains-mono","lucida sans typewriter":"jetbrains-mono","andale mono":"jetbrains-mono","dejavu sans mono":"jetbrains-mono","liberation mono":"jetbrains-mono",georgia:"eb-garamond",palatino:"eb-garamond","palatino linotype":"eb-garamond","book antiqua":"eb-garamond",cambria:"eb-garamond",times:"eb-garamond","times new roman":"eb-garamond","dejavu serif":"eb-garamond","liberation serif":"eb-garamond"};new Set(Object.keys(s9));const JR={inter:"Inter",montserrat:"Montserrat",outfit:"Outfit",nunito:"Nunito",oswald:"Oswald","league-gothic":"League Gothic","archivo-black":"Archivo Black","space-mono":"Space Mono","ibm-plex-mono":"IBM Plex Mono","jetbrains-mono":"JetBrains Mono","eb-garamond":"EB Garamond","playfair-display":"Playfair Display","source-code-pro":"Source Code Pro","noto-sans-jp":"Noto Sans JP",roboto:"Roboto","open-sans":"Open Sans",lato:"Lato",poppins:"Poppins"};function eV(t){const e=s9[t.toLowerCase()];if(e)return JR[e]}const db=["ABeeZee","Abel","Abril Fatface","Alegreya","Alegreya Sans","Anton","Archivo","Archivo Black","Arimo","Assistant","Barlow","Barlow Condensed","Bebas Neue","Bitter","Bricolage Grotesque","Cabin","Cardo","Catamaran","Caveat","Chivo","Cormorant Garamond","Crimson Text","Dancing Script","DM Sans","DM Serif Display","Domine","EB Garamond","Exo 2","Figtree","Fira Code","Fira Sans","Fraunces","Fredoka","IBM Plex Mono","IBM Plex Sans","IBM Plex Serif","Inconsolata","Instrument Sans","Instrument Serif","Inter","JetBrains Mono","Josefin Sans","Jost","Kanit","Karla","Lato","League Gothic","Lexend","Libre Baskerville","Libre Franklin","Lora","Manrope","Merriweather","Montserrat","Mukta","Mulish","Newsreader","Noto Sans","Noto Sans JP","Noto Serif","Nunito","Nunito Sans","Open Sans","Oswald","Outfit","Overpass","Pacifico","Pathway Extreme","Permanent Marker","Playfair Display","Plus Jakarta Sans","Poppins","Prata","PT Sans","PT Serif","Public Sans","Quicksand","Raleway","Red Hat Display","Roboto","Roboto Condensed","Roboto Mono","Roboto Serif","Rubik","Schibsted Grotesk","Signika","Source Code Pro","Source Sans 3","Source Serif 4","Space Grotesk","Space Mono","Spectral","Sora","Syne","Teko","Titillium Web","Ubuntu","Ubuntu Mono","Unbounded","Urbanist","Varela Round","Work Sans","Young Serif","Zilla Slab"],$g=["TT Norms Pro","SF Pro Display","SF Pro Text","Avenir","Avenir Next","Menlo","Monaco"];function hb(t){const e=eV(t);if(!(!e||e.toLowerCase()===t.toLowerCase()))return e}function l9(t){return`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t.trim()).replace(/%20/g,"+")}:wght@300;400;500;600;700;800;900&display=swap`}const tV=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"]);function nV(t){return(t.split(",")[0]??"").trim().replace(/^["']|["']$/g,"")}function rV(t){var e;return((e=t.split(",")[0])==null?void 0:e.trim().replace(/^["']|["']$/g,"").trim())??""}function mb(t,e){const n=nV(e);if(!n||tV.has(n.toLowerCase()))return;const r=`studio-preview-google-font-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(t.getElementById(r))return;const i=t.createElement("link");i.id=r,i.rel="stylesheet",i.href=l9(n),t.head.appendChild(i)}function pb(t,e){const n=`studio-imported-font-${e.family.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(t.getElementById(n))return;const r=t.createElement("style");r.id=n,r.textContent=q8(e),t.head.appendChild(r)}function gb(t,e,n){const r=q8(e,sR(n,e.path));if(t.includes(r))return t;const a=/<style\b[^>]*data-hf-studio-fonts=(["'])true\1[^>]*>([\s\S]*?)<\/style>/i.exec(t);if(a){const c=`${a[2].trim()}
|
|
90
|
+
${r}`.trim();return t.replace(a[0],`<style data-hf-studio-fonts="true">
|
|
91
|
+
${c}
|
|
92
|
+
</style>`)}const l=`<style data-hf-studio-fonts="true">
|
|
93
|
+
${r}
|
|
94
|
+
</style>`;return/<\/head>/i.test(t)?t.replace(/<\/head>/i,` ${l}
|
|
95
|
+
</head>`):`${l}
|
|
96
|
+
${t}`}function iV({activeCompPath:t,previewIframeRef:e,domEditSelection:n,applyDomSelection:r,refreshDomEditSelectionFromPreview:i,buildDomSelectionFromTarget:a,persistDomEditOperations:l,resolveImportedFontAsset:c}){const u=d.useRef(0),h=d.useCallback(async(A,C)=>{if(!n||cR(A)||!n.capabilities.canEditStyles)return;const T=A==="font-family"?c(C):null,j=e.current,M=j==null?void 0:j.contentDocument;if(M){const N=mr(M,n,t);N&&(N.style.setProperty(A,Dp(A,C)),A==="font-family"&&(mb(M,C),T&&pb(M,T)),A==="background-image"&&tb(C)&&(N.style.setProperty("background-position","center"),N.style.setProperty("background-repeat","no-repeat"),N.style.setProperty("background-size","contain")))}const E=[H1(A,Dp(A,C))];A==="background-image"&&tb(C)&&E.push(H1("background-position","center"),H1("background-repeat","no-repeat"),H1("background-size","contain"));const $=A!=="z-index";try{await l(n,E,{label:"Edit layer style",skipRefresh:$,prepareContent:T?(N,D)=>gb(N,T,D):void 0})}catch(N){console.warn("[Studio] Style persist failed:",N instanceof Error?N.message:N)}i(n)},[t,n,l,i,c,e]),p=d.useCallback(async(A,C)=>{if(!n)return;const T=e.current,j=T==null?void 0:T.contentDocument;if(j){const E=mr(j,n,t);E&&E.setAttribute(`data-${A}`,C)}const M={type:"attribute",property:A,value:C};try{await l(n,[M],{label:`Edit ${A.replace(/-/g," ")}`,coalesceKey:`attr:${A}:${di(n)}`,skipRefresh:!1})}catch(E){console.warn("[Studio] Attribute persist failed:",E instanceof Error?E.message:E)}i(n)},[t,n,l,i,e]),O=d.useCallback(async(A,C)=>{if(!n)return;const T=e.current,j=T==null?void 0:T.contentDocument;if(j){const E=mr(j,n,t);E&&(C===null||C===""||C==="false"?E.removeAttribute(A):E.setAttribute(A,C))}const M={type:"html-attribute",property:A,value:C};try{await l(n,[M],{label:`Edit ${A}`,coalesceKey:`html-attr:${A}:${di(n)}`,skipRefresh:!1})}catch(E){console.warn("[Studio] HTML attribute persist failed:",E instanceof Error?E.message:E)}i(n)},[t,n,l,i,e]),x=d.useCallback(async(A,C)=>{if(!n||!sO(n))return;const T=u.current+1;u.current=T;const j=n.textFields.length>0?n.textFields.map(N=>N.key===C?{...N,value:A}:N):[],M=j.length>1||j.some(N=>N.source==="child")?ob(j):A,E=e.current,$=E==null?void 0:E.contentDocument;if($){const N=mr($,n,t);N&&(j.length>1||j.some(D=>D.source==="child")?N.innerHTML=M:N.textContent=A)}if(await l(n,[cb(M)],{label:"Edit text",skipRefresh:!0,shouldSave:()=>u.current===T}),u.current===T&&$){const N=mr($,n,t);if(N){const D=await a(N);D&&r(D,{revealPanel:!1,preserveGroup:!0})}}},[t,r,a,n,l,e]),y=d.useCallback(async(A,C,T)=>{var N;const j=C.length>1||C.some(D=>D.source==="child")?ob(C):((N=C[0])==null?void 0:N.value)??"",M=e.current,E=M==null?void 0:M.contentDocument;if(E){const D=mr(E,A,t);D&&(C.length>1||C.some(z=>z.source==="child")?D.innerHTML=j:D.textContent=j)}const $=(T==null?void 0:T.importedFont)??null;if(await l(A,[cb(j)],{label:"Edit text",skipRefresh:!0,prepareContent:$?(D,z)=>gb(D,$,z):void 0}),E){const D=mr(E,A,t);if(D){const z=await a(D);z&&r(z,{revealPanel:!1,preserveGroup:!0})}}},[t,r,a,l,e]),b=d.useCallback(async(A,C,T)=>{var N;if(!n)return;const j=n.textFields.find(D=>D.key===A);if(!j)return;if(j.source==="self"){await h(C,T);return}const M=Dp(C,T),E=C==="font-family"?c(T):null;if(C==="font-family"){const D=(N=e.current)==null?void 0:N.contentDocument;D&&(mb(D,M),E&&pb(D,E))}const $=n.textFields.map(D=>D.key===A?{...D,inlineStyles:{...D.inlineStyles,[C]:M},computedStyles:{...D.computedStyles,[C]:M}}:D);await y(n,$,{importedFont:E})},[y,n,h,c,e]),S=d.useCallback(async A=>{if(!n||!n.textFields.some(E=>E.source==="child"))return null;const C=n.textFields.findIndex(E=>E.key===A),T=n.textFields[C>=0?C:0]??n.textFields[0],j=PR(T),M=[...n.textFields];return M.splice(C>=0?C+1:M.length,0,j),await y(n,M),j.key},[y,n]),k=d.useCallback(async A=>{if(!n)return;const C=n.textFields.find(j=>j.key===A);if(!C)return;if(C.source==="self"){await x("",A);return}const T=n.textFields.filter(j=>j.key!==A);await y(n,T)},[y,n,x]);return{handleDomStyleCommit:h,handleDomAttributeCommit:p,handleDomHtmlAttributeCommit:O,handleDomTextCommit:x,commitDomTextFields:y,handleDomTextFieldStyleCommit:b,handleDomAddTextField:S,handleDomRemoveTextField:k}}function z1(t,e){if(!(t!=null&&t.contentWindow))return!1;let n;try{n=t.contentWindow.__timelines}catch{return!1}if(!n)return!1;const r=e.id;for(const i of Object.values(n))if(i!=null&&i.getChildren)try{for(const a of i.getChildren(!0))if(a.targets){for(const l of a.targets())if(l===e||r&&l.id===r)return!0}}catch{continue}return!1}function aV({activeCompPath:t,previewIframeRef:e,showToast:n,queueDomEditSave:r,writeProjectFile:i,domEditSaveTimestampRef:a,editHistory:l,fileTree:c,importedFontAssetsRef:u,projectId:h,projectIdRef:p,reloadPreview:O,domEditSelection:x,applyDomSelection:y,clearDomSelection:b,refreshDomEditSelectionFromPreview:S,buildDomSelectionFromTarget:k}){const A=d.useCallback(P=>{const L=rV(P);if(!L)return null;const V=u.current.find(ee=>ee.family.toLowerCase()===L.toLowerCase());if(V)return V;const W=c.find(ee=>Tf.test(ee)&&Co(ee).toLowerCase()===L.toLowerCase());return W?{family:Co(W),path:W,url:`/api/projects/${h}/preview/${W}`}:null},[c,h,u]),C=d.useRef(new Set),T=d.useCallback(async(P,L,V)=>{const W=p.current;if(!W)throw new Error("No active project");if(V!=null&&V.shouldSave&&!V.shouldSave())return;const ee=P.sourceFile||t||"index.html",ue=await fetch(`/api/projects/${W}/files/${encodeURIComponent(ee)}`);if(!ue.ok)throw new Error(`Failed to read ${ee}`);const Y=(await ue.json()).content;if(typeof Y!="string")throw new Error(`Missing file contents for ${ee}`);if(V!=null&&V.shouldSave&&!V.shouldSave())return;const re=ub(P);a.current=Date.now();const he=await fetch(`/api/projects/${W}/file-mutations/patch-element/${encodeURIComponent(ee)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:re,operations:L})});if(!he.ok)throw new Error(`Failed to patch ${ee}`);const xe=await he.json();if(!xe.changed){if(xe.matched===!1){const Se=P.selector??P.id??"selection";C.current.has(Se)||(C.current.add(Se),Yt("save_skipped_unresolvable",{target_id:P.id??void 0,target_selector:P.selector??void 0,target_source_file:P.sourceFile??void 0,composition:t??void 0}),console.warn(`[studio] Element not found in source: ${Se}. This element may be generated at runtime and cannot be persisted.`))}return}const ke=typeof xe.content=="string"?xe.content:Y;let be=ke;V!=null&&V.prepareContent&&(be=V.prepareContent(ke,ee),be!==ke&&await i(ee,be)),await l.recordEdit({label:(V==null?void 0:V.label)??"Edit layer",kind:"manual",coalesceKey:V==null?void 0:V.coalesceKey,files:{[ee]:{before:Y,after:be}}}),V!=null&&V.skipRefresh||O()},[t,l,i,p,a,O]),{handleDomStyleCommit:j,handleDomAttributeCommit:M,handleDomHtmlAttributeCommit:E,handleDomTextCommit:$,commitDomTextFields:N,handleDomTextFieldStyleCommit:D,handleDomAddTextField:z,handleDomRemoveTextField:B}=iV({activeCompPath:t,previewIframeRef:e,domEditSelection:x,applyDomSelection:y,refreshDomEditSelectionFromPreview:S,buildDomSelectionFromTarget:k,persistDomEditOperations:T,resolveImportedFontAsset:A}),X=d.useCallback((P,L,V)=>{r(async()=>{await T(P,L,{label:V.label,coalesceKey:V.coalesceKey,skipRefresh:V.skipRefresh??!0})}).catch(W=>{const ee=W instanceof Error?W.message:"Failed to save position";n(ee),Yt("save_failure",{source:"dom_edit",label:V.label,error_message:ee,target_id:P.id??void 0,target_selector:P.selector??void 0,target_source_file:P.sourceFile??void 0})})},[T,r,n]),U=d.useCallback((P,L)=>{If(P.element,L),!z1(e.current,P.element)&&X(P,U5(P.element),{label:"Move layer",coalesceKey:`path-offset:${di(P)}`})},[X,e]),I=d.useCallback(P=>{if(P.length===0)return;const L=P.map(V=>di(V.selection)).sort().join(":");for(const{selection:V,next:W}of P)If(V.element,W),!z1(e.current,V.element)&&X(V,U5(V.element),{label:`Move ${P.length} layers`,coalesceKey:`group-path-offset:${L}`})},[X,e]),K=d.useCallback((P,L)=>{K8(P.element,L),!z1(e.current,P.element)&&X(P,CN(P.element),{label:"Resize layer box",coalesceKey:`box-size:${di(P)}`})},[X,e]),Z=d.useCallback((P,L)=>{eO(P.element,L),!z1(e.current,P.element)&&X(P,jN(P.element),{label:"Rotate layer",coalesceKey:`rotation:${di(P)}`})},[X,e]),F=d.useCallback(P=>{const L=P.element,V=[...AN(L),...TN(L),...PN(L)];eR(L),nR(L),tR(L),X(P,V,{label:"Reset layer edits",coalesceKey:`manual-reset:${di(P)}`,skipRefresh:!1})},[X]),_=d.useCallback((P,L)=>{var ee;NP(P.element,L);let V=null;try{V=((ee=e.current)==null?void 0:ee.contentDocument)??null}catch{}V&&gg(V);const W=ZN(P.element);X(P,W,{label:"Set GSAP motion",coalesceKey:`motion:${di(P)}`}),S(P)},[X,e,S]),q=d.useCallback(P=>{var ee,ue,ae;const L=NN(P.element);let V;try{V=(ue=(ee=e.current)==null?void 0:ee.contentWindow)==null?void 0:ue.gsap}catch{}RP(P.element,V);let W=null;try{W=((ae=e.current)==null?void 0:ae.contentDocument)??null}catch{}W&&gg(W),X(P,L,{label:"Clear GSAP motion",coalesceKey:`motion:${di(P)}`,skipRefresh:!1}),S(P)},[X,e,S]),G=d.useCallback(async P=>{const L=p.current;if(!L)return;const V=P.label||P.id||P.selector||P.tagName,W=P.sourceFile||t||"index.html";try{const ee=await fetch(`/api/projects/${L}/files/${encodeURIComponent(W)}`);if(!ee.ok)throw new Error(`Failed to read ${W}`);const ae=(await ee.json()).content;if(typeof ae!="string")throw new Error(`Missing file contents for ${W}`);const Y=ub(P);if(!Y.id&&!Y.selector&&!Y.hfId)throw new Error("Selected element has no patchable target");a.current=Date.now();const re=await fetch(`/api/projects/${L}/file-mutations/remove-element/${encodeURIComponent(W)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:Y})});if(!re.ok)throw new Error(`Failed to delete element from ${W}`);const he=await re.json(),xe=typeof he.content=="string"?he.content:ae;await xs({projectId:L,label:"Delete element",kind:"timeline",files:{[W]:xe},readFile:async()=>ae,writeFile:i,recordEdit:l.recordEdit}),b(),oe.getState().setSelectedElementId(null),O(),n(`Deleted ${V}. Use Undo to restore it.`,"info")}catch(ee){const ue=ee instanceof Error?ee.message:"Failed to delete element";n(ue)}},[t,b,a,l.recordEdit,p,O,n,i]),R=d.useCallback(P=>{var V;if(P.length===0)return;const L=`z-reorder:${P.map(W=>W.id??W.selector??W.element.getAttribute("data-hf-id")??"el").join(":")}`;for(let W=0;W<P.length;W++){const ee=P[W];ee.element.style.zIndex=String(ee.zIndex);const ue=[{type:"inline-style",property:"z-index",value:String(ee.zIndex)}];try{const ae=(V=ee.element.ownerDocument)==null?void 0:V.defaultView;ae&&ae.getComputedStyle(ee.element).position==="static"&&(ee.element.style.position="relative",ue.push({type:"inline-style",property:"position",value:"relative"}))}catch{}X({element:ee.element,id:ee.id??null,hfId:n9(ee.element),selector:ee.selector,selectorIndex:ee.selectorIndex,sourceFile:ee.sourceFile},ue,{label:"Reorder layers",coalesceKey:L,skipRefresh:W<P.length-1})}},[X]);return{resolveImportedFontAsset:A,handleDomStyleCommit:j,handleDomAttributeCommit:M,handleDomHtmlAttributeCommit:E,handleDomTextCommit:$,commitDomTextFields:N,handleDomTextFieldStyleCommit:D,handleDomAddTextField:z,handleDomRemoveTextField:B,handleDomPathOffsetCommit:U,handleDomGroupPathOffsetCommit:I,handleDomBoxSizeCommit:K,handleDomRotationCommit:Z,handleDomManualEditsReset:F,handleDomMotionCommit:_,handleDomMotionClear:q,handleDomEditElementDelete:G,handleDomZIndexReorderCommit:R}}function sV(t){return t.includes("gsap.timeline")||t.includes("__timelines")||t.includes(".to(")||t.includes(".set(")}function lV(t){const e=[],n=t.querySelectorAll("script:not([src])");for(const r of n)sV(r.textContent||"")&&e.push(r);return e}function oV(t,e){var u,h;if(!t||!e)return!1;const n=t.contentWindow,r=t.contentDocument;if(!n||!r||!n.gsap||!n.__hfForceTimelineRebind)return!1;const i=lV(r);if(i.length!==1)return!1;const a=i[0],l=((h=(u=n.__player)==null?void 0:u.getTime)==null?void 0:h.call(u))??0,c=()=>{var y;const p=n.__timelines;if(p)for(const b of Object.keys(p)){try{const S=p[b],k=[];if(S!=null&&S.getChildren)try{for(const A of S.getChildren(!0))if(typeof A.targets=="function")for(const C of A.targets())k.push(C),delete C._gsap}catch{}(y=S==null?void 0:S.kill)==null||y.call(S)}catch{}delete p[b]}a.remove();const O=()=>{var S,k,A,C,T;n.MotionPathPlugin&&((S=n.gsap)!=null&&S.registerPlugin)&&n.gsap.registerPlugin(n.MotionPathPlugin);const b=r.createElement("script");b.textContent=`(function(){${e}
|
|
97
|
+
})();`,r.body.appendChild(b),(k=n.__hfForceTimelineRebind)==null||k.call(n),(C=(A=n.__player)==null?void 0:A.seek)==null||C.call(A,l),(T=n.__hfStudioManualEditsApply)==null||T.call(n)};if(/motionPath\s*[:{]/.test(e)&&!n.MotionPathPlugin&&n.gsap){const b=r.createElement("script");b.src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/MotionPathPlugin.min.js",b.onload=()=>O(),b.onerror=()=>O(),r.head.appendChild(b);return}O()};try{return n.__hfSuppressSceneMutations?n.__hfSuppressSceneMutations(c):c(),!0}catch{return!1}}async function Ob(t){const e=t.apply();try{await t.persist()}catch(n){t.rollback(e),console.warn("[optimistic] Mutation failed, rolled back:",n)}}function o9(t,e,n){if(n<=0)return 0;const r=(t-e)/n*100;return Math.max(0,Math.min(100,Math.round(r*10)/10))}function cV(t,e,n){return t>=e&&t<=e+n}function _d(t){if(typeof t.position=="number")return t.position;const e=Number.parseFloat(t.position);return Number.isNaN(e)?null:e}function Dd(t){return t.duration??1}function uV(t,e,n){for(const r of e){if(!dV(r.targetSelector,n))continue;const i=_d(r);if(i===null)continue;const a=Dd(r);if(cV(t,i,a))return r}return null}function fV(t,e){const n=_d(e);if(n===null)return null;const r=Dd(e);return o9(t,n,r)}function dV(t,e){return t.split(",").some(n=>n.trim()===e)}const hV={opacity:1,x:0,y:0,scale:1,scaleX:1,scaleY:1,rotation:0,width:100,height:100};async function mV(t,e,n,r,i){const a=t.id?`#${t.id}`:t.selector;if(!a)return;const l=uV(e,n,a);if(l){const c=fV(e,l);if(c===null)return;!!l.keyframes&&l.keyframes.keyframes.length>0||await i(t,{type:"convert-to-keyframes",animationId:l.id},{label:"Convert to keyframes",skipReload:!0});const h={};for(const p of Object.keys(r))h[p]=hV[p]??0;await i(t,{type:"add-keyframe",animationId:l.id,percentage:c,properties:r,backfillDefaults:h},{label:`Add keyframe at ${Math.round(e*100)/100}s`,coalesceKey:`keyframe:${l.id}:${c}`,softReload:!0})}else await i(t,{type:"add-with-keyframes",targetSelector:a,position:e,duration:.5,keyframes:[{percentage:0,properties:r},{percentage:100,properties:r}]},{label:`New animation at ${Math.round(e*100)/100}s`,softReload:!0})}function pV(t,e,n,r){var h,p,O;const{setKeyframeCache:i,elements:a}=oe.getState(),l=new Set,c=new Map;for(const x of t){const y=(h=x.targetSelector.match(/^#([\w-]+)/))==null?void 0:h[1];if(!y||!x.keyframes)continue;l.add(y);const b=typeof x.position=="number"?x.position:0,S=x.duration??1,k=a.find(M=>M.domId===y||(M.key??M.id)===`${e}#${y}`),A=(k==null?void 0:k.start)??0,C=(k==null?void 0:k.duration)??4,T=x.keyframes.keyframes.map(M=>{const E=b+M.percentage/100*S,$=C>0?Math.round((E-A)/C*1e3)/10:M.percentage;return{...M,percentage:$}}),j=c.get(y);if(j){const M=new Map;for(const E of[...j.keyframes,...T]){const $=M.get(E.percentage);$?($.properties={...$.properties,...E.properties},E.ease&&($.ease=E.ease)):M.set(E.percentage,{...E,properties:{...E.properties}})}j.keyframes=Array.from(M.values()).sort((E,$)=>E.percentage-$.percentage)}else c.set(y,{...x.keyframes,keyframes:T})}for(const[x,y]of c)i(`${e}#${x}`,y),i(x,y),e!=="index.html"&&i(`index.html#${x}`,y);const u=((O=(p=r.targetSelector)==null?void 0:p.match(/^#([\w-]+)/))==null?void 0:O[1])??n;u&&!l.has(u)&&(i(`${e}#${u}`,void 0),e!=="index.html"&&i(`index.html#${u}`,void 0))}function c9(t,e){return`${t}#${e}`}function xb(t,e){if(e)return oe.getState().keyframeCache.get(c9(t,e))}function F1(t,e,n){e&&oe.getState().setKeyframeCache(c9(t,e),n)}const yb={opacity:1,x:0,y:0,scale:1,scaleX:1,scaleY:1,rotation:0,width:100,height:100};function gV(t){if(t.id)return{selector:`#${t.id}`};if(t.selector)return{selector:t.selector};const e=t.element,n=e.ownerDocument,r=e.tagName.toLowerCase();let i=r,a=1;for(;n.getElementById(i);)a+=1,i=`${r}-${a}`;return e.setAttribute("id",i),{selector:`#${i}`,autoId:i}}async function OV(t,e,n){try{const r=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-mutations/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return r.ok?await r.json():null}catch{return null}}const xV=150;function yV({projectIdRef:t,activeCompPath:e,previewIframeRef:n,editHistory:r,domEditSaveTimestampRef:i,reloadPreview:a,onCacheInvalidate:l,onFileContentChanged:c}){const u=d.useRef(null),h=d.useRef(null),p=d.useCallback(async(I,K,Z)=>{var G,R;const F=t.current;if(!F)return;const _=I.sourceFile||e||"index.html",q=await OV(F,_,K);q!=null&&q.ok&&(i.current=Date.now(),q.before!=null&&q.after!=null&&await r.recordEdit({label:Z.label,kind:"manual",coalesceKey:Z.coalesceKey,files:{[_]:{before:q.before,after:q.after}}}),q.after!=null&&(c==null||c(_,q.after)),!Z.skipReload&&((G=q.parsed)!=null&&G.animations&&pV(q.parsed.animations,_,I.id??void 0,K),(R=Z.beforeReload)==null||R.call(Z),Z.softReload&&q.scriptText&&oV(n.current,q.scriptText)||a(),l()))},[t,e,n,r,i,a,l,c]),O=d.useCallback(()=>{const I=u.current;if(!I)return;u.current=null;const{selection:K,animationId:Z,property:F,value:_}=I;p(K,{type:"update-property",animationId:Z,property:F,value:_},{label:`Edit GSAP ${F}`,coalesceKey:`gsap:${Z}:${F}`,softReload:!0})},[p]),x=d.useCallback((I,K,Z,F)=>{u.current={selection:I,animationId:K,property:Z,value:F},h.current&&clearTimeout(h.current),h.current=setTimeout(O,xV)},[O]);d.useEffect(()=>()=>{h.current&&clearTimeout(h.current),O()},[O]);const y=d.useCallback((I,K,Z)=>{p(I,{type:"update-meta",animationId:K,updates:Z},{label:"Edit GSAP animation",coalesceKey:`gsap:${K}:meta`})},[p]),b=d.useCallback((I,K)=>{p(I,{type:"delete",animationId:K,stripStudioEdits:!0},{label:"Delete GSAP animation"})},[p]),S=d.useCallback(async(I,K,Z)=>{var V,W;const{selector:F,autoId:_}=gV(I);if(_){const ee=t.current,ue=I.sourceFile||e||"index.html";if(!ee)return;const ae=await fetch(`/api/projects/${encodeURIComponent(ee)}/file-mutations/patch-element/${encodeURIComponent(ue)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:{id:I.id,hfId:I.hfId,selector:I.selector,selectorIndex:I.selectorIndex},operations:[{type:"html-attribute",property:"id",value:_}]})});if(!ae.ok||!(await ae.json()).changed)return}const q=Number.parseFloat(((V=I.dataAttributes)==null?void 0:V.start)??"0")||0,G=Number.parseFloat(((W=I.dataAttributes)==null?void 0:W.duration)??"1")||1,R=Math.round(q*1e3)/1e3,P=Math.round(G*1e3)/1e3;await p(I,{type:"add",targetSelector:F,method:K,position:R,duration:K==="set"?void 0:P,ease:K==="set"?void 0:"power2.out",properties:{from:{opacity:0},to:{x:0,y:0,opacity:1},set:{opacity:1},fromTo:{x:0,y:0,opacity:1}}[K]??{opacity:1},fromProperties:K==="fromTo"?{opacity:0}:void 0},{label:`Add GSAP ${K} animation`})},[p,t,e]),k=d.useCallback((I,K,Z)=>{var q;let F=yb[Z]??0;const _=I.element;if(Z==="width"||Z==="height"){const G=_.getBoundingClientRect();F=Math.round(Z==="width"?G.width:G.height)}else if(Z==="opacity"||Z==="autoAlpha"){const G=(q=_.ownerDocument.defaultView)==null?void 0:q.getComputedStyle(_);F=G&&Number.parseFloat(G.opacity)||1}p(I,{type:"add-property",animationId:K,property:Z,defaultValue:F},{label:`Add GSAP ${Z}`})},[p]),A=d.useCallback((I,K,Z)=>{p(I,{type:"remove-property",animationId:K,property:Z},{label:`Remove GSAP ${Z}`})},[p]),C=d.useCallback((I,K,Z,F)=>{p(I,{type:"update-from-property",animationId:K,property:Z,value:F},{label:`Edit GSAP from-${Z}`,coalesceKey:`gsap:${K}:from:${Z}`})},[p]),T=d.useCallback((I,K,Z)=>{const F=yb[Z]??0;p(I,{type:"add-from-property",animationId:K,property:Z,defaultValue:F},{label:`Add GSAP from-${Z}`})},[p]),j=d.useCallback((I,K,Z)=>{p(I,{type:"remove-from-property",animationId:K,property:Z},{label:`Remove GSAP from-${Z}`})},[p]),M=d.useCallback((I,K,Z,F,_)=>{const q=I.sourceFile||e||"index.html",G=I.id;Ob({apply:()=>{const R=xb(q,G);if(R){const P=[...R.keyframes,{percentage:Z,properties:{[F]:_}}].sort((L,V)=>L.percentage-V.percentage);F1(q,G,{...R,keyframes:P})}return R},persist:()=>p(I,{type:"add-keyframe",animationId:K,percentage:Z,properties:{[F]:_}},{label:`Add keyframe at ${Z}%`,softReload:!0}),rollback:R=>{F1(q,G,R)}})},[p,e]),E=d.useCallback((I,K,Z,F)=>p(I,{type:"add-keyframe",animationId:K,percentage:Z,properties:F},{label:`Add keyframe at ${Z}%`,softReload:!0}),[p]),$=d.useCallback((I,K,Z)=>{const F=I.sourceFile||e||"index.html",_=I.id;Ob({apply:()=>{const q=xb(F,_);if(q){const G=q.keyframes.filter(R=>R.percentage!==Z);F1(F,_,{...q,keyframes:G})}return q},persist:()=>p(I,{type:"remove-keyframe",animationId:K,percentage:Z},{label:`Remove keyframe at ${Z}%`,softReload:!0}),rollback:q=>{F1(F,_,q)}})},[p,e]),N=d.useCallback((I,K,Z)=>p(I,{type:"convert-to-keyframes",animationId:K,resolvedFromValues:Z},{label:"Convert to keyframes"}),[p]),D=d.useCallback((I,K)=>{p(I,{type:"remove-all-keyframes",animationId:K},{label:"Remove all keyframes",softReload:!0})},[p]),z=d.useCallback((I,K,Z)=>{p(I,{type:"set-arc-path",animationId:K,...Z},{label:Z.enabled?"Enable arc path":"Disable arc path",softReload:!0})},[p]),B=d.useCallback((I,K,Z,F)=>{p(I,{type:"update-arc-segment",animationId:K,segmentIndex:Z,...F},{label:"Update arc segment",softReload:!0})},[p]),X=d.useCallback((I,K)=>{p(I,{type:"remove-arc-path",animationId:K},{label:"Remove arc path",softReload:!0})},[p]),U=d.useCallback((I,K,Z,F)=>mV(I,K,Z,F,p),[p]);return{commitMutation:p,updateGsapProperty:x,updateGsapMeta:y,deleteGsapAnimation:b,addGsapAnimation:S,addGsapProperty:k,removeGsapProperty:A,updateGsapFromProperty:C,addGsapFromProperty:T,removeGsapFromProperty:j,addKeyframe:M,addKeyframeBatch:E,removeKeyframe:$,convertToKeyframes:N,removeAllKeyframes:D,setArcPath:z,updateArcSegment:B,removeArcPath:X,commitKeyframeAtTime:U}}function qf(t,e,n){var r;if(!(t!=null&&t.contentWindow)||!e)return null;try{const i=t.contentWindow.gsap;if(!(i!=null&&i.getProperty))return null;const a=(r=t.contentDocument)==null?void 0:r.querySelector(e);if(!a)return null;const l=Number(i.getProperty(a,n));return Number.isFinite(l)?Math.round(l):null}catch{return null}}const bV=new Set(["x","y","xPercent","yPercent"]),vV=new Set(["duration","ease","delay","stagger","id","onComplete","onUpdate","onStart","onRepeat","repeat","yoyo","repeatDelay","paused","immediateRender","lazy","overwrite","keyframes","parent"]);function $u(t,e,n){var x;const r={};if(!(t!=null&&t.contentWindow))return r;let i;try{i=t.contentWindow.gsap}catch{return r}if(!(i!=null&&i.getProperty))return r;let a=null;try{a=t.contentDocument}catch{return r}const l=a==null?void 0:a.querySelector(e);if(!l)return r;const c=new Set;if(n.keyframes)for(const y of n.keyframes.keyframes)for(const b of Object.keys(y.properties))typeof y.properties[b]=="number"&&c.add(b);else for(const y of Object.keys(n.properties))c.add(y);for(const y of c){const b=Number(i.getProperty(l,y));Number.isFinite(b)&&(r[y]=bV.has(y)?Math.round(b):Math.round(b*1e3)/1e3)}const u=new Set;try{const b=t.contentWindow.__timelines;if(b)for(const S of Object.values(b)){const k=S;if(k!=null&&k.getChildren)for(const A of k.getChildren(!0)){if(typeof A.targets!="function"||!A.targets().includes(l))continue;const T=A.vars;if(T)for(const j of Object.keys(T))vV.has(j)||u.add(j)}}}catch(y){console.warn("Cross-tween guard failed — baseline capture may include values from other tweens",y)}for(const y of c)u.delete(y);const h={opacity:1,scale:1,scaleX:1,scaleY:1,scaleZ:1,rotation:0,rotationX:0,rotationY:0,skewX:0,skewY:0,z:0,xPercent:0,yPercent:0,transformPerspective:0,blur:0,brightness:1,contrast:1,saturate:1,hueRotate:0,grayscale:0,sepia:0,invert:0};for(const[y,b]of Object.entries(h)){if(y in r||u.has(y))continue;const S=Number(i.getProperty(l,y));Number.isFinite(S)&&Math.round(S*1e3)!==Math.round(b*1e3)&&(r[y]=Math.round(S*1e3)/1e3)}const p=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","letterSpacing","wordSpacing","lineHeight","fontSize","outlineOffset","outlineWidth","strokeDashoffset","strokeWidth","backgroundPositionX","backgroundPositionY"];let O=null;try{O=((x=a==null?void 0:a.defaultView)==null?void 0:x.getComputedStyle(l))??null}catch{}for(const y of p){if(y in r||u.has(y))continue;const b=Number(i.getProperty(l,y));if(!Number.isFinite(b))continue;let S=NaN;if(O){const k=O.getPropertyValue(y.replace(/[A-Z]/g,A=>`-${A.toLowerCase()}`));S=parseFloat(k)}Number.isFinite(S)&&Math.round(b*1e3)===Math.round(S*1e3)||(r[y]=Math.round(b*1e3)/1e3)}return r}function SV(t,e,n){if(!(t!=null&&t.contentWindow))return null;let r;try{r=t.contentWindow.__timelines}catch{return null}if(!r)return null;const i=Object.keys(r)[0];if(!i)return null;const a=r[i];if(!(a!=null&&a.getChildren))return null;let l=null;try{l=t.contentDocument}catch{return null}if(!l)return null;const c=l.querySelector(e);if(!c)return null;for(const u of a.getChildren(!0)){if(!u.targets||!u.vars)continue;let h=!1;for(const b of u.targets())if(b===c||c.id&&b.id===c.id){h=!0;break}if(!h)continue;const p=u.vars;if(!p.keyframes||typeof p.keyframes!="object")continue;const O=p.keyframes,x=[];let y;for(const[b,S]of Object.entries(O)){if(b==="easeEach"){typeof S=="string"&&(y=S);continue}const k=b.match(/^(\d+(?:\.\d+)?)%$/);if(!k||!S||typeof S!="object")continue;const A=parseFloat(k[1]),C={};for(const[T,j]of Object.entries(S))T!=="ease"&&(typeof j=="number"?C[T]=Math.round(j*1e3)/1e3:typeof j=="string"&&(C[T]=j));Object.keys(C).length>0&&x.push({percentage:A,properties:C})}if(x.length>0)return x.sort((b,S)=>b.percentage-S.percentage),{keyframes:x,easeEach:y}}return null}function u9(t){const e=new Map;if(!(t!=null&&t.contentWindow))return e;let n;try{n=t.contentWindow.__timelines}catch{return e}if(!n)return e;for(const r of Object.values(n)){if(!(r!=null&&r.getChildren))continue;const i=typeof r.duration=="function"?r.duration():0;for(const a of r.getChildren(!0)){if(!a.targets||!a.vars)continue;const l=a.vars;if(l.keyframes&&typeof l.keyframes=="object"){const y=l.keyframes,b=[];let S;for(const[k,A]of Object.entries(y)){if(k==="easeEach"){typeof A=="string"&&(S=A);continue}const C=k.match(/^(\d+(?:\.\d+)?)%$/);if(!C||!A||typeof A!="object")continue;const T=parseFloat(C[1]),j={};for(const[M,E]of Object.entries(A))M!=="ease"&&(typeof E=="number"?j[M]=Math.round(E*1e3)/1e3:typeof E=="string"&&(j[M]=E));Object.keys(j).length>0&&b.push({percentage:T,properties:j})}if(b.length>0){b.sort((k,A)=>k.percentage-A.percentage);for(const k of a.targets()){const A=k.id;A&&!e.has(A)&&e.set(A,{keyframes:b,easeEach:S})}continue}}if(!i||i<=0)continue;const c=typeof a.startTime=="function"?a.startTime():void 0;if(typeof c!="number"||!Number.isFinite(c))continue;const u=typeof a.duration=="function"?a.duration():0,h=Math.round(c/i*1e3)/10,p=u>0?Math.round((c+u)/i*1e3)/10:h,O={},x=new Set(["ease","duration","delay","stagger","motionPath","overwrite","immediateRender","onComplete","onUpdate","onStart"]);for(const[y,b]of Object.entries(l))x.has(y)||(typeof b=="number"?O[y]=Math.round(b*1e3)/1e3:typeof b=="string"&&(O[y]=b));if(Object.keys(O).length!==0)for(const y of a.targets()){const b=y.id;if(!b)continue;const S=e.get(b),k=S??{keyframes:[]};k.keyframes.push({percentage:h,properties:O}),p!==h&&k.keyframes.push({percentage:p,properties:O}),S||e.set(b,k)}}}for(const r of e.values())r.keyframes.sort((i,a)=>i.percentage-a.percentage);return e}function Hd(t,e){var a,l;const n=oe.getState().currentTime;if(e){const c=_d(e),u=Dd(e);if(c!==null)return o9(n,c,u)}const r=Number.parseFloat(((a=t.dataAttributes)==null?void 0:a.start)??"0")||0,i=Number.parseFloat(((l=t.dataAttributes)==null?void 0:l.duration)??"1")||1;return i>0?Math.max(0,Math.min(100,Math.round((n-r)/i*1e3)/10)):0}async function lO(t,e,n,r){var a;if(!t.hasUnresolvedKeyframes&&!t.hasUnresolvedSelector)return;if(t.hasUnresolvedSelector){const l=u9(e);if(l.size===0)return;const c=Array.from(l.entries()).map(([u,h])=>({selector:`#${u}`,keyframes:h.keyframes,easeEach:h.easeEach}));return await n(r,{type:"materialize-keyframes",animationId:t.id,keyframes:((a=l.get(r.id??""))==null?void 0:a.keyframes)??[],allElements:c},{label:"Unroll dynamic animations",skipReload:!0}),`${t.targetSelector}-to-0`}const i=SV(e,t.targetSelector);!i||i.keyframes.length===0||await n(r,{type:"materialize-keyframes",animationId:t.id,keyframes:i.keyframes,easeEach:i.easeEach},{label:"Materialize dynamic keyframes",skipReload:!0})}async function wV(t,e,n,r,i,a,l,c){var k;const u=i+a,h=Math.min(r,i),p=Math.max(r,u),O=Math.max(.01,p-h),x=((k=e.keyframes)==null?void 0:k.keyframes)??[],y=[];for(const A of x){const C=i+A.percentage/100*a,T=Math.round((C-h)/O*1e3)/10;y.push({percentage:T,properties:{...A.properties}})}const b=Math.round((r-h)/O*1e3)/10;y.push({percentage:b,properties:n}),y.sort((A,C)=>A.percentage-C.percentage),await l.commitMutation(t,{type:"delete",animationId:e.id},{label:"Extend tween range",skipReload:!0});const S=e.targetSelector;await l.commitMutation(t,{type:"add-with-keyframes",targetSelector:S,position:Math.round(h*1e3)/1e3,duration:Math.round(O*1e3)/1e3,keyframes:y},{label:"Move layer (extended keyframe)",softReload:!0,beforeReload:c})}async function kV(t,e,n,r,i){const a=Hd(t,e);await r.commitMutation(t,{type:"add-keyframe",animationId:e.id,percentage:a,properties:n},{label:`Move layer (keyframe ${a}%)`,softReload:!0,beforeReload:i})}async function AV(t,e,n,r,i){await r.commitMutation(t,{type:"convert-to-keyframes",animationId:e.id},{label:"Convert to keyframes for drag",skipReload:!0});const a=Hd(t,e);await r.commitMutation(t,{type:"add-keyframe",animationId:e.id,percentage:a,properties:n},{label:`Move layer (keyframe ${a}%)`,softReload:!0,beforeReload:i})}async function MV(t,e,n,r,i,a,l){const c=t.element.style.getPropertyValue("--hf-studio-rotation"),h=-(Number.parseFloat(c)||0)*Math.PI/180,p=Math.cos(h),O=Math.sin(h),x=t.element,y=Number.parseFloat(x.getAttribute("data-hf-drag-initial-offset-x")??"")||0,b=Number.parseFloat(x.getAttribute("data-hf-drag-initial-offset-y")??"")||0,S=n.x-y,k=n.y-b,A=S*p-k*O,C=S*O+k*p,T=Number.parseFloat(x.getAttribute("data-hf-drag-gsap-base-x")??""),j=Number.parseFloat(x.getAttribute("data-hf-drag-gsap-base-y")??""),M=Number.isFinite(T)?T:r.x,E=Number.isFinite(j)?j:r.y,$=Math.round(M+A),N=Math.round(E+C),D=()=>{x.style.setProperty("--hf-studio-offset-x",`${y}px`),x.style.setProperty("--hf-studio-offset-y",`${b}px`),x.removeAttribute("data-hf-drag-initial-offset-x"),x.removeAttribute("data-hf-drag-initial-offset-y")};if(e.keyframes){const z=await lO(e,i,l.commitMutation,t),B=z?{...e,id:z}:e,X=$u(i,a,e),U=oe.getState().currentTime,I=_d(B),K=Dd(B);I!==null&&K>0&&(U<I-.01||U>I+K+.01)?await wV(t,B,{...X,x:$,y:N},U,I,K,l,D):await kV(t,B,{...X,x:$,y:N},l,D)}else if(e.method==="from"||e.method==="fromTo")await l.commitMutation(t,{type:"convert-to-keyframes",animationId:e.id,resolvedFromValues:{x:$,y:N}},{label:"Move layer (keyframe rest)",softReload:!0,beforeReload:D});else{const z=$u(i,a,e);await AV(t,e,{...z,x:$,y:N},l,D)}}function CV(t,e){if(!(t!=null&&t.contentWindow))return null;let n;try{n=t.contentWindow.gsap}catch{return null}if(!(n!=null&&n.getProperty))return null;let r=null;try{r=t.contentDocument}catch{return null}if(!r)return null;const i=r.querySelector(e);if(!i)return null;const a=Number(n.getProperty(i,"x"))||0,l=Number(n.getProperty(i,"y"))||0;return{x:a,y:l}}function bb(t){var e;if((e=t.keyframes)!=null&&e.keyframes.some(n=>"x"in n.properties||"y"in n.properties))return!0;if(t.method==="fromTo"){const n=t.fromProperties;return"x"in t.properties||"y"in t.properties||!!(n&&("x"in n||"y"in n))}return"x"in t.properties||"y"in t.properties}function vb(t,e){var i;if(t.length===0)return null;const n=oe.getState().currentTime,r=t.filter(a=>bb(a)||a.keyframes||t.length===1).map(a=>{let l=0;bb(a)&&(l+=10),a.keyframes&&(l+=5),e&&a.targetSelector===e?l+=8:a.targetSelector.includes(",")&&(l-=5);const c=typeof a.position=="number"?a.position:0,u=a.duration??0;return n>=c-.05&&n<=c+u+.05&&(l+=4),{anim:a,score:l}});return r.sort((a,l)=>l.score-a.score),((i=r[0])==null?void 0:i.anim)??t[0]}function oO(t){return t.id?`#${t.id}`:t.selector?t.selector:null}async function TV(t,e,n,r,i,a){const l=oO(t);if(!l)return!1;let c=vb(n,l);if(!c&&a){const h=await a();c=vb(h,l)}if(!c)return!1;const u=CV(r,l);return u?(await MV(t,c,e,u,r,l,{commitMutation:i}),!0):!1}async function EV(t,e,n,r,i,a){let l=n.find(x=>"width"in x.properties||"height"in x.properties||x.keyframes);if(!l&&a&&(l=(await a()).find(y=>"width"in y.properties||"height"in y.properties||y.keyframes)),!l)return!1;const c=Hd(t,l);if(l.hasUnresolvedKeyframes||l.hasUnresolvedSelector){const x=await lO(l,r,i,t);x&&(l={...l,id:x})}else l.keyframes||await i(t,{type:"convert-to-keyframes",animationId:l.id},{label:"Convert to keyframes for resize",skipReload:!0});const u=oO(t),h=u?$u(r,u,l):{},p={...h};if(!("width"in h)){const x=qf(r,u,"width");p.width=x??Math.round(e.width)}if(!("height"in h)){const x=qf(r,u,"height");p.height=x??Math.round(e.height)}const O={...h,width:Math.round(e.width),height:Math.round(e.height)};return await i(t,{type:"add-keyframe",animationId:l.id,percentage:c,properties:O,backfillDefaults:p},{label:`Resize (keyframe ${c}%)`,softReload:!0}),!0}async function $V(t,e,n,r,i,a){let l=n.find(b=>"rotation"in b.properties||b.keyframes);if(!l&&a&&(l=(await a()).find(S=>"rotation"in S.properties||S.keyframes)),!l)return!1;const c=oO(t);if(!c)return!1;let u=0;if(r!=null&&r.contentWindow)try{const b=r.contentWindow.gsap,S=r.contentDocument,k=S==null?void 0:S.querySelector(c);b!=null&&b.getProperty&&k&&(u=Number(b.getProperty(k,"rotation"))||0)}catch{}const h=Hd(t,l),p=Math.round(u+e);if(l.hasUnresolvedKeyframes||l.hasUnresolvedSelector){const b=await lO(l,r,i,t);b&&(l={...l,id:b})}else l.keyframes||await i(t,{type:"convert-to-keyframes",animationId:l.id},{label:"Convert to keyframes for rotation",skipReload:!0});const O=$u(r,c,l),x={...O};"rotation"in O||(x.rotation=qf(r,c,"rotation")??0);const y={...O,rotation:p};return await i(t,{type:"add-keyframe",animationId:l.id,percentage:h,properties:y,backfillDefaults:x},{label:`Rotate (keyframe ${h}%)`,softReload:!0}),!0}function f9(t){const e=new Map;for(const n of t){const r=e.get(n.percentage);r?(r.properties={...r.properties,...n.properties},n.ease&&(r.ease=n.ease)):e.set(n.percentage,{...n,properties:{...n.properties}})}return Array.from(e.values()).sort((n,r)=>n.percentage-r.percentage)}const Sb={opacity:1,x:0,y:0,scale:1,scaleX:1,scaleY:1,rotation:0};function d9(t){if(t.method==="set")return{format:"percentage",keyframes:[{percentage:0,properties:{...t.properties}}]};const e=t.properties,n=t.fromProperties;if(!e||Object.keys(e).length===0)return null;const r={},i={};if(t.method==="from")for(const[a,l]of Object.entries(e))r[a]=l,i[a]=Sb[a]??0;else if(t.method==="fromTo"&&n)Object.assign(r,n),Object.assign(i,e);else for(const[a,l]of Object.entries(e))r[a]=Sb[a]??0,i[a]=l;return{format:"percentage",keyframes:[{percentage:0,properties:r},{percentage:100,properties:i}],...t.ease?{ease:t.ease}:{}}}function jV(t){const e=t.match(/^#([\w-]+)/);return e?e[1]:null}function Gf(t,e){const n=new Set;return e.id&&n.add(`#${e.id}`),e.selector&&n.add(e.selector),n.size===0?[]:t.filter(r=>r.targetSelector.split(",").some(i=>{const a=i.trim();if(n.has(a))return!0;const l=a.split(/\s+/).pop();return l?n.has(l):!1}))}async function $o(t,e){try{const n=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-animations/${encodeURIComponent(e)}`);return n.ok?await n.json():null}catch{return null}}function PV(t,e,n,r,i){const[a,l]=d.useState([]),[c,u]=d.useState(!1),[h,p]=d.useState(!1),O=d.useRef("");d.useEffect(()=>{const A=`${t}:${e}:${r}`;if(A===O.current)return;if(O.current=A,!t){l([]),u(!1),p(!1);return}let C=!1;return $o(t,e).then(T=>{if(!C){if(!T){l([]),u(!1),p(!1);return}l(T.animations),u(T.multipleTimelines===!0),p(T.unsupportedTimelinePattern===!0)}}),()=>{C=!0}},[t,e,r]),d.useEffect(()=>{if(!t||!n||a.length>0)return;const A=setTimeout(()=>{$o(t,e).then(C=>{C&&C.animations.length>0&&l(C.animations)})},800);return()=>clearTimeout(A)},[t,e,n,a.length]);const x=(n==null?void 0:n.id)??null,y=(n==null?void 0:n.selector)??null,b=d.useMemo(()=>x||y?Gf(a,{id:x,selector:y}):[],[a,x,y]),S=d.useMemo(()=>b,[b,a,i,x]),k=(n==null?void 0:n.id)??null;return d.useEffect(()=>{if(!k)return;const{elements:A}=oe.getState(),C=A.find(X=>X.domId===k||(X.key??X.id)===`${e}#${k}`),T=(C==null?void 0:C.start)??0,j=(C==null?void 0:C.duration)??4,M=[];let E="percentage",$,N;for(const X of S){const U=X.keyframes??d9(X);if(!U)continue;const I=typeof X.position=="number"?X.position:0,K=X.duration??j;for(const Z of U.keyframes){const F=I+Z.percentage/100*K,_=j>0?Math.round((F-T)/j*1e3)/10:Z.percentage;M.push({...Z,percentage:_})}E=U.format,U.ease&&($=U.ease),U.easeEach&&(N=U.easeEach)}if(M.length===0){const{keyframeCache:X,setKeyframeCache:U}=oe.getState();X.has(`${e}#${k}`)&&U(`${e}#${k}`,void 0);return}const D=f9(M),z={format:E,keyframes:D,...$?{ease:$}:{},...N?{easeEach:N}:{}},{setKeyframeCache:B}=oe.getState();B(`${e}#${k}`,z)},[k,e,S]),{animations:S,multipleTimelines:c,unsupportedTimelinePattern:h}}function QV(){const[t,e]=d.useState(0),n=d.useCallback(()=>e(r=>r+1),[]);return{version:t,bump:n}}function ZV(t,e,n,r){const i=d.useRef(""),a=d.useRef(""),l=d.useRef("");d.useEffect(()=>{const c=`kf-cache:${t}:${e}:${n}`;if(c===i.current||(i.current=c,a.current="",l.current="",!t))return;const u=e;$o(t,u).then(h=>{if(!h)return;const{setKeyframeCache:p,keyframeCache:O}=oe.getState(),x=`${u}#`,y="index.html#";for(const k of O.keys())(k.startsWith(x)||u!=="index.html"&&k.startsWith(y))&&p(k,void 0);const{elements:b}=oe.getState(),S=new Map;for(const k of h.animations){const A=jV(k.targetSelector);if(!A)continue;const C=k.keyframes??d9(k);if(!C)continue;const T=typeof k.position=="number"?k.position:0,j=k.duration??1,M=b.find(z=>z.domId===A||(z.key??z.id)===`${u}#${A}`),E=(M==null?void 0:M.start)??0,$=(M==null?void 0:M.duration)??4,N=C.keyframes.map(z=>{const B=T+z.percentage/100*j,X=$>0?Math.round((B-E)/$*1e3)/10:z.percentage;return{...z,percentage:X}}),D=S.get(A);D?D.keyframes=f9([...D.keyframes,...N]):S.set(A,{...C,keyframes:N})}for(const[k,A]of S)p(`${u}#${k}`,A),p(k,A),u!=="index.html"&&p(`index.html#${k}`,A);l.current=c})},[t,e,n]),d.useEffect(()=>{if(!t)return;const c=e;let u=0;const h=10,p=()=>{if(a.current===`kf-cache:${t}:${c}:${n}`)return!0;const x=(r==null?void 0:r.current)??document.querySelector("iframe[src*='/preview/']");if(!x)return!1;const y=u9(x);if(y.size===0)return!1;const{setKeyframeCache:b,keyframeCache:S}=oe.getState();for(const[k,A]of y){const C=`${c}#${k}`,T=`index.html#${k}`;if(S.has(C)||S.has(T)||S.has(k))continue;const j={format:"percentage",keyframes:A.keyframes,...A.easeEach?{easeEach:A.easeEach}:{}};b(C,j),c!=="index.html"&&b(T,j),b(k,j)}return a.current=`kf-cache:${t}:${c}:${n}`,!0};if(p())return;const O=setInterval(()=>{u++,(p()||u>=h)&&clearInterval(O)},500);return()=>clearInterval(O)},[t,e,n,r])}function NV(t,e){var c,u;const n=oe.getState().currentTime,r=typeof(e==null?void 0:e.position)=="number"?e.position:0,i=(e==null?void 0:e.duration)??0;if(i>0)return Math.max(0,Math.min(100,Math.round((n-r)/i*1e3)/10));const a=Number.parseFloat(((c=t.dataAttributes)==null?void 0:c.start)??"0")||0,l=Number.parseFloat(((u=t.dataAttributes)==null?void 0:u.duration)??"1")||1;return l>0?Math.max(0,Math.min(100,Math.round((n-a)/l*1e3)/10)):0}function RV(t,e){var i;if(t.length<=1)return t[0];const n=oe.getState().currentTime,r=t.map(a=>{let l=0;a.keyframes&&(l+=10),e&&a.targetSelector===e?l+=5:a.targetSelector.includes(",")&&(l-=3);const c=typeof a.position=="number"?a.position:0,u=a.duration??0;return n>=c-.05&&n<=c+u+.05&&(l+=8),{anim:a,score:l}});return r.sort((a,l)=>l.score-a.score),(i=r[0])==null?void 0:i.anim}function VV(t){return t.id?`#${t.id}`:t.selector?t.selector:null}function LV(t){const{selectedGsapAnimations:e,gsapCommitMutation:n,addGsapAnimation:r,previewIframeRef:i,bumpGsapCache:a}=t;return d.useCallback(async(c,u,h)=>{var C;if(!n)return;const p=i.current,O=VV(c);let x=RV(e,O);if(!x){r(c,"to"),await new Promise(T=>setTimeout(T,500)),a();return}x.keyframes||await n(c,{type:"convert-to-keyframes",animationId:x.id},{label:"Convert to keyframes",skipReload:!0});const y=NV(c,x),b=O?$u(p,O,x):{},S={...b};S[u]=h;const k={...b};if(!(u in b)&&O){const T=qf(p,O,u);T!=null&&(k[u]=T)}k[u]=h;const A=(C=x.keyframes)==null?void 0:C.keyframes.some(T=>Math.abs(T.percentage-y)<.05);await n(c,A?{type:"update-keyframe",animationId:x.id,percentage:y,properties:S}:{type:"add-keyframe",animationId:x.id,percentage:y,properties:S,backfillDefaults:k},{label:`Edit ${u} (keyframe ${y}%)`,softReload:!0})},[e,n,r,i,a])}function _V({domEditSelection:t,updateGsapProperty:e,updateGsapMeta:n,deleteGsapAnimation:r,addGsapAnimation:i,addGsapProperty:a,removeGsapProperty:l,updateGsapFromProperty:c,addGsapFromProperty:u,removeGsapFromProperty:h,addKeyframe:p,addKeyframeBatch:O,removeKeyframe:x,convertToKeyframes:y,removeAllKeyframes:b,handleDomManualEditsReset:S,selectedGsapAnimations:k}){const A=d.useCallback((Z,F,_)=>{t&&e(t,Z,F,_)},[t,e]),C=d.useCallback((Z,F)=>{t&&n(t,Z,F)},[t,n]),T=d.useCallback(Z=>{t&&r(t,Z)},[t,r]),j=d.useCallback(Z=>{t&&(i(t,Z,oe.getState().currentTime),t.element.hasAttribute("data-hf-studio-path-offset")&&S(t))},[t,i,S]),M=d.useCallback((Z,F)=>{t&&a(t,Z,F)},[t,a]),E=d.useCallback((Z,F)=>{t&&l(t,Z,F)},[t,l]),$=d.useCallback((Z,F,_)=>{t&&c(t,Z,F,_)},[t,c]),N=d.useCallback((Z,F)=>{t&&u(t,Z,F)},[t,u]),D=d.useCallback((Z,F)=>{t&&h(t,Z,F)},[t,h]),z=d.useCallback((Z,F,_,q)=>{t&&p(t,Z,F,_,q)},[t,p]),B=d.useCallback((Z,F,_)=>t?O(t,Z,F,_):Promise.resolve(),[t,O]),X=d.useCallback((Z,F)=>{t&&x(t,Z,F)},[t,x]),U=d.useCallback((Z,F)=>t?y(t,Z,F):Promise.resolve(),[t,y]),I=d.useCallback(Z=>{t&&b(t,Z)},[t,b]),K=d.useCallback(()=>{if(!t)return!1;const Z=k.find(F=>F.keyframes);return Z?(b(t,Z.id),!0):!1},[t,k,b]);return{handleGsapUpdateProperty:A,handleGsapUpdateMeta:C,handleGsapDeleteAnimation:T,handleGsapAddAnimation:j,handleGsapAddProperty:M,handleGsapRemoveProperty:E,handleGsapUpdateFromProperty:$,handleGsapAddFromProperty:N,handleGsapRemoveFromProperty:D,handleGsapAddKeyframe:z,handleGsapAddKeyframeBatch:B,handleGsapRemoveKeyframe:X,handleGsapConvertToKeyframes:U,handleGsapRemoveAllKeyframes:I,handleResetSelectedElementKeyframes:K}}function DV({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,compositionLoading:a,previewIframeRef:l,timelineElements:c,setSelectedTimelineElementId:u,setRightCollapsed:h,setRightPanelTab:p,showToast:O,refreshPreviewDocumentVersion:x,queueDomEditSave:y,readProjectFile:b,writeProjectFile:S,updateEditingFileContent:k,domEditSaveTimestampRef:A,editHistory:C,fileTree:T,importedFontAssetsRef:j,projectDir:M,projectIdRef:E,previewIframe:$,refreshKey:N,rightPanelTab:D,applyStudioManualEditsToPreviewRef:z,syncPreviewHistoryHotkey:B,reloadPreview:X,setRefreshKey:U,openSourceForSelection:I,selectSidebarTab:K,getSidebarTab:Z}){const F=d.useCallback(vt=>{!I||!K||vt.sourceFile&&(K("code"),I(vt.sourceFile,{id:vt.id,selector:vt.selector,selectorIndex:vt.selectorIndex}))},[I,K]),{domEditSelection:_,domEditGroupSelections:q,domEditHoverSelection:G,domEditSelectionRef:R,applyDomSelection:P,clearDomSelection:L,buildDomSelectionFromTarget:V,resolveDomSelectionFromPreviewPoint:W,resolveAllDomSelectionsFromPreviewPoint:ee,updateDomEditHoverSelection:ue,buildDomSelectionForTimelineElement:ae,handleTimelineElementSelect:Y,refreshDomEditSelectionFromPreview:re}=GR({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,previewIframeRef:l,timelineElements:c,setSelectedTimelineElementId:u,setRightCollapsed:h,setRightPanelTab:p,previewIframe:$,refreshKey:N,rightPanelTab:D}),{agentModalOpen:he,agentModalAnchorPoint:xe,copiedAgentPrompt:ke,agentPromptSelectionContext:be,setAgentModalOpen:Se,setAgentPromptSelectionContext:Ve,setAgentModalAnchorPoint:Te,handleAskAgent:Ze,handleAgentModalSubmit:Xe}=HR({activeCompPath:e,projectDir:M,projectIdRef:E,showToast:O,domEditSelectionRef:R,domEditSelection:_}),{handlePreviewCanvasMouseDown:ze,handlePreviewCanvasPointerMove:et,handlePreviewCanvasPointerLeave:Ot,handleBlockedDomMove:He,handleDomManualDragStart:ct}=KR({captionEditMode:i,compositionLoading:a,previewIframeRef:l,showToast:O,applyDomSelection:P,resolveDomSelectionFromPreviewPoint:W,resolveAllDomSelectionsFromPreviewPoint:ee,updateDomEditHoverSelection:ue,onClickToSource:F});d.useEffect(()=>{if(!(_!=null&&_.id))return;const{selectedElementId:vt,elements:Ft,setSelectedElementId:wr}=oe.getState(),kn=Ft.find(Es=>Es.domId===_.id||Es.id===_.id),ki=kn?kn.key??kn.id:null;ki&&ki!==vt&&wr(ki)},[_==null?void 0:_.id]);const{version:yt,bump:Oe}=QV(),Ge=d.useRef(N);d.useEffect(()=>{N!==Ge.current&&(Ge.current=N,Oe())},[N,Oe]);const Re=(_==null?void 0:_.sourceFile)||e||"index.html";ZV(dg?t??null:null,Re,yt,l);const{animations:qe,multipleTimelines:Ie,unsupportedTimelinePattern:$e}=PV(dg?t??null:null,Re,_?{id:_.id??null,selector:_.selector??null}:null,yt),{commitMutation:ut,updateGsapProperty:Ae,updateGsapMeta:Be,deleteGsapAnimation:lt,addGsapAnimation:ot,addGsapProperty:gn,removeGsapProperty:at,updateGsapFromProperty:Le,addGsapFromProperty:Ue,removeGsapFromProperty:Mt,addKeyframe:We,addKeyframeBatch:bt,removeKeyframe:Et,convertToKeyframes:It,removeAllKeyframes:qt,setArcPath:Tn,updateArcSegment:Zn}=yV({projectIdRef:E,activeCompPath:e,previewIframeRef:l,editHistory:C,domEditSaveTimestampRef:A,reloadPreview:X,onCacheInvalidate:Oe,onFileContentChanged:k}),{resolveImportedFontAsset:Fn,handleDomStyleCommit:ni,handleDomAttributeCommit:ri,handleDomHtmlAttributeCommit:ii,handleDomTextCommit:Pe,handleDomTextFieldStyleCommit:jt,handleDomAddTextField:Nt,handleDomRemoveTextField:nn,handleDomPathOffsetCommit:Jn,handleDomGroupPathOffsetCommit:Sn,handleDomBoxSizeCommit:Rt,handleDomRotationCommit:ve,handleDomManualEditsReset:tt,handleDomMotionCommit:wn,handleDomMotionClear:vr,handleDomEditElementDelete:Yi,handleDomZIndexReorderCommit:Ii}=aV({activeCompPath:e,previewIframeRef:l,showToast:O,queueDomEditSave:y,writeProjectFile:S,domEditSaveTimestampRef:A,editHistory:C,fileTree:T,importedFontAssetsRef:j,projectId:t,projectIdRef:E,reloadPreview:X,domEditSelection:_,applyDomSelection:P,clearDomSelection:L,refreshDomEditSelectionFromPreview:re,buildDomSelectionFromTarget:V}),wi=d.useCallback(async(vt,Ft)=>{$p&&ut&&await TV(vt,Ft,qe,l.current,ut,async()=>{const kn=t;if(!kn)return[];const ki=await $o(kn,Re);if(!ki)return[];const Es={id:vt.id??null,selector:vt.selector??null};return Gf(ki.animations,Es)})||Jn(vt,Ft)},[Jn,qe,ut,l,t,Re]),ai=d.useCallback(vt=>async()=>{const Ft=t;if(!Ft)return[];const wr=await $o(Ft,Re);return wr?Gf(wr.animations,{id:vt.id??null,selector:vt.selector??null}):[]},[t,Re]),si=d.useCallback(async(vt,Ft)=>{$p&&ut&&await EV(vt,Ft,qe,l.current,ut,ai(vt))||Rt(vt,Ft)},[Rt,qe,ut,l,ai]),ye=d.useCallback(async(vt,Ft)=>{$p&&ut&&await $V(vt,Ft.angle,qe,l.current,ut,ai(vt))||ve(vt,Ft)},[ve,qe,ut,l,ai]),{handleGsapUpdateProperty:_e,handleGsapUpdateMeta:ft,handleGsapDeleteAnimation:rt,handleGsapAddAnimation:Sr,handleGsapAddProperty:Za,handleGsapRemoveProperty:Bn,handleGsapUpdateFromProperty:Na,handleGsapAddFromProperty:fh,handleGsapRemoveFromProperty:m0,handleGsapAddKeyframe:p0,handleGsapAddKeyframeBatch:dh,handleGsapRemoveKeyframe:Ol,handleGsapConvertToKeyframes:xl,handleGsapRemoveAllKeyframes:li,handleResetSelectedElementKeyframes:ar}=_V({domEditSelection:_,updateGsapProperty:Ae,updateGsapMeta:Be,deleteGsapAnimation:lt,addGsapAnimation:ot,addGsapProperty:gn,removeGsapProperty:at,updateGsapFromProperty:Le,addGsapFromProperty:Ue,removeGsapFromProperty:Mt,addKeyframe:We,addKeyframeBatch:bt,removeKeyframe:Et,convertToKeyframes:It,removeAllKeyframes:qt,handleDomManualEditsReset:tt,selectedGsapAnimations:qe}),g0=LV({selectedGsapAnimations:qe,gsapCommitMutation:ut,addGsapAnimation:(vt,Ft,wr)=>ot(vt,Ft,wr),previewIframeRef:l,bumpGsapCache:Oe}),hh=d.useCallback((vt,Ft)=>{_&&Tn(_,vt,Ft)},[_,Tn]),Wo=d.useCallback((vt,Ft,wr)=>{_&&Zn(_,vt,Ft,wr)},[_,Zn]);return DR({previewIframe:$,activeCompPath:e,captionEditMode:i,domEditSelectionRef:R,domEditSelection:_,applyDomSelection:P,buildDomSelectionFromTarget:V,refreshPreviewDocumentVersion:x,syncPreviewHistoryHotkey:B,applyStudioManualEditsToPreviewRef:z,openSourceForSelection:I,getSidebarTab:Z}),{domEditSelection:_,domEditGroupSelections:q,domEditHoverSelection:G,agentModalOpen:he,agentModalAnchorPoint:xe,copiedAgentPrompt:ke,agentPromptSelectionContext:be,domEditSelectionRef:R,handleTimelineElementSelect:Y,handlePreviewCanvasMouseDown:ze,handlePreviewCanvasPointerMove:et,handlePreviewCanvasPointerLeave:Ot,applyDomSelection:P,clearDomSelection:L,handleDomStyleCommit:ni,handleDomAttributeCommit:ri,handleDomHtmlAttributeCommit:ii,handleDomPathOffsetCommit:wi,handleDomGroupPathOffsetCommit:Sn,handleDomZIndexReorderCommit:Ii,handleDomBoxSizeCommit:si,handleDomRotationCommit:ye,handleDomManualEditsReset:tt,handleDomMotionCommit:wn,handleDomMotionClear:vr,handleDomTextCommit:Pe,handleDomTextFieldStyleCommit:jt,handleDomAddTextField:Nt,handleDomRemoveTextField:nn,handleAskAgent:Ze,handleAgentModalSubmit:Xe,handleBlockedDomMove:He,handleDomManualDragStart:ct,handleDomEditElementDelete:Yi,buildDomSelectionFromTarget:V,buildDomSelectionForTimelineElement:ae,updateDomEditHoverSelection:ue,resolveImportedFontAsset:Fn,setAgentModalOpen:Se,setAgentPromptSelectionContext:Ve,setAgentModalAnchorPoint:Te,selectedGsapAnimations:qe,gsapMultipleTimelines:Ie,gsapUnsupportedTimelinePattern:$e,handleGsapUpdateProperty:_e,handleGsapUpdateMeta:ft,handleGsapDeleteAnimation:rt,handleGsapAddAnimation:Sr,handleGsapAddProperty:Za,handleGsapRemoveProperty:Bn,handleGsapUpdateFromProperty:Na,handleGsapAddFromProperty:fh,handleGsapRemoveFromProperty:m0,handleGsapAddKeyframe:p0,handleGsapAddKeyframeBatch:dh,handleGsapRemoveKeyframe:Ol,handleGsapConvertToKeyframes:xl,handleGsapRemoveAllKeyframes:li,handleResetSelectedElementKeyframes:ar,commitAnimatedProperty:g0,handleSetArcPath:hh,handleUpdateArcSegment:Wo,invalidateGsapCache:Oe,previewIframeRef:l,commitMutation:async(vt,Ft)=>{_&&await ut(_,vt,Ft)}}}function HV(t){try{const e=t==null?void 0:t.contentDocument;if(!e)return 0;let n=0;for(const r of e.body.querySelectorAll("*")){const i=parseInt(getComputedStyle(r).zIndex,10);Number.isFinite(i)&&i>n&&(n=i)}return n}catch{return 0}}function XV(t,e){const n=new Set(e);if(!n.has(t))return t;let r=2;for(;n.has(`${t}_${r}`);)r++;return`${t}_${r}`}async function Bp(t){const{projectId:e,blockName:n,activeCompPath:r,placement:i,visualPosition:a,timelineElements:l,readProjectFile:c,writeProjectFile:u,recordEdit:h,refreshFileTree:p,reloadPreview:O,showToast:x}=t;try{const y=await fetch(`/api/projects/${e}/registry/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blockName:n})});if(!y.ok){const A=await y.json().catch(()=>({error:"Install failed"}));return x(A.error||"Failed to install block"),null}const{written:b,block:S}=await y.json(),k=b.find(A=>A.endsWith(".html"))??b[0];if(!k)return x("Installed but no composition file was written"),null;if(S.type==="hyperframes:component"){const A=await c(k),C=A.replace(/background:\s*(?:#(?:0a0a0a|000000|000|0a0805)|rgba?\([^)]*\))\s*;/g,"background: transparent;");C!==A&&await u(k,C)}{const A=r||"index.html",C=await c(A),T=Vd(C),j=XV(S.name,T),M=A||"index.html",E=l.filter(L=>(L.sourceFile||r||"index.html")===M),$=S.type==="hyperframes:block",N=x7(C),D=t.currentTime??0,z=Number(In(i?i.start:D)),X=("duration"in S?S.duration:void 0)??E.reduce((L,V)=>Math.max(L,(V.start??0)+(V.duration??0)),10),U=(i==null?void 0:i.track)??($?0:E.length>0?Math.max(...E.map(L=>L.track))+1:1),I=HV(t.previewIframe??null)+1,K=N.width,Z=N.height,F=a?Math.round(a.left):0,_=a?Math.round(a.top):0,q=["<div",` data-composition-id="${j}"`,` data-composition-src="${k}"`,` data-start="${In(z)}"`,` data-duration="${In(X)}"`,` data-track-index="${U}"`,` data-width="${K}"`,` data-height="${Z}"`,` style="position: absolute; left: ${F}px; top: ${_}px; width: ${K}px; height: ${Z}px; z-index: ${I}"`,"></div>"].join(`
|
|
98
|
+
`);let G=X8(C,q);const R=z+X,P=G.match(/(<[^>]*data-composition-id="[^"]*"[^>]*data-duration=")([^"]*)(")/);if(P){const L=parseFloat(P[2]);R>L&&(G=G.replace(P[0],`${P[1]}${In(R)}${P[3]}`))}await xs({projectId:e,label:`Add ${$?"block":"component"}: ${S.title}`,kind:"timeline",files:{[A]:G},readFile:async()=>C,writeFile:u,recordEdit:h})}return await p(),O(),{block:S,compositionPath:k}}catch(y){const b=y instanceof Error?y.message:"Failed to add block";return x(b),null}}function zV({projectId:t,blockCtxDeps:e,previewIframeRef:n,setRightCollapsed:r,setRightPanelTab:i}){const[a,l]=d.useState(null),c=d.useMemo(()=>({activeCompPath:e.activeCompPath,timelineElements:e.timelineElements,readProjectFile:e.readProjectFile,writeProjectFile:e.writeProjectFile,recordEdit:e.recordEdit,refreshFileTree:e.refreshFileTree,reloadPreview:e.reloadPreview,showToast:e.showToast}),[e.activeCompPath,e.timelineElements,e.readProjectFile,e.writeProjectFile,e.recordEdit,e.refreshFileTree,e.reloadPreview,e.showToast]),u=d.useCallback(O=>{t&&(async()=>{const x=await Bp({projectId:t,blockName:O,...c,previewIframe:n.current,currentTime:oe.getState().currentTime}),y=(x==null?void 0:x.block.type)==="hyperframes:block"?x.block.params:void 0;y!=null&&y.length&&(l({blockName:x.block.name,blockTitle:x.block.title,params:y,compositionPath:x.compositionPath}),r(!1),i("block-params"))})()},[t,c,n,r,i]),h=d.useCallback((O,x)=>{t&&Bp({projectId:t,blockName:O,placement:x,...c,previewIframe:n.current,currentTime:oe.getState().currentTime})},[t,c,n]),p=d.useCallback((O,x)=>{t&&Bp({projectId:t,blockName:O,visualPosition:x,...c,previewIframe:n.current,currentTime:oe.getState().currentTime})},[t,c,n]);return{activeBlockParams:a,setActiveBlockParams:l,handleAddBlock:u,handleTimelineBlockDrop:h,handlePreviewBlockDrop:p}}const h9="Shift+T";function fi(t){var i,a,l;if(!t||typeof t!="object")return!1;const e=t,n=(i=e.tagName)==null?void 0:i.toLowerCase();if(n==="input"||n==="textarea"||n==="select"||e.isContentEditable)return!0;const r=(a=e.getAttribute)==null?void 0:a.call(e,"role");return r==="textbox"||r==="searchbox"||r==="combobox"?!0:!!((l=e.closest)!=null&&l.call(e,"input, textarea, select, [contenteditable='true'], [role='textbox'], .cm-editor"))}function FV(t){return t.metaKey||t.ctrlKey||t.altKey||!t.shiftKey||t.key.toLowerCase()!=="t"?!1:!fi(t.target)}function m9(t){return`${t?"Hide":"Show"} timeline editor (${h9})`}function wb(t){try{return(t==null?void 0:t.contentWindow)??null}catch{return null}}function kb(t,e,n){const r=t.key.toLowerCase();return r==="z"&&!t.shiftKey?(t.preventDefault(),e(),!0):r==="z"&&t.shiftKey||t.ctrlKey&&!t.metaKey&&r==="y"?(t.preventDefault(),n(),!0):!1}function BV({toggleTimelineVisibility:t,handleTimelineElementDelete:e,handleTimelineElementSplit:n,handleDomEditElementDelete:r,domEditSelectionRef:i,editHistory:a,readOptionalProjectFile:l,readProjectFile:c,writeProjectFile:u,domEditSaveTimestampRef:h,showToast:p,syncHistoryPreviewAfterApply:O,waitForPendingDomEditSaves:x,leftSidebarRef:y,handleCopy:b,handlePaste:S,handleCut:k,onResetKeyframes:A,onDeleteSelectedKeyframes:C,onAfterUndoRedo:T,onToggleRecording:j}){const M=d.useRef(null),E=d.useRef(void 0),$=d.useRef(null),N=d.useCallback(Y=>{FV(Y)&&(Y.preventDefault(),t())},[t]),D=d.useCallback(async Y=>Y===mg?l(Y):c(Y),[l,c]),z=d.useCallback(async(Y,re)=>{h.current=Date.now(),await u(Y,re)},[h,u]),B=d.useCallback(async()=>{await x();const Y=await a.undo({readFile:D,writeFile:z});if(!Y.ok&&Y.reason==="content-mismatch"){p("File changed outside Studio. Undo history was not applied.","info");return}Y.ok&&Y.label&&(T==null||T(),await O(Y.paths),p(`Undid ${Y.label}`,"info"))},[a,D,p,O,x,z,T]),X=d.useCallback(async()=>{await x();const Y=await a.redo({readFile:D,writeFile:z});if(!Y.ok&&Y.reason==="content-mismatch"){p("File changed outside Studio. Redo history was not applied.","info");return}Y.ok&&Y.label&&(T==null||T(),await O(Y.paths),p(`Redid ${Y.label}`,"info"))},[a,D,p,O,x,z,T]),U=d.useRef(N);U.current=N;const I=d.useRef(e);I.current=e;const K=d.useRef(n);K.current=n;const Z=d.useRef(r);Z.current=r;const F=d.useRef(B);F.current=B;const _=d.useRef(X);_.current=X;const q=d.useRef(b);q.current=b;const G=d.useRef(S);G.current=S;const R=d.useRef(k);R.current=k;const P=d.useRef(A);P.current=A;const L=d.useRef(C);L.current=C;const V=d.useRef(j);V.current=j,E.current=Y=>{var re,he,xe;if(U.current(Y),Y.metaKey||Y.ctrlKey){if(!nb(Y.target)&&kb(Y,()=>void F.current(),()=>void _.current()))return;if(Y.key==="1"){Y.preventDefault(),(re=y.current)==null||re.selectTab("compositions");return}if(Y.key==="2"){Y.preventDefault(),(he=y.current)==null||he.selectTab("assets");return}const ke=Y.key.toLowerCase();if(ke==="c"&&!Y.shiftKey&&!Y.altKey&&!fi(Y.target)){q.current()&&Y.preventDefault();return}if(ke==="v"&&!Y.shiftKey&&!Y.altKey&&!fi(Y.target)){Y.preventDefault(),G.current();return}if(ke==="x"&&!Y.shiftKey&&!Y.altKey&&!fi(Y.target)){(!!oe.getState().selectedElementId||!!i.current)&&(Y.preventDefault(),R.current());return}}if(Y.key.toLowerCase()==="f"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!Y.shiftKey&&!fi(Y.target)){Y.preventDefault(),document.fullscreenElement?document.exitFullscreen():(xe=document.querySelector("[data-studio-fullscreen-target]"))==null||xe.requestFullscreen();return}if(Y.key==="s"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!fi(Y.target)){const{selectedElementId:ke,elements:be,currentTime:Se}=oe.getState();if(ke){const Ve=be.find(Te=>(Te.key??Te.id)===ke);if(Ve&&wu(Ve)&&Se>Ve.start&&Se<Ve.start+Ve.duration){Y.preventDefault(),K.current(Ve,Se);return}}}if(y7&&Y.key.toLowerCase()==="b"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!Y.shiftKey&&!fi(Y.target)){Y.preventDefault();const{activeTool:ke,setActiveTool:be}=oe.getState();be(ke==="razor"?"select":"razor");return}if(Y.key.toLowerCase()==="v"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!Y.shiftKey&&!fi(Y.target)){Y.preventDefault(),oe.getState().setActiveTool("select");return}if(Y.key==="Escape"&&!fi(Y.target)){const{activeTool:ke,selectedElementId:be,setActiveTool:Se,setSelectedElementId:Ve}=oe.getState();if(ke==="razor"){be?Ve(null):Se("select"),Y.preventDefault();return}}if((Y.key==="Delete"||Y.key==="Backspace")&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!fi(Y.target)){const{selectedKeyframes:ke}=oe.getState();if(ke.size>0){L.current(),oe.getState().clearSelectedKeyframes(),Y.preventDefault();return}if(Y.key==="Backspace"){const{selectedElementId:Te,keyframeCache:Ze}=oe.getState();if(Te&&Ze.has(Te)&&P.current()){Y.preventDefault();return}}const{selectedElementId:be,elements:Se}=oe.getState();if(be){const Te=Se.find(Ze=>(Ze.key??Ze.id)===be);if(Te){Y.preventDefault(),I.current(Te);return}}const Ve=i.current;Ve&&(Y.preventDefault(),Z.current(Ve))}Y.key==="r"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!Y.shiftKey&&!fi(Y.target)&&V.current&&(Y.preventDefault(),V.current())},d.useEffect(()=>{function Y(re){var he;(he=E.current)==null||he.call(E,re)}return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[]);const W=d.useCallback(Y=>{var re;(re=E.current)==null||re.call(E,Y)},[]),ee=d.useCallback(Y=>{const re=wb(Y);if(M.current!==re){if(M.current)try{M.current.removeEventListener("keydown",W)}catch{}M.current=re;try{re==null||re.addEventListener("keydown",W,!0)}catch{}}},[W]);d.useEffect(()=>()=>{if(M.current){try{M.current.removeEventListener("keydown",W)}catch{}M.current=null}},[W]);const ue=d.useCallback(Y=>{(Y.metaKey||Y.ctrlKey)&&(nb(Y.target)||kb(Y,()=>void F.current(),()=>void _.current()))},[]),ae=d.useCallback(Y=>{var xe;(xe=$.current)==null||xe.call($),$.current=null;const re=wb(Y);let he=null;try{he=(Y==null?void 0:Y.contentDocument)??null}catch{he=null}if(!(!re&&!he)){try{re==null||re.addEventListener("keydown",ue,!0)}catch{}he==null||he.addEventListener("keydown",ue,!0),$.current=()=>{try{re==null||re.removeEventListener("keydown",ue,!0)}catch{}he==null||he.removeEventListener("keydown",ue,!0)}}},[ue]);return d.useEffect(()=>()=>{var Y;(Y=$.current)==null||Y.call($),$.current=null},[]),{handleUndo:B,handleRedo:X,syncPreviewTimelineHotkey:ee,syncPreviewHistoryHotkey:ae,handleTimelineToggleHotkey:N}}function YV(t,e,n,r){if(n){const l=r??0;let c=0,u=null;if(n.startsWith("#")){const h=n.slice(1);u=new RegExp(`<[a-z][^>]*\\bid="${h}"[^>]*>`,"gi")}else if(n.startsWith(".")){const h=n.slice(1);u=new RegExp(`<[a-z][^>]*\\bclass="[^"]*\\b${h}\\b[^"]*"[^>]*>`,"gi")}else if(n.startsWith("[")){const h=n.slice(1,-1);u=new RegExp(`<[a-z][^>]*\\b${h}[^>]*>`,"gi")}if(u){let h;for(;(h=u.exec(t))!==null;){if(c===l){const p=IV(t,h.index);if(p>0)return t.slice(0,p)+`
|
|
99
|
+
`+e+t.slice(p)}c++}}}const a=/<[^>]*data-composition-id="[^"]+"[^>]*>/i.exec(t);if(a&&a.index!=null){const l=a.index+a[0].length;return t.slice(0,l)+e+t.slice(l)}return t+e}function IV(t,e){const n=t.indexOf(">",e);if(n<0)return-1;if(t[n-1]==="/")return n+1;const r=t.slice(e).match(/^<([a-z][a-z0-9]*)/i);if(!r)return-1;const i=r[1];let a=1,l=n+1;const c=new RegExp(`<${i}(?:\\s|>|/>)`,"gi"),u=new RegExp(`</${i}\\s*>`,"gi");for(;a>0&&l<t.length;){c.lastIndex=l,u.lastIndex=l;const h=c.exec(t),p=u.exec(t);if(!p)return-1;if(h&&h.index<p.index)t.lastIndexOf("/",t.indexOf(">",h.index))>h.index||a++,l=t.indexOf(">",h.index)+1;else{if(a--,a===0)return p.index+p[0].length;l=p.index+p[0].length}}return-1}function qV(t,e){const n=new Set(e);return t.replace(new RegExp('(?<=\\s)id="([^"]+)"',"g"),(r,i)=>{if(!n.has(i))return r;let a=2;for(;n.has(`${i}-${a}`);)a++;const l=`${i}-${a}`;return n.add(l),`id="${l}"`})}function GV(t,e){var i;let n=null;try{n=((i=t.current)==null?void 0:i.contentDocument)??null}catch{return null}if(!n)return null;let r=null;return e.id&&(r=n.getElementById(e.id)),!r&&e.selector&&(r=n.querySelectorAll(e.selector)[e.selectorIndex??0]??null),r&&"outerHTML"in r?r.outerHTML:null}function UV({projectId:t,activeCompPath:e,domEditSelectionRef:n,showToast:r,writeProjectFile:i,recordEdit:a,domEditSaveTimestampRef:l,reloadPreview:c,handleTimelineElementDelete:u,handleDomEditElementDelete:h,previewIframeRef:p}){const O=d.useRef(null),x=d.useRef(t);x.current=t;const y=d.useCallback(()=>{var T;const{selectedElementId:k,elements:A}=oe.getState();if(k){const j=A.find(N=>(N.key??N.id)===k);if(!j)return!1;const M=j.sourceFile||e||"index.html";let E=null;try{const N=(T=p.current)==null?void 0:T.contentDocument;if(N){let D=null;j.domId&&(D=N.getElementById(j.domId)),!D&&j.selector&&(D=N.querySelectorAll(j.selector)[j.selectorIndex??0]??null),D&&"outerHTML"in D&&(E=D.outerHTML)}}catch{}if(!E)return r("Unable to copy this element.","info"),!1;const $={kind:"timeline-clip",html:E,sourceFile:M};return O.current=$,r("Copied clip","info"),!0}const C=n.current;if(C){const j=GV(p,C);if(!j)return r("Unable to copy this element.","info"),!1;const M=C.sourceFile||e||"index.html",E={kind:"dom-element",html:j,sourceFile:M,originSelector:C.selector,originSelectorIndex:C.selectorIndex};return O.current=E,r("Copied element","info"),!0}return!1},[e,n,p,r]),b=d.useCallback(async()=>{const k=O.current;if(!k){r("Nothing to paste.","info");return}const A=x.current;if(!A)return;const C=e||"index.html";try{const T=await Ao(A,C),j=Vd(T),M=qV(k.html,j);let E;if(k.kind==="timeline-clip"){const{currentTime:$}=oe.getState(),N=M.indexOf(">"),B=(N>=0?M.slice(0,N+1):M).replace(/data-start="[^"]*"/,`data-start="${In($)}"`)+M.slice(N+1);E=X8(T,B)}else E=YV(T,M,k.originSelector,k.originSelectorIndex);l.current=Date.now(),await xs({projectId:A,label:k.kind==="timeline-clip"?"Paste clip":"Paste element",kind:"timeline",files:{[C]:E},readFile:async()=>T,writeFile:i,recordEdit:a}),c(),r(k.kind==="timeline-clip"?"Pasted clip":"Pasted element","info")}catch(T){const j=T instanceof Error?T.message:"Failed to paste";r(j)}},[e,l,a,c,r,i]),S=d.useCallback(async()=>{if(!y())return!1;const{selectedElementId:A,elements:C}=oe.getState();if(A){const j=C.find(M=>(M.key??M.id)===A);if(j)return await u(j),!0}const T=n.current;return T&&await h(T),!0},[y,n,u,h]);return{handleCopy:y,handlePaste:b,handleCut:S}}const p9={fontFamily:"sans-serif",fontSize:48,fontWeight:700,fontStyle:"normal",textDecoration:"none",textTransform:"none",letterSpacing:0,lineHeight:1.2,color:"#ffffff",activeColor:"#ffffff",dimColor:"rgba(255, 255, 255, 0.3)",opacity:1,gradientFill:null,strokeWidth:0,strokeColor:"#000000",shadows:[],glow:null,x:0,y:0,rotation:0,scaleX:1,scaleY:1,skewX:0,skewY:0,transformOrigin:"center center",blendMode:"normal"},WV={backgroundColor:"transparent",backgroundOpacity:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,borderRadius:0,borderWidth:0,borderColor:"transparent",borderStyle:"solid",boxShadow:"none"},Ab={preset:"fade",duration:.2,ease:"power2.out",stagger:0,staggerDirection:"start",intensity:1},to={entrance:Ab,highlight:null,exit:{...Ab}};function KV(t,e){const{width:n,height:r,duration:i,wordsPerGroup:a=5}=e,l=new Map,c=new Map,u=[];for(let h=0;h<t.length;h+=a){const p=t.slice(h,h+a),O=`group-${h/a}`,x=[];p.forEach((b,S)=>{const k=`segment-${h+S}`,A={id:k,wordId:b.id??`w${h+S}`,text:b.text,start:b.start,end:b.end,groupIndex:S,style:{},animation:{}};l.set(k,A),x.push(k)});const y={id:O,segmentIds:x,style:{...p9},animation:{entrance:{...to.entrance},highlight:to.highlight,exit:{...to.exit}},containerStyle:{...WV}};c.set(O,y),u.push(O)}return{width:n,height:r,duration:i,segments:l,groups:c,groupOrder:u,defaultAnimation:{entrance:{...to.entrance},highlight:to.highlight,exit:{...to.exit}}}}function JV(t){const e=/(?:const|let|var)\s+(?:TRANSCRIPT|script)\s*=\s*(\[[\s\S]*?\]);/,n=t.match(e);if(!n)return[];const r=n[1];try{return tL(r)}catch{return[]}}function eL(t,e,n,r,i,a){const l=JV(n);if(l.length===0)return null;const c=t.querySelectorAll(".caption-group, .caption-line, .caption-block"),u=t.querySelectorAll(".word, .caption-word");let h=5;c.length>0&&u.length>0&&(h=Math.round(u.length/c.length),h<1&&(h=1));const p=KV(l,{width:r,height:i,duration:a,wordsPerGroup:h}),O=u.item(0),x=c.item(0),y=O??x;if(y){const b=e.getComputedStyle(y),S={},k=parseFloat(b.fontSize);!isNaN(k)&&k>0&&(S.fontSize=k);const A=b.fontWeight;if(A){const $=parseInt(A,10);S.fontWeight=isNaN($)?A:$}const C=b.fontFamily;C&&(S.fontFamily=C);const T=b.color;T&&(S.color=T);const j=b.textTransform;(j==="none"||j==="uppercase"||j==="lowercase"||j==="capitalize")&&(S.textTransform=j);const M=b.letterSpacing;if(M&&M!=="normal"){const $=parseFloat(M),N=S.fontSize??p9.fontSize;!isNaN($)&&N>0&&(S.letterSpacing=$/N)}const E={};if(x){const $=e.getComputedStyle(x),N=$.backgroundColor;N&&N!=="rgba(0, 0, 0, 0)"&&N!=="transparent"&&(E.backgroundColor=N,E.backgroundOpacity=1);const D=parseFloat($.borderRadius);!isNaN(D)&&D>0&&(E.borderRadius=D);const z=parseFloat($.paddingTop),B=parseFloat($.paddingRight),X=parseFloat($.paddingBottom),U=parseFloat($.paddingLeft);isNaN(z)||(E.paddingTop=z),isNaN(B)||(E.paddingRight=B),isNaN(X)||(E.paddingBottom=X),isNaN(U)||(E.paddingLeft=U)}for(const $ of p.groupOrder){const N=p.groups.get($);N&&(N.style={...N.style,...S},N.containerStyle={...N.containerStyle,...E})}}return p}function tL(t){let e;try{e=JSON.parse(t)}catch{let r=t;r=r.replace(/'((?:[^'\\]|\\.)*)'/g,(i,a)=>`"${a.replace(/\\'/g,"'").replace(/"/g,'\\"')}"`),r=r.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g,'$1"$2":'),r=r.replace(/,(\s*[}\]])/g,"$1"),e=JSON.parse(r)}if(!Array.isArray(e))return[];const n=[];for(const r of e)if(r!==null&&typeof r=="object"&&typeof r.text=="string"&&typeof r.start=="number"&&typeof r.end=="number"){const i=r;n.push({...typeof i.id=="string"?{id:i.id}:{},text:i.text,start:i.start,end:i.end})}return n}function nL({projectId:t,activeCompPath:e,compIdToSrc:n,captionEditMode:r,captionHasSelection:i,previewIframeRef:a,captionSync:l,setRightCollapsed:c}){d.useEffect(()=>{if(!t)return;let u=!1;const h=()=>{if(kt.getState().isEditMode||u)return;const O=a.current;let x=null,y=null;try{x=(O==null?void 0:O.contentDocument)??null,y=(O==null?void 0:O.contentWindow)??null}catch{return}if(!x||!y||x.querySelectorAll(".caption-group").length===0)return;let S=null;const k=x.querySelectorAll("[data-composition-src], [data-composition-file]");for(const C of k){const T=C.getAttribute("data-composition-src")||C.getAttribute("data-composition-file");if(T&&T.includes("captions")){S=T;break}}if(!S){for(const[C,T]of n)if(C.includes("caption")||T.includes("caption")){S=T;break}}if(!S&&(e!=null&&e.includes("captions"))&&(S=e),!S){const C=x.querySelector('[data-composition-id*="caption"]');if(C){const T=C.getAttribute("data-composition-id")||"";S=n.get(T)||null}}if(!S)return;u=!0;const A=S;fetch(`/api/projects/${t}/files/${encodeURIComponent(A)}`).then(C=>C.json()).then(C=>{if(!C.content||!x||!y||kt.getState().isEditMode)return;const T=x.querySelector("[data-composition-id]"),j=parseInt((T==null?void 0:T.getAttribute("data-width"))??"1920",10),M=parseInt((T==null?void 0:T.getAttribute("data-height"))??"1080",10),E=parseFloat((T==null?void 0:T.getAttribute("data-duration"))??"0"),$=eL(x,y,C.content,j,M,E);if(!$)return;const N=kt.getState();N.setModel($),N.setSourceFilePath(A),N.setEditMode(!0),l.loadOverrides()}).catch(()=>{}).finally(()=>{u=!1})},p=O=>{const x=O.data;(x==null?void 0:x.source)==="hf-preview"&&((x==null?void 0:x.type)==="state"||(x==null?void 0:x.type)==="timeline")&&h()};return window.addEventListener("message",p),h(),()=>{window.removeEventListener("message",p)}},[e,t,n,l,a]),d.useEffect(()=>{r&&c(!i)},[i,r,c])}const g9=2,rL=1,Mb=g9+rL;function iL(t,e){const n=[],r=Math.floor(t.length/e);if(r===0)return Array(e).fill(0);for(let a=0;a<e;a++){let l=0;const c=a*r,u=Math.min(c+r,t.length);for(let h=c;h<u;h++){const p=Math.abs(t[h]??0);p>l&&(l=p)}n.push(l)}const i=Math.max(...n,.001);return n.map(a=>a/i)}function aL(t,e){let n=0;for(let a=0;a<t.length;a++)n=(n<<5)-n+t.charCodeAt(a)|0;n=Math.abs(n)||42;const r=()=>(n=n*16807%2147483647,(n&2147483647)/2147483647),i=[];for(let a=0;a<e;a++){const l=a/e,c=.3+.3*Math.sin(l*Math.PI*3.2)+.2*Math.sin(l*Math.PI*7.1);i.push(Math.max(.05,Math.min(1,c*(.4+.6*r()))))}return i}const Cb=new Map,Yp=new Map,sL=d.memo(function({audioUrl:e,waveformUrl:n,label:r,labelColor:i}){const a=d.useRef(null),l=d.useRef(null),c=d.useRef(null),u=n??e,[h,p]=d.useState(Cb.get(u)??null);d.useEffect(()=>{if(h||!u)return;let y=!1,b=Yp.get(u);return b||(b=(n?fetch(n).then(S=>S.json()).then(S=>{if(!Array.isArray(S.peaks))throw new Error("bad response");return S.peaks}):fetch(e).then(S=>S.arrayBuffer()).then(S=>{const k=new AudioContext;return k.decodeAudioData(S).finally(()=>k.close())}).then(S=>iL(S.getChannelData(0),4e3))).catch(()=>aL(u,4e3)).then(S=>(Cb.set(u,S),S)).finally(()=>Yp.delete(u)),Yp.set(u,b)),b.then(S=>{y||p(S)}),()=>{y=!0}},[e,n,u,h]);const O=d.useCallback(()=>{const y=a.current,b=l.current;if(!y||!b||!h)return;const S=y.clientWidth||400,k=Math.min(Math.floor(S/Mb),h.length);let A="";for(let C=0;C<k;C++){const T=Math.floor(C/k*h.length),j=h[T]??0,M=Math.max(3,Math.round(j*100)),E=(.45+j*.4).toFixed(2);A+=`<div style="position:absolute;bottom:0;left:${C*Mb}px;width:${g9}px;height:${M}%;background:rgba(75,163,210,${E})"></div>`}b.innerHTML=A},[h]),x=d.useCallback(y=>{var b;(b=c.current)==null||b.disconnect(),a.current=y,y&&(O(),c.current=new ResizeObserver(()=>O()),c.current.observe(y))},[O]);return d.useEffect(()=>{O()},[O]),d.useEffect(()=>()=>{var y;(y=c.current)==null||y.disconnect()},[]),m.jsxs("div",{ref:x,className:"absolute inset-0 overflow-hidden",children:[m.jsx("div",{ref:l,className:"absolute left-0 right-0 bottom-0",style:{top:16}}),!h&&m.jsx("div",{className:"absolute left-0 right-0 bottom-0 animate-pulse",style:{top:16,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%)"}}),m.jsx("div",{className:"absolute top-0 left-0 right-0 px-1.5 py-0.5 z-10",children:m.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:i,textShadow:"0 1px 3px rgba(0,0,0,0.9)"},children:r})})]})});function lL(t,e,n){try{const r=new URL(t,n),i=`/api/projects/${e}/preview/`;if(r.pathname.startsWith(i))return r.pathname.slice(i.length)}catch{}return t}function oL({projectIdRef:t,compIdToSrc:e,activePreviewUrl:n,effectiveTimelineDuration:r}){return d.useCallback((i,a)=>{var h;const l=t.current;if(!l)return null;let c=i.compositionSrc;if(c&&(c=lL(c,l,window.location.origin)),c&&e.size>0){const p=e.get(i.id)||e.get(c.replace(/^compositions\//,"").replace(/\.html$/,""));p&&(c=p)}if(c)return d.createElement(Zp,{previewUrl:`/api/projects/${l}/preview/comp/${c}`,label:qs(i),labelColor:a.label,seekTime:0,duration:i.duration});if(n&&i.duration>0)return d.createElement(Zp,{previewUrl:n,label:qs(i),labelColor:a.label,selector:i.selector,selectorIndex:i.selectorIndex,seekTime:i.start,duration:i.duration});const u=i.duration>0&&r>0&&i.duration<r*.92&&!/(backdrop|background|overlay|scrim|mask)/i.test(i.id);if(i.tag==="audio"){const p=`/api/projects/${l}/preview/`,O=(h=i.src)!=null&&h.startsWith("http")?i.src.indexOf(p):-1,x=i.src?O!==-1?decodeURIComponent(i.src.slice(O+p.length)):i.src.startsWith("http")?null:i.src:null,y=x?`/api/projects/${l}/preview/${x}`:i.src??"",b=x?`/api/projects/${l}/waveform/${x}`:void 0;return d.createElement(sL,{audioUrl:y,waveformUrl:b,label:qs(i),labelColor:a.label})}if((i.tag==="video"||i.tag==="img")&&i.src){const p=i.src.startsWith("http")?i.src:`/api/projects/${l}/preview/${i.src}`;return d.createElement(GP,{videoSrc:p,label:qs(i),labelColor:a.label,duration:i.duration})}return u?d.createElement(Zp,{previewUrl:`/api/projects/${l}/preview`,label:qs(i),labelColor:a.label,selector:i.selector,selectorIndex:i.selectorIndex,seekTime:i.start,duration:i.duration}):null},[t,e,n,r])}function cL(t){const[e,n]=d.useState(null),r=d.useRef([]),i=d.useCallback(()=>{r.current=[],n(null)},[]);return d.useEffect(()=>{if(!t)return;const a=()=>{try{const c=t.contentWindow;if(!c||c.__hfErrorCapture)return;c.__hfErrorCapture=!0;const u=c.console.error.bind(c.console);c.console.error=function(...h){u(...h);const p=h.map(O=>O instanceof Error?O.message:String(O)).join(" ");p.includes("favicon")||(r.current=[...r.current,{severity:"error",message:p}],n([...r.current]))},c.addEventListener("error",h=>{const p=h.message||String(h);r.current=[...r.current,{severity:"error",message:p}],n([...r.current])})}catch{}};a();const l=()=>{r.current=[],n(null),a()};return t.addEventListener("load",l),()=>t.removeEventListener("load",l)},[t]),{consoleErrors:e,setConsoleErrors:n,resetErrors:i}}const jg="#project/";function uL(t){try{return decodeURIComponent(t)}catch{return t}}function fL(t){if(!t)return new URLSearchParams;if(t instanceof URLSearchParams)return t;const e=new URLSearchParams;for(const[n,r]of Object.entries(t))!n||r==null||r===""||e.set(n,r);return e}function O9(t){return encodeURIComponent(t)}function x9(t,e){const n=fL(e).toString();return`${jg}${O9(t)}${n?`?${n}`:""}`}function y9(t){if(!t.startsWith(jg))return null;const e=t.slice(jg.length),n=e.indexOf("?"),r=n>=0?e.slice(0,n):e;if(!r||r.includes("/"))return null;const i=n>=0?e.slice(n+1):"";return{projectId:uL(r),params:new URLSearchParams(i)}}function Tb(t){var e;return((e=y9(t))==null?void 0:e.projectId)??null}function dL(t,e=""){const n=e&&!e.startsWith("/")?`/${e}`:e;return`/api/projects/${O9(t)}${n}`}function b9(t){return t&&t!=="master"?t:"index.html"}function Eb({projectId:t,compositionPath:e,currentTime:n,origin:r=window.location.origin}){const i=b9(e),a=new URL(dL(t,`/thumbnail/${encodeURIComponent(i)}`),r);return a.searchParams.set("t",Math.max(0,n).toFixed(3)),a.searchParams.set("format","png"),a.searchParams.set("v",String(Date.now())),a.toString()}function $b(t,e){var a;const r=((a=b9(t).split("/").pop())==null?void 0:a.replace(/\.html$/i,""))||"frame",i=Math.max(0,e).toFixed(3).replace(".","-");return`${r}-${i}s.png`}function hL({projectId:t,activeCompPath:e,showToast:n,waitForPendingDomEditSaves:r}){const[i,a]=d.useState(0);Wt(()=>(a(oe.getState().currentTime),pr.subscribe(a)));const l=d.useCallback(()=>{a(oe.getState().currentTime)},[]),c=d.useCallback(async p=>{if(t){p.preventDefault();try{const O=oe.getState().currentTime;a(O),await Promise.race([r(),new Promise((k,A)=>setTimeout(()=>A(new Error("Save queue timed out")),5e3))]);const x=Eb({projectId:t,compositionPath:e,currentTime:O}),y=$b(e,O),b=new AbortController,S=setTimeout(()=>b.abort(),3e4);try{const k=await fetch(x,{cache:"no-store",signal:b.signal});if(clearTimeout(S),!k.ok){let j=`Capture failed (${k.status})`;try{const M=await k.json();M!=null&&M.error&&(j=M.error)}catch{}throw new Error(j)}const A=await k.blob(),C=URL.createObjectURL(A),T=document.createElement("a");T.href=C,T.download=y,document.body.appendChild(T),T.click(),T.remove(),setTimeout(()=>URL.revokeObjectURL(C),1e3)}catch(k){throw clearTimeout(S),k instanceof DOMException&&k.name==="AbortError"?new Error("Capture timed out — the server took too long to respond"):k}}catch(O){n(O instanceof Error?O.message:"Capture failed","error")}}},[e,t,n,r]),u=t?Eb({projectId:t,compositionPath:e,currentTime:i}):"#",h=$b(e,i);return{captureFrameHref:u,captureFrameFilename:h,handleCaptureFrameClick:c,refreshCaptureFrameTime:l}}function mL(t){return{severity:t.severity==="error"?"error":"warning",message:t.message??"",file:t.file,fixHint:t.fixHint,elementId:t.elementId}}function pL(t,e){const[n,r]=d.useState(null),[i,a]=d.useState(!1),[l,c]=d.useState([]),u=d.useRef(!1),h=d.useCallback(async k=>{if(t){k!=null&&k.background||a(!0);try{const T=((await(await fetch(`/api/projects/${t}/lint`)).json()).findings??[]).map(mL);k!=null&&k.background||r(T),c(T)}catch(A){if(!(k!=null&&k.background)){const C=A instanceof Error?A.message:String(A);r([{severity:"error",message:`Failed to run lint: ${C}`}])}}finally{k!=null&&k.background||a(!1)}}},[t]),p=d.useCallback(()=>h(),[h]),O=d.useRef(t);d.useEffect(()=>{t!==O.current&&(u.current=!1,O.current=t),!(!t||u.current)&&(u.current=!0,h({background:!0}))},[t,h]),d.useEffect(()=>{if(!t||!e)return;const k=setTimeout(()=>void h({background:!0}),1e3);return()=>clearTimeout(k)},[t,e,h]);const x=d.useCallback(()=>r(null),[]),y=d.useCallback(k=>{const A=new Map;for(const C of l){const T=k(C);if(!T)continue;const j=A.get(T)??{count:0,messages:[]};j.count+=1,j.messages.push(C.message),A.set(T,j)}return A},[l]),b=d.useMemo(()=>y(k=>k.elementId),[y]),S=d.useMemo(()=>y(k=>k.file),[y]);return{lintModal:n,linting:i,handleLint:p,closeLintModal:x,backgroundFindings:l,findingsByElement:b,findingsByFile:S}}function gL(){const[t,e]=d.useState(null);return Wt(()=>{const n=r=>{const i=r.data;if((i==null?void 0:i.source)!=="hf-preview"||(i==null?void 0:i.type)!=="stage-size")return;const{width:a,height:l}=i;!(a>0)||!(l>0)||e(c=>c&&c.width===a&&c.height===l?c:{width:a,height:l})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}),t}function OL(){const[t,e]=d.useState(null),n=d.useRef(null),r=d.useCallback((a,l="error")=>{n.current&&clearTimeout(n.current),e({message:a,tone:l}),n.current=setTimeout(()=>e(null),4e3)},[]);Wt(()=>()=>{n.current&&clearTimeout(n.current)});const i=d.useCallback(()=>{n.current&&clearTimeout(n.current),e(null)},[]);return{appToast:t,showToast:r,dismissToast:i}}const v9=["layers","design","motion","renders"];function xL(t,e={}){if(!t||!v9.includes(t))return null;const n=e.inspectorPanelsEnabled??Pn,r=e.motionPanelEnabled??z8;return!n&&t!=="renders"?"renders":t==="motion"&&!r?"design":t}function yL(t,e){return!t||t==="index.html"?null:e.includes(t)?t:null}function jb(t){return t==="1"?!0:t==="0"?!1:null}function S9(t){if(t==null||t==="")return null;const e=Number(t);return Number.isFinite(e)?e:null}function bL(t){return v9.includes(t)?t:null}function vL(t){const e=t.get("selFile")||void 0,n=t.get("selId")||void 0,r=t.get("selSelector")||void 0,i=S9(t.get("selIndex"));return!e&&!n&&!r?null:{sourceFile:e,id:n,selector:r,selectorIndex:i!=null?Math.max(0,Math.floor(i)):void 0}}function w9(){return{activeCompPath:null,currentTime:null,rightPanelTab:null,rightCollapsed:null,timelineVisible:null,selection:null}}function SL(t){const e=y9(t);if(!e)return w9();const{params:n}=e;return{activeCompPath:n.get("comp")||null,currentTime:S9(n.get("t")),rightPanelTab:xL(bL(n.get("tab"))),rightCollapsed:jb(n.get("rc")),timelineVisible:jb(n.get("tv")),selection:vL(n)}}function wL(){return typeof window>"u"?w9():SL(window.location.hash)}function Pb(t,e){const n=new URLSearchParams;return n.set("v","1"),e.activeCompPath&&n.set("comp",e.activeCompPath),e.currentTime!=null&&Number.isFinite(e.currentTime)&&n.set("t",String(Math.max(0,Math.round(e.currentTime*1e3)/1e3))),e.rightPanelTab&&n.set("tab",e.rightPanelTab),e.rightCollapsed!=null&&n.set("rc",e.rightCollapsed?"1":"0"),e.timelineVisible!=null&&n.set("tv",e.timelineVisible?"1":"0"),e.selection&&(e.selection.sourceFile&&n.set("selFile",e.selection.sourceFile),e.selection.id&&n.set("selId",e.selection.id),e.selection.selector&&n.set("selSelector",e.selection.selector),typeof e.selection.selectorIndex=="number"&&n.set("selIndex",String(Math.max(0,Math.floor(e.selection.selectorIndex))))),x9(t,n)}function kL(t){return!t||!t.id&&!t.selector?null:{sourceFile:t.sourceFile||void 0,id:t.id||void 0,selector:t.selector||void 0,selectorIndex:t.selectorIndex??void 0}}function Qb(t){typeof window>"u"||window.location.hash!==t&&window.history.replaceState(null,"",t)}function AL({projectId:t,activeCompPath:e,duration:n,isPlaying:r,compositionLoading:i,refreshKey:a,previewIframeRef:l,rightPanelTab:c,rightCollapsed:u,timelineVisible:h,activeCompPathHydrated:p,domEditSelection:O,buildDomSelectionFromTarget:x,applyDomSelection:y,initialState:b}){const S=oe(E=>E.currentTime),k=d.useRef(b.currentTime==null),A=d.useRef(b.currentTime==null),C=d.useRef(b.selection==null),T=d.useRef(b.selection),j=d.useRef(b.currentTime),M=d.useCallback(()=>({activeCompPath:e,currentTime:j.current,rightPanelTab:c,rightCollapsed:u,timelineVisible:h,selection:C.current?kL(O):T.current}),[e,O,u,c,h]);d.useEffect(()=>{if(!t||k.current||i)return;const E=n>0?Eu(b.currentTime??0,0,n):Math.max(0,b.currentTime??0);oe.getState().requestSeek(E),j.current=E,k.current=!0},[t,i,n,b.currentTime]),d.useEffect(()=>{var z;if(!t||C.current||i||!k.current||b.currentTime!=null&&Math.abs(S-j.current)>.05)return;const $=T.current;if(!$){C.current=!0;return}let N=null;try{N=((z=l.current)==null?void 0:z.contentDocument)??null}catch{return}if(!N)return;const D=mr(N,{sourceFile:$.sourceFile??"",id:$.id,selector:$.selector,selectorIndex:$.selectorIndex},e);if(!D){y(null,{revealPanel:!1}),C.current=!0,T.current=null;return}C.current=!0,T.current=null,x(D,{preferClipAncestor:!1}).then(B=>{y(B,{revealPanel:!1})})},[e,y,x,i,S,b.currentTime,l,t,a]),d.useEffect(()=>{if(A.current)return;const E=j.current;if(E==null){A.current=!0;return}Math.abs(S-E)>.05||(A.current=!0)},[S]),d.useEffect(()=>{if(!p||!k.current||!A.current||!t||r)return;const E=window.setTimeout(()=>{j.current=Eu(S,0,Math.max(0,n)),Qb(Pb(t,M()))},200);return()=>window.clearTimeout(E)},[p,M,S,n,r,t]),d.useEffect(()=>{p&&t&&Qb(Pb(t,M()))},[p,M,t])}function ML(t){return{projectId:t.projectId,activeCompPath:t.activeCompPath,setActiveCompPath:t.setActiveCompPath,showToast:t.showToast,previewIframeRef:t.previewIframeRef,captionEditMode:t.captionEditMode,compositionLoading:t.compositionLoading,refreshKey:t.refreshKey,setRefreshKey:t.setRefreshKey,timelineElements:t.timelineElements,isPlaying:t.isPlaying,editHistory:t.editHistory,handleUndo:t.handleUndo,handleRedo:t.handleRedo,renderQueue:t.renderQueue,compositionDimensions:t.compositionDimensions,waitForPendingDomEditSaves:t.waitForPendingDomEditSaves,handlePreviewIframeRef:t.handlePreviewIframeRef,refreshPreviewDocumentVersion:t.refreshPreviewDocumentVersion,timelineVisible:t.timelineVisible,toggleTimelineVisibility:t.toggleTimelineVisibility}}function CL(t,e,n,r,i){return d.useMemo(()=>{const a=Pn&&r?k7(r.element):null,l=Pn&&t==="layers",c=Pn&&t==="design",u=Pn&&z8&&t==="motion",h=l||c||u;return{selectedStudioMotion:a,layersPanelActive:l,designPanelActive:c,motionPanelActive:u,inspectorPanelActive:h,inspectorButtonActive:Pn&&!e&&h,shouldShowSelectedDomBounds:h&&!e&&!n&&!i}},[t,e,n,r,i])}function TL(t){const[e,n]=d.useState(!1),r=d.useRef(0),i=d.useCallback(u=>{u.dataTransfer.types.includes("Files")&&u.preventDefault()},[]),a=d.useCallback(u=>{u.dataTransfer.types.includes("Files")&&(u.preventDefault(),r.current++,n(!0))},[]),l=d.useCallback(()=>{r.current--,r.current===0&&n(!1)},[]),c=d.useCallback(u=>{r.current=0,n(!1),!u.defaultPrevented&&(u.preventDefault(),u.dataTransfer.files.length&&t(u.dataTransfer.files))},[t]);return{active:e,onDragOver:i,onDragEnter:a,onDragLeave:l,onDrop:c}}function EL(t){if(!t||typeof window>"u")return;const e=480,n=270,r=16,i=Eu(t.x,r+e/2,window.innerWidth-r-e/2),a=Eu(t.y+12,r,window.innerHeight-r-n);return{left:i,top:a,transform:"translateX(-50%)"}}function $L({selectionLabel:t,contextPreview:e,anchorPoint:n=null,onSubmit:r,onClose:i}){const[a,l]=d.useState(""),c=d.useRef(null),u=EL(n);Wt(()=>{requestAnimationFrame(()=>{var p;return(p=c.current)==null?void 0:p.focus()})});const h=()=>{a.trim()&&r(a.trim())};return m.jsx("div",{className:n?"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm":"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:i,children:m.jsxs("div",{className:`w-[480px] rounded-2xl border border-neutral-800 bg-neutral-950 shadow-2xl ${n?"fixed":""}`,style:u,onClick:p=>p.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800/60",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-medium text-neutral-200",children:"Copy prompt to AI agent"}),m.jsx("p",{className:"text-xs text-neutral-500 mt-0.5",children:t.length>50?`${t.slice(0,49)}…`:t})]}),m.jsx("button",{className:"p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50",onClick:i,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),m.jsxs("div",{className:"px-5 py-4 space-y-3",children:[m.jsx("textarea",{ref:c,className:"w-full h-24 px-3 py-2 rounded-lg border border-neutral-800 bg-neutral-900/60 text-sm text-neutral-200 placeholder-neutral-600 resize-none focus:outline-none focus:border-studio-accent/60 focus:ring-1 focus:ring-studio-accent/30",placeholder:"Describe what you want to change…",value:a,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&h(),p.key==="Escape"&&i()}}),e&&m.jsxs("details",{className:"group",children:[m.jsx("summary",{className:"text-[11px] text-neutral-500 cursor-pointer select-none hover:text-neutral-400",children:"Context included in prompt"}),m.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-lg bg-neutral-900/80 px-3 py-2 text-[11px] leading-relaxed text-neutral-500 whitespace-pre-wrap break-words border border-neutral-800/50",children:e})]})]}),m.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-neutral-800/60",children:[m.jsxs("span",{className:"text-[11px] text-neutral-600",children:[navigator.platform.includes("Mac")?"⌘":"Ctrl","+Enter to copy"]}),m.jsx("button",{className:"px-4 py-1.5 rounded-lg bg-studio-accent/90 text-xs font-medium text-neutral-950 hover:bg-studio-accent disabled:opacity-40 disabled:cursor-not-allowed",disabled:!a.trim(),onClick:h,children:"Copy prompt"})]})]})})}function jL(){return m.jsx("div",{className:"absolute inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm pointer-events-none",children:m.jsxs("div",{className:"flex flex-col items-center gap-3 px-8 py-6 rounded-xl border-2 border-dashed border-studio-accent/60 bg-studio-accent/[0.06]",children:[m.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-studio-accent",children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsx("span",{className:"text-sm font-medium text-studio-accent",children:"Drop files to import into project"})]})})}const pn=t=>({title:n,...r})=>m.jsx(t,{alt:n,"aria-label":n,"aria-hidden":n?void 0:!0,...r}),PL=pn(yZ),QL=pn(vZ),k9=pn(wZ),A9=pn(LZ),Uf=pn(UZ),ZL=pn(gZ),NL=pn(BZ),RL=pn(YZ),cO=pn(vw),VL=pn(GZ),Zb=pn(KZ),Xd=pn(tN),uO=pn(zZ),LL=pn(xZ),_L=pn(D7),DL=pn(bZ),fO=pn(mZ),HL=pn(OZ),XL=pn(hZ),zL=pn(DZ),Nb=pn(qZ),M9=d.createContext(null);function hl(){const t=d.useContext(M9);if(!t)throw new Error("useStudioContext must be used within StudioProvider");return t}function FL({value:t,children:e}){const{projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:a,previewIframeRef:l,captionEditMode:c,compositionLoading:u,refreshKey:h,setRefreshKey:p,timelineElements:O,isPlaying:x,editHistory:y,handleUndo:b,handleRedo:S,renderQueue:k,compositionDimensions:A,waitForPendingDomEditSaves:C,handlePreviewIframeRef:T,refreshPreviewDocumentVersion:j,timelineVisible:M,toggleTimelineVisibility:E}=t,$=d.useMemo(()=>({projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:a,previewIframeRef:l,captionEditMode:c,compositionLoading:u,refreshKey:h,setRefreshKey:p,timelineElements:O,isPlaying:x,editHistory:y,handleUndo:b,handleRedo:S,renderQueue:k,compositionDimensions:A,waitForPendingDomEditSaves:C,handlePreviewIframeRef:T,refreshPreviewDocumentVersion:j,timelineVisible:M,toggleTimelineVisibility:E}),[n,r,c,u,h,x,A,M,y,O,k,i,a,l,p,b,S,C,T,j,E]);return m.jsx(M9,{value:$,children:e})}const C9=d.createContext(null);function dO(){const t=d.useContext(C9);if(!t)throw new Error("usePanelLayoutContext must be used within PanelLayoutProvider");return t}function BL({value:{leftWidth:t,setLeftWidth:e,rightWidth:n,leftCollapsed:r,setLeftCollapsed:i,rightCollapsed:a,setRightCollapsed:l,rightPanelTab:c,setRightPanelTab:u,toggleLeftSidebar:h,handlePanelResizeStart:p,handlePanelResizeMove:O,handlePanelResizeEnd:x},children:y}){const b=d.useMemo(()=>({leftWidth:t,setLeftWidth:e,rightWidth:n,leftCollapsed:r,setLeftCollapsed:i,rightCollapsed:a,setRightCollapsed:l,rightPanelTab:c,setRightPanelTab:u,toggleLeftSidebar:h,handlePanelResizeStart:p,handlePanelResizeMove:O,handlePanelResizeEnd:x}),[t,e,n,r,i,a,l,c,u,h,p,O,x]);return m.jsx(C9,{value:b,children:y})}const T9=d.createContext(null);function zd(){const t=d.useContext(T9);if(!t)throw new Error("useDomEditContext must be used within DomEditProvider");return t}function YL({value:{domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:a,agentPromptSelectionContext:l,domEditSelectionRef:c,handleTimelineElementSelect:u,handlePreviewCanvasMouseDown:h,handlePreviewCanvasPointerMove:p,handlePreviewCanvasPointerLeave:O,applyDomSelection:x,clearDomSelection:y,handleDomStyleCommit:b,handleDomAttributeCommit:S,handleDomHtmlAttributeCommit:k,handleDomPathOffsetCommit:A,handleDomGroupPathOffsetCommit:C,handleDomZIndexReorderCommit:T,handleDomBoxSizeCommit:j,handleDomRotationCommit:M,handleDomManualEditsReset:E,handleDomMotionCommit:$,handleDomMotionClear:N,handleDomTextCommit:D,handleDomTextFieldStyleCommit:z,handleDomAddTextField:B,handleDomRemoveTextField:X,handleAskAgent:U,handleAgentModalSubmit:I,handleBlockedDomMove:K,handleDomManualDragStart:Z,handleDomEditElementDelete:F,buildDomSelectionFromTarget:_,buildDomSelectionForTimelineElement:q,updateDomEditHoverSelection:G,resolveImportedFontAsset:R,setAgentModalOpen:P,setAgentPromptSelectionContext:L,setAgentModalAnchorPoint:V,selectedGsapAnimations:W,gsapMultipleTimelines:ee,gsapUnsupportedTimelinePattern:ue,handleGsapUpdateProperty:ae,handleGsapUpdateMeta:Y,handleGsapDeleteAnimation:re,handleGsapAddAnimation:he,handleGsapAddProperty:xe,handleGsapRemoveProperty:ke,handleGsapUpdateFromProperty:be,handleGsapAddFromProperty:Se,handleGsapRemoveFromProperty:Ve,handleGsapAddKeyframe:Te,handleGsapAddKeyframeBatch:Ze,handleGsapRemoveKeyframe:Xe,handleGsapConvertToKeyframes:ze,handleGsapRemoveAllKeyframes:et,handleResetSelectedElementKeyframes:Ot,commitAnimatedProperty:He,handleSetArcPath:ct,handleUpdateArcSegment:yt,invalidateGsapCache:Oe,previewIframeRef:Ge,commitMutation:Re},children:qe}){const Ie=d.useMemo(()=>({domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:a,agentPromptSelectionContext:l,domEditSelectionRef:c,handleTimelineElementSelect:u,handlePreviewCanvasMouseDown:h,handlePreviewCanvasPointerMove:p,handlePreviewCanvasPointerLeave:O,applyDomSelection:x,clearDomSelection:y,handleDomStyleCommit:b,handleDomAttributeCommit:S,handleDomHtmlAttributeCommit:k,handleDomPathOffsetCommit:A,handleDomGroupPathOffsetCommit:C,handleDomZIndexReorderCommit:T,handleDomBoxSizeCommit:j,handleDomRotationCommit:M,handleDomManualEditsReset:E,handleDomMotionCommit:$,handleDomMotionClear:N,handleDomTextCommit:D,handleDomTextFieldStyleCommit:z,handleDomAddTextField:B,handleDomRemoveTextField:X,handleAskAgent:U,handleAgentModalSubmit:I,handleBlockedDomMove:K,handleDomManualDragStart:Z,handleDomEditElementDelete:F,buildDomSelectionFromTarget:_,buildDomSelectionForTimelineElement:q,updateDomEditHoverSelection:G,resolveImportedFontAsset:R,setAgentModalOpen:P,setAgentPromptSelectionContext:L,setAgentModalAnchorPoint:V,selectedGsapAnimations:W,gsapMultipleTimelines:ee,gsapUnsupportedTimelinePattern:ue,handleGsapUpdateProperty:ae,handleGsapUpdateMeta:Y,handleGsapDeleteAnimation:re,handleGsapAddAnimation:he,handleGsapAddProperty:xe,handleGsapRemoveProperty:ke,handleGsapUpdateFromProperty:be,handleGsapAddFromProperty:Se,handleGsapRemoveFromProperty:Ve,handleGsapAddKeyframe:Te,handleGsapAddKeyframeBatch:Ze,handleGsapRemoveKeyframe:Xe,handleGsapConvertToKeyframes:ze,handleGsapRemoveAllKeyframes:et,handleResetSelectedElementKeyframes:Ot,commitAnimatedProperty:He,handleSetArcPath:ct,handleUpdateArcSegment:yt,invalidateGsapCache:Oe,previewIframeRef:Ge,commitMutation:Re}),[t,e,n,r,i,a,l,c,u,h,p,O,x,y,b,S,k,A,C,T,j,M,E,$,N,D,z,B,X,U,I,K,Z,F,_,q,G,R,P,L,V,W,ee,ue,ae,Y,re,he,xe,ke,be,Se,Ve,Te,Ze,Xe,ze,et,Ot,He,ct,yt,Oe,Ge,Re]);return m.jsx(T9,{value:Ie,children:qe})}function IL(){const e=Math.round(93.21518987341773);return m.jsxs("svg",{width:e,height:28,viewBox:"0 0 263 79",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hyperframes",children:[m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"hf-g0",x1:"225.869",y1:"0",x2:"222.845",y2:"37.482",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),m.jsxs("linearGradient",{id:"hf-g1",x1:"230.87",y1:"39",x2:"244.661",y2:"6.303",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]}),m.jsx("path",{d:"M0 16.6738H4.96V23.3838H11.53V16.6738H16.49V35.4538H11.53V27.6738H4.96V35.4538H0V16.6738Z",fill:"white"}),m.jsx("path",{d:"M17.8899 28.0137C17.8899 23.4237 21.2399 20.0237 25.7999 20.0237C30.0099 20.0237 32.9399 23.0837 32.9399 27.5637C32.9399 28.2037 32.8599 28.8237 32.8299 29.3337H22.6099C23.0399 31.1337 24.6199 32.1237 27.1399 32.1237C28.7199 32.1237 30.2199 31.7237 31.2999 31.0237V34.6737C30.1699 35.3937 28.2999 35.8537 26.3599 35.8537C21.2599 35.8537 17.8799 32.6037 17.8799 28.0237L17.8899 28.0137ZM28.5699 26.1937C28.4899 24.5337 27.3899 23.5637 25.7499 23.5637C24.1099 23.5637 22.9599 24.5337 22.6099 26.1937H28.5699Z",fill:"white"}),m.jsx("path",{d:"M37.85 33.8638L32 20.4238H37.29L40.46 28.1538L43.6 20.4238H48.48L40.33 39.5738H35.26L37.86 33.8638H37.85Z",fill:"white"}),m.jsx("path",{d:"M48.1797 26.1138C48.1797 20.4238 52.7097 16.2438 58.9397 16.2438C61.2997 16.2438 63.5297 16.8038 64.8197 17.7238V21.9338C63.5597 20.9138 61.6797 20.2938 59.7497 20.2938C55.7797 20.2938 53.2597 22.6238 53.2597 26.1438C53.2597 29.6638 55.5697 31.8838 58.8897 31.8838C59.6397 31.8838 60.4997 31.7538 61.1997 31.5038V27.8838H57.4697V24.2338H65.5197V33.7038C63.6697 35.0938 61.1997 35.8738 58.5997 35.8738C52.5397 35.8738 48.1897 31.7438 48.1897 26.1138H48.1797Z",fill:"white"}),m.jsx("path",{d:"M66.6604 28.0137C66.6604 23.4237 70.0104 20.0237 74.5704 20.0237C78.7804 20.0237 81.7104 23.0837 81.7104 27.5637C81.7104 28.2037 81.6304 28.8237 81.6004 29.3337H71.3804C71.8104 31.1337 73.3904 32.1237 75.9104 32.1237C77.4904 32.1237 78.9904 31.7237 80.0704 31.0237V34.6737C78.9404 35.3937 77.0704 35.8537 75.1304 35.8537C70.0304 35.8537 66.6504 32.6037 66.6504 28.0237L66.6604 28.0137ZM77.3404 26.1937C77.2604 24.5337 76.1604 23.5637 74.5204 23.5637C72.8804 23.5637 71.7304 24.5337 71.3804 26.1937H77.3404Z",fill:"white"}),m.jsx("path",{d:"M82.9688 20.4238H87.8488V22.4138C88.7588 20.9638 90.3488 20.1038 92.3288 20.1038C95.4988 20.1038 97.3988 22.3338 97.3988 25.8138V35.4438H92.5188V26.8638C92.5188 25.0438 91.8188 24.1838 90.4788 24.1838C88.9488 24.1838 87.8488 25.3638 87.8488 27.2638V35.4438H82.9688V20.4238Z",fill:"white"}),m.jsx("path",{d:"M195.219 26.1937L213.529 38.9937C216.009 40.7237 220.239 38.7637 221.009 35.5337L228.419 4.33374C229.189 1.10374 225.879 -0.856262 222.589 0.873738L198.199 13.6737C192.649 16.5837 191.059 23.2837 195.219 26.1937Z",fill:"url(#hf-g0)"}),m.jsx("path",{d:"M256.97 25.9638L232.58 38.7638C229.28 40.4938 225.98 38.5338 226.75 35.3038L234.16 4.10376C234.93 0.873757 239.16 -1.08624 241.64 0.643757L259.95 13.4438C264.12 16.3538 262.52 23.0538 256.97 25.9638Z",fill:"url(#hf-g1)"}),m.jsx("path",{d:"M0 71.9996V42.7256H7.7367V53.1806H17.9826V42.7256H25.7193V71.9996H17.9826V59.8718H7.7367V71.9996H0Z",fill:"white"}),m.jsx("path",{d:"M31.9606 78.4405L36.0171 69.5329L26.9004 48.5811H35.1389L40.0737 60.6252L44.9666 48.5811H52.5779L39.8646 78.4405H31.9606Z",fill:"white"}),m.jsx("path",{d:"M53.3711 78.4404V48.5809H60.9823V52.052C62.446 49.501 65.0807 48.0791 68.3008 48.0791C74.3647 48.0791 78.9649 53.3066 78.9649 60.2487C78.9649 67.2745 74.3229 72.4602 68.259 72.4602C65.0807 72.4602 62.446 71.1637 60.9823 68.78V78.4404H53.3711ZM66.1262 66.1872C69.2627 66.1872 71.3119 63.7616 71.3119 60.2905C71.3119 56.8195 69.2627 54.4357 66.1262 54.4357C62.7388 54.4357 60.9823 57.2795 60.9823 59.7051V60.9178C60.9823 63.3434 62.7388 66.1872 66.1262 66.1872Z",fill:"white"}),m.jsx("path",{d:"M93.4397 72.6269C85.4939 72.6269 80.2246 67.5667 80.2246 60.4155C80.2246 53.2643 85.4521 47.9531 92.5615 47.9531C99.1273 47.9531 103.686 52.7206 103.686 59.7045C103.686 60.7082 103.56 61.6701 103.518 62.4647H87.5849C88.2541 65.2666 90.7214 66.8139 94.6525 66.8139C97.1199 66.8139 99.4618 66.1866 101.135 65.0993V70.7868C99.3782 71.916 96.4508 72.6269 93.4397 72.6269ZM87.5849 57.5717H96.869C96.7435 54.9789 95.0289 53.4734 92.4779 53.4734C89.9687 53.4734 88.1286 54.9789 87.5849 57.5717Z",fill:"white"}),m.jsx("path",{d:"M105.645 72V48.5808H113.214V52.9719C114.218 50.0445 116.183 48.2881 118.692 48.2881C119.361 48.2881 119.989 48.4135 120.407 48.6645V55.8993C119.822 55.5648 119.111 55.4393 118.274 55.4393C115.138 55.4393 113.256 57.6558 113.256 61.2941V72H105.645Z",fill:"white"}),m.jsx("path",{d:"M122.643 71.9996V42.7256H139.371V49.124H130.379V54.477H138.911V60.5827H130.379V71.9996H122.643Z",fill:"white"}),m.jsx("path",{d:"M141.258 72V48.5808H148.827V52.9719C149.831 50.0445 151.796 48.2881 154.306 48.2881C154.975 48.2881 155.602 48.4135 156.02 48.6645V55.8993C155.435 55.5648 154.724 55.4393 153.887 55.4393C150.751 55.4393 148.869 57.6558 148.869 61.2941V72H141.258Z",fill:"white"}),m.jsx("path",{d:"M167.26 72.4602C161.154 72.4602 156.596 67.2745 156.596 60.3324C156.596 53.3066 161.196 48.0791 167.302 48.0791C170.438 48.0791 173.031 49.4173 174.536 51.8429V48.5809H182.148V72.0001H174.536V68.4873C173.031 71.0801 170.438 72.4602 167.26 72.4602ZM169.393 66.1872C172.78 66.1872 174.536 63.3434 174.536 60.876V59.6632C174.536 57.2377 172.78 54.4357 169.393 54.4357C166.298 54.4357 164.207 56.7777 164.207 60.2905C164.207 63.7616 166.298 66.1872 169.393 66.1872Z",fill:"white"}),m.jsx("path",{d:"M184.998 72.0001V48.5809H192.609V51.6756C193.989 49.4173 196.373 48.0791 199.426 48.0791C202.521 48.0791 204.779 49.5428 206.075 52.052C207.497 49.5846 210.132 48.0791 213.352 48.0791C218.245 48.0791 221.214 51.592 221.214 57.0286V72.0001H213.603V58.5341C213.603 55.774 212.557 54.4357 210.634 54.4357C208.459 54.4357 206.912 56.234 206.912 59.0778V72.0001H199.3V58.5341C199.3 55.774 198.255 54.4357 196.373 54.4357C194.157 54.4357 192.609 56.234 192.609 59.0778V72.0001H184.998Z",fill:"white"}),m.jsx("path",{d:"M236.338 72.6269C228.392 72.6269 223.123 67.5667 223.123 60.4155C223.123 53.2643 228.351 47.9531 235.46 47.9531C242.026 47.9531 246.584 52.7206 246.584 59.7045C246.584 60.7082 246.459 61.6701 246.417 62.4647H230.483C231.152 65.2666 233.62 66.8139 237.551 66.8139C240.018 66.8139 242.36 66.1866 244.033 65.0993V70.7868C242.277 71.916 239.349 72.6269 236.338 72.6269ZM230.483 57.5717H239.767C239.642 54.9789 237.927 53.4734 235.376 53.4734C232.867 53.4734 231.027 54.9789 230.483 57.5717Z",fill:"white"}),m.jsx("path",{d:"M252.115 72.502C250.192 72.502 248.268 72.0838 246.93 71.3728V65.6853C247.808 66.3126 248.937 66.689 250.066 66.689C251.739 66.689 252.784 65.8526 252.784 64.5562C252.784 63.8452 252.492 63.0925 251.655 62.0888L249.899 59.956C248.728 58.4923 248.226 56.9031 248.226 55.2721C248.226 51.0065 251.864 48.0791 256.883 48.0791C258.723 48.0791 260.438 48.4555 261.65 49.0828V54.7703C260.898 54.2266 259.768 53.8503 258.723 53.8503C257.092 53.8503 256.046 54.6867 256.046 55.8994C256.046 56.6522 256.423 57.405 257.259 58.4086L258.974 60.4996C260.187 62.047 260.73 63.5943 260.73 65.2671C260.73 69.5746 257.05 72.502 252.115 72.502Z",fill:"white"})]})}function qL({captureFrameHref:t,captureFrameFilename:e,handleCaptureFrameClick:n,refreshCaptureFrameTime:r,inspectorButtonActive:i,inspectorPanelActive:a,onExport:l}){const{projectId:c,editHistory:u,handleUndo:h,handleRedo:p}=hl(),{rightCollapsed:O,setRightCollapsed:x,setRightPanelTab:y}=dO(),{clearDomSelection:b}=zd();return m.jsxs("div",{className:"flex items-center justify-between h-10 px-3 bg-neutral-900 border-b border-neutral-800 flex-shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(IL,{}),m.jsx("span",{className:"text-neutral-700 select-none","aria-hidden":"true",children:"|"}),m.jsx("span",{className:"text-[11px] font-medium text-neutral-300",children:c})]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("button",{type:"button",onClick:()=>{Yt("toolbar_action",{action:"undo"}),h()},disabled:!u.canUndo,className:`h-7 w-7 flex items-center justify-center rounded-md transition-colors ${u.canUndo?"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800":"text-neutral-700 cursor-default"}`,title:u.undoLabel?`Undo ${u.undoLabel} (${L1("undo")})`:`Undo (${L1("undo")})`,"aria-label":"Undo",children:m.jsx(fO,{size:14})}),m.jsx("button",{type:"button",onClick:()=>{Yt("toolbar_action",{action:"redo"}),p()},disabled:!u.canRedo,className:`h-7 w-7 flex items-center justify-center rounded-md transition-colors ${u.canRedo?"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800":"text-neutral-700 cursor-default"}`,title:u.redoLabel?`Redo ${u.redoLabel} (${L1("redo")})`:`Redo (${L1("redo")})`,"aria-label":"Redo",children:m.jsx(XL,{size:14})}),m.jsxs("a",{href:t,download:e,onClick:S=>{Yt("toolbar_action",{action:"capture_frame"}),n(S)},onFocus:r,onPointerDown:r,className:"h-7 flex items-center gap-1.5 px-2.5 rounded-md text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200 hover:bg-neutral-800",title:"Capture current frame","aria-label":"Capture current frame",children:[m.jsx(HL,{size:14}),m.jsx("span",{children:"Capture"})]}),m.jsxs("button",{type:"button",onClick:()=>{if(Pn){if(O||!a){Yt("panel_toggle",{panel:"inspector",collapsed:!1}),y("design"),x(!1);return}Yt("panel_toggle",{panel:"inspector",collapsed:!0}),b(),x(!0)}},disabled:!Pn,className:`h-7 flex items-center gap-1.5 px-2.5 rounded-md text-[11px] font-medium border transition-colors ${i?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":Pn?"text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800 border-transparent":"cursor-not-allowed border-transparent text-neutral-700"}`,title:Pn?"Inspector":j5,"aria-label":Pn?"Inspector":j5,children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("polygon",{points:"10 8 16 12 10 16",fill:"currentColor",stroke:"none"})]}),"Inspector"]}),m.jsx("button",{type:"button",onClick:()=>{y("renders"),x(!1),l==null||l()},className:"h-7 flex items-center gap-1.5 px-3 rounded-md text-[11px] font-semibold bg-studio-accent text-[#09090B] hover:brightness-110 transition-colors",children:"Export"})]})]})}function GL(t,e){let n=1,r=1,i=0,a=0;try{const h=e.contentWindow.gsap;h!=null&&h.getProperty&&(n=Number(h.getProperty(t,"opacity"))||1,r=Number(h.getProperty(t,"scaleX"))||1,i=Number(h.getProperty(t,"x"))||0,a=Number(h.getProperty(t,"y"))||0)}catch{}const l=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-x"))||0,c=Number.parseFloat(t.style.getPropertyValue("--hf-studio-offset-y"))||0;return(t.style.translate??"").includes("var(")&&(i+=l,a+=c),{baseX:i,baseY:a,baseOpacity:n,baseScale:r,cssOffX:l,cssOffY:c}}function UL(t,e,n,r){var i,a;try{const l=e.contentWindow,c=l!=null&&l.__timelines?Object.values(l.__timelines)[0]:null;if((i=l==null?void 0:l.gsap)!=null&&i.set&&(c!=null&&c.seek)&&n){const u=c.duration();return{seek:c.seek.bind(c),set:l.gsap.set.bind(l.gsap),selector:n,element:t,startTime:((a=l.__player)==null?void 0:a.getTime())??0,maxSeekTime:r!=null&&r<u?r:u,savedVisibility:t.style.visibility,savedTranslate:t.style.getPropertyValue("translate")}}}catch{}return null}function WL(t,e,n){const r=Math.min(t.startTime+e,t.maxSeekTime);t.seek(r),t.element.style.setProperty("translate","none"),t.set(t.selector,{...n}),t.element.style.visibility="visible",pr.notify(r),oe.getState().setCurrentTime(r)}function KL(t,e,n){const r={...n};"x"in r&&(r.x-=t.cssVarOffset.x),"y"in r&&(r.y-=t.cssVarOffset.y),t.samples.push({time:e,properties:r}),t.trail.push({x:t.pointer.x,y:t.pointer.y})}function JL(t){const e=t.getBoundingClientRect(),n=t.contentDocument,r=(n==null?void 0:n.querySelector("[data-composition-id]"))??(n==null?void 0:n.documentElement),i=Number(r==null?void 0:r.getAttribute("data-width"))||1920;return i>0?e.width/i:1}function e_(t,e,n,r,i){const a={};let l=i.opacity,c=i.scale,u=i.z;return r.meta?(l=Math.max(0,Math.min(1,1-e*.005)),a.opacity=l,n!==0&&(c=Math.max(.01,i.scale+n*.01),a.scale=c)):r.shift?(a.rotationX=e*.5,a.rotationY=t*.5):r.alt?a.rotation=t*.5:(a.x=t,a.y=e),!r.meta&&n!==0&&(u=i.z+n,a.z=u),{properties:a,nextState:{opacity:l,scale:c,z:u}}}function t_(){return{pointer:{x:0,y:0},startPointer:{x:0,y:0},hasMoved:!1,scrollDelta:0,modifiers:{shift:!1,alt:!1,meta:!1},accumulated:{opacity:1,scale:1,z:0},basePosition:{x:0,y:0},cssVarOffset:{x:0,y:0},scale:1,pointerElementOffset:{x:0,y:0},runtime:null,rafId:0,samples:[],trail:[],cleanup:null}}function n_(){const[t,e]=d.useState(!1),[n,r]=d.useState(0),i=d.useRef(!1),a=d.useRef(t_()),l=d.useRef(a.current.samples),c=d.useRef(a.current.trail);d.useEffect(()=>{const O=a.current;return()=>{var x;(x=O.cleanup)==null||x.call(O),O.cleanup=null,i.current=!1}},[]);const u=d.useCallback((O,x,y)=>{if(i.current)return;i.current=!0;const b=a.current;b.samples=[],b.trail=[],b.hasMoved=!1,b.scrollDelta=0,l.current=b.samples,c.current=b.trail,r(0);const S=GL(O,x);b.cssVarOffset={x:S.cssOffX,y:S.cssOffY},b.accumulated={opacity:S.baseOpacity,scale:S.baseScale,z:0},b.basePosition={x:S.baseX,y:S.baseY},(S.cssOffX||S.cssOffY)&&(O.style.setProperty("--hf-studio-offset-x","0px"),O.style.setProperty("--hf-studio-offset-y","0px"));const k=O.id?`#${O.id}`:null;b.runtime=UL(O,x,k,y),b.scale=JL(x);const A=x.getBoundingClientRect(),C=O.getBoundingClientRect(),T=b.scale||1,j={x:A.left+(C.left+C.width/2)*T,y:A.top+(C.top+C.height/2)*T};b.pointerElementOffset={x:0,y:0};const M=B=>{b.pointer={x:B.clientX,y:B.clientY},b.modifiers={shift:B.shiftKey,alt:B.altKey,meta:B.metaKey||B.ctrlKey}},E=B=>{b.scrollDelta+=B.deltaY,b.modifiers={shift:B.shiftKey,alt:B.altKey,meta:B.metaKey||B.ctrlKey}},$=B=>{b.modifiers={shift:B.shiftKey,alt:B.altKey,meta:B.metaKey||B.ctrlKey}};document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("wheel",E,{passive:!0}),document.addEventListener("keydown",$,{passive:!0}),document.addEventListener("keyup",$,{passive:!0});const N=performance.now();b.startPointer={...b.pointer};const D=B=>{if(!b.hasMoved){b.startPointer={x:B.clientX,y:B.clientY};const X=B.clientX-j.x,U=B.clientY-j.y;b.pointerElementOffset={x:X,y:U},b.basePosition.x+=X/T,b.basePosition.y+=U/T,b.hasMoved=!0}};document.addEventListener("pointermove",D,{passive:!0,once:!0});const z=()=>{if(!i.current)return;const X=(performance.now()-N)/1e3,U=b.scale||1,I=(b.pointer.x-b.startPointer.x)/U,K=(b.pointer.y-b.startPointer.y)/U,Z=b.scrollDelta;if(!b.hasMoved&&I===0&&K===0&&Z===0){b.rafId=requestAnimationFrame(z);return}b.hasMoved=!0;const{properties:F,nextState:_}=e_(I,K,Z,b.modifiers,b.accumulated);if("x"in F&&(F.x=Math.round(b.basePosition.x+F.x)),"y"in F&&(F.y=Math.round(b.basePosition.y+F.y)),b.accumulated=_,b.scrollDelta=0,b.runtime)try{WL(b.runtime,X,F)}catch{b.runtime=null}KL(b,X,F),r(X),b.rafId=requestAnimationFrame(z)};e(!0),b.rafId=requestAnimationFrame(z),b.cleanup=()=>{cancelAnimationFrame(b.rafId),document.removeEventListener("pointermove",M),document.removeEventListener("wheel",E),document.removeEventListener("keydown",$),document.removeEventListener("keyup",$),document.removeEventListener("pointermove",D)}},[]),h=d.useCallback(()=>{var y,b;if(!i.current)return[];i.current=!1;const O=a.current;if(O.runtime){const{element:S,savedVisibility:k,savedTranslate:A}=O.runtime;S.style.visibility=k,S.style.setProperty("translate",A||"")}if(O.cssVarOffset.x||O.cssVarOffset.y){const S=(y=O.runtime)==null?void 0:y.element;S&&(S.style.setProperty("--hf-studio-offset-x",`${O.cssVarOffset.x}px`),S.style.setProperty("--hf-studio-offset-y",`${O.cssVarOffset.y}px`))}O.runtime=null,(b=O.cleanup)==null||b.call(O),O.cleanup=null;const x=O.samples.slice();return r(x.length>0?x[x.length-1].time:0),e(!1),x},[]),p=d.useCallback(()=>{const O=a.current;O.samples=[],O.trail=[],l.current=O.samples,c.current=O.trail,r(0),O.accumulated={opacity:1,scale:1,z:0},O.scrollDelta=0},[]);return{startRecording:u,stopRecording:h,isRecording:t,samplesRef:l,trailRef:c,recordingDuration:n,clearSamples:p}}function r_(t,e,n,r,i,a){if(i===n)return Math.abs(e-r);const l=r+(a-r)*(t-n)/(i-n);return Math.abs(e-l)}function Pg(t,e){if(t.length<=2)return t;const n=t[0],r=t[t.length-1];let i=0,a=0;for(let l=1;l<t.length-1;l++){const c=r_(t[l].time,t[l].value,n.time,n.value,r.time,r.value);c>i&&(i=c,a=l)}if(i>e){const l=Pg(t.slice(0,a+1),e),c=Pg(t.slice(a),e);return l.slice(0,-1).concat(c)}return[n,r]}function i_(t,e,n){if(t.length===0)return new Map;if(e<=0)return new Map;const r=new Set;for(const c of t)for(const u of Object.keys(c.properties))r.add(u);const i=new Set;for(const c of r){const u=[];for(const p of t)c in p.properties&&u.push({time:p.time,value:p.properties[c]});const h=Pg(u,n);for(const p of h)i.add(p.time)}const a=Array.from(i).sort((c,u)=>c-u),l=new Map;for(const c of a){const u=Math.round(c/e*1e3)/10,h={};for(const p of r)h[p]=a_(t,p,c);l.set(u,h)}return l}function a_(t,e,n){let r,i;for(const l of t){if(!(e in l.properties))continue;const c=l.properties[e];l.time<=n&&(r={time:l.time,value:c}),l.time>=n&&i===void 0&&(i={time:l.time,value:c})}if(r&&r.time===n)return r.value;if(i&&i.time===n||!r)return i.value;if(!i)return r.value;const a=(n-r.time)/(i.time-r.time);return r.value+(i.value-r.value)*a}function s_({domEditSessionRef:t,previewIframeRef:e,showToast:n,isGestureRecordingRef:r}){const i=n_(),[a,l]=d.useState("idle"),c=d.useRef("idle"),u=d.useRef(void 0),h=d.useRef(0),p=d.useRef(!1);d.useEffect(()=>()=>clearInterval(u.current),[]);const O=d.useCallback(async()=>{if(clearInterval(u.current),p.current)return;p.current=!0,c.current="idle",r.current=!1;const y=i.stopRecording(),b=oe.getState();b.setIsPlaying(!1);try{const S=t.current,k=S.domEditSelection;if(!k){y.length>2&&n("Selection lost during recording","error");return}const A=y.length>0?y[y.length-1].time:0;if(y.length<=2){n("No gesture detected — move the pointer while recording","error");return}if(A<=0){n("Recording too short — try again","error");return}const C=i_(y,A,5),T=Array.from(C.keys()).sort((M,E)=>M-E);!C.has(0)&&y.length>0&&(C.set(0,y[0].properties),T.includes(0)||T.unshift(0));const j=k.id?`#${k.id}`:k.selector;if(!j){n("Cannot save — element has no selector","error");return}if(S.commitMutation){const M=h.current,E=T.map($=>({percentage:$,properties:C.get($)}));await S.commitMutation({type:"add-with-keyframes",targetSelector:j,position:Math.round(M*1e3)/1e3,duration:Math.round(A*1e3)/1e3,keyframes:E},{label:"Gesture recording",softReload:!0})}n(`Recorded ${T.length} keyframes`,"info")}finally{b.requestSeek(h.current),i.clearSamples(),l("idle"),p.current=!1}},[i,n,r,t]),x=d.useCallback(()=>{var j,M;if(c.current==="recording"){O();return}const y=t.current.domEditSelection;if(!y){n("Select an element first","error");return}const b=e.current;if(!b){n("Preview not ready — try again","error");return}const S=oe.getState();h.current=S.currentTime;const k=Number.parseFloat(((j=y.dataAttributes)==null?void 0:j.start)??"0")||0,A=Number.parseFloat(((M=y.dataAttributes)==null?void 0:M.duration)??"0")||0,C=A>0?k+A:void 0;i.startRecording(y.element,b,C),c.current="recording",r.current=!0,l("recording"),clearInterval(u.current);const T=C??1/0;u.current=setInterval(()=>{const{currentTime:E,duration:$}=oe.getState(),N=Math.min(T,$);N>0&&E>=N-.05&&O()},100)},[i,n,O,e,t,r]);return{gestureState:a,gestureRecording:i,handleToggleRecording:x}}const l_=d.memo(function({samples:e,sampleCount:n,trail:r,simplifiedPoints:i,canvasRect:a,compositionSize:l,mode:c,accentColor:u="#3CE6AC"}){const h=d.useMemo(()=>r&&r.length>1?r.map(x=>`${x.x-a.left},${x.y-a.top}`).join(" "):e.length===0?"":e.filter(x=>x.properties.x!=null&&x.properties.y!=null).map(x=>`${x.properties.x},${x.properties.y}`).join(" "),[e,r,n,a.left,a.top]),p=d.useMemo(()=>{if(!i||i.size===0)return"";const x=[];for(const[y,b]of i)b.x!=null&&b.y!=null&&x.push({x:b.x,y:b.y,pct:y});return x.sort((y,b)=>y.pct-b.pct),x.length===0?"":x.map(y=>`${y.x},${y.y}`).join(" ")},[i]),O=d.useMemo(()=>{if(!i||i.size===0)return[];const x=[];for(const[y,b]of i)b.x!=null&&b.y!=null&&x.push({x:b.x,y:b.y,pct:y});return x.sort((y,b)=>y.pct-b.pct)},[i]);return e.length<2&&!i?null:m.jsxs("svg",{className:"pointer-events-none fixed z-50",style:{left:a.left,top:a.top,width:a.width,height:a.height},viewBox:r&&r.length>1?`0 0 ${a.width} ${a.height}`:`0 0 ${(l==null?void 0:l.width)??a.width} ${(l==null?void 0:l.height)??a.height}`,children:[c==="recording"&&h&&m.jsx("polyline",{points:h,fill:"none",stroke:u,strokeWidth:"2",strokeOpacity:"0.6",strokeLinecap:"round",strokeLinejoin:"round"}),c==="preview"&&m.jsxs(m.Fragment,{children:[h&&m.jsx("polyline",{points:h,fill:"none",stroke:u,strokeWidth:"1",strokeOpacity:"0.2",strokeDasharray:"4 3",strokeLinecap:"round"}),p&&m.jsx("polyline",{points:p,fill:"none",stroke:u,strokeWidth:"2",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),O.map(x=>m.jsx("g",{transform:`translate(${x.x}, ${x.y})`,children:m.jsx("rect",{x:"-4",y:"-4",width:"8",height:"8",rx:"1",transform:"rotate(45)",fill:u,fillOpacity:"0.9"})},x.pct))]})]})});let Qg=[],E9=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?E9:Qg).push(n=n+t[e])})();function o_(t){if(t<768)return!1;for(let e=0,n=Qg.length;;){let r=e+n>>1;if(t<Qg[r])n=r;else if(t>=E9[r])e=r+1;else return!0;if(e==n)return!1}}function Rb(t){return t>=127462&&t<=127487}const Vb=8205;function c_(t,e,n=!0,r=!0){return(n?$9:u_)(t,e,r)}function $9(t,e,n){if(e==t.length)return e;e&&j9(t.charCodeAt(e))&&P9(t.charCodeAt(e-1))&&e--;let r=Ip(t,e);for(e+=Lb(r);e<t.length;){let i=Ip(t,e);if(r==Vb||i==Vb||n&&o_(i))e+=Lb(i),r=i;else if(Rb(i)){let a=0,l=e-2;for(;l>=0&&Rb(Ip(t,l));)a++,l-=2;if(a%2==0)break;e+=2}else break}return e}function u_(t,e,n){for(;e>0;){let r=$9(t,e-2,n);if(r<e)return r;e--}return 0}function Ip(t,e){let n=t.charCodeAt(e);if(!P9(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return j9(r)?(n-55296<<10)+(r-56320)+65536:n}function j9(t){return t>=56320&&t<57344}function P9(t){return t>=55296&&t<56320}function Lb(t){return t<65536?1:2}class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=jo(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ni.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=jo(this,e,n);let r=[];return this.decompose(e,n,r,0),Ni.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new uu(this),a=new uu(e);for(let l=n,c=n;;){if(i.next(l),a.next(l),l=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(c+=i.value.length,i.done||c>=r)return!0}}iter(e=1){return new uu(this,e)}iterRange(e,n=this.length){return new Q9(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Z9(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new fn(e):Ni.from(fn.split(e,[]))}}class fn extends St{constructor(e,n=f_(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let l=this.text[a],c=i+l.length;if((n?r:c)>=e)return new d_(i,c,r,l);i=c+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new fn(_b(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let l=r.pop(),c=jf(a.text,l.text.slice(),0,a.length);if(c.length<=32)r.push(new fn(c,l.length+a.length));else{let u=c.length>>1;r.push(new fn(c.slice(0,u)),new fn(c.slice(u)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof fn))return super.replace(e,n,r);[e,n]=jo(this,e,n);let i=jf(this.text,jf(r.text,_b(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new fn(i,a):Ni.from(fn.split(i,[]),a)}sliceString(e,n=this.length,r=`
|
|
100
|
+
`){[e,n]=jo(this,e,n);let i="";for(let a=0,l=0;a<=n&&l<this.text.length;l++){let c=this.text[l],u=a+c.length;a>e&&l&&(i+=r),e<u&&n>a&&(i+=c.slice(Math.max(0,e-a),n-a)),a=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let a of e)r.push(a),i+=a.length+1,r.length==32&&(n.push(new fn(r,i)),r=[],i=-1);return i>-1&&n.push(new fn(r,i)),n}}class Ni extends St{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let a=0;;a++){let l=this.children[a],c=i+l.length,u=r+l.lines-1;if((n?u:c)>=e)return l.lineInner(e,n,r,i);i=c+1,r=u+1}}decompose(e,n,r,i){for(let a=0,l=0;l<=n&&a<this.children.length;a++){let c=this.children[a],u=l+c.length;if(e<=u&&n>=l){let h=i&((l<=e?1:0)|(u>=n?2:0));l>=e&&u<=n&&!h?r.push(c):c.decompose(e-l,n-l,r,h)}l=u+1}}replace(e,n,r){if([e,n]=jo(this,e,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let l=this.children[i],c=a+l.length;if(e>=a&&n<=c){let u=l.replace(e-a,n-a,r),h=this.lines-l.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let p=this.children.slice();return p[i]=u,new Ni(p,this.length-(n-e)+r.length)}return super.replace(a,c,u)}a=c+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
101
|
+
`){[e,n]=jo(this,e,n);let i="";for(let a=0,l=0;a<this.children.length&&l<=n;a++){let c=this.children[a],u=l+c.length;l>e&&a&&(i+=r),e<u&&n>l&&(i+=c.sliceString(e-l,n-l,r)),l=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ni))return 0;let r=0,[i,a,l,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==l||a==c)return r;let u=this.children[i],h=e.children[a];if(u!=h)return r+u.scanIdentical(h,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let y of e)r+=y.lines;if(r<32){let y=[];for(let b of e)b.flatten(y);return new fn(y,n)}let i=Math.max(32,r>>5),a=i<<1,l=i>>1,c=[],u=0,h=-1,p=[];function O(y){let b;if(y.lines>a&&y instanceof Ni)for(let S of y.children)O(S);else y.lines>l&&(u>l||!u)?(x(),c.push(y)):y instanceof fn&&u&&(b=p[p.length-1])instanceof fn&&y.lines+b.lines<=32?(u+=y.lines,h+=y.length+1,p[p.length-1]=new fn(b.text.concat(y.text),b.length+1+y.length)):(u+y.lines>i&&x(),u+=y.lines,h+=y.length+1,p.push(y))}function x(){u!=0&&(c.push(p.length==1?p[0]:Ni.from(p,h)),h=-1,u=p.length=0)}for(let y of e)O(y);return x(),c.length==1?c[0]:new Ni(c,n)}}St.empty=new fn([""],0);function f_(t){let e=-1;for(let n of t)e+=n.length+1;return e}function jf(t,e,n=0,r=1e9){for(let i=0,a=0,l=!0;a<t.length&&i<=r;a++){let c=t[a],u=i+c.length;u>=n&&(u>r&&(c=c.slice(0,r-i)),i<n&&(c=c.slice(n-i)),l?(e[e.length-1]+=c,l=!1):e.push(c)),i=u+1}return e}function _b(t,e,n){return jf(t,[""],e,n)}class uu{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof fn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],a=this.offsets[r],l=a>>1,c=i instanceof fn?i.text.length:i.children.length;if(l==(n>0?c:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
102
|
+
`,this;e--}else if(i instanceof fn){let u=i.text[l+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[l+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof fn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Q9{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new uu(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Z9{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(St.prototype[Symbol.iterator]=function(){return this.iter()},uu.prototype[Symbol.iterator]=Q9.prototype[Symbol.iterator]=Z9.prototype[Symbol.iterator]=function(){return this});class d_{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function jo(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Qn(t,e,n=!0,r=!0){return c_(t,e,n,r)}function h_(t){return t>=56320&&t<57344}function m_(t){return t>=55296&&t<56320}function ml(t,e){let n=t.charCodeAt(e);if(!m_(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return h_(r)?(n-55296<<10)+(r-56320)+65536:n}function N9(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function a0(t){return t<65536?1:2}const Zg=/\r\n?|\n/;var Gn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Gn||(Gn={}));class Xi{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let a=this.sections[n++],l=this.sections[n++];l<0?(e(r,i,a),i+=a):i+=l,r+=a}}iterChangedRanges(e,n=!1){Ng(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Xi(e)}composeDesc(e){return this.empty?e:e.empty?this:R9(this,e)}mapDesc(e,n=!1){return e.empty?this:Rg(this,e,n)}mapPos(e,n=-1,r=Gn.Simple){let i=0,a=0;for(let l=0;l<this.sections.length;){let c=this.sections[l++],u=this.sections[l++],h=i+c;if(u<0){if(h>e)return a+(e-i);a+=c}else{if(r!=Gn.Simple&&h>=e&&(r==Gn.TrackDel&&i<e&&h>e||r==Gn.TrackBefore&&i<e||r==Gn.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!c)return e==i||n<0?a:a+u;a+=u}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let a=this.sections[r++],l=this.sections[r++],c=i+a;if(l>=0&&i<=n&&c>=e)return i<e&&c>n?"cover":!0;i=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Xi(e)}static create(e){return new Xi(e)}}class Mn extends Xi{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Ng(this,(n,r,i,a,l)=>e=e.replace(i,i+(r-n),l),!1),e}mapDesc(e,n=!1){return Rg(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,a=0;i<n.length;i+=2){let l=n[i],c=n[i+1];if(c>=0){n[i]=c,n[i+1]=l;let u=i>>1;for(;r.length<u;)r.push(St.empty);r.push(l?e.slice(a,a+l):St.empty)}a+=l}return new Mn(n,r)}compose(e){return this.empty?e:e.empty?this:R9(this,e,!0)}map(e,n=!1){return e.empty?this:Rg(this,e,n,!0)}iterChanges(e,n=!1){Ng(this,e,n)}get desc(){return Xi.create(this.sections)}filter(e){let n=[],r=[],i=[],a=new ju(this);e:for(let l=0,c=0;;){let u=l==e.length?1e9:e[l++];for(;c<u||c==u&&a.len==0;){if(a.done)break e;let p=Math.min(a.len,u-c);qn(i,p,-1);let O=a.ins==-1?-1:a.off==0?a.ins:0;qn(n,p,O),O>0&&ds(r,n,a.text),a.forward(p),c+=p}let h=e[l++];for(;c<h;){if(a.done)break e;let p=Math.min(a.len,h-c);qn(n,p,-1),qn(i,p,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(p),c+=p}}return{changes:new Mn(n,r),filtered:Xi.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],a=[],l=0,c=null;function u(p=!1){if(!p&&!i.length)return;l<n&&qn(i,n-l,-1);let O=new Mn(i,a);c=c?c.compose(O.map(c)):O,i=[],a=[],l=0}function h(p){if(Array.isArray(p))for(let O of p)h(O);else if(p instanceof Mn){if(p.length!=n)throw new RangeError(`Mismatched change set length (got ${p.length}, expected ${n})`);u(),c=c?c.compose(p.map(c)):p}else{let{from:O,to:x=O,insert:y}=p;if(O>x||O<0||x>n)throw new RangeError(`Invalid change range ${O} to ${x} (in doc of length ${n})`);let b=y?typeof y=="string"?St.of(y.split(r||Zg)):y:St.empty,S=b.length;if(O==x&&S==0)return;O<l&&u(),O>l&&qn(i,O-l,-1),qn(i,x-O,S),ds(a,i,b),l=x}}return h(e),u(!c),c}static empty(e){return new Mn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((l,c)=>c&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<i;)r.push(St.empty);r[i]=St.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new Mn(n,r)}static createSet(e,n){return new Mn(e,n)}}function qn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function ds(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(St.empty);t.push(n)}}function Ng(t,e,n){let r=t.inserted;for(let i=0,a=0,l=0;l<t.sections.length;){let c=t.sections[l++],u=t.sections[l++];if(u<0)i+=c,a+=c;else{let h=i,p=a,O=St.empty;for(;h+=c,p+=u,u&&r&&(O=O.append(r[l-2>>1])),!(n||l==t.sections.length||t.sections[l+1]<0);)c=t.sections[l++],u=t.sections[l++];e(i,h,a,p,O),i=h,a=p}}}function Rg(t,e,n,r=!1){let i=[],a=r?[]:null,l=new ju(t),c=new ju(e);for(let u=-1;;){if(l.done&&c.len||c.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&c.ins==-1){let h=Math.min(l.len,c.len);qn(i,h,-1),l.forward(h),c.forward(h)}else if(c.ins>=0&&(l.ins<0||u==l.i||l.off==0&&(c.len<l.len||c.len==l.len&&!n))){let h=c.len;for(qn(i,c.ins,-1);h;){let p=Math.min(l.len,h);l.ins>=0&&u<l.i&&l.len<=p&&(qn(i,0,l.ins),a&&ds(a,i,l.text),u=l.i),l.forward(p),h-=p}c.next()}else if(l.ins>=0){let h=0,p=l.len;for(;p;)if(c.ins==-1){let O=Math.min(p,c.len);h+=O,p-=O,c.forward(O)}else if(c.ins==0&&c.len<p)p-=c.len,c.next();else break;qn(i,h,u<l.i?l.ins:0),a&&u<l.i&&ds(a,i,l.text),u=l.i,l.forward(l.len-p)}else{if(l.done&&c.done)return a?Mn.createSet(i,a):Xi.create(i);throw new Error("Mismatched change set lengths")}}}function R9(t,e,n=!1){let r=[],i=n?[]:null,a=new ju(t),l=new ju(e);for(let c=!1;;){if(a.done&&l.done)return i?Mn.createSet(r,i):Xi.create(r);if(a.ins==0)qn(r,a.len,0,c),a.next();else if(l.len==0&&!l.done)qn(r,0,l.ins,c),i&&ds(i,r,l.text),l.next();else{if(a.done||l.done)throw new Error("Mismatched change set lengths");{let u=Math.min(a.len2,l.len),h=r.length;if(a.ins==-1){let p=l.ins==-1?-1:l.off?0:l.ins;qn(r,u,p,c),i&&p&&ds(i,r,l.text)}else l.ins==-1?(qn(r,a.off?0:a.len,u,c),i&&ds(i,r,a.textBit(u))):(qn(r,a.off?0:a.len,l.off?0:l.ins,c),i&&!l.off&&ds(i,r,l.text));c=(a.ins>u||l.ins>=0&&l.len>u)&&(c||r.length>h),a.forward2(u),l.forward(u)}}}}class ju{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?St.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?St.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ks{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Ks(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return ge.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ge.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ge.range(e.anchor,e.head)}static create(e,n,r){return new Ks(e,n,r)}}class ge{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ge.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ge([this.main],0)}addRange(e,n=!0){return ge.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,ge.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ge(e.ranges.map(n=>Ks.fromJSON(n)),e.main)}static single(e,n=e){return new ge([ge.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let a=e[i];if(a.empty?a.from<=r:a.from<r)return ge.normalized(e.slice(),n);r=a.to}return new ge(e,n)}static cursor(e,n=0,r,i){return Ks.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,a){let l=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!a&&e!=n&&(a=n<e?1:-1),n<e?Ks.create(n,e,48|l):Ks.create(e,n,(a?a<0?8:16:0)|l)}static normalized(e,n=0){let r=e[n];e.sort((i,a)=>i.from-a.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let a=e[i],l=e[i-1];if(a.empty?a.from<=l.to:a.from<l.to){let c=l.from,u=Math.max(a.to,l.to);i<=n&&n--,e.splice(--i,2,a.anchor>a.head?ge.range(u,c):ge.range(c,u))}}return new ge(e,n)}}function V9(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let hO=0;class je{constructor(e,n,r,i,a){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=hO++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new je(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:mO),!!e.static,e.enables)}of(e){return new Pf([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Pf(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Pf(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function mO(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Pf{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=hO++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,a=this.id,l=e[a]>>1,c=this.type==2,u=!1,h=!1,p=[];for(let O of this.dependencies)O=="doc"?u=!0:O=="selection"?h=!0:(((n=e[O.id])!==null&&n!==void 0?n:1)&1)==0&&p.push(e[O.id]);return{create(O){return O.values[l]=r(O),1},update(O,x){if(u&&x.docChanged||h&&(x.docChanged||x.selection)||Vg(O,p)){let y=r(O);if(c?!Db(y,O.values[l],i):!i(y,O.values[l]))return O.values[l]=y,1}return 0},reconfigure:(O,x)=>{let y,b=x.config.address[a];if(b!=null){let S=Kf(x,b);if(this.dependencies.every(k=>k instanceof je?x.facet(k)===O.facet(k):k instanceof Lr?x.field(k,!1)==O.field(k,!1):!0)||(c?Db(y=r(O),S,i):i(y=r(O),S)))return O.values[l]=S,0}else y=r(O);return O.values[l]=y,1}}}}function Db(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Vg(t,e){let n=!1;for(let r of e)fu(t,r)&1&&(n=!0);return n}function p_(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),a=r.filter(u=>!(u&1)),l=t[e.id]>>1;function c(u){let h=[];for(let p=0;p<r.length;p++){let O=Kf(u,r[p]);if(i[p]==2)for(let x of O)h.push(x);else h.push(O)}return e.combine(h)}return{create(u){for(let h of r)fu(u,h);return u.values[l]=c(u),1},update(u,h){if(!Vg(u,a))return 0;let p=c(u);return e.compare(p,u.values[l])?0:(u.values[l]=p,1)},reconfigure(u,h){let p=Vg(u,r),O=h.config.facets[e.id],x=h.facet(e);if(O&&!p&&mO(n,O))return u.values[l]=x,0;let y=c(u);return e.compare(y,x)?(u.values[l]=x,0):(u.values[l]=y,1)}}}const B1=je.define({static:!0});class Lr{constructor(e,n,r,i,a){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=a,this.provides=void 0}static define(e){let n=new Lr(hO++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(B1).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let a=r.values[n],l=this.updateF(a,i);return this.compareF(a,l)?0:(r.values[n]=l,1)},reconfigure:(r,i)=>{let a=r.facet(B1),l=i.facet(B1),c;return(c=a.find(u=>u.field==this))&&c!=l.find(u=>u.field==this)?(r.values[n]=c.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,B1.of({field:this,create:e})]}get extension(){return this}}const Gs={lowest:4,low:3,default:2,high:1,highest:0};function zc(t){return e=>new L9(e,t)}const s0={highest:zc(Gs.highest),high:zc(Gs.high),default:zc(Gs.default),low:zc(Gs.low),lowest:zc(Gs.lowest)};class L9{constructor(e,n){this.inner=e,this.prec=n}}class Fd{of(e){return new Lg(this,e)}reconfigure(e){return Fd.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Lg{constructor(e,n){this.compartment=e,this.inner=n}}class Wf{constructor(e,n,r,i,a,l){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],a=Object.create(null),l=new Map;for(let x of g_(e,n,l))x instanceof Lr?i.push(x):(a[x.facet.id]||(a[x.facet.id]=[])).push(x);let c=Object.create(null),u=[],h=[];for(let x of i)c[x.id]=h.length<<1,h.push(y=>x.slot(y));let p=r==null?void 0:r.config.facets;for(let x in a){let y=a[x],b=y[0].facet,S=p&&p[x]||[];if(y.every(k=>k.type==0))if(c[b.id]=u.length<<1|1,mO(S,y))u.push(r.facet(b));else{let k=b.combine(y.map(A=>A.value));u.push(r&&b.compare(k,r.facet(b))?r.facet(b):k)}else{for(let k of y)k.type==0?(c[k.id]=u.length<<1|1,u.push(k.value)):(c[k.id]=h.length<<1,h.push(A=>k.dynamicSlot(A)));c[b.id]=h.length<<1,h.push(k=>p_(k,b,y))}}let O=h.map(x=>x(c));return new Wf(e,l,O,c,u,a)}}function g_(t,e,n){let r=[[],[],[],[],[]],i=new Map;function a(l,c){let u=i.get(l);if(u!=null){if(u<=c)return;let h=r[u].indexOf(l);h>-1&&r[u].splice(h,1),l instanceof Lg&&n.delete(l.compartment)}if(i.set(l,c),Array.isArray(l))for(let h of l)a(h,c);else if(l instanceof Lg){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;n.set(l.compartment,h),a(h,c)}else if(l instanceof L9)a(l.inner,l.prec);else if(l instanceof Lr)r[c].push(l),l.provides&&a(l.provides,c);else if(l instanceof Pf)r[c].push(l),l.facet.extensions&&a(l.facet.extensions,Gs.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(h,c)}}return a(t,Gs.default),r.reduce((l,c)=>l.concat(c))}function fu(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Kf(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const _9=je.define(),_g=je.define({combine:t=>t.some(e=>e),static:!0}),D9=je.define({combine:t=>t.length?t[0]:void 0,static:!0}),H9=je.define(),X9=je.define(),z9=je.define(),F9=je.define({combine:t=>t.length?t[0]:!1});class Qa{constructor(e,n){this.type=e,this.value=n}static define(){return new O_}}class O_{of(e){return new Qa(this,e)}}class x_{constructor(e){this.map=e}of(e){return new At(this,e)}}class At{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new At(this.type,n)}is(e){return this.type==e}static define(e={}){return new x_(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let a=i.map(n);a&&r.push(a)}return r}}At.reconfigure=At.define();At.appendConfig=At.define();class vn{constructor(e,n,r,i,a,l){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=l,this._doc=null,this._state=null,r&&V9(r,n.newLength),a.some(c=>c.type==vn.time)||(this.annotations=a.concat(vn.time.of(Date.now())))}static create(e,n,r,i,a,l){return new vn(e,n,r,i,a,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(vn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}vn.time=Qa.define();vn.userEvent=Qa.define();vn.addToHistory=Qa.define();vn.remote=Qa.define();function y_(t,e){let n=[];for(let r=0,i=0;;){let a,l;if(r<t.length&&(i==e.length||e[i]>=t[r]))a=t[r++],l=t[r++];else if(i<e.length)a=e[i++],l=e[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function B9(t,e,n){var r;let i,a,l;return n?(i=e.changes,a=Mn.empty(e.changes.length),l=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),a=t.changes.mapDesc(e.changes,!0),l=t.changes.compose(i)),{changes:l,selection:e.selection?e.selection.map(a):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:At.mapEffects(t.effects,i).concat(At.mapEffects(e.effects,a)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Dg(t,e,n){let r=e.selection,i=po(e.annotations);return e.userEvent&&(i=i.concat(vn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Mn?e.changes:Mn.of(e.changes||[],n,t.facet(D9)),selection:r&&(r instanceof ge?r:ge.single(r.anchor,r.head)),effects:po(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function Y9(t,e,n){let r=Dg(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(n=!1);let l=!!e[a].sequential;r=B9(r,Dg(t,e[a],l?r.changes.newLength:t.doc.length),l)}let i=vn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return v_(n?b_(i):i)}function b_(t){let e=t.startState,n=!0;for(let i of e.facet(H9)){let a=i(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:y_(n,a))}if(n!==!0){let i,a;if(n===!1)a=t.changes.invertedDesc,i=Mn.empty(e.doc.length);else{let l=t.changes.filter(n);i=l.changes,a=l.filtered.mapDesc(l.changes).invertedDesc}t=vn.create(e,i,t.selection&&t.selection.map(a),At.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(X9);for(let i=r.length-1;i>=0;i--){let a=r[i](t);a instanceof vn?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof vn?t=a[0]:t=Y9(e,po(a),!1)}return t}function v_(t){let e=t.startState,n=e.facet(z9),r=t;for(let i=n.length-1;i>=0;i--){let a=n[i](t);a&&Object.keys(a).length&&(r=B9(r,Dg(e,a,t.changes.newLength),!0))}return r==t?t:vn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const S_=[];function po(t){return t==null?S_:Array.isArray(t)?t:[t]}var en=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(en||(en={}));const w_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Hg;try{Hg=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function k_(t){if(Hg)return Hg.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||w_.test(n)))return!0}return!1}function A_(t){return e=>{if(!/\S/.test(e))return en.Space;if(k_(e))return en.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return en.Word;return en.Other}}class wt{constructor(e,n,r,i,a,l){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,l&&(l._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)fu(this,c<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return fu(this,r),Kf(this,r)}update(...e){return Y9(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let c of e.effects)c.is(Fd.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,h)=>i.set(h,u)),n=null),i.set(c.value.compartment,c.value.extension)):c.is(At.reconfigure)?(n=null,r=c.value):c.is(At.appendConfig)&&(n=null,r=po(r).concat(c.value));let a;n?a=e.startState.values.slice():(n=Wf.resolve(r,i,this),a=new wt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,h)=>h.reconfigure(u,this),null).values);let l=e.startState.facet(_g)?e.newSelection:e.newSelection.asSingle();new wt(n,e.newDoc,l,a,(c,u)=>u.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ge.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),a=[r.range],l=po(r.effects);for(let c=1;c<n.ranges.length;c++){let u=e(n.ranges[c]),h=this.changes(u.changes),p=h.map(i);for(let x=0;x<c;x++)a[x]=a[x].map(p);let O=i.mapDesc(h,!0);a.push(u.range.map(O)),i=i.compose(p),l=At.mapEffects(l,p).concat(At.mapEffects(po(u.effects),O))}return{changes:i,selection:ge.create(a,n.mainIndex),effects:l}}changes(e=[]){return e instanceof Mn?e:Mn.of(e,this.doc.length,this.facet(wt.lineSeparator))}toText(e){return St.of(e.split(this.facet(wt.lineSeparator)||Zg))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(fu(this,n),Kf(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Lr&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(e,a)){let l=r[a],c=e[a];i.push(l.init(u=>l.spec.fromJSON(c,u)))}}return wt.create({doc:e.doc,selection:ge.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Wf.resolve(e.extensions||[],new Map),r=e.doc instanceof St?e.doc:St.of((e.doc||"").split(n.staticFacet(wt.lineSeparator)||Zg)),i=e.selection?e.selection instanceof ge?e.selection:ge.single(e.selection.anchor,e.selection.head):ge.single(0);return V9(i,r.length),n.staticFacet(_g)||(i=i.asSingle()),new wt(n,r,i,n.dynamicSlots.map(()=>null),(a,l)=>l.create(a),null)}get tabSize(){return this.facet(wt.tabSize)}get lineBreak(){return this.facet(wt.lineSeparator)||`
|
|
103
|
+
`}get readOnly(){return this.facet(F9)}phrase(e,...n){for(let r of this.facet(wt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let a=+(i||1);return!a||a>n.length?r:n[a-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let a of this.facet(_9))for(let l of a(this,n,r))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return A_(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),a=this.charCategorizer(e),l=e-r,c=e-r;for(;l>0;){let u=Qn(n,l,!1);if(a(n.slice(u,l))!=en.Word)break;l=u}for(;c<i;){let u=Qn(n,c);if(a(n.slice(c,u))!=en.Word)break;c=u}return l==c?null:ge.range(l+r,c+r)}}wt.allowMultipleSelections=_g;wt.tabSize=je.define({combine:t=>t.length?t[0]:4});wt.lineSeparator=D9;wt.readOnly=F9;wt.phrases=je.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});wt.languageData=_9;wt.changeFilter=H9;wt.transactionFilter=X9;wt.transactionExtender=z9;Fd.reconfigure=At.define();function Bo(t,e,n={}){let r={};for(let i of t)for(let a of Object.keys(i)){let l=i[a],c=r[a];if(c===void 0)r[a]=l;else if(!(c===l||l===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](c,l);else throw new Error("Config merge conflict for field "+a)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class bs{eq(e){return this==e}range(e,n=e){return Xg.create(e,n,this)}}bs.prototype.startSide=bs.prototype.endSide=0;bs.prototype.point=!1;bs.prototype.mapMode=Gn.TrackDel;function pO(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Xg=class I9{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new I9(e,n,r)}};function zg(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class gO{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let a=r?this.to:this.from;for(let l=i,c=a.length;;){if(l==c)return l;let u=l+c>>1,h=a[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==l)return h>=0?l:c;h>=0?c=u:l=u+1}}between(e,n,r,i){for(let a=this.findIndex(n,-1e9,!0),l=this.findIndex(r,1e9,!1,a);a<l;a++)if(i(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,n){let r=[],i=[],a=[],l=-1,c=-1;for(let u=0;u<this.value.length;u++){let h=this.value[u],p=this.from[u]+e,O=this.to[u]+e,x,y;if(p==O){let b=n.mapPos(p,h.startSide,h.mapMode);if(b==null||(x=y=b,h.startSide!=h.endSide&&(y=n.mapPos(p,h.endSide),y<x)))continue}else if(x=n.mapPos(p,h.startSide),y=n.mapPos(O,h.endSide),x>y||x==y&&h.startSide>0&&h.endSide<=0)continue;(y-x||h.endSide-h.startSide)<0||(l<0&&(l=x),h.point&&(c=Math.max(c,y-x)),r.push(h),i.push(x-l),a.push(y-l))}return{mapped:r.length?new gO(i,a,r,c):null,pos:l}}}class mt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new mt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=e,l=e.filter;if(n.length==0&&!l)return this;if(r&&(n=n.slice().sort(zg)),this.isEmpty)return n.length?mt.of(n):this;let c=new q9(this,null,-1).goto(0),u=0,h=[],p=new ol;for(;c.value||u<n.length;)if(u<n.length&&(c.from-n[u].from||c.startSide-n[u].value.startSide)>=0){let O=n[u++];p.addInner(O.from,O.to,O.value)||h.push(O)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(c.chunkIndex)<n[u].from)&&(!l||i>this.chunkEnd(c.chunkIndex)||a<this.chunkPos[c.chunkIndex])&&p.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!l||i>c.to||a<c.from||l(c.from,c.to,c.value))&&(p.addInner(c.from,c.to,c.value)||h.push(Xg.create(c.from,c.to,c.value))),c.next());return p.finishInner(this.nextLayer.isEmpty&&!h.length?mt.empty:this.nextLayer.update({add:h,filter:l,filterFrom:i,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let l=0;l<this.chunk.length;l++){let c=this.chunkPos[l],u=this.chunk[l],h=e.touchesRange(c,c+u.length);if(h===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(c));else if(h===!0){let{mapped:p,pos:O}=u.map(c,e);p&&(i=Math.max(i,p.maxPoint),n.push(p),r.push(O))}}let a=this.nextLayer.map(e);return n.length==0?a:new mt(r,n,a||mt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let a=this.chunkPos[i],l=this.chunk[i];if(n>=a&&e<=a+l.length&&l.between(a,e-a,n-a,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Pu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Pu.from(e).goto(n)}static compare(e,n,r,i,a=-1){let l=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=a),c=n.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=a),u=Hb(l,c,r),h=new Fc(l,u,a),p=new Fc(c,u,a);r.iterGaps((O,x,y)=>Xb(h,O,p,x,y,i)),r.empty&&r.length==0&&Xb(h,0,p,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let a=e.filter(p=>!p.isEmpty&&n.indexOf(p)<0),l=n.filter(p=>!p.isEmpty&&e.indexOf(p)<0);if(a.length!=l.length)return!1;if(!a.length)return!0;let c=Hb(a,l),u=new Fc(a,c,0).goto(r),h=new Fc(l,c,0).goto(r);for(;;){if(u.to!=h.to||!Fg(u.active,h.active)||u.point&&(!h.point||!pO(u.point,h.point)))return!1;if(u.to>i)return!0;u.next(),h.next()}}static spans(e,n,r,i,a=-1){let l=new Fc(e,null,a).goto(n),c=n,u=l.openStart;for(;;){let h=Math.min(l.to,r);if(l.point){let p=l.activeForPoint(l.to),O=l.pointFrom<n?p.length+1:l.point.startSide<0?p.length:Math.min(p.length,u);i.point(c,h,l.point,p,O,l.pointRank),u=Math.min(l.openEnd(h),p.length)}else h>c&&(i.span(c,h,l.active,u),u=l.openEnd(h));if(l.to>r)return u+(l.point&&l.to>r?1:0);c=l.to,l.next()}}static of(e,n=!1){let r=new ol;for(let i of e instanceof Xg?[e]:n?M_(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return mt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=mt.empty;i=i.nextLayer)n=new mt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}mt.empty=new mt([],[],null,-1);function M_(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(zg(e,r)>0)return t.slice().sort(zg);e=r}return t}mt.empty.nextLayer=mt.empty;class ol{finishChunk(e){this.chunks.push(new gO(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new ol)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(mt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=mt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function Hb(t,e,n){let r=new Map;for(let a of t)for(let l=0;l<a.chunk.length;l++)a.chunk[l].maxPoint<=0&&r.set(a.chunk[l],a.chunkPos[l]);let i=new Set;for(let a of e)for(let l=0;l<a.chunk.length;l++){let c=r.get(a.chunk[l]);c!=null&&(n?n.mapPos(c):c)==a.chunkPos[l]&&!(n!=null&&n.touchesRange(c,c+a.chunk[l].length))&&i.add(a.chunk[l])}return i}class q9{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Pu{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let a=0;a<e.length;a++)for(let l=e[a];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&i.push(new q9(l,n,r,a));return i.length==1?i[0]:new Pu(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)qp(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)qp(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),qp(this.heap,0)}}}function qp(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Fc{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pu.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Y1(this.active,e),Y1(this.activeTo,e),Y1(this.activeRank,e),this.minActive=zb(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:a}=this.cursor;for(;n<this.activeRank.length&&(a-this.activeRank[n]||i-this.activeTo[n])>0;)n++;I1(this.active,n,r),I1(this.activeTo,n,i),I1(this.activeRank,n,a),e&&I1(e,n,this.cursor.from),this.minActive=zb(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Y1(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Xb(t,e,n,r,i,a){t.goto(e),n.goto(r);let l=r+i,c=r,u=r-e,h=!!a.boundChange;for(let p=!1;;){let O=t.to+u-n.to,x=O||t.endSide-n.endSide,y=x<0?t.to+u:n.to,b=Math.min(y,l);if(t.point||n.point?(t.point&&n.point&&pO(t.point,n.point)&&Fg(t.activeForPoint(t.to),n.activeForPoint(n.to))||a.comparePoint(c,b,t.point,n.point),p=!1):(p&&a.boundChange(c),b>c&&!Fg(t.active,n.active)&&a.compareRange(c,b,t.active,n.active),h&&b<l&&(O||t.openEnd(y)!=n.openEnd(y))&&(p=!0)),y>l)break;c=y,x<=0&&t.next(),x>=0&&n.next()}}function Fg(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!pO(t[n],e[n]))return!1;return!0}function Y1(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function I1(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function zb(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Bd(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Qn(t,i));return r}function C_(t,e,n,r){for(let i=0,a=0;;){if(a>=e)return i;if(i==t.length)break;a+=t.charCodeAt(i)==9?n-a%n:1,i=Qn(t,i)}return t.length}const Bg="ͼ",Fb=typeof Symbol>"u"?"__"+Bg:Symbol.for(Bg),Yg=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Bb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vs{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function a(l,c,u,h){let p=[],O=/^@(\w+)\b/.exec(l[0]),x=O&&O[1]=="keyframes";if(O&&c==null)return u.push(l[0]+";");for(let y in c){let b=c[y];if(/&/.test(y))a(y.split(/,\s*/).map(S=>l.map(k=>S.replace(/&/,k))).reduce((S,k)=>S.concat(k)),b,u);else if(b&&typeof b=="object"){if(!O)throw new RangeError("The value of a property ("+y+") should be a primitive value.");a(i(y),b,p,x)}else b!=null&&p.push(y.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+b+";")}(p.length||x)&&u.push((r&&!O&&!h?l.map(r):l).join(", ")+" {"+p.join(" ")+"}")}for(let l in e)a(i(l),e[l],this.rules)}getRules(){return this.rules.join(`
|
|
104
|
+
`)}static newName(){let e=Bb[Fb]||1;return Bb[Fb]=e+1,Bg+e.toString(36)}static mount(e,n,r){let i=e[Yg],a=r&&r.nonce;i?a&&i.setNonce(a):i=new T_(e,a),i.mount(Array.isArray(n)?n:[n],e)}}let Yb=new Map;class T_{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=Yb.get(r);if(a)return e[Yg]=a;this.sheet=new i.CSSStyleSheet,Yb.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Yg]=this}mount(e,n){let r=this.sheet,i=0,a=0;for(let l=0;l<e.length;l++){let c=e[l],u=this.modules.indexOf(c);if(u<a&&u>-1&&(this.modules.splice(u,1),a--,u=-1),u==-1){if(this.modules.splice(a++,0,c),r)for(let h=0;h<c.rules.length;h++)r.insertRule(c.rules[h],i++)}else{for(;a<u;)i+=this.modules[a++].rules.length;i+=c.rules.length,a++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let u=0;u<this.modules.length;u++)l+=this.modules[u].getRules()+`
|
|
105
|
+
`;this.styleTag.textContent=l;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ss={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},E_=typeof navigator<"u"&&/Mac/.test(navigator.platform),$_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var zn=0;zn<10;zn++)Ss[48+zn]=Ss[96+zn]=String(zn);for(var zn=1;zn<=24;zn++)Ss[zn+111]="F"+zn;for(var zn=65;zn<=90;zn++)Ss[zn]=String.fromCharCode(zn+32),Qu[zn]=String.fromCharCode(zn);for(var Gp in Ss)Qu.hasOwnProperty(Gp)||(Qu[Gp]=Ss[Gp]);function j_(t){var e=E_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||$_&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Qu:Ss)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function jn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)G9(t,arguments[e]);return t}function G9(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)G9(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let tr=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ig=typeof document<"u"?document:{documentElement:{style:{}}};const qg=/Edge\/(\d+)/.exec(tr.userAgent),U9=/MSIE \d/.test(tr.userAgent),Gg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tr.userAgent),Yd=!!(U9||Gg||qg),Ib=!Yd&&/gecko\/(\d+)/i.test(tr.userAgent),Up=!Yd&&/Chrome\/(\d+)/.exec(tr.userAgent),P_="webkitFontSmoothing"in Ig.documentElement.style,Ug=!Yd&&/Apple Computer/.test(tr.vendor),qb=Ug&&(/Mobile\/\w+/.test(tr.userAgent)||tr.maxTouchPoints>2);var Me={mac:qb||/Mac/.test(tr.platform),windows:/Win/.test(tr.platform),linux:/Linux|X11/.test(tr.platform),ie:Yd,ie_version:U9?Ig.documentMode||6:Gg?+Gg[1]:qg?+qg[1]:0,gecko:Ib,gecko_version:Ib?+(/Firefox\/(\d+)/.exec(tr.userAgent)||[0,0])[1]:0,chrome:!!Up,chrome_version:Up?+Up[1]:0,ios:qb,android:/Android\b/.test(tr.userAgent),webkit_version:P_?+(/\bAppleWebKit\/(\d+)/.exec(tr.userAgent)||[0,0])[1]:0,safari:Ug,safari_version:Ug?+(/\bVersion\/(\d+(\.\d+)?)/.exec(tr.userAgent)||[0,0])[1]:0,tabSize:Ig.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function OO(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Jf=Object.create(null);function xO(t,e,n){if(t==e)return!0;t||(t=Jf),e||(e=Jf);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||t[a]!==e[a]))return!1;return!0}function Q_(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function Gb(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function Z_(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class pl{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var xr=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(xr||(xr={}));class Je extends bs{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new l0(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new cl(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:a,end:l}=W9(e,n);r=(a?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new cl(e,r,i,n,e.widget||null,!0)}static line(e){return new o0(e)}static set(e,n=!1){return mt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Je.none=mt.empty;class l0 extends Je{constructor(e){let{start:n,end:r}=W9(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?OO(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Jf}eq(e){return this==e||e instanceof l0&&this.tagName==e.tagName&&xO(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}l0.prototype.point=!1;class o0 extends Je{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof o0&&this.spec.class==e.spec.class&&xO(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}o0.prototype.mapMode=Gn.TrackBefore;o0.prototype.point=!0;class cl extends Je{constructor(e,n,r,i,a,l){super(n,r,a,e),this.block=i,this.isReplace=l,this.mapMode=i?n<=0?Gn.TrackBefore:Gn.TrackAfter:Gn.TrackDel}get type(){return this.startSide!=this.endSide?xr.WidgetRange:this.startSide<=0?xr.WidgetBefore:xr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof cl&&N_(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}cl.prototype.point=!0;function W9(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function N_(t,e){return t==e||!!(t&&e&&t.compare(e))}function go(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Zu extends bs{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Zu&&this.tagName==e.tagName&&xO(this.attributes,e.attributes)}static create(e){return new Zu(e.tagName,e.attributes||Jf)}static set(e,n=!1){return mt.of(e,n)}}Zu.prototype.startSide=Zu.prototype.endSide=-1;function Nu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Wg(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function du(t,e){if(!e.anchorNode)return!1;try{return Wg(t,e.anchorNode)}catch{return!1}}function Qf(t){return t.nodeType==3?Ru(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function hu(t,e,n,r){return n?Ub(t,e,n,r,-1)||Ub(t,e,n,r,1):!1}function ws(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function ed(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Ub(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ea(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=ws(t)+(i<0?0:1),t=a}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Ea(t):0}else return!1}}function Ea(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function td(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function R_(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function K9(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function V_(t,e,n,r,i,a,l,c){let u=t.ownerDocument,h=u.defaultView||window;for(let p=t,O=!1;p&&!O;)if(p.nodeType==1){let x,y=p==u.body,b=1,S=1;if(y)x=R_(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(p).position)&&(O=!0),p.scrollHeight<=p.clientHeight&&p.scrollWidth<=p.clientWidth){p=p.assignedSlot||p.parentNode;continue}let C=p.getBoundingClientRect();({scaleX:b,scaleY:S}=K9(p,C)),x={left:C.left,right:C.left+p.clientWidth*b,top:C.top,bottom:C.top+p.clientHeight*S}}let k=0,A=0;if(i=="nearest")e.top<x.top?(A=e.top-(x.top+l),n>0&&e.bottom>x.bottom+A&&(A=e.bottom-x.bottom+l)):e.bottom>x.bottom&&(A=e.bottom-x.bottom+l,n<0&&e.top-A<x.top&&(A=e.top-(x.top+l)));else{let C=e.bottom-e.top,T=x.bottom-x.top;A=(i=="center"&&C<=T?e.top+C/2-T/2:i=="start"||i=="center"&&n<0?e.top-l:e.bottom-T+l)-x.top}if(r=="nearest"?e.left<x.left?(k=e.left-(x.left+a),n>0&&e.right>x.right+k&&(k=e.right-x.right+a)):e.right>x.right&&(k=e.right-x.right+a,n<0&&e.left<x.left+k&&(k=e.left-(x.left+a))):k=(r=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:r=="start"==c?e.left-a:e.right-(x.right-x.left)+a)-x.left,k||A)if(y)h.scrollBy(k,A);else{let C=0,T=0;if(A){let j=p.scrollTop;p.scrollTop+=A/S,T=(p.scrollTop-j)*S}if(k){let j=p.scrollLeft;p.scrollLeft+=k/b,C=(p.scrollLeft-j)*b}e={left:e.left-C,top:e.top-T,right:e.right-C,bottom:e.bottom-T},C&&Math.abs(C-k)<1&&(r="nearest"),T&&Math.abs(T-A)<1&&(i="nearest")}if(y)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),p=p.assignedSlot||p.parentNode}else if(p.nodeType==11)p=p.host;else break}function J9(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let a=t.parentNode;a&&!(a==n.body||(!e||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),e&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}class L_{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Ea(n):0),r,Math.min(e.focusOffset,r?Ea(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Is=null;Me.safari&&Me.safari_version>=26&&(Is=!1);function ek(t){if(t.setActive)return t.setActive();if(Is)return t.focus(Is);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Is==null?{get preventScroll(){return Is={preventScroll:!0},!0}}:void 0),!Is){Is=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],a=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=a&&(r.scrollLeft=a)}}}let Wb;function Ru(t,e,n=e){let r=Wb||(Wb=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Oo(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent("keydown",i);a.synthetic=!0,t.dispatchEvent(a);let l=new KeyboardEvent("keyup",i);return l.synthetic=!0,t.dispatchEvent(l),a.defaultPrevented||l.defaultPrevented}function __(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function D_(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Ea(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Ea(n))}else{if(n==t)return!0;r=ws(n),n=n.parentNode}}function tk(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function nk(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Ea(n)}else if(n.parentNode&&!ed(n))r=ws(n),n=n.parentNode;else return null}}function rk(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!ed(n))r=ws(n)+1,n=n.parentNode;else return null}}class gi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new gi(e.parentNode,ws(e),n)}static after(e,n){return new gi(e.parentNode,ws(e)+1,n)}}var hn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(hn||(hn={}));const ul=hn.LTR,yO=hn.RTL;function ik(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const H_=ik("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),X_=ik("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Kg=Object.create(null),Ei=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Kg[e]=n,Kg[n]=-e}function ak(t){return t<=247?H_[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?X_[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const z_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vi{get dir(){return this.level%2?yO:ul}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let a=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c.from<=n&&c.to>=n){if(c.level==r)return l;(a<0||(i!=0?i<0?c.from<n:c.to>n:e[a].level>c.level))&&(a=l)}}if(a<0)throw new RangeError("Index out of range");return a}}function sk(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!sk(r.inner,i.inner))return!1}return!0}const Ht=[];function F_(t,e,n,r,i){for(let a=0;a<=r.length;a++){let l=a?r[a-1].to:e,c=a<r.length?r[a].from:n,u=a?256:i;for(let h=l,p=u,O=u;h<c;h++){let x=ak(t.charCodeAt(h));x==512?x=p:x==8&&O==4&&(x=16),Ht[h]=x==4?2:x,x&7&&(O=x),p=x}for(let h=l,p=u,O=u;h<c;h++){let x=Ht[h];if(x==128)h<c-1&&p==Ht[h+1]&&p&24?x=Ht[h]=p:Ht[h]=256;else if(x==64){let y=h+1;for(;y<c&&Ht[y]==64;)y++;let b=h&&p==8||y<n&&Ht[y]==8?O==1?1:8:256;for(let S=h;S<y;S++)Ht[S]=b;h=y-1}else x==8&&O==1&&(Ht[h]=1);p=x,x&7&&(O=x)}}}function B_(t,e,n,r,i){let a=i==1?2:1;for(let l=0,c=0,u=0;l<=r.length;l++){let h=l?r[l-1].to:e,p=l<r.length?r[l].from:n;for(let O=h,x,y,b;O<p;O++)if(y=Kg[x=t.charCodeAt(O)])if(y<0){for(let S=c-3;S>=0;S-=3)if(Ei[S+1]==-y){let k=Ei[S+2],A=k&2?i:k&4?k&1?a:i:0;A&&(Ht[O]=Ht[Ei[S]]=A),c=S;break}}else{if(Ei.length==189)break;Ei[c++]=O,Ei[c++]=x,Ei[c++]=u}else if((b=Ht[O])==2||b==1){let S=b==i;u=S?0:1;for(let k=c-3;k>=0;k-=3){let A=Ei[k+2];if(A&2)break;if(S)Ei[k+2]|=2;else{if(A&4)break;Ei[k+2]|=4}}}}}function Y_(t,e,n,r){for(let i=0,a=r;i<=n.length;i++){let l=i?n[i-1].to:t,c=i<n.length?n[i].from:e;for(let u=l;u<c;){let h=Ht[u];if(h==256){let p=u+1;for(;;)if(p==c){if(i==n.length)break;p=n[i++].to,c=i<n.length?n[i].from:e}else if(Ht[p]==256)p++;else break;let O=a==1,x=(p<e?Ht[p]:r)==1,y=O==x?O?1:2:r;for(let b=p,S=i,k=S?n[S-1].to:t;b>u;)b==k&&(b=n[--S].from,k=S?n[S-1].to:t),Ht[--b]=y;u=p}else a=h,u++}}}function Jg(t,e,n,r,i,a,l){let c=r%2?2:1;if(r%2==i%2)for(let u=e,h=0;u<n;){let p=!0,O=!1;if(h==a.length||u<a[h].from){let S=Ht[u];S!=c&&(p=!1,O=S==16)}let x=!p&&c==1?[]:null,y=p?r:r+1,b=u;e:for(;;)if(h<a.length&&b==a[h].from){if(O)break e;let S=a[h];if(!p)for(let k=S.to,A=h+1;;){if(k==n)break e;if(A<a.length&&a[A].from==k)k=a[A++].to;else{if(Ht[k]==c)break e;break}}if(h++,x)x.push(S);else{S.from>u&&l.push(new Vi(u,S.from,y));let k=S.direction==ul!=!(y%2);e8(t,k?r+1:r,i,S.inner,S.from,S.to,l),u=S.to}b=S.to}else{if(b==n||(p?Ht[b]!=c:Ht[b]==c))break;b++}x?Jg(t,u,b,r+1,i,x,l):u<b&&l.push(new Vi(u,b,y)),u=b}else for(let u=n,h=a.length;u>e;){let p=!0,O=!1;if(!h||u>a[h-1].to){let S=Ht[u-1];S!=c&&(p=!1,O=S==16)}let x=!p&&c==1?[]:null,y=p?r:r+1,b=u;e:for(;;)if(h&&b==a[h-1].to){if(O)break e;let S=a[--h];if(!p)for(let k=S.from,A=h;;){if(k==e)break e;if(A&&a[A-1].to==k)k=a[--A].from;else{if(Ht[k-1]==c)break e;break}}if(x)x.push(S);else{S.to<u&&l.push(new Vi(S.to,u,y));let k=S.direction==ul!=!(y%2);e8(t,k?r+1:r,i,S.inner,S.from,S.to,l),u=S.from}b=S.from}else{if(b==e||(p?Ht[b-1]!=c:Ht[b-1]==c))break;b--}x?Jg(t,b,u,r+1,i,x,l):b<u&&l.push(new Vi(b,u,y)),u=b}}function e8(t,e,n,r,i,a,l){let c=e%2?2:1;F_(t,i,a,r,c),B_(t,i,a,r,c),Y_(i,a,r,c),Jg(t,i,a,e,n,r,l)}function I_(t,e,n){if(!t)return[new Vi(0,0,e==yO?1:0)];if(e==ul&&!n.length&&!z_.test(t))return lk(t.length);if(n.length)for(;t.length>Ht.length;)Ht[Ht.length]=256;let r=[],i=e==ul?0:1;return e8(t,i,i,n,0,t.length,r),r}function lk(t){return[new Vi(0,t,0)]}let ok="";function q_(t,e,n,r,i){var a;let l=r.head-t.from,c=Vi.find(e,l,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),u=e[c],h=u.side(i,n);if(l==h){let x=c+=i?1:-1;if(x<0||x>=e.length)return null;u=e[c=x],l=u.side(!i,n),h=u.side(i,n)}let p=Qn(t.text,l,u.forward(i,n));(p<u.from||p>u.to)&&(p=h),ok=t.text.slice(Math.min(l,p),Math.max(l,p));let O=c==(i?e.length-1:0)?null:e[c+(i?1:-1)];return O&&p==h&&O.level+(i?0:1)<u.level?ge.cursor(O.side(!i,n)+t.from,O.forward(i,n)?1:-1,O.level):ge.cursor(p+t.from,u.forward(i,n)?-1:1,u.level)}function G_(t,e,n){for(let r=e;r<n;r++){let i=ak(t.charCodeAt(r));if(i==1)return ul;if(i==2||i==4)return yO}return ul}const ck=je.define(),uk=je.define(),fk=je.define(),dk=je.define(),t8=je.define(),hk=je.define(),mk=je.define(),bO=je.define(),vO=je.define(),pk=je.define({combine:t=>t.some(e=>e)}),U_=je.define({combine:t=>t.some(e=>e)}),gk=je.define();class xo{constructor(e,n="nearest",r="nearest",i=5,a=5,l=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=a,this.isSnapshot=l}map(e){return e.empty?this:new xo(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new xo(ge.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const q1=At.define({map:(t,e)=>t.map(e)}),Ok=At.define();function Li(t,e,n){let r=t.facet(dk);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const pa=je.define({combine:t=>t.length?t[0]:!0});let W_=0;const lo=je.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class yr{constructor(e,n,r,i,a){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(lo.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(lo.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:a,decorations:l}=n||{};return new yr(W_++,e,r,i,c=>{let u=[];return l&&u.push(Id.of(h=>{let p=h.plugin(c);return p?l(p):Je.none})),a&&u.push(a(c)),u})}static fromClass(e,n){return yr.define((r,i)=>new e(r,i),n)}}class Wp{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Li(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Li(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Li(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const xk=je.define(),SO=je.define(),Id=je.define(),yk=je.define(),wO=je.define(),c0=je.define(),bk=je.define();function Kb(t,e){let n=t.state.facet(bk);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(t):a),i=[];return mt.spans(r,e.from,e.to,{point(){},span(a,l,c,u){let h=a-e.from,p=l-e.from,O=i;for(let x=c.length-1;x>=0;x--,u--){let y=c[x].spec.bidiIsolate,b;if(y==null&&(y=G_(e.text,h,p)),u>0&&O.length&&(b=O[O.length-1]).to==h&&b.direction==y)b.to=p,O=b.inner;else{let S={from:h,to:p,direction:y,inner:[]};O.push(S),O=S.inner}}}}),i}const vk=je.define();function Sk(t){let e=0,n=0,r=0,i=0;for(let a of t.state.facet(vk)){let l=a(t);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:e,right:n,top:r,bottom:i}}const tu=je.define();class Ur{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Ur(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,a=0,l=0;;){let c=i<e.length?e[i].fromB:1e9,u=a<n.length?n[a]:1e9,h=Math.min(c,u);if(h==1e9)break;let p=h+l,O=h,x=p;for(;;)if(a<n.length&&n[a]<=O){let y=n[a+1];a+=2,O=Math.max(O,y);for(let b=i;b<e.length&&e[b].fromB<=O;b++)l=e[b].toA-e[b].toB;x=Math.max(x,y+l)}else if(i<e.length&&e[i].fromB<=O){let y=e[i++];O=Math.max(O,y.toB),x=Math.max(x,y.toA),l=y.toA-y.toB}else break;r.push(new Ur(p,x,h,O))}return r}}class nd{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Mn.empty(this.startState.doc.length);for(let a of r)this.changes=this.changes.compose(a.changes);let i=[];this.changes.iterChangedRanges((a,l,c,u)=>i.push(new Ur(a,l,c,u))),this.changedRanges=i}static create(e,n,r){return new nd(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const K_=[];class on{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return K_}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&Q_(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=ws(this.dom),i=this.length?e>0:n>0;return new gi(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Gd)return e;return null}static get(e){return e.cmTile}}class qd extends on{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,a=(e==null?void 0:e.node)==n?e:null,l=0;for(let c of this.children){if(c.sync(e),l+=c.length+c.breakAfter,i=r?r.nextSibling:n.firstChild,a&&i!=c.dom&&(a.written=!0),c.dom.parentNode==n)for(;i&&i!=c.dom;)i=Jb(i);else n.insertBefore(c.dom,i);r=c.dom}for(i=r?r.nextSibling:n.firstChild,a&&i&&(a.written=!0);i;)i=Jb(i);this.length=l}}function Jb(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Gd extends qd{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=on.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,a=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&a++,i=n.pop()}else{let l=r.children[i++];if(l instanceof xa)n.push(i),r=l,i=0;else{let c=a+l.length,u=e(l,a);if(u!==void 0)return u;a=c+l.breakAfter}}}resolveBlock(e,n){let r,i=-1,a,l=-1;if(this.blockTiles((c,u)=>{let h=u+c.length;if(e>=u&&e<=h){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(r=void 0)}(u<e||e==h&&(n<-1?c.length:c.covers(1)))&&(!r||!c.isWidget()&&r.isWidget())&&(r=c,i=e-u),(h>e||e==u&&(n>1?c.length:c.covers(-1)))&&(!a||!c.isWidget()&&a.isWidget())&&(a=c,l=e-u)}}),!r&&!a)throw new Error("No tile at position "+e);return r&&n<0||!a?{tile:r,offset:i}:{tile:a,offset:l}}}class xa extends qd{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new xa(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Po extends qd{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Po(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,a=-1,l=null,c=-1;function u(p,O){for(let x=0,y=0;x<p.children.length&&y<=O;x++){let b=p.children[x],S=y+b.length;S>=O&&(b.isComposite()?u(b,O-y):(!l||l.isHidden&&(n>0||r&&eD(l,b)))&&(S>O||b.flags&32)?(l=b,c=O-y):(y<O||b.flags&16&&!b.isHidden)&&(i=b,a=O-y)),y=S}}u(this,e);let h=(n<0?i:l)||i||l;return h?{tile:h,offset:h==i?a:c}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):J_(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:a}=r;if(this.dom.contains(i.dom))return i.isText()?new gi(i.dom,Math.min(i.dom.nodeValue.length,a)):i.domPosFor(a,i.flags&16?1:i.flags&32?-1:n);let l=r.tile.parent,c=!1;for(let u of l.children){if(c)return new gi(u.dom,0);u==r.tile&&(c=!0)}}return new gi(this.dom,0)}}function J_(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Qf(e);return n[n.length-1]||null}function eD(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class gr extends qd{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new gr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Js extends on{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,l=0;e==0&&n<0||e==r&&n>=0?Me.chrome||Me.gecko||(e?(i--,l=1):a<r&&(a++,l=-1)):n<0?i--:a<r&&a++;let c=Ru(this.dom,i,a).getClientRects();if(!c.length)return null;let u=c[(l?l<0:n>=0)?0:c.length-1];return Me.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,h=>h.width)||u),l?td(u,l<0):u||null}static of(e,n){let r=new Js(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class fl extends on{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return td(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let a=this.dom.getClientRects(),l=null;if(!a.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=c?a.length-1:0;l=a[u],!(e>0?u==0:u==a.length-1||l.top<l.bottom);u+=c?-1:1);return td(l,!c)}}get overrideDOMText(){if(!this.length)return St.empty;let{root:e}=this;if(!e)return St.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,a){return a||(a=e.toDOM(n),e.editable||(a.contentEditable="false")),new fl(a,r,e,i)}}class rd extends on{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return St.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class tD{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:a,beforeBreak:l,parents:c}=this;for(;e||n>0;)if(i.isComposite())if(l){if(!e)break;r&&r.break(),e--,l=!1}else if(a==i.children.length){if(!e&&!c.length)break;r&&r.leave(i),l=!!i.breakAfter,{tile:i,index:a}=c.pop(),a++}else{let u=i.children[a],h=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(l=!!h,a++,e-=u.length):(c.push({tile:i,index:a}),i=u,a=0,r&&u.isComposite()&&r.enter(u))}else if(a==i.length)l=!!i.breakAfter,{tile:i,index:a}=c.pop(),a++;else if(e){let u=Math.min(e,i.length-a);r&&r.skip(i,a,a+u),e-=u,a+=u}else break;return this.tile=i,this.index=a,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class nD{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class rD{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var a;this.flushBuffer();let l=this.ensureMarks(n,r),c=l.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let u=l.children[l.children.length-1]=new Js(c.dom,c.text+e);u.parent=l}else l.append(i||Js.of(e,(a=this.cache.find(Js))===null||a===void 0?void 0:a.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Kp(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let c=n.marks.length-1;c>=0;c--){let u=n.marks[c],h=i.lastChild;if(h instanceof gr&&h.mark.eq(u.mark))h.dom!=u.dom&&h.setDOM(Kp(u.dom)),i=h;else{if(this.cache.reused.get(u)){let O=on.get(u.dom);O&&O.setDOM(Kp(u.dom))}let p=gr.of(u.mark,u.dom);i.append(p),i=p}this.cache.reused.set(u,2)}let a=on.get(e.text);a&&this.cache.reused.set(a,2);let l=new Js(e.text,e.text.nodeValue);l.flags|=8,i.append(l)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let a=this.ensureMarks(n,r);!i&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=wk);let i=Po.start(e,n||((r=this.cache.find(Po))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let a=e.length-1;a>=0;a--){let l=e[a],c;if(n>0&&(c=i.lastChild)&&c instanceof gr&&c.mark.eq(l))i=c,n--;else{let u=gr.of(l,(r=this.cache.find(gr,h=>h.mark.eq(l)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!e3(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Me.ios&&e3(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Jp,0,32)||new fl(Jp.toDOM(),0,Jp,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new nD(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof xa&&i.wrapper.eq(r.wrapper))n=i;else{let a=xa.of(r.wrapper,(e=this.cache.find(xa,l=>l.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(a),n=a}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(rd,void 0,1);return r&&(r.flags=n),r||new rd(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class iD{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:a,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=i;let c=this.textOff=Math.min(e,i.length);return a?null:i.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const id=[fl,Po,Js,gr,rd,xa,Gd];for(let t=0;t<id.length;t++)id[t].bucket=t;class aD{constructor(e){this.view=e,this.buckets=id.map(()=>[]),this.index=id.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,a=this.buckets[i],l=this.index[i];for(let c=a.length-1;c>=0;c--){let u=(c+l)%a.length,h=a[u];if((!n||n(h))&&!this.reused.has(h))return a.splice(u,1),u<l&&this.index[i]--,this.reused.set(h,r),h}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let a=0,l=0;;a++){if(a==i.length){if(l)return null;l=1,a=0}let c=i[a];if(!this.reused.has(c)&&(l==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return i.splice(a,1),a<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==r?(this.reused.set(c,1),c):(this.reused.set(c,2),new fl(c.dom,n,e,c.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class sD{constructor(e,n,r,i,a){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new aD(e),this.text=new iD(e.state.doc),this.builder=new rD(this.cache,new Gd(e,e.contentDOM),mt.iter(r)),this.cache.reused.set(n,2),this.old=new tD(n),this.reuseWalker={skip:(l,c,u)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,a=0,l=0;;){let c=l<e.length?e[l++]:null,u=c?c.fromA:this.old.root.length;if(u>i){let h=u-i;this.preserve(h,!l,!c),i=u,a+=h}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(a,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(a,c.toB)),a=c.toB,i=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=cD(this.old),a=this.openMarks;this.old.advance(e,r?1:-1,{skip:(l,c,u)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(u-c);else{let h=u>0||c<l.length?fl.of(l.widget,this.view,u-c,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,i,a),a=i.length)}else if(l.isText())this.builder.ensureLine(null),!c&&u==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,i,a,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(c,u),i,a)),a=i.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof rd)this.cache.add(l);else if(l instanceof gr)this.builder.ensureLine(null),this.builder.addMark(l,i,a),this.cache.reused.set(l,1),a=i.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof gr&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=a=0):l instanceof gr&&(i.shift(),a=Math.min(a,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,a=0,l=mt.spans(this.decorations,e,n,{point:(c,u,h,p,O,x)=>{if(h instanceof cl){if(this.disallowBlockEffectsFor[x]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=p.length,O>p.length)i.continueWidget(u-c);else{let y=h.widget||(h.block?Qo.block:Qo.inline),b=lD(h),S=this.cache.findWidget(y,u-c,b)||fl.of(y,this.view,u-c,b);h.block?(h.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(S)):(i.ensureLine(r),i.addInlineWidget(S,p,O))}r=null}else r=oD(r,h);u>c&&this.text.skip(u-c)},span:(c,u,h,p)=>{for(let O=c;O<u;){let x=this.text.next(Math.min(512,u-O));x==null?(i.addLineStartIfNotCovered(r),i.addBreak(),O++):(i.ensureLine(r),i.addText(x,h,O==c?p:h.length),O+=x.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=l>a,this.openMarks=l}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let a=on.get(i);if(i==this.view.contentDOM)break;a instanceof gr?n.push(a):a!=null&&a.isLine()?r=a:a instanceof xa||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Po(i,wk):r||n.push(gr.of(new l0({tagName:i.nodeName.toLowerCase(),attributes:Z_(i)}),i)))}return{line:r,marks:n}}}function e3(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function lD(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const wk={class:"cm-line"};function oD(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&OO(n,t),r&&(t.class+=" "+r)),t}function cD(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof gr&&e.push(r.mark)}return e}function Kp(t){let e=on.get(t);return e&&e.setDOM(t.cloneNode()),t}class Qo extends pl{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Qo.inline=new Qo("span");Qo.block=new Qo("div");const Jp=new class extends pl{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class t3{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Je.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Gd(e,e.contentDOM),this.updateInner([new Ur(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:p,toA:O})=>O<this.minWidthFrom||p>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!xD(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?fD(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:O}=this.hasComposition;r=new Ur(p,O,e.changes.mapPos(p,-1),e.changes.mapPos(O,1)).addToSet(r.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(Me.ie||Me.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,c=this.blockWrappers;this.updateDeco();let u=mD(l,this.decorations,e.changes);u.length&&(r=Ur.extendWithRanges(r,u));let h=gD(c,this.blockWrappers,e.changes);return h.length&&(r=Ur.extendWithRanges(r,h)),a&&!r.some(p=>p.fromA<=a.range.fromA&&p.toA>=a.range.toA)&&(r=a.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let l=this.tile,c=new sD(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&on.get(n.text)&&c.cache.reused.set(on.get(n.text),2),this.tile=c.run(e,n),n8(l,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=Me.chrome||Me.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||r.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof e2&&i.push(a.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(Ok)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,a=i==r,l=!a&&!(this.view.state.facet(pa)||r.tabIndex>-1)&&du(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(a||n||l))return;let c=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,h,p;if(u.empty?p=h=this.inlineDOMNearPos(u.anchor,u.assoc||1):(p=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),h=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Me.gecko&&u.empty&&!this.hasComposition&&uD(h)){let x=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(x,h.node.childNodes[h.offset]||null)),h=p=new gi(x,0),c=!0}let O=this.view.observer.selectionRange;(c||!O.focusNode||(!hu(h.node,h.offset,O.anchorNode,O.anchorOffset)||!hu(p.node,p.offset,O.focusNode,O.focusOffset))&&!this.suppressWidgetCursorChange(O,u))&&(this.view.observer.ignore(()=>{Me.android&&Me.chrome&&r.contains(O.focusNode)&&OD(O.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let x=Nu(this.view.root);if(x)if(u.empty){if(Me.gecko){let y=dD(h.node,h.offset);if(y&&y!=3){let b=(y==1?nk:rk)(h.node,h.offset);b&&(h=new gi(b.node,b.offset))}}x.collapse(h.node,h.offset),u.bidiLevel!=null&&x.caretBidiLevel!==void 0&&(x.caretBidiLevel=u.bidiLevel)}else if(x.extend){x.collapse(h.node,h.offset);try{x.extend(p.node,p.offset)}catch{}}else{let y=document.createRange();u.anchor>u.head&&([h,p]=[p,h]),y.setEnd(p.node,p.offset),y.setStart(h.node,h.offset),x.removeAllRanges(),x.addRange(y)}l&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(h,p)),this.impreciseAnchor=h.precise?null:new gi(O.anchorNode,O.anchorOffset),this.impreciseHead=p.precise?null:new gi(O.focusNode,O.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&hu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Nu(e.root),{anchorNode:i,anchorOffset:a}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let l=this.lineAt(n.head,n.assoc);if(!l)return;let c=l.posAtStart;if(n.head==c||n.head==c+l.length)return;let u=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!u||!h||u.bottom>h.top)return;let p=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(p.node,p.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=n.from&&r.collapse(i,a)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let a;if(e==r.dom)a=r.dom.childNodes[n];else{let l=Ea(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==r.dom)break;l==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?l=-1:l=1),e=c}l<0?a=e:a=e.nextSibling}if(a==r.dom.firstChild)return i;for(;a&&!on.get(a);)a=a.nextSibling;if(!a)return i+r.length;for(let l=0,c=i;;l++){let u=r.children[l];if(u.dom==a)return c;c+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,a=!1,l,c=-1,u=!1;return this.tile.blockTiles((h,p)=>{if(h.isWidget()){if(h.flags&32&&p>=e)return!0;h.flags&16&&(a=!0)}else{let O=p+h.length;if(p<=e&&(r=h,i=e-p,a=O<e),O>=e&&!l&&(l=h,c=e-p,u=p>e),p>e&&l)return!0}}),!r&&!l?this.domAtPos(e,n):(a&&l?r=null:u&&r&&(l=null),r&&n<0||!l?r.domIn(i,n):l.domIn(c,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof e2?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(a,l){if(a.isComposite())for(let c of a.children){if(c.length>=l){let u=i(c,l);if(u)return u}if(l-=c.length,l<0)break}else if(a.isText()&&l<a.length){let c=Qn(a.text,l);if(c==l)return null;let u=Ru(a.dom,l,c).getClientRects();for(let h=0;h<u.length;h++){let p=u[h];if(h==u.length-1||p.top<p.bottom&&p.left<p.right)return p}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,a=this.view.contentDOM.clientWidth,l=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,u=this.view.textDirection==hn.LTR,h=0,p=(O,x,y)=>{for(let b=0;b<O.children.length&&!(x>i);b++){let S=O.children[b],k=x+S.length,A=S.dom.getBoundingClientRect(),{height:C}=A;if(y&&!b&&(h+=A.top-y.top),S instanceof xa)k>r&&p(S,x,A);else if(x>=r&&(h>0&&n.push(-h),n.push(C+h),h=0,l)){let T=S.dom.lastChild,j=T?Qf(T):[];if(j.length){let M=j[j.length-1],E=u?M.right-A.left:A.right-M.left;E>c&&(c=E,this.minWidth=a,this.minWidthFrom=x,this.minWidthTo=k)}}y&&b==O.children.length-1&&(h+=y.bottom-A.bottom),x=k+S.breakAfter}};return p(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?hn.RTL:hn.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let c=0,u;for(let h of l.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let p=Qf(h.dom);if(p.length!=1)return;c+=p[0].width,u=p[0].height}if(c)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:c/l.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,a;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let l=Qf(n.firstChild)[0];r=n.getBoundingClientRect().height,i=l&&l.width?l.width/27:7,a=l&&l.height?l.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:a}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let a=i==n.viewports.length?null:n.viewports[i],l=a?a.from-1:this.view.state.doc.length;if(l>r){let c=(n.lineBlockAt(l).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Je.replace({widget:new e2(c),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!a)break;r=a.to+1}return Je.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Id).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),r=!1,i=this.view.state.facet(wO).map((a,l)=>{let c=typeof a=="function";return c&&(r=!0),c?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(mt.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(yk).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){var n;if(e.isSnapshot){let p=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=p.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let p of this.view.state.facet(gk))try{if(p(this.view,e.range,e))return!0}catch(O){Li(this.view.state,O,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),a;if(!i)return;!r.empty&&(a=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,a.left),top:Math.min(i.top,a.top),right:Math.max(i.right,a.right),bottom:Math.max(i.bottom,a.bottom)});let l=Sk(this.view),c={left:i.left-l.left,top:i.top-l.top,right:i.right+l.right,bottom:i.bottom+l.bottom},{offsetWidth:u,offsetHeight:h}=this.view.scrollDOM;if(V_(this.view.scrollDOM,c,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==hn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let p=this.view.docView.lineAt(r.head,1);p&&p.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){n8(this.tile)}}function n8(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)n8(r,e)}}function uD(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function kk(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=nk(n.focusNode,n.focusOffset),i=rk(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let c=on.get(i.node);if(!c||c.isText()&&c.text!=i.node.nodeValue)a=i;else if(t.docView.lastCompositionAfterCursor){let u=on.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(a=i)}}if(t.docView.lastCompositionAfterCursor=a!=r,!a)return null;let l=e-a.offset;return{from:l,to:l+a.node.nodeValue.length,node:a.node}}function fD(t,e,n){let r=kk(t,n);if(!r)return null;let{node:i,from:a,to:l}=r,c=i.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(r.from,r.to)!=c)return null;let u=e.invertedDesc;return{range:new Ur(u.mapPos(a),u.mapPos(l),a,l),text:i}}function dD(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let hD=class{constructor(){this.changes=[]}compareRange(e,n){go(e,n,this.changes)}comparePoint(e,n){go(e,n,this.changes)}boundChange(e){go(e,e,this.changes)}};function mD(t,e,n){let r=new hD;return mt.compare(t,e,n,r),r.changes}class pD{constructor(){this.changes=[]}compareRange(e,n){go(e,n,this.changes)}comparePoint(){}boundChange(e){go(e,e,this.changes)}}function gD(t,e,n){let r=new pD;return mt.compare(t,e,n,r),r.changes}function OD(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function xD(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class e2 extends pl{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function yD(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),a=e-i.from;if(i.length==0)return ge.cursor(e);a==0?n=1:a==i.length&&(n=-1);let l=a,c=a;n<0?l=Qn(i.text,a,!1):c=Qn(i.text,a);let u=r(i.text.slice(l,c));for(;l>0;){let h=Qn(i.text,l,!1);if(r(i.text.slice(h,l))!=u)break;l=h}for(;c<i.length;){let h=Qn(i.text,c);if(r(i.text.slice(c,h))!=u)break;c=h}return ge.range(l+i.from,c+i.from)}function bD(t,e,n,r,i){let a=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-c)*.5)/c);a+=u*t.viewState.heightOracle.lineLength}let l=t.state.sliceDoc(n.from,n.to);return n.from+C_(l,a,t.state.tabSize)}function vD(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let a of r.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!i||a.type==xr.Text&&(i.type!=a.type||(n<0?a.from<e:a.to>e)))&&(i=a)}}return i||r}return r}function SD(t,e,n,r){let i=vD(t,e.head,e.assoc||-1),a=!r||i.type!=xr.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(a){let l=t.dom.getBoundingClientRect(),c=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(c==hn.LTR)?l.right-1:l.left+1,y:(a.top+a.bottom)/2});if(u!=null)return ge.cursor(u,n?-1:1)}return ge.cursor(n?i.to:i.from,n?-1:1)}function n3(t,e,n,r){let i=t.state.doc.lineAt(e.head),a=t.bidiSpans(i),l=t.textDirectionAt(i.from);for(let c=e,u=null;;){let h=q_(i,a,l,c,n),p=ok;if(!h){if(i.number==(n?t.state.doc.lines:1))return c;p=`
|
|
106
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),a=t.bidiSpans(i),h=t.visualLineSide(i,!n)}if(u){if(!u(p))return c}else{if(!r)return h;u=r(p)}c=h}}function wD(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return a=>{let l=r(a);return i==en.Space&&(i=l),i==l}}function kD(t,e,n,r){let i=e.head,a=n?1:-1;if(i==(n?t.state.doc.length:0))return ge.cursor(i,e.assoc);let l=e.goalColumn,c,u=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),p=t.documentTop;if(h)l==null&&(l=h.left-u.left),c=a<0?h.top:h.bottom;else{let b=t.viewState.lineBlockAt(i);l==null&&(l=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-b.from))),c=(a<0?b.top:b.bottom)+p}let O=u.left+l,x=t.viewState.heightOracle.textHeight>>1,y=r??x;for(let b=0;;b+=x){let S=c+(y+b)*a,k=r8(t,{x:O,y:S},!1,a);if(n?S>u.bottom:S<u.top)return ge.cursor(k.pos,k.assoc);let A=t.coordsAtPos(k.pos,k.assoc),C=A?(A.top+A.bottom)/2:0;if(!A||(n?C>c:C<c))return ge.cursor(k.pos,k.assoc,void 0,l)}}function mu(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(a,l,c)=>{if(e>a&&e<l){let u=r||n||(e-a<l-e?-1:1);e=u<0?a:l,r=u}});if(!r)return e}}function Ak(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],a=null;if(i.empty){let l=mu(t,i.from,0);l!=i.from&&(a=ge.cursor(l,-1))}else{let l=mu(t,i.from,-1),c=mu(t,i.to,1);(l!=i.from||c!=i.to)&&(a=ge.range(i.from==i.anchor?l:c,i.from==i.head?l:c))}a&&(n||(n=e.ranges.slice()),n[r]=a)}return n?ge.create(n,e.mainIndex):e}function t2(t,e,n){let r=mu(t.state.facet(c0).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:ge.cursor(r,r<n.from?1:-1)}class Ri{constructor(e,n){this.pos=e,this.assoc=n}}function r8(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),a=i.top+t.viewState.paddingTop,{x:l,y:c}=e,u=c-a,h;for(;;){if(u<0)return new Ri(0,1);if(u>t.viewState.docHeight)return new Ri(t.state.doc.length,-1);if(h=t.elementAtHeight(u),r==null)break;if(h.type==xr.Text){if(r<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let x=t.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(x&&(r<0?x.top<=u+a:x.bottom>=u+a))break}let O=t.viewState.heightOracle.textHeight/2;u=r>0?h.bottom+O:h.top-O}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==xr.Text){let O=bD(t,i,h,l,c);return new Ri(O,O==h.from?1:-1)}}if(h.type!=xr.Text)return u<(h.top+h.bottom)/2?new Ri(h.from,1):new Ri(h.to,-1);let p=t.docView.lineAt(h.from,2);return(!p||p.length!=h.length)&&(p=t.docView.lineAt(h.from,-2)),new AD(t,l,c,t.textDirectionAt(h.from)).scanTile(p,h.from)}class AD{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Vi.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Vi.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,a=new Set,l=this.bidiIn(e[0],e[i]),c,u,h=-1,p=1e9,O;e:for(;r<i;){let y=i-r,b=r+i>>1;t:if(a.has(b)){let k=r+Math.floor(Math.random()*y);for(let A=0;A<y;A++){if(!a.has(k)){b=k;break t}k++,k==i&&(k=r)}break e}a.add(b);let S=n(b);if(S)for(let k=0;k<S.length;k++){let A=S[k],C=0;if(!(A.width==0&&S.length>1)){if(A.bottom<this.y)(!c||c.bottom<A.bottom)&&(c=A),C=1;else if(A.top>this.y)(!u||u.top>A.top)&&(u=A),C=-1;else{let T=A.left>this.x?this.x-A.left:A.right<this.x?this.x-A.right:0,j=Math.abs(T);j<p&&(h=b,p=j,O=A),T&&(C=T<0==(this.baseDir==hn.LTR)?-1:1)}C==-1&&(!l||this.baseDirAt(e[b],1))?i=b:C==1&&(!l||this.baseDirAt(e[b+1],-1))&&(r=b+1)}}}if(!O){let y=c&&(!u||this.y-c.bottom<u.top-this.y)?c:u;return this.y=(y.top+y.bottom)/2,this.scan(e,n)}let x=(l?this.dirAt(e[h],1):this.baseDir)==hn.LTR;return{i:h,after:this.x>(O.left+O.right)/2==x}}scanText(e,n){let r=[];for(let a=0;a<e.length;a=Qn(e.text,a))r.push(n+a);r.push(n+e.length);let i=this.scan(r,a=>{let l=r[a]-n,c=r[a+1]-n;return Ru(e.dom,l,c).getClientRects()});return i.after?new Ri(r[i.i+1],-1):new Ri(r[i.i],1)}scanTile(e,n){if(!e.length)return new Ri(n,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,n);if(c.isComposite())return this.scanTile(c,n)}let r=[n];for(let c=0,u=n;c<e.children.length;c++)r.push(u+=e.children[c].length);let i=this.scan(r,c=>{let u=e.children[c];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Ru(u.dom,0,u.length)).getClientRects()}),a=e.children[i.i],l=r[i.i];return a.isText()?this.scanText(a,l):a.isComposite()?this.scanTile(a,l):i.after?new Ri(r[i.i+1],-1):new Ri(l,1)}}const no="";class MD{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(wt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=no}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let a=this.text.length;this.readNode(i);let l=on.get(i),c=i.nextSibling;if(c==n){l!=null&&l.breakAfter&&!c&&r!=this.view.contentDOM&&this.lineBreak();break}let u=on.get(c);(l&&u?l.breakAfter:(l?l.breakAfter:ed(i))||ed(c)&&(i.nodeName!="BR"||l!=null&&l.isWidget())&&this.text.length>a)&&!TD(c,n)&&this.lineBreak(),i=c}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,l=1,c;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(c=i.exec(n))&&(a=c.index,l=c[0].length),this.append(n.slice(r,a<0?n.length:a)),a<0)break;if(this.lineBreak(),l>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=l-1);r=a+l}}readNode(e){let n=on.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(CD(e,r.node,r.offset)?n:0))}}function CD(t,e,n){for(;;){if(!e||n<Ea(e))return!1;if(e==t)return!0;n=ws(e)+1,e=e.parentNode}}function TD(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=on.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class r3{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class ED{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:l}=e.docView,c=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=Mk(e.docView.tile,n,r,0))){let u=a||l?[]:jD(e),h=new MD(u,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=PD(u,this.bounds.from)}else{let u=e.observer.selectionRange,h=a&&a.node==u.focusNode&&a.offset==u.focusOffset||!Wg(e.contentDOM,u.focusNode)?c.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),p=l&&l.node==u.anchorNode&&l.offset==u.anchorOffset||!Wg(e.contentDOM,u.anchorNode)?c.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),O=e.viewport;if((Me.ios||Me.chrome)&&c.main.empty&&h!=p&&(O.from>0||O.to<e.state.doc.length)){let x=Math.min(h,p),y=Math.max(h,p),b=O.from-x,S=O.to-y;(b==0||b==1||x==0)&&(S==0||S==-1||y==e.state.doc.length)&&(h=0,p=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(ge.range(p,h));else if(e.lineWrapping&&p==h&&!(c.main.empty&&c.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let x=e.coordsAtPos(h,-1),y=0;x&&(y=e.inputState.lastTouchY<=x.bottom?-1:1),this.newSel=ge.create([ge.cursor(h,y)])}else this.newSel=ge.single(p,h)}}}function Mk(t,e,n,r){if(t.isComposite()){let i=-1,a=-1,l=-1,c=-1;for(let u=0,h=r,p=r;u<t.children.length;u++){let O=t.children[u],x=h+O.length;if(h<e&&x>n)return Mk(O,e,n,h);if(x>=e&&i==-1&&(i=u,a=h),h>n&&O.dom.parentNode==t.dom){l=u,c=p;break}p=x,h=x+O.breakAfter}return{from:a,to:c<0?r+t.length:c,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:l<t.children.length&&l>=0?t.children[l].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function Ck(t,e){let n,{newSel:r}=e,{state:i}=t,a=i.selection.main,l=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:u}=e.bounds,h=a.from,p=null;(l===8||Me.android&&e.text.length<u-c)&&(h=a.to,p="end");let O=i.doc.sliceString(c,u,no),x,y;!a.empty&&a.from>=c&&a.to<=u&&(e.typeOver||O!=e.text)&&O.slice(0,a.from-c)==e.text.slice(0,a.from-c)&&O.slice(a.to-c)==e.text.slice(x=e.text.length-(O.length-(a.to-c)))?n={from:a.from,to:a.to,insert:St.of(e.text.slice(a.from-c,x).split(no))}:(y=Tk(O,e.text,h-c,p))&&(Me.chrome&&l==13&&y.toB==y.from+2&&e.text.slice(y.from,y.toB)==no+no&&y.toB--,n={from:c+y.from,to:c+y.toA,insert:St.of(e.text.slice(y.from,y.toB).split(no))})}else r&&(!t.hasFocus&&i.facet(pa)||ad(r,a))&&(r=null);if(!n&&!r)return!1;if((Me.mac||Me.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:St.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(a.from).to<a.to&&t.docView.lineHasWidget(a.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(t.inputState.insertingText)}:Me.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
107
|
+
`&&t.lineWrapping&&(r&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:St.of([" "])}),n)return kO(t,n,r,l);if(r&&!ad(r,a)){let c=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(c=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(r=Ak(i.facet(c0).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:c,userEvent:u}),!0}else return!1}function kO(t,e,n,r=-1){if(Me.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Me.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Oo(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Oo(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Oo(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l,c=()=>l||(l=$D(t,e,n));return t.state.facet(hk).some(u=>u(t,e.from,e.to,a,c))||t.dispatch(c()),!0}function $D(t,e,n){let r,i=t.state,a=i.selection.main,l=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let u=e.from<a.from?-1:1,h=u<0?a.from:a.to,p=mu(i.facet(c0).map(O=>O(t)),h,u);e.from==p&&(l=p)}if(l>-1)r={changes:e,selection:ge.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=a.from<e.from?i.sliceDoc(a.from,e.from):"",h=a.to>e.to?i.sliceDoc(e.to,a.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let u=i.changes(e),h=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let p=t.state.sliceDoc(e.from,e.to),O,x=n&&kk(t,n.main.head);if(x){let b=e.insert.length-(e.to-e.from);O={from:x.from,to:x.to-b}}else O=t.state.doc.lineAt(a.head);let y=a.to-e.to;r=i.changeByRange(b=>{if(b.from==a.from&&b.to==a.to)return{changes:u,range:h||b.map(u)};let S=b.to-y,k=S-p.length;if(t.state.sliceDoc(k,S)!=p||S>=O.from&&k<=O.to)return{range:b};let A=i.changes({from:k,to:S,insert:e.insert}),C=b.to-a.to;return{changes:A,range:h?ge.range(Math.max(0,h.anchor+C),Math.max(0,h.head+C)):b.map(A)}})}else r={changes:u,selection:h&&i.selection.replaceRange(h)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:c,scrollIntoView:!0})}function Tk(t,e,n,r){let i=Math.min(t.length,e.length),a=0;for(;a<i&&t.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==i&&t.length==e.length)return null;let l=t.length,c=e.length;for(;l>0&&c>0&&t.charCodeAt(l-1)==e.charCodeAt(c-1);)l--,c--;if(r=="end"){let u=Math.max(0,a-Math.min(l,c));n-=l+u-a}if(l<a&&t.length<e.length){let u=n<=a&&n>=l?a-n:0;a-=u,c=a+(c-l),l=a}else if(c<a){let u=n<=a&&n>=c?a-n:0;a-=u,l=a+(l-c),c=a}return{from:a,toA:l,toB:c}}function jD(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=t.observer.selectionRange;return n&&(e.push(new r3(n,r)),(i!=n||a!=r)&&e.push(new r3(i,a))),e}function PD(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?ge.single(n+e,r+e):null}function ad(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class QD{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Me.safari&&e.contentDOM.addEventListener("input",()=>null),Me.gecko&&qD(e.contentDOM.ownerDocument)}handleEvent(e){!HD(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=ZD(e),r=this.handlers,i=this.view.contentDOM;for(let a in n)if(a!="scroll"){let l=!n[a].handlers.length,c=r[a];c&&l!=!c.handlers.length&&(i.removeEventListener(a,this.handleEvent),c=null),c||i.addEventListener(a,this.handleEvent,{passive:l})}for(let a in r)a!="scroll"&&!n[a]&&i.removeEventListener(a,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&$k.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Me.android&&Me.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Me.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=Ek.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||ND.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Oo(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Me.safari&&!Me.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function i3(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Li(n.state,i)}}}function ZD(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,a=i&&i.plugin.domEventHandlers,l=i&&i.plugin.domEventObservers;if(a)for(let c in a){let u=a[c];u&&n(c).handlers.push(i3(r.value,u))}if(l)for(let c in l){let u=l[c];u&&n(c).observers.push(i3(r.value,u))}}for(let r in yi)n(r).handlers.push(yi[r]);for(let r in br)n(r).observers.push(br[r]);return e}const Ek=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ND="dthko",$k=[16,17,18,20,91,92,224,225],G1=6;function U1(t){return Math.max(0,t)*.7+8}function RD(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class VD{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=J9(e.contentDOM),this.atoms=e.state.facet(c0).map(l=>l(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(wt.allowMultipleSelections)&&LD(e,n),this.dragging=DD(e,n)&&Qk(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&RD(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,a=0,l=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:c}=this.scrollParents.y.getBoundingClientRect());let u=Sk(this.view);e.clientX-u.left<=i+G1?n=-U1(i-e.clientX):e.clientX+u.right>=l-G1&&(n=U1(e.clientX-l)),e.clientY-u.top<=a+G1?r=-U1(a-e.clientY):e.clientY+u.bottom>=c-G1&&(r=U1(e.clientY-c)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=Ak(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function LD(t,e){let n=t.state.facet(ck);return n.length?n[0](e):Me.mac?e.metaKey:e.ctrlKey}function _D(t,e){let n=t.state.facet(uk);return n.length?n[0](e):Me.mac?!e.altKey:!e.ctrlKey}function DD(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Nu(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let a=0;a<i.length;a++){let l=i[a];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function HD(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=on.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const yi=Object.create(null),br=Object.create(null),jk=Me.ie&&Me.ie_version<15||Me.ios&&Me.webkit_version<604;function XD(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Pk(t,n.value)},50)}function Ud(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function Pk(t,e){e=Ud(t.state,bO,e);let{state:n}=t,r,i=1,a=n.toText(e),l=a.lines==n.selection.ranges.length;if(i8!=null&&n.selection.ranges.every(u=>u.empty)&&i8==a.toString()){let u=-1;r=n.changeByRange(h=>{let p=n.doc.lineAt(h.from);if(p.from==u)return{range:h};u=p.from;let O=n.toText((l?a.line(i++).text:e)+n.lineBreak);return{changes:{from:p.from,insert:O},range:ge.cursor(h.from+O.length)}})}else l?r=n.changeByRange(u=>{let h=a.line(i++);return{changes:{from:u.from,to:u.to,insert:h.text},range:ge.cursor(u.from+h.length)}}):r=n.replaceSelection(a);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}br.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};br.wheel=br.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};yi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);br.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};br.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};yi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(fk))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=FD(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new VD(t,e,n,r)),r&&t.observer.ignore(()=>{ek(t.contentDOM);let a=t.root.activeElement;a&&!a.contains(t.contentDOM)&&a.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function a3(t,e,n,r){if(r==1)return ge.cursor(e,n);if(r==2)return yD(t.state,e,n);{let i=t.docView.lineAt(e,n),a=t.state.doc.lineAt(i?i.posAtEnd:e),l=i?i.posAtStart:a.from,c=i?i.posAtEnd:a.to;return c<t.state.doc.length&&c==a.to&&c++,ge.range(l,c)}}const zD=Me.ie&&Me.ie_version<=11;let s3=null,l3=0,o3=0;function Qk(t){if(!zD)return t.detail;let e=s3,n=o3;return s3=t,o3=Date.now(),l3=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(l3+1)%3:1}function FD(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=Qk(e),i=t.state.selection;return{update(a){a.docChanged&&(n.pos=a.changes.mapPos(n.pos),i=i.map(a.changes))},get(a,l,c){let u=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),h,p=a3(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!l){let O=a3(t,n.pos,n.assoc,r),x=Math.min(O.from,p.from),y=Math.max(O.to,p.to);p=x<p.from?ge.range(x,y,p.assoc):ge.range(y,x,p.assoc)}return l?i.replaceRange(i.main.extend(p.from,p.to,p.assoc)):c&&r==1&&i.ranges.length>1&&(h=BD(i,u.pos))?h:c?i.addRange(p):ge.create([p])}}}function BD(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return ge.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}yi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let a=i.posAtStart,l=a+i.length;(a>=n.to||l<=n.from)&&(n=ge.range(a,l))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Ud(t.state,vO,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};yi.dragend=t=>(t.inputState.draggedContent=null,!1);function c3(t,e,n,r){if(n=Ud(t.state,bO,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,l=r&&a&&_D(t,e)?{from:a.from,to:a.to}:null,c={from:i,insert:n},u=t.state.changes(l?[l,c]:c);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),t.inputState.draggedContent=null}yi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&c3(t,e,r.filter(l=>l!=null).join(t.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let c=new FileReader;c.onerror=a,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[l]=c.result),a()},c.readAsText(n[l])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return c3(t,e,r,!0),!0}return!1};yi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=jk?null:e.clipboardData;return n?(Pk(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(XD(t),!1)};function YD(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function ID(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:a}of t.selection.ranges){let l=t.doc.lineAt(a);l.number>i&&(e.push(l.text),n.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),i=l.number}r=!0}return{text:Ud(t,vO,e.join(t.lineBreak)),ranges:n,linewise:r}}let i8=null;yi.copy=yi.cut=(t,e)=>{if(!du(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=ID(t.state);if(!n&&!i)return!1;i8=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=jk?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(YD(t,n),!1)};const Zk=Qa.define();function Nk(t,e){let n=[];for(let r of t.facet(mk)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:Zk.of(!0)}):null}function Rk(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Nk(t.state,e);n?t.dispatch(n):t.update([])}},10)}br.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Rk(t)};br.blur=t=>{t.observer.clearSelectionRange(),Rk(t)};br.compositionstart=br.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};br.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Me.chrome&&Me.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};br.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};yi.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let a=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),l=e.getTargetRanges();if(a&&l.length){let c=l[0],u=t.posAtDOM(c.startContainer,c.startOffset),h=t.posAtDOM(c.endContainer,c.endOffset);return kO(t,{from:u,to:h,insert:t.state.toText(a)},null),!0}}let i;if(Me.chrome&&Me.android&&(i=Ek.find(a=>a.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let a=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>a+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Me.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Me.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>br.compositionend(t,e),20),!1};const u3=new Set;function qD(t){u3.has(t)||(u3.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const f3=["pre-wrap","normal","pre-line","break-spaces"];let Zo=!1;function d3(){Zo=!1}class GD{constructor(e){this.lineWrapping=e,this.doc=St.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return f3.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,a,l){let c=f3.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=a,u){this.heightSamples={};for(let h=0;h<l.length;h++){let p=l[h];p<0?h++:this.heightSamples[Math.floor(p*10)]=!0}}return u}}class UD{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class pi{constructor(e,n,r,i,a){this.from=e,this.length=n,this.top=r,this.height=i,this._content=a}get type(){return typeof this._content=="number"?xr.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof cl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new pi(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Bt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Bt||(Bt={}));const Zf=.001;class rr{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Zf&&(Zo=!0),this.height=e)}replace(e,n,r){return rr.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let a=this,l=r.doc;for(let c=i.length-1;c>=0;c--){let{fromA:u,toA:h,fromB:p,toB:O}=i[c],x=a.lineAt(u,Bt.ByPosNoHeight,r.setDoc(n),0,0),y=x.to>=h?x:a.lineAt(h,Bt.ByPosNoHeight,r,0,0);for(O+=y.to-h,h=y.to;c>0&&x.from<=i[c-1].toA;)u=i[c-1].fromA,p=i[c-1].fromB,c--,u<x.from&&(x=a.lineAt(u,Bt.ByPosNoHeight,r,0,0));p+=x.from-u,u=x.from;let b=AO.build(r.setDoc(l),e,p,O);a=sd(a,a.replace(u,h,b))}return a.updateHeight(r,0)}static empty(){return new Nr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),r+=1+c.break,i-=c.size}else if(a>i*2){let c=e[r];c.break?e.splice(r,1,c.left,null,c.right):e.splice(r,1,c.left,c.right),r+=2+c.break,a-=c.size}else break;else if(i<a){let c=e[n++];c&&(i+=c.size)}else{let c=e[--r];c&&(a+=c.size)}let l=0;return e[n-1]==null?(l=1,n--):e[n]==null&&(l=1,r++),new KD(rr.of(e.slice(0,n)),l,rr.of(e.slice(r)))}}function sd(t,e){return t==e?t:(t.constructor!=e.constructor&&(Zo=!0),e)}rr.prototype.size=1;const WD=Je.replace({});class Vk extends rr{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new pi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new pi(i,0,r,this.spaceAbove,WD):this.mainBlock(r,i)}lineAt(e,n,r,i,a){let l=this.mainBlock(i,a);return this.spaceAbove?this.blockAt(0,r,i,a).join(l):l}forEachLine(e,n,r,i,a,l){e<=a+this.length&&n>=a&&l(this.lineAt(0,Bt.ByPos,r,i,a))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Nr extends Vk{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new pi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Nr||i instanceof Hn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Hn?i=new Nr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):rr.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Hn extends rr{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,a=i-r+1,l,c=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*a);l=u/a,this.length>a+1&&(c=(this.height-u)/(this.length-a-1))}else l=this.height/a;return{firstLine:r,lastLine:i,perLine:l,perChar:c}}blockAt(e,n,r,i){let{firstLine:a,lastLine:l,perLine:c,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let h=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),p=n.doc.lineAt(h),O=c+p.length*u,x=Math.max(r,e-O/2);return new pi(p.from,p.length,x,O,0)}else{let h=Math.max(0,Math.min(l-a,Math.floor((e-r)/c))),{from:p,length:O}=n.doc.line(a+h);return new pi(p,O,r+c*h,c,0)}}lineAt(e,n,r,i,a){if(n==Bt.ByHeight)return this.blockAt(e,r,i,a);if(n==Bt.ByPosNoHeight){let{from:y,to:b}=r.doc.lineAt(e);return new pi(y,b-y,0,0,0)}let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(r,a),h=r.doc.lineAt(e),p=c+h.length*u,O=h.number-l,x=i+c*O+u*(h.from-a-O);return new pi(h.from,h.length,Math.max(i,Math.min(x,i+this.height-p)),p,0)}forEachLine(e,n,r,i,a,l){e=Math.max(e,a),n=Math.min(n,a+this.length);let{firstLine:c,perLine:u,perChar:h}=this.heightMetrics(r,a);for(let p=e,O=i;p<=n;){let x=r.doc.lineAt(p);if(p==e){let b=x.number-c;O+=u*b+h*(e-a-b)}let y=u+h*x.length;l(new pi(x.from,x.length,O,y,0)),O+=y,p=x.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let a=r[r.length-1];a instanceof Hn?r[r.length-1]=new Hn(a.length+i):r.push(null,new Hn(i-1))}if(e>0){let a=r[0];a instanceof Hn?r[0]=new Hn(e+a.length):r.unshift(new Hn(e-1),null)}return rr.of(r)}decomposeLeft(e,n){n.push(new Hn(e-1),null)}decomposeRight(e,n){n.push(null,new Hn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let l=[],c=Math.max(n,i.from),u=-1;for(i.from>n&&l.push(new Hn(i.from-n-1).updateHeight(e,n));c<=a&&i.more;){let p=e.doc.lineAt(c).length;l.length&&l.push(null);let O=i.heights[i.index++],x=0;O<0&&(x=-O,O=i.heights[i.index++]),u==-1?u=O:Math.abs(O-u)>=Zf&&(u=-2);let y=new Nr(p,O,x);y.outdated=!1,l.push(y),c+=p+1}c<=a&&l.push(null,new Hn(a-c).updateHeight(e,c));let h=rr.of(l);return(u<0||Math.abs(h.height-this.height)>=Zf||Math.abs(u-this.heightMetrics(e,n).perLine)>=Zf)&&(Zo=!0),sd(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class KD extends rr{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let a=r+this.left.height;return e<a?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,a,i+this.left.length+this.break)}lineAt(e,n,r,i,a){let l=i+this.left.height,c=a+this.left.length+this.break,u=n==Bt.ByHeight?e<l:e<c,h=u?this.left.lineAt(e,n,r,i,a):this.right.lineAt(e,n,r,l,c);if(this.break||(u?h.to<c:h.from>c))return h;let p=n==Bt.ByPosNoHeight?Bt.ByPosNoHeight:Bt.ByPos;return u?h.join(this.right.lineAt(c,p,r,l,c)):this.left.lineAt(c,p,r,i,a).join(h)}forEachLine(e,n,r,i,a,l){let c=i+this.left.height,u=a+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,a,l),n>=u&&this.right.forEachLine(e,n,r,c,u,l);else{let h=this.lineAt(u,Bt.ByPos,r,i,a);e<h.from&&this.left.forEachLine(e,h.from-1,r,i,a,l),h.to>=e&&h.from<=n&&l(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,c,u,l)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let a=[];e>0&&this.decomposeLeft(e,a);let l=a.length;for(let c of r)a.push(c);if(e>0&&h3(a,l-1),n<this.length){let c=a.length;this.decomposeRight(n,a),h3(a,c)}return rr.of(a)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?rr.of(this.break?[e,null,n]:[e,n]):(this.left=sd(this.left,e),this.right=sd(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:a,right:l}=this,c=n+a.length+this.break,u=null;return i&&i.from<=n+a.length&&i.more?u=a=a.updateHeight(e,n,r,i):a.updateHeight(e,n,r),i&&i.from<=c+l.length&&i.more?u=l=l.updateHeight(e,c,r,i):l.updateHeight(e,c,r),u?this.balanced(a,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function h3(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Hn&&(r=t[e+1])instanceof Hn&&t.splice(e-1,3,new Hn(n.length+1+r.length))}const JD=5;class AO{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Nr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Nr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,a=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let l=n-e;r.block?this.addBlock(new Vk(l,i,r)):(l||a||i>=JD)&&this.addLineDeco(i,a,l)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Nr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new Hn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Nr)return e;let n=new Nr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Nr)&&!this.isCovered?this.nodes.push(new Nr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Nr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let a=new AO(r,e);return mt.spans(n,r,i,a,0),a.finish(r)}}function eH(t,e,n){let r=new tH;return mt.compare(t,e,n,r,0),r.changes}class tH{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&go(e,n,this.changes,5)}}function nH(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),l=Math.min(i.innerWidth,n.right),c=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let p=h,O=window.getComputedStyle(p);if((p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth)&&O.overflow!="visible"){let x=p.getBoundingClientRect();a=Math.max(a,x.left),l=Math.min(l,x.right),c=Math.max(c,x.top),u=Math.min(h==t.parentNode?i.innerHeight:u,x.bottom)}h=O.position=="absolute"||O.position=="fixed"?p.offsetParent:p.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:a-n.left,right:Math.max(a,l)-n.left,top:c-(n.top+e),bottom:Math.max(c,u)-(n.top+e)}}function rH(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function iH(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class n2{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=n[r];if(i.from!=a.from||i.to!=a.to||i.size!=a.size)return!1}return!0}draw(e,n){return Je.replace({widget:new aH(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class aH extends pl{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class m3{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=p3,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(SO).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new GD(r),this.stateDeco=g3(n),this.heightMap=rr.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle.setDoc(n.doc),[new Ur(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Je.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:a,to:l})=>i>=a&&i<=l)){let{from:a,to:l}=this.lineBlockAt(i);e.push(new W1(a,l))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?p3:new MO(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(nu(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=g3(this.state);let i=e.changedRanges,a=Ur.extendWithRanges(i,eH(r,this.stateDeco,e?e.changes:Mn.empty(this.state.doc.length))),l=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);d3(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||Zo)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let u=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let h=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(U_)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,a=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?hn.RTL:hn.LTR;let l=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",c=n.getBoundingClientRect(),u=l||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let h=0,p=0;if(c.width&&c.height){let{scaleX:M,scaleY:E}=K9(n,c);(M>.005&&Math.abs(this.scaleX-M)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=M,this.scaleY=E,h|=16,l=u=!0)}let O=(parseInt(r.paddingTop)||0)*this.scaleY,x=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=x)&&(this.paddingTop=O,this.paddingBottom=x,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let y=J9(this.view.contentDOM,!1).y;y!=this.scrollParent&&(this.scrollParent=y,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=tk(this.scrollParent||e.win);let S=(this.printing?iH:nH)(n,this.paddingTop),k=S.top-this.pixelViewport.top,A=S.bottom-this.pixelViewport.bottom;this.pixelViewport=S;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(u=!0)),!this.inView&&!this.scrollTarget&&!rH(e.dom))return 0;let T=c.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),u){let M=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(M)&&(l=!0),l||i.lineWrapping&&Math.abs(T-this.contentDOMWidth)>i.charWidth){let{lineHeight:E,charWidth:$,textHeight:N}=e.docView.measureTextSize();l=E>0&&i.refresh(a,E,$,N,Math.max(5,T/$),M),l&&(e.docView.minWidth=0,h|=16)}k>0&&A>0?p=Math.max(k,A):k<0&&A<0&&(p=Math.min(k,A)),d3();for(let E of this.viewports){let $=E.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(E);this.heightMap=(l?rr.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle,[new Ur(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new UD(E.from,$))}Zo&&(h|=2)}let j=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return j&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),h|=this.updateForViewport()),(h&2||j)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,a=this.heightOracle,{visibleTop:l,visibleBottom:c}=this,u=new W1(i.lineAt(l-r*1e3,Bt.ByHeight,a,0,0).from,i.lineAt(c+(1-r)*1e3,Bt.ByHeight,a,0,0).to);if(n){let{head:h}=n.range;if(h<u.from||h>u.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=i.lineAt(h,Bt.ByPos,a,0,0),x;n.y=="center"?x=(O.top+O.bottom)/2-p/2:n.y=="start"||n.y=="nearest"&&h<u.from?x=O.top:x=O.bottom-p,u=new W1(i.lineAt(x-1e3/2,Bt.ByHeight,a,0,0).from,i.lineAt(x+p+1e3/2,Bt.ByHeight,a,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new W1(this.heightMap.lineAt(r,Bt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Bt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Bt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,Bt.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:c}=this;return(e==0||i<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=c+Math.max(10,Math.min(r,250)))&&i>l-2*1e3&&a<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new n2(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,a=i>>1,l=i<<1;if(this.defaultTextDirection!=hn.LTR&&!r)return[];let c=[],u=(p,O,x,y)=>{if(O-p<a)return;let b=this.state.selection.main,S=[b.from];b.empty||S.push(b.to);for(let A of S)if(A>p&&A<O){u(p,A-10,x,y),u(A+10,O,x,y);return}let k=lH(e,A=>A.from>=x.from&&A.to<=x.to&&Math.abs(A.from-p)<a&&Math.abs(A.to-O)<a&&!S.some(C=>A.from<C&&A.to>C));if(!k){if(O<x.to&&n&&r&&n.visibleRanges.some(T=>T.from<=O&&T.to>=O)){let T=n.moveToLineBoundary(ge.cursor(O),!1,!0).head;T>p&&(O=T)}let A=this.gapSize(x,p,O,y),C=r||A<2e6?A:2e6;k=new n2(p,O,A,C)}c.push(k)},h=p=>{if(p.length<l||p.type!=xr.Text)return;let O=sH(p.from,p.to,this.stateDeco);if(O.total<l)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,y,b;if(r){let S=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,A;if(x!=null){let C=J1(O,x),T=((this.visibleBottom-this.visibleTop)/2+S)/p.height;k=C-T,A=C+T}else k=(this.visibleTop-p.top-S)/p.height,A=(this.visibleBottom-p.top+S)/p.height;y=K1(O,k),b=K1(O,A)}else{let S=O.total*this.heightOracle.charWidth,k=i*this.heightOracle.charWidth,A=0;if(S>2e6)for(let E of e)E.from>=p.from&&E.from<p.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=E.size-E.displaySize);let C=this.pixelViewport.left+A,T=this.pixelViewport.right+A,j,M;if(x!=null){let E=J1(O,x),$=((T-C)/2+k)/S;j=E-$,M=E+$}else j=(C-k)/S,M=(T+k)/S;y=K1(O,j),b=K1(O,M)}y>p.from&&u(p.from,y,p,O),b<p.to&&u(b,p.to,p,O)};for(let p of this.viewportLines)Array.isArray(p.type)?p.type.forEach(h):h(p);return c}gapSize(e,n,r,i){let a=J1(i,r)-J1(i,n);return this.heightOracle.lineWrapping?e.height*a:i.total*this.heightOracle.charWidth*a}updateLineGaps(e){n2.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Je.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];mt.spans(n,this.viewport.from,this.viewport.to,{span(a,l){r.push({from:a,to:l})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let a=0;a<r.length&&!(i&8);a++){let l=this.visibleRanges[a],c=r[a];(l.from!=c.from||l.to!=c.to)&&(i|=4,e&&e.mapPos(l.from,-1)==c.from&&e.mapPos(l.to,1)==c.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||nu(this.heightMap.lineAt(e,Bt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||nu(this.heightMap.lineAt(this.scaler.fromDOM(e),Bt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return nu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class W1{constructor(e,n){this.from=e,this.to=n}}function sH(t,e,n){let r=[],i=t,a=0;return mt.spans(n,t,e,{span(){},point(l,c){l>i&&(r.push({from:i,to:l}),a+=l-i),i=c}},20),i<e&&(r.push({from:i,to:e}),a+=e-i),{total:a,ranges:r}}function K1({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:a,to:l}=e[i],c=l-a;if(r<=c)return a+r;r-=c}}function J1(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function lH(t,e){for(let n of t)if(e(n))return n}const p3={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function g3(t){let e=t.facet(Id).filter(r=>typeof r!="function"),n=t.facet(wO).filter(r=>typeof r!="function");return n.length&&e.push(mt.join(n)),e}class MO{constructor(e,n,r){let i=0,a=0,l=0;this.viewports=r.map(({from:c,to:u})=>{let h=n.lineAt(c,Bt.ByPos,e,0,0).top,p=n.lineAt(u,Bt.ByPos,e,0,0).bottom;return i+=p-h,{from:c,to:u,top:h,bottom:p,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let c of this.viewports)c.domTop=l+(c.top-a)*this.scale,l=c.domBottom=c.domTop+(c.bottom-c.top),a=c.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.top)return i+(e-r)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);r=a.bottom,i=a.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.domTop)return r+(e-i)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);r=a.bottom,i=a.domBottom}}eq(e){return e instanceof MO?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function nu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new pi(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>nu(i,e)):t._content)}const ef=je.define({combine:t=>t.join(" ")}),a8=je.define({combine:t=>t.indexOf(!0)>-1}),s8=vs.newName(),Lk=vs.newName(),_k=vs.newName(),Dk={"&light":"."+Lk,"&dark":"."+_k};function l8(t,e,n){return new vs(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const oH=l8("."+s8,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Dk),cH={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},r2=Me.ie&&Me.ie_version<=11;class uH{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new L_,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Me.ie&&Me.ie_version<=11||Me.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Me.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Me.chrome&&Me.chrome_version<126)&&(this.editContext=new dH(e),e.state.facet(pa)&&(e.contentDOM.editContext=this.editContext.editContext)),r2&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(pa)?r.root.activeElement!=this.dom:!du(this.dom,i))return;let a=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Me.ie&&Me.ie_version<=11||Me.android&&Me.chrome)&&!r.state.selection.main.empty&&i.focusNode&&hu(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Nu(e.root);if(!n)return!1;let r=Me.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&fH(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=du(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&D_(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,cH),r2&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),r2&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&Oo(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let a of e){let l=this.readMutation(a);l&&(l.typeOver&&(i=!0),n==-1?{from:n,to:r}=l:(n=Math.min(l.from,n),r=Math.max(l.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&du(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new ED(this.view,e,n,r);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Ck(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!ad(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=O3(n,e.previousSibling||e.target.previousSibling,-1),i=O3(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(pa)!=e.state.facet(pa)&&(e.view.contentDOM.editContext=e.state.facet(pa)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function O3(t,e,n){for(;e;){let r=on.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function x3(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,a=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor,1);return hu(l.node,l.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function fH(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return x3(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?x3(t,n):null}class dH{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:a,head:l}=i,c=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:c,drifted:!1});let h=u-c>r.text.length;c==this.from&&a<this.from?c=a:u==this.to&&a>this.to&&(u=a);let p=Tk(e.state.sliceDoc(c,u),r.text,(h?i.from:i.to)-c,h?"end":null);if(!p){let x=ge.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ad(x,i)||e.dispatch({selection:x,userEvent:"select"});return}let O={from:p.from+c,to:p.toA+c,insert:St.of(r.text.slice(p.from,p.toB).split(`
|
|
108
|
+
`))};if((Me.mac||Me.android)&&O.from==l-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:c,to:u,insert:St.of([r.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let x=this.to-this.from+(O.to-O.from+O.insert.length);kO(e,O,ge.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),O.from<O.to&&!O.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],a=null;for(let l=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);l<c;l++){let u=e.coordsForChar(l);a=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||a||new DOMRect,i.push(a)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let a of r.getTextFormats()){let l=a.underlineStyle,c=a.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(c)){let u=this.toEditorPos(a.rangeStart),h=this.toEditorPos(a.rangeEnd);if(u<h){let p=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;i.push(Je.mark({attributes:{style:p}}).range(u,h))}}}e.dispatch({effects:Ok.of(Je.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Nu(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((a,l,c,u,h)=>{if(r)return;let p=h.length-(l-a);if(i&&l>=i.to)if(i.from==a&&i.to==l&&i.insert.eq(h)){i=this.pendingContextChange=null,n+=p,this.to+=p;return}else i=null,this.revertPending(e.state);if(a+=n,l+=n,l<=this.from)this.from+=p,this.to+=p;else if(a<this.to){if(a<this.from||l>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(l),h.toString()),this.to+=p}n+=p}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ee{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(a=>r(a,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||__(e.parent)||document,this.viewState=new m3(this,e.state||wt.create(e)),e.scrollTo&&e.scrollTo.is(q1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(lo).map(i=>new Wp(i));for(let i of this.plugins)i.update(this);this.observer=new uH(this),this.inputState=new QD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new t3(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof vn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,a=this.state;for(let x of e){if(x.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=x.state}if(this.destroyed){this.viewState.state=a;return}let l=this.hasFocus,c=0,u=null;e.some(x=>x.annotation(Zk))?(this.inputState.notifiedFocused=l,c=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,u=Nk(a,l),u||(c=1));let h=this.observer.delayedAndroidKey,p=null;if(h?(this.observer.clearDelayedAndroidKey(),p=this.observer.readChange(),(p&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(p=null)):this.observer.clear(),a.facet(wt.phrases)!=this.state.facet(wt.phrases))return this.setState(a);i=nd.create(this,a,e),i.flags|=c;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(O&&(O=O.map(x.changes)),x.scrollIntoView){let{main:y}=x.state.selection;O=new xo(y.empty?y:ge.cursor(y.head,y.head>y.anchor?-1:1))}for(let y of x.effects)y.is(q1)&&(O=y.value.clip(this.state))}this.viewState.update(i,O),this.bidiCache=ld.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(tu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(ef)!=i.state.facet(ef)&&(this.viewState.mustMeasureContent=!0),(n||r||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let x of this.state.facet(t8))try{x(i)}catch(y){Li(this.state,y,"update listener")}(u||p)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),p&&!Ck(this,p)&&h.force&&Oo(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new m3(this,e),this.plugins=e.facet(lo).map(r=>new Wp(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new t3(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(lo),r=e.state.facet(lo);if(n!=r){let i=[];for(let a of r){let l=n.indexOf(a);if(l<0)i.push(new Wp(a));else{let c=this.plugins[l];c.mustUpdate=e,i.push(c)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Li(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(l<0)if(tk(r||this.win))a=-1,l=this.viewState.heightMap.height;else{let y=this.viewState.scrollAnchorAt(i);a=y.from,l=y.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];u&4||([this.measureRequests,h]=[h,this.measureRequests]);let p=h.map(y=>{try{return y.read(this)}catch(b){return Li(this.state,b),y3}}),O=nd.create(this,this.state,[]),x=!1;O.flags|=u,n?n.flags|=u:n=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),x=this.docView.update(O),x&&this.docViewUpdate());for(let y=0;y<h.length;y++)if(p[y]!=y3)try{let b=h[y];b.write&&b.write(p[y],this)}catch(b){Li(this.state,b)}if(x&&this.docView.updateSelection(!0),!O.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let b=((a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-l)/this.scaleY;if((b>1||b<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+b,r?r.scrollTop+=b:this.win.scrollBy(0,b),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(t8))c(n)}get themeClasses(){return s8+" "+(this.state.facet(a8)?_k:Lk)+" "+this.state.facet(ef)}updateAttrs(){let e=b3(this,xk,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(pa)?"true":"false",class:"cm-content",style:`${Me.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),b3(this,SO,n);let r=this.observer.ignore(()=>{let i=Gb(this.contentDOM,this.contentAttrs,n),a=Gb(this.dom,this.editorAttrs,e);return i||a});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Ee.announce)){n&&(this.announceDOM.textContent=""),n=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(tu);let e=this.state.facet(Ee.cspNonce);vs.mount(this.root,this.styleModules.concat(oH).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return t2(this,e,n3(this,e,n,r))}moveByGroup(e,n){return t2(this,e,n3(this,e,n,r=>wD(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),a=r[n?r.length-1:0];return ge.cursor(a.side(n,i)+e.from,a.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return SD(this,e,n,r)}moveVertically(e,n,r){return t2(this,e,kD(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=r8(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),r8(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),a=this.bidiSpans(i),l=a[Vi.find(a,e-i.from,-1,n)];return td(r,l.dir==hn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(pk)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hH)return lk(e.length);let n=this.textDirectionAt(e.from),r;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==n&&(a.fresh||sk(a.isolates,r=Kb(this,e))))return a.order;r||(r=Kb(this,e));let i=I_(e.text,n,r);return this.bidiCache.push(new ld(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Me.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ek(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return q1.of(new xo(typeof e=="number"?ge.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return q1.of(new xo(ge.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return yr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return yr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=vs.newName(),i=[ef.of(r),tu.of(l8(`.${r}`,e))];return n&&n.dark&&i.push(a8.of(!0)),i}static baseTheme(e){return s0.lowest(tu.of(l8("."+s8,e,Dk)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&on.get(r)||on.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}Ee.styleModule=tu;Ee.inputHandler=hk;Ee.clipboardInputFilter=bO;Ee.clipboardOutputFilter=vO;Ee.scrollHandler=gk;Ee.focusChangeEffect=mk;Ee.perLineTextDirection=pk;Ee.exceptionSink=dk;Ee.updateListener=t8;Ee.editable=pa;Ee.mouseSelectionStyle=fk;Ee.dragMovesSelection=uk;Ee.clickAddsSelectionRange=ck;Ee.decorations=Id;Ee.blockWrappers=yk;Ee.outerDecorations=wO;Ee.atomicRanges=c0;Ee.bidiIsolatedRanges=bk;Ee.scrollMargins=vk;Ee.darkTheme=a8;Ee.cspNonce=je.define({combine:t=>t.length?t[0]:""});Ee.contentAttributes=SO;Ee.editorAttributes=xk;Ee.lineWrapping=Ee.contentAttributes.of({class:"cm-lineWrapping"});Ee.announce=At.define();const hH=4096,y3={};class ld{constructor(e,n,r,i,a,l){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=a,this.order=l}static update(e,n){if(n.empty&&!e.some(a=>a.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:hn.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let l=e[a];l.dir==i&&!n.touchesRange(l.from,l.to)&&r.push(new ld(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function b3(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let a=r[i],l=typeof a=="function"?a(t):a;l&&OO(l,n)}return n}const mH=Me.mac?"mac":Me.windows?"win":Me.linux?"linux":"key";function pH(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,a,l,c;for(let u=0;u<n.length-1;++u){const h=n[u];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))a=!0;else if(/^s(hift)?$/i.test(h))l=!0;else if(/^mod$/i.test(h))e=="mac"?c=!0:a=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(r="Alt-"+r),a&&(r="Ctrl-"+r),c&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function tf(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const gH=s0.default(Ee.domEventHandlers({keydown(t,e){return Xk(Hk(e.state),t,e,"editor")}})),CO=je.define({enables:gH}),v3=new WeakMap;function Hk(t){let e=t.facet(CO),n=v3.get(e);return n||v3.set(e,n=yH(e.reduce((r,i)=>r.concat(i),[]))),n}function OH(t,e,n){return Xk(Hk(t.state),e,t,n)}let fs=null;const xH=4e3;function yH(t,e=mH){let n=Object.create(null),r=Object.create(null),i=(l,c)=>{let u=r[l];if(u==null)r[l]=c;else if(u!=c)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},a=(l,c,u,h,p)=>{var O,x;let y=n[l]||(n[l]=Object.create(null)),b=c.split(/ (?!$)/).map(A=>pH(A,e));for(let A=1;A<b.length;A++){let C=b.slice(0,A).join(" ");i(C,!0),y[C]||(y[C]={preventDefault:!0,stopPropagation:!1,run:[T=>{let j=fs={view:T,prefix:C,scope:l};return setTimeout(()=>{fs==j&&(fs=null)},xH),!0}]})}let S=b.join(" ");i(S,!1);let k=y[S]||(y[S]={preventDefault:!1,stopPropagation:!1,run:((x=(O=y._any)===null||O===void 0?void 0:O.run)===null||x===void 0?void 0:x.slice())||[]});u&&k.run.push(u),h&&(k.preventDefault=!0),p&&(k.stopPropagation=!0)};for(let l of t){let c=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of c){let p=n[h]||(n[h]=Object.create(null));p._any||(p._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:O}=l;for(let x in p)p[x].run.push(y=>O(y,o8))}let u=l[e]||l.key;if(u)for(let h of c)a(h,u,l.run,l.preventDefault,l.stopPropagation),l.shift&&a(h,"Shift-"+u,l.shift,l.preventDefault,l.stopPropagation)}return n}let o8=null;function Xk(t,e,n,r){o8=e;let i=j_(e),a=ml(i,0),l=a0(a)==i.length&&i!=" ",c="",u=!1,h=!1,p=!1;fs&&fs.view==n&&fs.scope==r&&(c=fs.prefix+" ",$k.indexOf(e.keyCode)<0&&(h=!0,fs=null));let O=new Set,x=k=>{if(k){for(let A of k.run)if(!O.has(A)&&(O.add(A),A(n)))return k.stopPropagation&&(p=!0),!0;k.preventDefault&&(k.stopPropagation&&(p=!0),h=!0)}return!1},y=t[r],b,S;return y&&(x(y[c+tf(i,e,!l)])?u=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Me.windows&&e.ctrlKey&&e.altKey)&&!(Me.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=Ss[e.keyCode])&&b!=i?(x(y[c+tf(b,e,!0)])||e.shiftKey&&(S=Qu[e.keyCode])!=i&&S!=b&&x(y[c+tf(S,e,!1)]))&&(u=!0):l&&e.shiftKey&&x(y[c+tf(i,e,!0)])&&(u=!0),!u&&x(y._any)&&(u=!0)),h&&(u=!0),u&&p&&e.stopPropagation(),o8=null,u}function bH(){return SH}const vH=Je.line({class:"cm-activeLine"}),SH=yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(vH.range(i.from)),e=i.from)}return Je.set(n)}},{decorations:t=>t.decorations}),S3=je.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function zk(t,e){let n=t.plugin(Fk),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Fk=yr.fromClass(class{constructor(t){this.input=t.state.facet(od),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(S3);this.top=new nf(t,!0,e.topContainer),this.bottom=new nf(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(S3);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new nf(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new nf(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(od);if(n!=this.input){let r=n.filter(u=>u),i=[],a=[],l=[],c=[];for(let u of r){let h=this.specs.indexOf(u),p;h<0?(p=u(t.view),c.push(p)):(p=this.panels[h],p.update&&p.update(t)),i.push(p),(p.top?a:l).push(p)}this.specs=r,this.panels=i,this.top.sync(a),this.bottom.sync(l);for(let u of c)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ee.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class nf{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=w3(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=w3(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function w3(t){let e=t.nextSibling;return t.remove(),e}const od=je.define({enables:Fk});function wH(t,e){let n,r=new Promise(l=>n=l),i=l=>kH(l,e,n);t.state.field(i2,!1)?t.dispatch({effects:Bk.of(i)}):t.dispatch({effects:At.appendConfig.of(i2.init(()=>[i]))});let a=Yk.of(i);return{close:a,result:r.then(l=>((t.win.queueMicrotask||(u=>t.win.setTimeout(u,10)))(()=>{t.state.field(i2).indexOf(i)>-1&&t.dispatch({effects:a})}),l))}}const i2=Lr.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(Bk)?t=[n.value].concat(t):n.is(Yk)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>od.computeN([t],e=>e.field(t))}),Bk=At.define(),Yk=At.define();function kH(t,e,n){let r=e.content?e.content(t,()=>l(null)):null;if(!r){if(r=jn("form"),e.input){let c=jn("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),r.appendChild(jn("label",(e.label||"")+": ",c))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(jn("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let c=0;c<i.length;c++){let u=i[c];u.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),l(null)):h.keyCode==13&&(h.preventDefault(),l(u))}),u.addEventListener("submit",h=>{h.preventDefault(),l(u)})}let a=jn("div",r,jn("button",{onclick:()=>l(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function l(c){a.contains(a.ownerDocument.activeElement)&&t.focus(),n(c)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=r.querySelector(e.focus):c=r.querySelector("input")||r.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class $a extends bs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}$a.prototype.elementClass="";$a.prototype.toDOM=void 0;$a.prototype.mapMode=Gn.TrackBefore;$a.prototype.startSide=$a.prototype.endSide=-1;$a.prototype.point=!0;const Nf=je.define(),AH=je.define(),MH={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>mt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},pu=je.define();function CH(t){return[Ik(),pu.of({...MH,...t})]}const k3=je.define({combine:t=>t.some(e=>e)});function Ik(t){return[TH]}const TH=yr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(pu).map(e=>new M3(t,e)),this.fixed=!t.state.facet(k3);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(k3)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=mt.iter(this.view.state.facet(Nf),this.view.viewport.from),r=[],i=this.gutters.map(a=>new EH(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(a.type)){let l=!0;for(let c of a.type)if(c.type==xr.Text&&l){c8(n,r,c.from);for(let u of i)u.line(this.view,c,r);l=!1}else if(c.widget)for(let u of i)u.widget(this.view,c)}else if(a.type==xr.Text){c8(n,r,a.from);for(let l of i)l.line(this.view,a,r)}else if(a.widget)for(let l of i)l.widget(this.view,a);for(let a of i)a.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(pu),n=t.state.facet(pu),r=t.docChanged||t.heightChanged||t.viewportChanged||!mt.eq(t.startState.facet(Nf),t.state.facet(Nf),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let a of n){let l=e.indexOf(a);l<0?i.push(new M3(this.view,a)):(this.gutters[l].update(t),i.push(this.gutters[l]))}for(let a of this.gutters)a.dom.remove(),i.indexOf(a)<0&&a.destroy();for(let a of i)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ee.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==hn.LTR?{left:r,right:i}:{right:r,left:i}})});function A3(t){return Array.isArray(t)?t:[t]}function c8(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class EH{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=mt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,a=(n.top-this.height)/e.scaleY,l=n.height/e.scaleY;if(this.i==i.elements.length){let c=new qk(e,l,a,r);i.elements.push(c),i.dom.appendChild(c.dom)}else i.elements[this.i].update(e,l,a,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];c8(this.cursor,i,n.from),r.length&&(i=i.concat(r));let a=this.gutter.config.lineMarker(e,n,i);a&&i.unshift(a);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let a of e.state.facet(AH)){let l=a(e,n.widget,n);l&&(i||(i=[])).push(l)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class M3{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let a=i.target,l;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let u=a.getBoundingClientRect();l=(u.top+u.bottom)/2}else l=i.clientY;let c=e.lineBlockAtHeight(l-e.documentTop);n.domEventHandlers[r](e,c,i)&&i.preventDefault()});this.markers=A3(n.markers(e)),n.initialSpacer&&(this.spacer=new qk(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=A3(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!mt.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class qk{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),$H(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let a=0,l=0;;){let c=l,u=a<n.length?n[a++]:null,h=!1;if(u){let p=u.elementClass;p&&(r+=" "+p);for(let O=l;O<this.markers.length;O++)if(this.markers[O].compare(u)){c=O,h=!0;break}}else c=this.markers.length;for(;l<c;){let p=this.markers[l++];if(p.toDOM){p.destroy(i);let O=i.nextSibling;i.remove(),i=O}}if(!u)break;u.toDOM&&(h?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),h&&l++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function $H(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const jH=je.define(),PH=je.define(),oo=je.define({combine(t){return Bo(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let a=r[i],l=n[i];r[i]=a?(c,u,h)=>a(c,u,h)||l(c,u,h):l}return r}})}});class a2 extends $a{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function s2(t,e){return t.state.facet(oo).formatNumber(e,t.state)}const QH=pu.compute([oo],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jH)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new a2(s2(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(PH)){let a=i(e,n,r);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(oo)!=e.state.facet(oo),initialSpacer(e){return new a2(s2(e,C3(e.state.doc.lines)))},updateSpacer(e,n){let r=s2(n.view,C3(n.view.state.doc.lines));return r==e.number?e:new a2(r)},domEventHandlers:t.facet(oo).domEventHandlers,side:"before"}));function ZH(t={}){return[oo.of(t),Ik(),QH]}function C3(t){let e=9;for(;e<t;)e=e*10+9;return e}const NH=new class extends $a{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},RH=Nf.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(NH.range(i)))}return mt.of(e)});function VH(){return RH}const Gk=1024;let LH=0;class Wr{constructor(e,n){this.from=e,this.to=n}}class st{constructor(e={}){this.id=LH++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ir.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}st.closedBy=new st({deserialize:t=>t.split(" ")});st.openedBy=new st({deserialize:t=>t.split(" ")});st.group=new st({deserialize:t=>t.split(" ")});st.isolate=new st({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});st.contextHash=new st({perNode:!0});st.lookAhead=new st({perNode:!0});st.mounted=new st({perNode:!0});class yo{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[st.mounted.id]}}const _H=Object.create(null);class ir{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):_H,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new ir(e.name||"",n,e.id,r);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(st.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(st.group),a=-1;a<(i?i.length:0);a++){let l=n[a<0?r.name:i[a]];if(l)return l}}}}ir.none=new ir("",Object.create(null),0,8);class TO{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let a of e){let l=a(r);if(l){i||(i=Object.assign({},r.props));let c=l[1],u=l[0];u.combine&&u.id in i&&(c=u.combine(i[u.id],c)),i[u.id]=c}}n.push(i?new ir(r.name,i,r.id,r.flags):r)}return new TO(n)}}const rf=new WeakMap,T3=new WeakMap;var Pt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Pt||(Pt={}));class tn{constructor(e,n,r,i,a){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,a&&a.length){this.props=Object.create(null);for(let[l,c]of a)this.props[typeof l=="number"?l:l.id]=c}}toString(){let e=yo.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new cd(this.topNode,e)}cursorAt(e,n=0,r=0){let i=rf.get(this)||this.topNode,a=new cd(i);return a.moveTo(e,n),rf.set(this,a._tree),a}get topNode(){return new Wn(this,0,0,null)}resolve(e,n=0){let r=Vu(rf.get(this)||this.topNode,e,n,!1);return rf.set(this,r),r}resolveInner(e,n=0){let r=Vu(T3.get(this)||this.topNode,e,n,!0);return T3.set(this,r),r}resolveStack(e,n=0){return XH(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:a=this.length}=e,l=e.mode||0,c=(l&Pt.IncludeAnonymous)>0;for(let u=this.cursor(l|Pt.IncludeAnonymous);;){let h=!1;if(u.from<=a&&u.to>=i&&(!c&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;h=!0}for(;h&&r&&(c||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:jO(ir.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new tn(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new tn(ir.none,n,r,i)))}static build(e){return zH(e)}}tn.empty=new tn(ir.none,[],[],0);class EO{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new EO(this.buffer,this.index)}}class ks{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ir.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],a=i.name;if(/\W/.test(a)&&!i.isError&&(a=JSON.stringify(a)),e+=4,r==e)return a;let l=[];for(;e<r;)l.push(this.childString(e)),e=this.buffer[e+3];return a+"("+l.join(",")+")"}findChild(e,n,r,i,a){let{buffer:l}=this,c=-1;for(let u=e;u!=n&&!(Uk(a,i,l[u+1],l[u+2])&&(c=u,r>0));u=l[u+3]);return c}slice(e,n,r){let i=this.buffer,a=new Uint16Array(n-e),l=0;for(let c=e,u=0;c<n;){a[u++]=i[c++],a[u++]=i[c++]-r;let h=a[u++]=i[c++]-r;a[u++]=i[c++]-e,l=Math.max(l,h)}return new ks(a,l,this.set)}}function Uk(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Vu(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let l=!r&&t instanceof Wn&&t.index<0?null:t.parent;if(!l)return t;t=l}let a=r?0:Pt.IgnoreOverlays;if(r)for(let l=t,c=l.parent;c;l=c,c=l.parent)l instanceof Wn&&l.index<0&&((i=c.enter(e,n,a))===null||i===void 0?void 0:i.from)!=l.from&&(t=c);for(;;){let l=t.enter(e,n,a);if(!l)return t;t=l}}class Wk{cursor(e=0){return new cd(this,e)}getChild(e,n=null,r=null){let i=E3(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return E3(this,e,n,r)}resolve(e,n=0){return Vu(this,e,n,!1)}resolveInner(e,n=0){return Vu(this,e,n,!0)}matchContext(e){return u8(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Wn extends Wk{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,a=0){for(let l=this;;){for(let{children:c,positions:u}=l._tree,h=n>0?c.length:-1;e!=h;e+=n){let p=c[e],O=u[e]+l.from,x;if(!(!(a&Pt.EnterBracketed&&p instanceof tn&&(x=yo.get(p))&&!x.overlay&&x.bracketed&&r>=O&&r<=O+p.length)&&!Uk(i,r,O,O+p.length))){if(p instanceof ks){if(a&Pt.ExcludeBuffers)continue;let y=p.findChild(0,p.buffer.length,n,r-O,i);if(y>-1)return new _i(new DH(l,p,e,O),null,y)}else if(a&Pt.IncludeAnonymous||!p.type.isAnonymous||$O(p)){let y;if(!(a&Pt.IgnoreMounts)&&(y=yo.get(p))&&!y.overlay)return new Wn(y.tree,O,e,l);let b=new Wn(p,O,e,l);return a&Pt.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(n<0?p.children.length-1:0,n,r,i,a)}}}if(a&Pt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+n:e=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&Pt.IgnoreOverlays)&&(i=yo.get(this._tree))&&i.overlay){let a=e-this.from,l=r&Pt.EnterBracketed&&i.bracketed;for(let{from:c,to:u}of i.overlay)if((n>0||l?c<=a:c<a)&&(n<0||l?u>=a:u>a))return new Wn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function E3(t,e,n,r){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let l=!1;!l;)if(l=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function u8(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class DH{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class _i extends Wk{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return a<0?null:new _i(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&Pt.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new _i(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new _i(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new _i(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,a=r.buffer[this.index+3];if(a>i){let l=r.buffer[this.index+1];e.push(r.slice(i,a,l)),n.push(0)}return new tn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Kk(t){if(!t.length)return null;let e=0,n=t[0];for(let a=1;a<t.length;a++){let l=t[a];(l.from>n.from||l.to<n.to)&&(n=l,e=a)}let r=n instanceof Wn&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new HH(i,n)}class HH{constructor(e,n){this.heads=e,this.node=n}get next(){return Kk(this.heads)}}function XH(t,e,n){let r=t.resolveInner(e,n),i=null;for(let a=r instanceof Wn?r:r.context.parent;a;a=a.parent)if(a.index<0){let l=a.parent;(i||(i=[r])).push(l.resolve(e,n)),a=l}else{let l=yo.get(a.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let c=new Wn(l.tree,l.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(Vu(c,e,n,!1))}}return i?Kk(i):r}class cd{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Pt.EnterBracketed,e instanceof Wn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Wn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Pt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Pt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Pt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(i.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+e,l=e<0?-1:r._tree.children.length;a!=l;a+=e){let c=r._tree.children[a];if(this.mode&Pt.IncludeAnonymous||c instanceof ks||!c.type.isAnonymous||$O(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,a=this.stack.length;a>=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;n=l,r=a+1;break e}i=this.stack[--a]}for(let i=r;i<this.stack.length;i++)n=new _i(this.buffer,n,this.stack[i]);return this.bufferNode=new _i(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return u8(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,a=this.stack.length-1;i>=0;a--){if(a<0)return u8(this._tree,e,i);let l=r[n.buffer[this.stack[a]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function $O(t){return t.children.some(e=>e instanceof ks||!e.type.isAnonymous||$O(e))}function zH(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Gk,reused:a=[],minRepeatType:l=r.types.length}=t,c=Array.isArray(n)?new EO(n,n.length):n,u=r.types,h=0,p=0;function O(M,E,$,N,D,z){let{id:B,start:X,end:U,size:I}=c,K=p,Z=h;if(I<0)if(c.next(),I==-1){let R=a[B];$.push(R),N.push(X-M);return}else if(I==-3){h=B;return}else if(I==-4){p=B;return}else throw new RangeError(`Unrecognized record size: ${I}`);let F=u[B],_,q,G=X-M;if(U-X<=i&&(q=k(c.pos-E,D))){let R=new Uint16Array(q.size-q.skip),P=c.pos-q.size,L=R.length;for(;c.pos>P;)L=A(q.start,R,L);_=new ks(R,U-q.start,r),G=q.start-M}else{let R=c.pos-I;c.next();let P=[],L=[],V=B>=l?B:-1,W=0,ee=U;for(;c.pos>R;)V>=0&&c.id==V&&c.size>=0?(c.end<=ee-i&&(b(P,L,X,W,c.end,ee,V,K,Z),W=P.length,ee=c.end),c.next()):z>2500?x(X,R,P,L):O(X,R,P,L,V,z+1);if(V>=0&&W>0&&W<P.length&&b(P,L,X,W,X,ee,V,K,Z),P.reverse(),L.reverse(),V>-1&&W>0){let ue=y(F,Z);_=jO(F,P,L,0,P.length,0,U-X,ue,ue)}else _=S(F,P,L,U-X,K-U,Z)}$.push(_),N.push(G)}function x(M,E,$,N){let D=[],z=0,B=-1;for(;c.pos>E;){let{id:X,start:U,end:I,size:K}=c;if(K>4)c.next();else{if(B>-1&&U<B)break;B<0&&(B=I-i),D.push(X,U,I),z++,c.next()}}if(z){let X=new Uint16Array(z*4),U=D[D.length-2];for(let I=D.length-3,K=0;I>=0;I-=3)X[K++]=D[I],X[K++]=D[I+1]-U,X[K++]=D[I+2]-U,X[K++]=K;$.push(new ks(X,D[2]-U,r)),N.push(U-M)}}function y(M,E){return($,N,D)=>{let z=0,B=$.length-1,X,U;if(B>=0&&(X=$[B])instanceof tn){if(!B&&X.type==M&&X.length==D)return X;(U=X.prop(st.lookAhead))&&(z=N[B]+X.length+U)}return S(M,$,N,D,z,E)}}function b(M,E,$,N,D,z,B,X,U){let I=[],K=[];for(;M.length>N;)I.push(M.pop()),K.push(E.pop()+$-D);M.push(S(r.types[B],I,K,z-D,X-z,U)),E.push(D-$)}function S(M,E,$,N,D,z,B){if(z){let X=[st.contextHash,z];B=B?[X].concat(B):[X]}if(D>25){let X=[st.lookAhead,D];B=B?[X].concat(B):[X]}return new tn(M,E,$,N,B)}function k(M,E){let $=c.fork(),N=0,D=0,z=0,B=$.end-i,X={size:0,start:0,skip:0};e:for(let U=$.pos-M;$.pos>U;){let I=$.size;if($.id==E&&I>=0){X.size=N,X.start=D,X.skip=z,z+=4,N+=4,$.next();continue}let K=$.pos-I;if(I<0||K<U||$.start<B)break;let Z=$.id>=l?4:0,F=$.start;for($.next();$.pos>K;){if($.size<0)if($.size==-3||$.size==-4)Z+=4;else break e;else $.id>=l&&(Z+=4);$.next()}D=F,N+=I,z+=Z}return(E<0||N==M)&&(X.size=N,X.start=D,X.skip=z),X.size>4?X:void 0}function A(M,E,$){let{id:N,start:D,end:z,size:B}=c;if(c.next(),B>=0&&N<l){let X=$;if(B>4){let U=c.pos-(B-4);for(;c.pos>U;)$=A(M,E,$)}E[--$]=X,E[--$]=z-M,E[--$]=D-M,E[--$]=N}else B==-3?h=N:B==-4&&(p=N);return $}let C=[],T=[];for(;c.pos>0;)O(t.start||0,t.bufferStart||0,C,T,-1,0);let j=(e=t.length)!==null&&e!==void 0?e:C.length?T[0]+C[0].length:0;return new tn(u[t.topID],C.reverse(),T.reverse(),j)}const $3=new WeakMap;function Rf(t,e){if(!t.isAnonymous||e instanceof ks||e.type!=t)return 1;let n=$3.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof tn)){n=1;break}n+=Rf(t,r)}$3.set(e,n)}return n}function jO(t,e,n,r,i,a,l,c,u){let h=0;for(let b=r;b<i;b++)h+=Rf(t,e[b]);let p=Math.ceil(h*1.5/8),O=[],x=[];function y(b,S,k,A,C){for(let T=k;T<A;){let j=T,M=S[T],E=Rf(t,b[T]);for(T++;T<A;T++){let $=Rf(t,b[T]);if(E+$>=p)break;E+=$}if(T==j+1){if(E>p){let $=b[j];y($.children,$.positions,0,$.children.length,S[j]+C);continue}O.push(b[j])}else{let $=S[T-1]+b[T-1].length-M;O.push(jO(t,b,S,j,T,M,$,null,u))}x.push(M+C-a)}}return y(e,n,r,i,0),(c||u)(O,x,l)}class Jk{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof _i?this.setBuffer(e.context.buffer,e.index,n):e instanceof Wn&&this.map.set(e.tree,n)}get(e){return e instanceof _i?this.getBuffer(e.context.buffer,e.index):e instanceof Wn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ya{constructor(e,n,r,i,a=!1,l=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(a?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new ya(0,e.length,e,0,!1,r)];for(let a of n)a.to>e.length&&i.push(a);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],a=1,l=e.length?e[0]:null;for(let c=0,u=0,h=0;;c++){let p=c<n.length?n[c]:null,O=p?p.fromA:1e9;if(O-u>=r)for(;l&&l.from<O;){let x=l;if(u>=x.from||O<=x.to||h){let y=Math.max(x.from,u)-h,b=Math.min(x.to,O)-h;x=y>=b?null:new ya(y,b,x.tree,x.offset+h,c>0,!!p)}if(x&&i.push(x),l.to>O)break;l=a<e.length?e[a++]:null}if(!p)break;u=p.toA,h=p.toA-p.toB}return i}}class eA{startParse(e,n,r){return typeof e=="string"&&(e=new FH(e)),r=r?r.length?r.map(i=>new Wr(i.from,i.to)):[new Wr(0,0)]:[new Wr(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let a=i.advance();if(a)return a}}}class FH{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function BH(t){return(e,n,r,i)=>new IH(e,t,n,r,i)}class j3{constructor(e,n,r,i,a,l){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=a,this.from=l}}function P3(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class YH{constructor(e,n,r,i,a,l,c,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=a,this.bracketed=l,this.target=c,this.prev=u,this.depth=0,this.ranges=[]}}const f8=new st({perNode:!0});class IH{constructor(e,n,r,i,a){this.nest=n,this.input=r,this.fragments=i,this.ranges=a,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new tn(r.type,r.children,r.positions,r.length,r.propValues.concat([[f8,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[st.mounted.id]=new yo(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new UH(this.fragments),n=null,r=null,i=new cd(new Wn(this.baseTree,this.ranges[0].from,0,null),Pt.IncludeAnonymous|Pt.IgnoreMounts);e:for(let a,l;;){let c=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)c=!1;else if(e.hasNode(i)){if(n){let h=n.mounts.find(p=>p.frag.from<=i.from&&p.frag.to>=i.to&&p.mount.overlay);if(h)for(let p of h.mount.overlay){let O=p.from+h.pos,x=p.to+h.pos;O>=i.from&&x<=i.to&&!n.ranges.some(y=>y.from<x&&y.to>O)&&n.ranges.push({from:O,to:x})}}c=!1}else if(r&&(l=qH(r.ranges,i.from,i.to)))c=l!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.from<i.to||!a.overlay)){i.tree||(GH(i),n&&n.depth++,r&&r.depth++);let h=e.findMounts(i.from,a.parser);if(typeof a.overlay=="function")n=new YH(a.parser,a.overlay,h,this.inner.length,i.from,!!a.bracketed,i.tree,n);else{let p=N3(this.ranges,a.overlay||(i.from<i.to?[new Wr(i.from,i.to)]:[]));p.length&&P3(p),(p.length||!a.overlay)&&this.inner.push(new j3(a.parser,p.length?a.parser.startParse(this.input,R3(h,p),p):a.parser.startParse(""),a.overlay?a.overlay.map(O=>new Wr(O.from-i.from,O.to-i.from)):null,!!a.bracketed,i.tree,p.length?p[0].from:i.from)),a.overlay?p.length&&(r={ranges:p,depth:0,prev:r}):c=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new Wr(i.from,i.to)),u.from<u.to)){let h=n.ranges.length-1;h>=0&&n.ranges[h].to==u.from?n.ranges[h]={from:n.ranges[h].from,to:u.to}:n.ranges.push(u)}if(c&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let h=N3(this.ranges,n.ranges);h.length&&(P3(h),this.inner.splice(n.index,0,new j3(n.parser,n.parser.startParse(this.input,R3(n.mounts,h),h),n.ranges.map(p=>new Wr(p.from-n.start,p.to-n.start)),n.bracketed,n.target,h[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function qH(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function Q3(t,e,n,r,i,a){if(e<n){let l=t.buffer[e+1];r.push(t.slice(e,n,l)),i.push(l-a)}}function GH(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,a=i.children.indexOf(r),l=i.children[a],c=l.buffer,u=[a];function h(p,O,x,y,b,S){let k=n[S],A=[],C=[];Q3(l,p,k,A,C,y);let T=c[k+1],j=c[k+2];u.push(A.length);let M=S?h(k+4,c[k+3],l.set.types[c[k]],T,j-T,S-1):e.toTree();return A.push(M),C.push(T-y),Q3(l,c[k+3],O,A,C,y),new tn(x,A,C,b)}i.children[a]=h(0,c.length,ir.none,0,l.length,n.length-1);for(let p of u){let O=t.tree.children[p],x=t.tree.positions[p];t.yield(new Wn(O,x+t.from,p,t._tree))}}class Z3{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Pt.IncludeAnonymous|Pt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)if(!(n.to>=e&&n.enter(r,1,Pt.IgnoreOverlays|Pt.ExcludeBuffers)))if(n.to<=e)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof tn)n=n.children[0];else break}return!1}}let UH=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(f8))!==null&&n!==void 0?n:r.to,this.inner=new Z3(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(f8))!==null&&e!==void 0?e:n.to,this.inner=new Z3(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let a=this.inner.cursor.node;a;a=a.parent){let l=(r=a.tree)===null||r===void 0?void 0:r.prop(st.mounted);if(l&&l.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let u=this.fragments[c];if(u.from>=a.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:a.from-u.offset,mount:l})}}}return i}};function N3(t,e){let n=null,r=e;for(let i=1,a=0;i<t.length;i++){let l=t[i-1].to,c=t[i].from;for(;a<r.length;a++){let u=r[a];if(u.from>=c)break;u.to<=l||(n||(r=n=e.slice()),u.from<l?(n[a]=new Wr(u.from,l),u.to>c&&n.splice(a+1,0,new Wr(c,u.to))):u.to>c?n[a--]=new Wr(c,u.to):n.splice(a--,1))}}return r}function WH(t,e,n,r){let i=0,a=0,l=!1,c=!1,u=-1e9,h=[];for(;;){let p=i==t.length?1e9:l?t[i].to:t[i].from,O=a==e.length?1e9:c?e[a].to:e[a].from;if(l!=c){let x=Math.max(u,n),y=Math.min(p,O,r);x<y&&h.push(new Wr(x,y))}if(u=Math.min(p,O),u==1e9)break;p==u&&(l?(l=!1,i++):l=!0),O==u&&(c?(c=!1,a++):c=!0)}return h}function R3(t,e){let n=[];for(let{pos:r,mount:i,frag:a}of t){let l=r+(i.overlay?i.overlay[0].from:0),c=l+i.tree.length,u=Math.max(a.from,l),h=Math.min(a.to,c);if(i.overlay){let p=i.overlay.map(x=>new Wr(x.from+r,x.to+r)),O=WH(e,p,u,h);for(let x=0,y=u;;x++){let b=x==O.length,S=b?h:O[x].from;if(S>y&&n.push(new ya(y,S,i.tree,-l,a.from>=y||a.openStart,a.to<=S||a.openEnd)),b)break;y=O[x].to}}else n.push(new ya(u,h,i.tree,-l,a.from>=l||a.openStart,a.to<=c||a.openEnd))}return n}let KH=0;class qr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=KH++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof qr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new qr(r,[],null,[]);if(i.set.push(i),n)for(let a of n.set)i.set.push(a);return i}static defineModifier(e){let n=new ud(e);return r=>r.modified.indexOf(n)>-1?r:ud.get(r.base||r,r.modified.concat(n).sort((i,a)=>i.id-a.id))}}let JH=0;class ud{constructor(e){this.name=e,this.instances=[],this.id=JH++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(c=>c.base==e&&eX(n,c.modified));if(r)return r;let i=[],a=new qr(e.name,i,e,n);for(let c of n)c.instances.push(a);let l=tX(n);for(let c of e.set)if(!c.modified.length)for(let u of l)i.push(ud.get(c,u));return a}}function eX(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function tX(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Wd(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let a=[],l=2,c=i;for(let O=0;;){if(c=="..."&&O>0&&O+3==i.length){l=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+i);if(a.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),O+=x[0].length,O==i.length)break;let y=i[O++];if(O==i.length&&y=="!"){l=0;break}if(y!="/")throw new RangeError("Invalid path: "+i);c=i.slice(O)}let u=a.length-1,h=a[u];if(!h)throw new RangeError("Invalid path: "+i);let p=new Lu(r,l,u>0?a.slice(0,u):null);e[h]=p.sort(e[h])}}return tA.add(e)}const tA=new st({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Lu(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});class Lu{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Lu.empty=new Lu([],2,null);function nA(t,e){let n=Object.create(null);for(let a of t)if(!Array.isArray(a.tag))n[a.tag.id]=a.class;else for(let l of a.tag)n[l.id]=a.class;let{scope:r,all:i=null}=e||{};return{style:a=>{let l=i;for(let c of a)for(let u of c.set){let h=n[u.id];if(h){l=l?l+" "+h:h;break}}return l},scope:r}}function nX(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function rX(t,e,n,r=0,i=t.length){let a=new iX(r,Array.isArray(e)?e:[e],n);a.highlightRange(t.cursor(),r,i,"",a.highlighters),a.flush(i)}class iX{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,a){let{type:l,from:c,to:u}=e;if(c>=r||u<=n)return;l.isTop&&(a=this.highlighters.filter(y=>!y.scope||y.scope(l)));let h=i,p=aX(e)||Lu.empty,O=nX(a,p.tags);if(O&&(h&&(h+=" "),h+=O,p.mode==1&&(i+=(i?" ":"")+O)),this.startSpan(Math.max(n,c),h),p.opaque)return;let x=e.tree&&e.tree.prop(st.mounted);if(x&&x.overlay){let y=e.node.enter(x.overlay[0].from+c,1),b=this.highlighters.filter(k=>!k.scope||k.scope(x.tree.type)),S=e.firstChild();for(let k=0,A=c;;k++){let C=k<x.overlay.length?x.overlay[k]:null,T=C?C.from+c:u,j=Math.max(n,A),M=Math.min(r,T);if(j<M&&S)for(;e.from<M&&(this.highlightRange(e,j,M,i,a),this.startSpan(Math.min(M,e.to),h),!(e.to>=T||!e.nextSibling())););if(!C||T>r)break;A=C.to+c,A>n&&(this.highlightRange(y.cursor(),Math.max(n,C.from+c),Math.min(r,A),"",b),this.startSpan(Math.min(r,A),h))}S&&e.parent()}else if(e.firstChild()){x&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,a),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function aX(t){let e=t.type.prop(tA);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const we=qr.define,af=we(),ss=we(),V3=we(ss),L3=we(ss),ls=we(),sf=we(ls),l2=we(ls),Pi=we(),Ys=we(Pi),$i=we(),ji=we(),d8=we(),Bc=we(d8),lf=we(),te={comment:af,lineComment:we(af),blockComment:we(af),docComment:we(af),name:ss,variableName:we(ss),typeName:V3,tagName:we(V3),propertyName:L3,attributeName:we(L3),className:we(ss),labelName:we(ss),namespace:we(ss),macroName:we(ss),literal:ls,string:sf,docString:we(sf),character:we(sf),attributeValue:we(sf),number:l2,integer:we(l2),float:we(l2),bool:we(ls),regexp:we(ls),escape:we(ls),color:we(ls),url:we(ls),keyword:$i,self:we($i),null:we($i),atom:we($i),unit:we($i),modifier:we($i),operatorKeyword:we($i),controlKeyword:we($i),definitionKeyword:we($i),moduleKeyword:we($i),operator:ji,derefOperator:we(ji),arithmeticOperator:we(ji),logicOperator:we(ji),bitwiseOperator:we(ji),compareOperator:we(ji),updateOperator:we(ji),definitionOperator:we(ji),typeOperator:we(ji),controlOperator:we(ji),punctuation:d8,separator:we(d8),bracket:Bc,angleBracket:we(Bc),squareBracket:we(Bc),paren:we(Bc),brace:we(Bc),content:Pi,heading:Ys,heading1:we(Ys),heading2:we(Ys),heading3:we(Ys),heading4:we(Ys),heading5:we(Ys),heading6:we(Ys),contentSeparator:we(Pi),list:we(Pi),quote:we(Pi),emphasis:we(Pi),strong:we(Pi),link:we(Pi),monospace:we(Pi),strikethrough:we(Pi),inserted:we(),deleted:we(),changed:we(),invalid:we(),meta:lf,documentMeta:we(lf),annotation:we(lf),processingInstruction:we(lf),definition:qr.defineModifier("definition"),constant:qr.defineModifier("constant"),function:qr.defineModifier("function"),standard:qr.defineModifier("standard"),local:qr.defineModifier("local"),special:qr.defineModifier("special")};for(let t in te){let e=te[t];e instanceof qr&&(e.name=t)}nA([{tag:te.link,class:"tok-link"},{tag:te.heading,class:"tok-heading"},{tag:te.emphasis,class:"tok-emphasis"},{tag:te.strong,class:"tok-strong"},{tag:te.keyword,class:"tok-keyword"},{tag:te.atom,class:"tok-atom"},{tag:te.bool,class:"tok-bool"},{tag:te.url,class:"tok-url"},{tag:te.labelName,class:"tok-labelName"},{tag:te.inserted,class:"tok-inserted"},{tag:te.deleted,class:"tok-deleted"},{tag:te.literal,class:"tok-literal"},{tag:te.string,class:"tok-string"},{tag:te.number,class:"tok-number"},{tag:[te.regexp,te.escape,te.special(te.string)],class:"tok-string2"},{tag:te.variableName,class:"tok-variableName"},{tag:te.local(te.variableName),class:"tok-variableName tok-local"},{tag:te.definition(te.variableName),class:"tok-variableName tok-definition"},{tag:te.special(te.variableName),class:"tok-variableName2"},{tag:te.definition(te.propertyName),class:"tok-propertyName tok-definition"},{tag:te.typeName,class:"tok-typeName"},{tag:te.namespace,class:"tok-namespace"},{tag:te.className,class:"tok-className"},{tag:te.macroName,class:"tok-macroName"},{tag:te.propertyName,class:"tok-propertyName"},{tag:te.operator,class:"tok-operator"},{tag:te.comment,class:"tok-comment"},{tag:te.meta,class:"tok-meta"},{tag:te.invalid,class:"tok-invalid"},{tag:te.punctuation,class:"tok-punctuation"}]);var o2;const co=new st;function rA(t){return je.define({combine:t?e=>e.concat(t):void 0})}const PO=new st;class Oi{constructor(e,n,r=[],i=""){this.data=e,this.name=i,wt.prototype.hasOwnProperty("tree")||Object.defineProperty(wt.prototype,"tree",{get(){return mn(this)}}),this.parser=n,this.extension=[As.of(this),wt.languageData.of((a,l,c)=>{let u=_3(a,l,c),h=u.type.prop(co);if(!h)return[];let p=a.facet(h),O=u.type.prop(PO);if(O){let x=u.resolve(l-u.from,c);for(let y of O)if(y.test(x,a)){let b=a.facet(y.facet);return y.type=="replace"?b:b.concat(p)}}return p})].concat(r)}isActiveAt(e,n,r=-1){return _3(e,n,r).type.prop(co)==this.data}findRegions(e){let n=e.facet(As);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(a,l)=>{if(a.prop(co)==this.data){r.push({from:l,to:l+a.length});return}let c=a.prop(st.mounted);if(c){if(c.tree.prop(co)==this.data){if(c.overlay)for(let u of c.overlay)r.push({from:u.from+l,to:u.to+l});else r.push({from:l,to:l+a.length});return}else if(c.overlay){let u=r.length;if(i(c.tree,c.overlay[0].from+l),r.length>u)return}}for(let u=0;u<a.children.length;u++){let h=a.children[u];h instanceof tn&&i(h,a.positions[u]+l)}};return i(mn(e),0),r}get allowsNesting(){return!0}}Oi.setState=At.define();function _3(t,e,n){let r=t.facet(As),i=mn(t).topNode;if(!r||r.allowsNesting)for(let a=i;a;a=a.enter(e,n,Pt.ExcludeBuffers|Pt.EnterBracketed))a.type.isTop&&(i=a);return i}class No extends Oi{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=rA(e.languageData);return new No(n,e.parser.configure({props:[co.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new No(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function mn(t){let e=t.field(Oi.state,!1);return e?e.tree:tn.empty}class sX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Yc=null;class fd{constructor(e,n,r=[],i,a,l,c,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=a,this.viewport=l,this.skipped=c,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new fd(e,n,[],tn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new sX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=tn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(ya.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(ya.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Yc;Yc=this;try{return e()}finally{Yc=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=D3(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:a,viewport:l,skipped:c}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((h,p,O,x)=>u.push({fromA:h,toA:p,fromB:O,toB:x})),r=ya.applyChanges(r,u),i=tn.empty,a=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let p=e.mapPos(h.from,1),O=e.mapPos(h.to,-1);p<O&&c.push({from:p,to:O})}}}return new fd(this.parser,n,r,i,a,l,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:a}=this.skipped[r];i<e.to&&a>e.from&&(this.fragments=D3(this.fragments,i,a),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends eA{createParse(n,r,i){let a=i[0].from,l=i[i.length-1].to;return{parsedPos:a,advance(){let u=Yc;if(u){for(let h of i)u.tempSkipped.push(h);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=l,new tn(ir.none,[],[],l-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Yc}}function D3(t,e,n){return ya.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Ro{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Ro(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=fd.create(e.facet(As).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Ro(r)}}Oi.state=Lr.define({create:Ro.init,update(t,e){for(let n of e.effects)if(n.is(Oi.setState))return n.value;return e.startState.facet(As)!=e.state.facet(As)?Ro.init(e.state):t.apply(e)}});let iA=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(iA=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const c2=typeof navigator<"u"&&(!((o2=navigator.scheduling)===null||o2===void 0)&&o2.isInputPending)?()=>navigator.scheduling.isInputPending():null,lX=yr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Oi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Oi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=iA(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,a=r.field(Oi.state);if(a.tree==a.context.tree&&a.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!c2?Math.max(25,e.timeRemaining()-5):1e9),c=a.context.treeLen<i&&r.doc.length>i+1e3,u=a.context.work(()=>c2&&c2()||Date.now()>l,i+(c?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:Oi.setState.of(new Ro(a.context))})),this.chunkBudget>0&&!(u&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Li(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),As=je.define({combine(t){return t.length?t[0]:null},enables:t=>[Oi.state,lX,Ee.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class QO{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const oX=je.define(),Kd=je.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function dd(t){let e=t.facet(Kd);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function _u(t,e){let n="",r=t.tabSize,i=t.facet(Kd)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let a=0;a<e;a++)n+=i;return n}function ZO(t,e){t instanceof wt&&(t=new Jd(t));for(let r of t.state.facet(oX)){let i=r(t,e);if(i!==void 0)return i}let n=mn(t.state);return n.length>=e?cX(t,n,e):null}class Jd{constructor(e,n={}){this.state=e,this.options=n,this.unit=dd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:a}=this.options;return i!=null&&i>=r.from&&i<=r.to?a&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),a=this.countColumn(r,e-i),l=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return l>-1&&(a+=l-this.countColumn(r,r.search(/\S|$/))),a}countColumn(e,n=e.length){return Bd(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),a=this.options.overrideIndentation;if(a){let l=a(i);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const eh=new st;function cX(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let a=[];for(let l=i;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)a.push(l);for(let l=a.length-1;l>=0;l--)r={node:a[l],next:r}}return aA(r,t,n)}function aA(t,e,n){for(let r=t;r;r=r.next){let i=fX(r.node);if(i)return i(NO.create(e,n,r))}return 0}function uX(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function fX(t){let e=t.type.prop(eh);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(st.closedBy))){let i=t.lastChild,a=i&&r.indexOf(i.name)>-1;return l=>sA(l,!0,1,void 0,a&&!uX(l)?i.from:void 0)}return t.parent==null?dX:null}function dX(){return 0}class NO extends Jd{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new NO(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(hX(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return aA(this.context.next,this.base,this.pos)}}function hX(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function mX(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,a=t.state.doc.lineAt(n.from),l=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let c=n.to;;){let u=e.childAfter(c);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=l)return null;let h=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+h}}c=u.to}}function pX({closing:t,align:e=!0,units:n=1}){return r=>sA(r,e,n,t)}function sA(t,e,n,r,i){let a=t.textAfter,l=a.match(/^\s*/)[0].length,c=r&&a.slice(l,l+r.length)==r||i==t.pos+l,u=e?mX(t):null;return u?c?t.column(u.from):t.column(u.to):t.baseIndent+(c?0:t.unit*n)}const gX=t=>t.baseIndent;function Vf({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const OX=200;function xX(){return wt.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+OX)return t;let a=n.sliceString(i.from,r);if(!e.some(h=>h.test(a)))return t;let{state:l}=t,c=-1,u=[];for(let{head:h}of l.selection.ranges){let p=l.doc.lineAt(h);if(p.from==c)continue;c=p.from;let O=ZO(l,p.from);if(O==null)continue;let x=/^\s*/.exec(p.text)[0],y=_u(l,O);x!=y&&u.push({from:p.from,to:p.from+x.length,insert:y})}return u.length?[t,{changes:u,sequential:!0}]:t})}const yX=je.define(),th=new st;function lA(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function bX(t,e,n){let r=mn(t);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let l=i;l;l=l.next){let c=l.node;if(c.to<=n||c.from>n)continue;if(a&&c.from<e)break;let u=c.type.prop(th);if(u&&(c.to<r.length-50||r.length==t.doc.length||!vX(c))){let h=u(c,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(a=h)}}return a}function vX(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function H3(t,e,n){for(let r of t.facet(yX)){let i=r(t,e,n);if(i)return i}return bX(t,e,n)}function oA(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const cA=At.define({map:oA}),RO=At.define({map:oA}),hd=Lr.define({create(){return Je.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=X3(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(cA)&&!SX(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(uA),i=r?Je.replace({widget:new AX(r(e.state,n.value))}):z3;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(RO)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=X3(t,e.selection.main.head)),t},provide:t=>Ee.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(z3.range(r,i))}return Je.set(e,!0)}});function X3(t,e,n=e){let r=!1;return t.between(e,n,(i,a)=>{i<n&&a>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,a)=>i>=n||a<=e}):t}function h8(t,e,n){var r;let i=null;return(r=t.field(hd,!1))===null||r===void 0||r.between(e,n,(a,l)=>{(!i||i.from>a)&&(i={from:a,to:l})}),i}function SX(t,e,n){let r=!1;return t.between(e,e,(i,a)=>{i==e&&a==n&&(r=!0)}),r}const wX={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},uA=je.define({combine(t){return Bo(t,wX)}});function kX(t){return[hd,TX]}function fA(t,e){let{state:n}=t,r=n.facet(uA),i=l=>{let c=t.lineBlockAt(t.posAtDOM(l.target)),u=h8(t.state,c.from,c.to);u&&t.dispatch({effects:RO.of(u)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let a=document.createElement("span");return a.textContent=r.placeholderText,a.setAttribute("aria-label",n.phrase("folded code")),a.title=n.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=i,a}const z3=Je.replace({widget:new class extends pl{toDOM(t){return fA(t,null)}}});class AX extends pl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return fA(e,this.value)}}const MX={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class u2 extends $a{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function CX(t={}){let e={...MX,...t},n=new u2(e,!0),r=new u2(e,!1),i=yr.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(As)!=l.state.facet(As)||l.startState.field(hd,!1)!=l.state.field(hd,!1)||mn(l.startState)!=mn(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let c=new ol;for(let u of l.viewportLineBlocks){let h=h8(l.state,u.from,u.to)?r:H3(l.state,u.from,u.to)?n:null;h&&c.add(u.from,u.from,h)}return c.finish()}}),{domEventHandlers:a}=e;return[i,CH({class:"cm-foldGutter",markers(l){var c;return((c=l.plugin(i))===null||c===void 0?void 0:c.markers)||mt.empty},initialSpacer(){return new u2(e,!1)},domEventHandlers:{...a,click:(l,c,u)=>{if(a.click&&a.click(l,c,u))return!0;let h=h8(l.state,c.from,c.to);if(h)return l.dispatch({effects:RO.of(h)}),!0;let p=H3(l.state,c.from,c.to);return p?(l.dispatch({effects:cA.of(p)}),!0):!1}}}),kX()]}const TX=Ee.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class nh{constructor(e,n){this.specs=e;let r;function i(c){let u=vs.newName();return(r||(r=Object.create(null)))["."+u]=c,u}const a=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,l=n.scope;this.scope=l instanceof Oi?c=>c.prop(co)==l.data:l?c=>c==l:void 0,this.style=nA(e.map(c=>({tag:c.tag,class:c.class||i(Object.assign({},c,{tag:null}))})),{all:a}).style,this.module=r?new vs(r):null,this.themeType=n.themeType}static define(e,n){return new nh(e,n||{})}}const m8=je.define(),EX=je.define({combine(t){return t.length?[t[0]]:null}});function f2(t){let e=t.facet(m8);return e.length?e:t.facet(EX)}function $X(t,e){let n=[PX],r;return t instanceof nh&&(t.module&&n.push(Ee.styleModule.of(t.module)),r=t.themeType),r?n.push(m8.computeN([Ee.darkTheme],i=>i.facet(Ee.darkTheme)==(r=="dark")?[t]:[])):n.push(m8.of(t)),n}class jX{constructor(e){this.markCache=Object.create(null),this.tree=mn(e.state),this.decorations=this.buildDeco(e,f2(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=mn(e.state),r=f2(e.state),i=r!=f2(e.startState),{viewport:a}=e.view,l=e.changes.mapPos(this.decoratedTo,1);n.length<a.to&&!i&&n.type==this.tree.type&&l>=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=a.to)}buildDeco(e,n){if(!n||!this.tree.length)return Je.none;let r=new ol;for(let{from:i,to:a}of e.visibleRanges)rX(this.tree,n,(l,c,u)=>{r.add(l,c,this.markCache[u]||(this.markCache[u]=Je.mark({class:u})))},i,a);return r.finish()}}const PX=s0.high(yr.fromClass(jX,{decorations:t=>t.decorations})),QX=Ee.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),dA=1e4,hA="()[]{}",mA=je.define({combine(t){return Bo(t,{afterCursor:!0,brackets:hA,maxScanDistance:dA,renderMatch:RX})}}),ZX=Je.mark({class:"cm-matchingBracket"}),NX=Je.mark({class:"cm-nonmatchingBracket"});function RX(t){let e=[],n=t.matched?ZX:NX;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function F3(t){let e=[],n=t.facet(mA);for(let r of t.selection.ranges){if(!r.empty)continue;let i=Di(t,r.head,-1,n)||r.head>0&&Di(t,r.head-1,1,n)||n.afterCursor&&(Di(t,r.head,1,n)||r.head<t.doc.length&&Di(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return Je.set(e,!0)}const VX=yr.fromClass(class{constructor(t){this.paused=!1,this.decorations=F3(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=F3(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),LX=[VX,QX];function _X(t={}){return[mA.of(t),LX]}const pA=new st;function p8(t,e,n){let r=t.prop(e<0?st.openedBy:st.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function g8(t){let e=t.type.prop(pA);return e?e(t.node):t}function Di(t,e,n,r={}){let i=r.maxScanDistance||dA,a=r.brackets||hA,l=mn(t),c=l.resolveInner(e,n);for(let u=c;u;u=u.parent){let h=p8(u.type,n,a);if(h&&u.from<u.to){let p=g8(u);if(p&&(n>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return DX(t,e,n,u,p,h,a)}}return HX(t,e,n,l,c.type,i,a)}function DX(t,e,n,r,i,a,l){let c=r.parent,u={from:i.from,to:i.to},h=0,p=c==null?void 0:c.cursor();if(p&&(n<0?p.childBefore(r.from):p.childAfter(r.to)))do if(n<0?p.to<=r.from:p.from>=r.to){if(h==0&&a.indexOf(p.type.name)>-1&&p.from<p.to){let O=g8(p);return{start:u,end:O?{from:O.from,to:O.to}:void 0,matched:!0}}else if(p8(p.type,n,l))h++;else if(p8(p.type,-n,l)){if(h==0){let O=g8(p);return{start:u,end:O&&O.from<O.to?{from:O.from,to:O.to}:void 0,matched:!1}}h--}}while(n<0?p.prevSibling():p.nextSibling());return{start:u,matched:!1}}function HX(t,e,n,r,i,a,l){if(n<0?!e:e==t.doc.length)return null;let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=l.indexOf(c);if(u<0||u%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},p=t.doc.iterRange(e,n>0?t.doc.length:0),O=0;for(let x=0;!p.next().done&&x<=a;){let y=p.value;n<0&&(x+=y.length);let b=e+x*n;for(let S=n>0?0:y.length-1,k=n>0?y.length:-1;S!=k;S+=n){let A=l.indexOf(y[S]);if(!(A<0||r.resolveInner(b+S,1).type!=i))if(A%2==0==n>0)O++;else{if(O==1)return{start:h,end:{from:b+S,to:b+S+1},matched:A>>1==u>>1};O--}}n>0&&(x+=y.length)}return p.done?{start:h,matched:!1}:null}const XX=Object.create(null),B3=[ir.none],Y3=[],I3=Object.create(null),zX=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])zX[t]=FX(XX,e);function d2(t,e){Y3.indexOf(t)>-1||(Y3.push(t),console.warn(e))}function FX(t,e){let n=[];for(let c of e.split(" ")){let u=[];for(let h of c.split(".")){let p=t[h]||te[h];p?typeof p=="function"?u.length?u=u.map(p):d2(h,`Modifier ${h} used at start of tag`):u.length?d2(h,`Tag ${h} used as modifier`):u=Array.isArray(p)?p:[p]:d2(h,`Unknown highlighting tag ${h}`)}for(let h of u)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(c=>c.id),a=I3[i];if(a)return a.id;let l=I3[i]=ir.define({id:B3.length,name:r,props:[Wd({[r]:n})]});return B3.push(l),l.id}hn.RTL,hn.LTR;const BX=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=LO(t.state,n.from);return r.line?YX(t):r.block?qX(t):!1};function VO(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const YX=VO(WX,0),IX=VO(gA,0),qX=VO((t,e)=>gA(t,e,UX(e)),0);function LO(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Ic=50;function GX(t,{open:e,close:n},r,i){let a=t.sliceDoc(r-Ic,r),l=t.sliceDoc(i,i+Ic),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,h=a.length-c;if(a.slice(h-e.length,h)==e&&l.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+u,margin:u&&1}};let p,O;i-r<=2*Ic?p=O=t.sliceDoc(r,i):(p=t.sliceDoc(r,r+Ic),O=t.sliceDoc(i-Ic,i));let x=/^\s*/.exec(p)[0].length,y=/\s*$/.exec(O)[0].length,b=O.length-y-n.length;return p.slice(x,x+e.length)==e&&O.slice(b,b+n.length)==n?{open:{pos:r+x+e.length,margin:/\s/.test(p.charAt(x+e.length))?1:0},close:{pos:i-y-n.length,margin:/\s/.test(O.charAt(b-1))?1:0}}:null}function UX(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let a=e.length-1;a>=0&&e[a].to>r.from?e[a].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function gA(t,e,n=e.selection.ranges){let r=n.map(a=>LO(e,a.from).block);if(!r.every(a=>a))return null;let i=n.map((a,l)=>GX(e,r[l],a.from,a.to));if(t!=2&&!i.every(a=>a))return{changes:e.changes(n.map((a,l)=>i[l]?[]:[{from:a.from,insert:r[l].open+" "},{from:a.to,insert:" "+r[l].close}]))};if(t!=1&&i.some(a=>a)){let a=[];for(let l=0,c;l<i.length;l++)if(c=i[l]){let u=r[l],{open:h,close:p}=c;a.push({from:h.pos-u.open.length,to:h.pos+h.margin},{from:p.pos-p.margin,to:p.pos+u.close.length})}return{changes:a}}return null}function WX(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:a,to:l}of n){let c=r.length,u=1e9,h;for(let p=a;p<=l;){let O=e.doc.lineAt(p);if(h==null&&(h=LO(e,O.from).line,!h))continue e;if(O.from>i&&(a==l||l>O.from)){i=O.from;let x=/^\s*/.exec(O.text)[0].length,y=x==O.length,b=O.text.slice(x,x+h.length)==h?x:-1;x<O.text.length&&x<u&&(u=x),r.push({line:O,comment:b,token:h,indent:x,empty:y,single:!1})}p=O.to+1}if(u<1e9)for(let p=c;p<r.length;p++)r[p].indent<r[p].line.text.length&&(r[p].indent=u);r.length==c+1&&(r[c].single=!0)}if(t!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:c,token:u,indent:h,empty:p,single:O}of r)(O||!p)&&a.push({from:c.from+h,insert:u+" "});let l=e.changes(a);return{changes:l,selection:e.selection.map(l,1)}}else if(t!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:l,comment:c,token:u}of r)if(c>=0){let h=l.from+c,p=h+u.length;l.text[p-l.from]==" "&&p++,a.push({from:h,to:p})}return{changes:a}}return null}const O8=Qa.define(),KX=Qa.define(),JX=je.define(),OA=je.define({combine(t){return Bo(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),xA=Lr.define({create(){return Hi.empty},update(t,e){let n=e.state.facet(OA),r=e.annotation(O8);if(r){let u=Or.fromTransaction(e,r.selection),h=r.side,p=h==0?t.undone:t.done;return u?p=md(p,p.length,n.minDepth,u):p=vA(p,e.startState.selection),new Hi(h==0?r.rest:p,h==0?p:r.rest)}let i=e.annotation(KX);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(vn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Or.fromTransaction(e),l=e.annotation(vn.time),c=e.annotation(vn.userEvent);return a?t=t.addChanges(a,l,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,l,c,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Hi(t.done.map(Or.fromJSON),t.undone.map(Or.fromJSON))}});function ez(t={}){return[xA,OA.of(t),Ee.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?yA:e.inputType=="historyRedo"?x8:null;return r?(e.preventDefault(),r(n)):!1}})]}function rh(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(xA,!1);if(!i)return!1;let a=i.pop(t,n,e);return a?(r(a),!0):!1}}const yA=rh(0,!1),x8=rh(1,!1),tz=rh(0,!0),nz=rh(1,!0);class Or{constructor(e,n,r,i,a){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=a}setSelAfter(e){return new Or(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Or(e.changes&&Mn.fromJSON(e.changes),[],e.mapped&&Xi.fromJSON(e.mapped),e.startSelection&&ge.fromJSON(e.startSelection),e.selectionsAfter.map(ge.fromJSON))}static fromTransaction(e,n){let r=Kr;for(let i of e.startState.facet(JX)){let a=i(e);a.length&&(r=r.concat(a))}return!r.length&&e.changes.empty?null:new Or(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Kr)}static selection(e){return new Or(void 0,Kr,void 0,void 0,e)}}function md(t,e,n,r){let i=e+1>n+20?e-n-1:0,a=t.slice(i,e);return a.push(r),a}function rz(t,e){let n=[],r=!1;return t.iterChangedRanges((i,a)=>n.push(i,a)),e.iterChangedRanges((i,a,l,c)=>{for(let u=0;u<n.length;){let h=n[u++],p=n[u++];c>=h&&l<=p&&(r=!0)}}),r}function iz(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function bA(t,e){return t.length?e.length?t.concat(e):t:e}const Kr=[],az=200;function vA(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-az));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),md(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Or.selection([e])]}function sz(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function h2(t,e){if(!t.length)return t;let n=t.length,r=Kr;for(;n;){let i=lz(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let a=t.slice(0,n);return a[n-1]=i,a}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Or.selection(r)]:Kr}function lz(t,e,n){let r=bA(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):Kr,n);if(!t.changes)return Or.selection(r);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(a):a;return new Or(i,At.mapEffects(t.effects,e),l,t.startSelection.map(a),r)}const oz=/^(input\.type|delete)($|\.)/;class Hi{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Hi(this.done,this.undone):this}addChanges(e,n,r,i,a){let l=this.done,c=l[l.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!r||oz.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,rz(c.changes,e.changes))||r=="input.type.compose")?l=md(l,l.length-1,i.minDepth,new Or(e.changes.compose(c.changes),bA(At.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,Kr)):l=md(l,l.length,i.minDepth,e),new Hi(l,Kr,n,r)}addSelection(e,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Kr;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&iz(a[a.length-1],e)?this:new Hi(vA(this.done,e),this.undone,n,r)}addMapping(e){return new Hi(h2(this.done,e),h2(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let a=i[i.length-1],l=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:O8.of({side:e,rest:sz(i),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let c=i.length==1?Kr:i.slice(0,i.length-1);return a.mapped&&(c=h2(c,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:O8.of({side:e,rest:c,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hi.empty=new Hi(Kr,Kr);const cz=[{key:"Mod-z",run:yA,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:x8,preventDefault:!0},{linux:"Ctrl-Shift-z",run:x8,preventDefault:!0},{key:"Mod-u",run:tz,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:nz,preventDefault:!0}];function Yo(t,e){return ge.create(t.ranges.map(e),t.mainIndex)}function vi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Si({state:t,dispatch:e},n){let r=Yo(t.selection,n);return r.eq(t.selection,!0)?!1:(e(vi(t,r)),!0)}function ih(t,e){return ge.cursor(e?t.to:t.from)}function SA(t,e){return Si(t,n=>n.empty?t.moveByChar(n,e):ih(n,e))}function Kn(t){return t.textDirectionAt(t.state.selection.main.head)==hn.LTR}const wA=t=>SA(t,!Kn(t)),kA=t=>SA(t,Kn(t));function AA(t,e){return Si(t,n=>n.empty?t.moveByGroup(n,e):ih(n,e))}const uz=t=>AA(t,!Kn(t)),fz=t=>AA(t,Kn(t));function dz(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ah(t,e,n){let r=mn(t).resolveInner(e.head),i=n?st.closedBy:st.openedBy;for(let u=e.head;;){let h=n?r.childAfter(u):r.childBefore(u);if(!h)break;dz(t,h,i)?r=h:u=n?h.to:h.from}let a=r.type.prop(i),l,c;return a&&(l=n?Di(t,r.from,1):Di(t,r.to,-1))&&l.matched?c=n?l.end.to:l.end.from:c=n?r.to:r.from,ge.cursor(c,n?-1:1)}const hz=t=>Si(t,e=>ah(t.state,e,!Kn(t))),mz=t=>Si(t,e=>ah(t.state,e,Kn(t)));function MA(t,e){return Si(t,n=>{if(!n.empty)return ih(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const CA=t=>MA(t,!1),TA=t=>MA(t,!0);function EA(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let a of t.state.facet(Ee.scrollMargins)){let l=a(t);l!=null&&l.top&&(n=Math.max(l==null?void 0:l.top,n)),l!=null&&l.bottom&&(r=Math.max(l==null?void 0:l.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function $A(t,e){let n=EA(t),{state:r}=t,i=Yo(r.selection,l=>l.empty?t.moveVertically(l,e,n.height):ih(l,e));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let l=t.coordsAtPos(r.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),u=c.top+n.marginTop,h=c.bottom-n.marginBottom;l&&l.top>u&&l.bottom<h&&(a=Ee.scrollIntoView(i.main.head,{y:"start",yMargin:l.top-u}))}return t.dispatch(vi(r,i),{effects:a}),!0}const q3=t=>$A(t,!1),y8=t=>$A(t,!0);function Ts(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let a=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&e.head!=r.from+a&&(i=ge.cursor(r.from+a))}return i}const pz=t=>Si(t,e=>Ts(t,e,!0)),gz=t=>Si(t,e=>Ts(t,e,!1)),Oz=t=>Si(t,e=>Ts(t,e,!Kn(t))),xz=t=>Si(t,e=>Ts(t,e,Kn(t))),yz=t=>Si(t,e=>ge.cursor(t.lineBlockAt(e.head).from,1)),bz=t=>Si(t,e=>ge.cursor(t.lineBlockAt(e.head).to,-1));function vz(t,e,n){let r=!1,i=Yo(t.selection,a=>{let l=Di(t,a.head,-1)||Di(t,a.head,1)||a.head>0&&Di(t,a.head-1,1)||a.head<t.doc.length&&Di(t,a.head+1,-1);if(!l||!l.end)return a;r=!0;let c=l.start.from==a.head?l.end.to:l.end.from;return ge.cursor(c)});return r?(e(vi(t,i)),!0):!1}const Sz=({state:t,dispatch:e})=>vz(t,e);function ti(t,e){let n=Yo(t.state.selection,r=>{let i=e(r);return ge.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(vi(t.state,n)),!0)}function jA(t,e){return ti(t,n=>t.moveByChar(n,e))}const PA=t=>jA(t,!Kn(t)),QA=t=>jA(t,Kn(t));function ZA(t,e){return ti(t,n=>t.moveByGroup(n,e))}const wz=t=>ZA(t,!Kn(t)),kz=t=>ZA(t,Kn(t)),Az=t=>ti(t,e=>ah(t.state,e,!Kn(t))),Mz=t=>ti(t,e=>ah(t.state,e,Kn(t)));function NA(t,e){return ti(t,n=>t.moveVertically(n,e))}const RA=t=>NA(t,!1),VA=t=>NA(t,!0);function LA(t,e){return ti(t,n=>t.moveVertically(n,e,EA(t).height))}const G3=t=>LA(t,!1),U3=t=>LA(t,!0),Cz=t=>ti(t,e=>Ts(t,e,!0)),Tz=t=>ti(t,e=>Ts(t,e,!1)),Ez=t=>ti(t,e=>Ts(t,e,!Kn(t))),$z=t=>ti(t,e=>Ts(t,e,Kn(t))),jz=t=>ti(t,e=>ge.cursor(t.lineBlockAt(e.head).from)),Pz=t=>ti(t,e=>ge.cursor(t.lineBlockAt(e.head).to)),W3=({state:t,dispatch:e})=>(e(vi(t,{anchor:0})),!0),K3=({state:t,dispatch:e})=>(e(vi(t,{anchor:t.doc.length})),!0),J3=({state:t,dispatch:e})=>(e(vi(t,{anchor:t.selection.main.anchor,head:0})),!0),ev=({state:t,dispatch:e})=>(e(vi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Qz=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Zz=({state:t,dispatch:e})=>{let n=sh(t).map(({from:r,to:i})=>ge.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:ge.create(n),userEvent:"select"})),!0},Nz=({state:t,dispatch:e})=>{let n=Yo(t.selection,r=>{let i=mn(t),a=i.resolveStack(r.from,1);if(r.empty){let l=i.resolveStack(r.from,-1);l.node.from>=a.node.from&&l.node.to<=a.node.to&&(a=l)}for(let l=a;l;l=l.next){let{node:c}=l;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&l.next)return ge.range(c.to,c.from)}return r});return n.eq(t.selection)?!1:(e(vi(t,n)),!0)};function _A(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let a of n.selection.ranges){let l=n.doc.lineAt(a.head);if(e?l.to<t.state.doc.length:l.from>0)for(let c=a;;){let u=t.moveVertically(c,e);if(u.head<l.from||u.head>l.to){i.some(h=>h.head==u.head)||i.push(u);break}else{if(u.head==c.head)break;c=u}}}return i.length==r.ranges.length?!1:(t.dispatch(vi(n,ge.create(i,i.length-1))),!0)}const Rz=t=>_A(t,!1),Vz=t=>_A(t,!0),Lz=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=ge.create([n.main]):n.main.empty||(r=ge.create([ge.cursor(n.main.head)])),r?(e(vi(t,r)),!0):!1};function u0(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(a=>{let{from:l,to:c}=a;if(l==c){let u=e(a);u<l?(n="delete.backward",u=of(t,u,!1)):u>l&&(n="delete.forward",u=of(t,u,!0)),l=Math.min(l,u),c=Math.max(c,u)}else l=of(t,l,!1),c=of(t,c,!0);return l==c?{range:a}:{changes:{from:l,to:c},range:ge.cursor(l,l<a.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ee.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function of(t,e,n){if(t instanceof Ee)for(let r of t.state.facet(Ee.atomicRanges).map(i=>i(t)))r.between(e,e,(i,a)=>{i<e&&a>e&&(e=n?a:i)});return e}const DA=(t,e,n)=>u0(t,r=>{let i=r.from,{state:a}=t,l=a.doc.lineAt(i),c,u;if(n&&!e&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(c=l.text.slice(0,i-l.from))){if(c[c.length-1]==" ")return i-1;let h=Bd(c,a.tabSize),p=h%dd(a)||dd(a);for(let O=0;O<p&&c[c.length-1-O]==" ";O++)i--;u=i}else u=Qn(l.text,i-l.from,e,e)+l.from,u==i&&l.number!=(e?a.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(u-l.from,i-l.from))&&(u=Qn(l.text,u-l.from,!1,!1)+l.from);return u}),b8=t=>DA(t,!1,!0),HA=t=>DA(t,!0,!1),XA=(t,e)=>u0(t,n=>{let r=n.head,{state:i}=t,a=i.doc.lineAt(r),l=i.charCategorizer(r);for(let c=null;;){if(r==(e?a.to:a.from)){r==n.head&&a.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=Qn(a.text,r-a.from,e)+a.from,h=a.text.slice(Math.min(r,u)-a.from,Math.max(r,u)-a.from),p=l(h);if(c!=null&&p!=c)break;(h!=" "||r!=n.head)&&(c=p),r=u}return r}),zA=t=>XA(t,!1),_z=t=>XA(t,!0),Dz=t=>u0(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Hz=t=>u0(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Xz=t=>u0(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),zz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:St.of(["",""])},range:ge.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Fz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,a=t.doc.lineAt(i),l=i==a.from?i-1:Qn(a.text,i-a.from,!1)+a.from,c=i==a.to?i+1:Qn(a.text,i-a.from,!0)+a.from;return{changes:{from:l,to:c,insert:t.doc.slice(i,c).append(t.doc.slice(l,i))},range:ge.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sh(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),a=t.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=t.doc.lineAt(r.to-1)),n>=i.number){let l=e[e.length-1];l.to=a.to,l.ranges.push(r)}else e.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return e}function FA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let a of sh(t)){if(n?a.to==t.doc.length:a.from==0)continue;let l=t.doc.lineAt(n?a.to+1:a.from-1),c=l.length+1;if(n){r.push({from:a.to,to:l.to},{from:a.from,insert:l.text+t.lineBreak});for(let u of a.ranges)i.push(ge.range(Math.min(t.doc.length,u.anchor+c),Math.min(t.doc.length,u.head+c)))}else{r.push({from:l.from,to:a.from},{from:a.to,insert:t.lineBreak+l.text});for(let u of a.ranges)i.push(ge.range(u.anchor-c,u.head-c))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:ge.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Bz=({state:t,dispatch:e})=>FA(t,e,!1),Yz=({state:t,dispatch:e})=>FA(t,e,!0);function BA(t,e,n){if(t.readOnly)return!1;let r=[];for(let a of sh(t))n?r.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):r.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Iz=({state:t,dispatch:e})=>BA(t,e,!1),qz=({state:t,dispatch:e})=>BA(t,e,!0),Gz=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(sh(e).map(({from:i,to:a})=>(i>0?i--:a<e.doc.length&&a++,{from:i,to:a}))),r=Yo(e.selection,i=>{let a;if(t.lineWrapping){let l=t.lineBlockAt(i.head),c=t.coordsAtPos(i.head,i.assoc||1);c&&(a=l.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,a)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Uz(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=mn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),a;return r&&i&&r.to<=e&&i.from>=e&&(a=r.type.prop(st.closedBy))&&a.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const tv=YA(!1),Wz=YA(!0);function YA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:a,to:l}=i,c=e.doc.lineAt(a),u=!t&&a==l&&Uz(e,a);t&&(a=l=(l<=c.to?c:e.doc.lineAt(l)).to);let h=new Jd(e,{simulateBreak:a,simulateDoubleBreak:!!u}),p=ZO(h,a);for(p==null&&(p=Bd(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));l<c.to&&/\s/.test(c.text[l-c.from]);)l++;u?{from:a,to:l}=u:a>c.from&&a<c.from+100&&!/\S/.test(c.text.slice(0,a))&&(a=c.from);let O=["",_u(e,p)];return u&&O.push(_u(e,h.lineIndent(c.from,-1))),{changes:{from:a,to:l,insert:St.of(O)},range:ge.cursor(a+1+O[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function _O(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let c=t.doc.lineAt(l);c.number>n&&(r.empty||r.to>c.from)&&(e(c,i,r),n=c.number),l=c.to+1}let a=t.changes(i);return{changes:i,range:ge.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const Kz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Jd(t,{overrideIndentation:a=>{let l=n[a];return l??-1}}),i=_O(t,(a,l,c)=>{let u=ZO(r,a.from);if(u==null)return;/\S/.test(a.text)||(u=0);let h=/^\s*/.exec(a.text)[0],p=_u(t,u);(h!=p||c.from<a.from+h.length)&&(n[a.from]=u,l.push({from:a.from,to:a.from+h.length,insert:p}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Jz=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_O(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Kd)})}),{userEvent:"input.indent"})),!0),eF=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_O(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=Bd(i,t.tabSize),l=0,c=_u(t,Math.max(0,a-dd(t)));for(;l<i.length&&l<c.length&&i.charCodeAt(l)==c.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:c.slice(l)})}),{userEvent:"delete.dedent"})),!0),tF=t=>(t.setTabFocusMode(),!0),nF=[{key:"Ctrl-b",run:wA,shift:PA,preventDefault:!0},{key:"Ctrl-f",run:kA,shift:QA},{key:"Ctrl-p",run:CA,shift:RA},{key:"Ctrl-n",run:TA,shift:VA},{key:"Ctrl-a",run:yz,shift:jz},{key:"Ctrl-e",run:bz,shift:Pz},{key:"Ctrl-d",run:HA},{key:"Ctrl-h",run:b8},{key:"Ctrl-k",run:Dz},{key:"Ctrl-Alt-h",run:zA},{key:"Ctrl-o",run:zz},{key:"Ctrl-t",run:Fz},{key:"Ctrl-v",run:y8}],rF=[{key:"ArrowLeft",run:wA,shift:PA,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:uz,shift:wz,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Oz,shift:Ez,preventDefault:!0},{key:"ArrowRight",run:kA,shift:QA,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:fz,shift:kz,preventDefault:!0},{mac:"Cmd-ArrowRight",run:xz,shift:$z,preventDefault:!0},{key:"ArrowUp",run:CA,shift:RA,preventDefault:!0},{mac:"Cmd-ArrowUp",run:W3,shift:J3},{mac:"Ctrl-ArrowUp",run:q3,shift:G3},{key:"ArrowDown",run:TA,shift:VA,preventDefault:!0},{mac:"Cmd-ArrowDown",run:K3,shift:ev},{mac:"Ctrl-ArrowDown",run:y8,shift:U3},{key:"PageUp",run:q3,shift:G3},{key:"PageDown",run:y8,shift:U3},{key:"Home",run:gz,shift:Tz,preventDefault:!0},{key:"Mod-Home",run:W3,shift:J3},{key:"End",run:pz,shift:Cz,preventDefault:!0},{key:"Mod-End",run:K3,shift:ev},{key:"Enter",run:tv,shift:tv},{key:"Mod-a",run:Qz},{key:"Backspace",run:b8,shift:b8,preventDefault:!0},{key:"Delete",run:HA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:_z,preventDefault:!0},{mac:"Mod-Backspace",run:Hz,preventDefault:!0},{mac:"Mod-Delete",run:Xz,preventDefault:!0}].concat(nF.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),iF=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:hz,shift:Az},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:mz,shift:Mz},{key:"Alt-ArrowUp",run:Bz},{key:"Shift-Alt-ArrowUp",run:Iz},{key:"Alt-ArrowDown",run:Yz},{key:"Shift-Alt-ArrowDown",run:qz},{key:"Mod-Alt-ArrowUp",run:Rz},{key:"Mod-Alt-ArrowDown",run:Vz},{key:"Escape",run:Lz},{key:"Mod-Enter",run:Wz},{key:"Alt-l",mac:"Ctrl-l",run:Zz},{key:"Mod-i",run:Nz,preventDefault:!0},{key:"Mod-[",run:eF},{key:"Mod-]",run:Jz},{key:"Mod-Alt-\\",run:Kz},{key:"Shift-Mod-k",run:Gz},{key:"Shift-Mod-\\",run:Sz},{key:"Mod-/",run:BX},{key:"Alt-A",run:IX},{key:"Ctrl-m",mac:"Shift-Alt-m",run:tF}].concat(rF);function nv(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function aF(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let a=1;a<i.length;a++)n[i[a]]=!0}let r=nv(e)+nv(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function sF(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:aF(e);return i=>{let a=i.matchBefore(r);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:n}:null}}function lF(t,e){return n=>{for(let r=mn(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}const oF=Qa.define(),cF=Ee.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class uF{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class DO{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Gn.TrackDel),r=e.mapPos(this.to,1,Gn.TrackDel);return n==null||r==null?null:new DO(this.field,n,r)}}class HO{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],a=e.doc.lineAt(n),l=/^\s*/.exec(a.text)[0];for(let u of this.lines){if(r.length){let h=l,p=/^\t*/.exec(u)[0].length;for(let O=0;O<p;O++)h+=e.facet(Kd);i.push(n+h.length-p),u=h+u.slice(p)}r.push(u),n+=u.length+1}let c=this.fieldPositions.map(u=>new DO(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:c}}static parse(e){let n=[],r=[],i=[],a;for(let l of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let c=a[1]?+a[1]:null,u=a[2]||a[3]||"",h=-1,p=u.replace(/\\[{}]/g,O=>O[1]);for(let O=0;O<n.length;O++)(c!=null?n[O].seq==c:p&&n[O].name==p)&&(h=O);if(h<0){let O=0;for(;O<n.length&&(c==null||n[O].seq!=null&&n[O].seq<c);)O++;n.splice(O,0,{seq:c,name:p}),h=O;for(let x of i)x.field>=h&&x.field++}for(let O of i)if(O.line==r.length&&O.from>a.index){let x=a[2]?3+(a[1]||"").length:2;O.from-=x,O.to-=x}i.push(new uF(h,r.length,a.index,a.index+p.length)),l=l.slice(0,a.index)+u+l.slice(a.index+a[0].length)}l=l.replace(/\\([{}])/g,(c,u,h)=>{for(let p of i)p.line==r.length&&p.from>h&&(p.from--,p.to--);return u}),r.push(l)}return new HO(r,i)}}let fF=Je.widget({widget:new class extends pl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),dF=Je.mark({class:"cm-snippetField"});class Io{constructor(e,n){this.ranges=e,this.active=n,this.deco=Je.set(e.map(r=>(r.from==r.to?fF:dF).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Io(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const f0=At.define({map(t,e){return t&&t.map(e)}}),hF=At.define(),Du=Lr.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(f0))return n.value;if(n.is(hF)&&t)return new Io(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ee.decorations.from(t,e=>e?e.deco:Je.none)});function XO(t,e){return ge.create(t.filter(n=>n.field==e).map(n=>ge.range(n.from,n.to)))}function mF(t){let e=HO.parse(t);return(n,r,i,a)=>{let{text:l,ranges:c}=e.instantiate(n.state,i),{main:u}=n.state.selection,h={changes:{from:i,to:a==u.from?u.to:a,insert:St.of(l)},scrollIntoView:!0,annotations:r?[oF.of(r),vn.userEvent.of("input.complete")]:void 0};if(c.length&&(h.selection=XO(c,0)),c.some(p=>p.field>0)){let p=new Io(c,0),O=h.effects=[f0.of(p)];n.state.field(Du,!1)===void 0&&O.push(At.appendConfig.of([Du,yF,bF,cF]))}n.dispatch(n.state.update(h))}}function IA(t){return({state:e,dispatch:n})=>{let r=e.field(Du,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,a=t>0&&!r.ranges.some(l=>l.field==i+t);return n(e.update({selection:XO(r.ranges,i),effects:f0.of(a?null:new Io(r.ranges,i)),scrollIntoView:!0})),!0}}const pF=({state:t,dispatch:e})=>t.field(Du,!1)?(e(t.update({effects:f0.of(null)})),!0):!1,gF=IA(1),OF=IA(-1),xF=[{key:"Tab",run:gF,shift:OF},{key:"Escape",run:pF}],rv=je.define({combine(t){return t.length?t[0]:xF}}),yF=s0.highest(CO.compute([rv],t=>t.facet(rv)));function hr(t,e){return{...e,apply:mF(t)}}const bF=Ee.domEventHandlers({mousedown(t,e){let n=e.state.field(Du,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(a=>a.from<=r&&a.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:XO(n.ranges,i.field),effects:f0.of(n.ranges.some(a=>a.field>i.field)?new Io(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Hu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},el=At.define({map(t,e){let n=e.mapPos(t,-1,Gn.TrackAfter);return n??void 0}}),zO=new class extends bs{};zO.startSide=1;zO.endSide=-1;const qA=Lr.define({create(){return mt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(el)&&(t=t.update({add:[zO.range(n.value,n.value+1)]}));return t}});function vF(){return[wF,qA]}const m2="()[]{}<>«»»«[]{}";function GA(t){for(let e=0;e<m2.length;e+=2)if(m2.charCodeAt(e)==t)return m2.charAt(e+1);return N9(t<128?t:t+1)}function UA(t,e){return t.languageDataAt("closeBrackets",e)[0]||Hu}const SF=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),wF=Ee.inputHandler.of((t,e,n,r)=>{if((SF?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&a0(ml(r,0))==1||e!=i.from||n!=i.to)return!1;let a=MF(t.state,r);return a?(t.dispatch(a),!0):!1}),kF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=UA(t,t.selection.main.head).brackets||Hu.brackets,i=null,a=t.changeByRange(l=>{if(l.empty){let c=CF(t.doc,l.head);for(let u of r)if(u==c&&lh(t.doc,l.head)==GA(ml(u,0)))return{changes:{from:l.head-u.length,to:l.head+u.length},range:ge.cursor(l.head-u.length)}}return{range:i=l}});return i||e(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},AF=[{key:"Backspace",run:kF}];function MF(t,e){let n=UA(t,t.selection.main.head),r=n.brackets||Hu.brackets;for(let i of r){let a=GA(ml(i,0));if(e==i)return a==i?$F(t,i,r.indexOf(i+i+i)>-1,n):TF(t,i,a,n.before||Hu.before);if(e==a&&WA(t,t.selection.main.from))return EF(t,i,a)}return null}function WA(t,e){let n=!1;return t.field(qA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function lh(t,e){let n=t.sliceString(e,e+2);return n.slice(0,a0(ml(n,0)))}function CF(t,e){let n=t.sliceString(e-2,e);return a0(ml(n,0))==n.length?n:n.slice(1)}function TF(t,e,n,r){let i=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:n,from:l.to}],effects:el.of(l.to+e.length),range:ge.range(l.anchor+e.length,l.head+e.length)};let c=lh(t.doc,l.head);return!c||/\s/.test(c)||r.indexOf(c)>-1?{changes:{insert:e+n,from:l.head},effects:el.of(l.head+e.length),range:ge.cursor(l.head+e.length)}:{range:i=l}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function EF(t,e,n){let r=null,i=t.changeByRange(a=>a.empty&&lh(t.doc,a.head)==n?{changes:{from:a.head,to:a.head+n.length,insert:n},range:ge.cursor(a.head+n.length)}:r={range:a});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function $F(t,e,n,r){let i=r.stringPrefixes||Hu.stringPrefixes,a=null,l=t.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:el.of(c.to+e.length),range:ge.range(c.anchor+e.length,c.head+e.length)};let u=c.head,h=lh(t.doc,u),p;if(h==e){if(iv(t,u))return{changes:{insert:e+e,from:u},effects:el.of(u+e.length),range:ge.cursor(u+e.length)};if(WA(t,u)){let x=n&&t.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+x.length,insert:x},range:ge.cursor(u+x.length)}}}else{if(n&&t.sliceDoc(u-2*e.length,u)==e+e&&(p=av(t,u-2*e.length,i))>-1&&iv(t,p))return{changes:{insert:e+e+e+e,from:u},effects:el.of(u+e.length),range:ge.cursor(u+e.length)};if(t.charCategorizer(u)(h)!=en.Word&&av(t,u,i)>-1&&!jF(t,u,e,i))return{changes:{insert:e+e,from:u},effects:el.of(u+e.length),range:ge.cursor(u+e.length)}}return{range:a=c}});return a?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function iv(t,e){let n=mn(t).resolveInner(e+1);return n.parent&&n.from==e}function jF(t,e,n,r){let i=mn(t).resolveInner(e,-1),a=r.reduce((l,c)=>Math.max(l,c.length),0);for(let l=0;l<5;l++){let c=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),u=c.indexOf(n);if(!u||u>-1&&r.indexOf(c.slice(0,u))>-1){let p=i.firstChild;for(;p&&p.from==i.from&&p.to-p.from>n.length+u;){if(t.sliceDoc(p.to-n.length,p.to)==n)return!1;p=p.firstChild}return!0}let h=i.to==e&&i.parent;if(!h)break;i=h}return!1}function av(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=en.Word)return e;for(let i of n){let a=e-i.length;if(t.sliceDoc(a,e)==i&&r(t.sliceDoc(a-1,a))!=en.Word)return a}return-1}const sv=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Vo{constructor(e,n,r=0,i=e.length,a,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=a?c=>a(sv(c)):sv,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ml(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=N9(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=a0(e);let i=this.normalize(n);if(i.length)for(let a=0,l=r,c=!0;;a++){let u=i.charCodeAt(a),h=this.match(u,l,c,this.bufferPos+this.bufferStart,a==i.length-1);if(h)return this.value=h,this;if(a==i.length-1)break;c&&a<n.length&&n.charCodeAt(a)==u?l++:c=!1}}}match(e,n,r,i,a){let l=null;for(let c=0;c<this.matches.length;){let u=this.matches[c],h=!1;this.query.charCodeAt(u.index)==e&&(u.index==this.query.length-1?l={from:u.from,to:i,precise:a&&u.precise}:(u.index++,h=!0)),h?c++:this.matches.splice(c,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:n,to:i,precise:r&&a}:this.matches.push({from:n,index:1,precise:r})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(Vo.prototype[Symbol.iterator]=function(){return this});const KA={from:-1,to:-1,match:/.*/.exec(""),precise:!0},FO="gm"+(/x/.unicode==null?"":"u");class JA{constructor(e,n,r,i=0,a=e.length){if(this.text=e,this.to=a,this.curLine="",this.done=!1,this.value=KA,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new eM(e,n,r,i,a);this.re=new RegExp(n,FO+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let l=e.lineAt(i);this.curLineStart=l.from,this.matchPos=pd(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=pd(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const p2=new WeakMap;class bo{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=p2.get(e);if(!i||i.from>=r||i.to<=n){let c=new bo(n,e.sliceString(n,r));return p2.set(e,c),c}if(i.from==n&&i.to==r)return i;let{text:a,from:l}=i;return l>n&&(a=e.sliceString(n,l)+a,l=n),i.to<r&&(a+=e.sliceString(i.to,r)),p2.set(e,new bo(l,a)),new bo(n,a.slice(n-l,r-l))}}class eM{constructor(e,n,r,i,a){this.text=e,this.to=a,this.done=!1,this.value=KA,this.matchPos=pd(e,i),this.re=new RegExp(n,FO+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=bo.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=pd(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(JA.prototype[Symbol.iterator]=eM.prototype[Symbol.iterator]=function(){return this});function PF(t){try{return new RegExp(t,FO),!0}catch{return!1}}function pd(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}const QF=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=wH(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(a=>{let l=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!l){t.dispatch({effects:r});return}let c=e.doc.lineAt(e.selection.main.head),[,u,h,p,O]=l,x=p?+p.slice(1):0,y=h?+h:c.number;if(h&&O){let k=y/100;u&&(k=k*(u=="-"?-1:1)+c.number/e.doc.lines),y=Math.round(e.doc.lines*k)}else h&&u&&(y=y*(u=="-"?-1:1)+c.number);let b=e.doc.line(Math.max(1,Math.min(e.doc.lines,y))),S=ge.cursor(b.from+Math.max(0,Math.min(x,b.length)));t.dispatch({effects:[r,Ee.scrollIntoView(S.from,{y:"center"})],selection:S})}),!0},ZF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},NF=je.define({combine(t){return Bo(t,ZF,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function RF(t){return[HF,DF]}const VF=Je.mark({class:"cm-selectionMatch"}),LF=Je.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function lv(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=en.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=en.Word)}function _F(t,e,n,r){return t(e.sliceDoc(n,n+1))==en.Word&&t(e.sliceDoc(r-1,r))==en.Word}const DF=yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(NF),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Je.none;let i=r.main,a,l=null;if(i.empty){if(!e.highlightWordAroundCursor)return Je.none;let u=n.wordAt(i.head);if(!u)return Je.none;l=n.charCategorizer(i.head),a=n.sliceDoc(u.from,u.to)}else{let u=i.to-i.from;if(u<e.minSelectionLength||u>200)return Je.none;if(e.wholeWords){if(a=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!(lv(l,n,i.from,i.to)&&_F(l,n,i.from,i.to)))return Je.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Je.none}let c=[];for(let u of t.visibleRanges){let h=new Vo(n.doc,a,u.from,u.to);for(;!h.next().done;){let{from:p,to:O}=h.value;if((!l||lv(l,n,p,O))&&(i.empty&&p<=i.from&&O>=i.to?c.push(LF.range(p,O)):(p>=i.to||O<=i.from)&&c.push(VF.range(p,O)),c.length>e.maxMatches))return Je.none}}return Je.set(c)}},{decorations:t=>t.decorations}),HF=Ee.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),XF=({state:t,dispatch:e})=>{let{selection:n}=t,r=ge.create(n.ranges.map(i=>t.wordAt(i.head)||ge.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function zF(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let l=!1,c=new Vo(t.doc,e,r[r.length-1].to);;)if(c.next(),c.done){if(l)return null;c=new Vo(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(u=>u.from==c.value.from))continue;if(a){let u=t.wordAt(c.value.from);if(!u||u.from!=c.value.from||u.to!=c.value.to)continue}return c.value}}const FF=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(a=>a.from===a.to))return XF({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(a=>t.sliceDoc(a.from,a.to)!=r))return!1;let i=zF(t,r);return i?(e(t.update({selection:t.selection.addRange(ge.range(i.from,i.to),!1),effects:Ee.scrollIntoView(i.to)})),!0):!1},qo=je.define({combine(t){return Bo(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new iB(e),scrollToMatch:e=>Ee.scrollIntoView(e)})}});class tM{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||PF(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
109
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new UF(this):new IF(this)}getCursor(e,n=0,r){let i=e.doc?e:wt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?io(this,i,n,r):ro(this,i,n,r)}}class nM{constructor(e){this.spec=e}}function BF(t,e,n){return(r,i,a,l)=>{if(n&&!n(r,i,a,l))return!1;let c=r>=l&&i<=l+a.length?a.slice(r-l,i-l):e.doc.sliceString(r,i);return t(c,e,r,i)}}function ro(t,e,n,r){let i;return t.wholeWord&&(i=YF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=BF(t.test,e,i)),new Vo(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function YF(t,e){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=t.sliceString(a,Math.min(t.length,r+2))),(e(gd(i,n-a))!=en.Word||e(Od(i,n-a))!=en.Word)&&(e(Od(i,r-a))!=en.Word||e(gd(i,r-a))!=en.Word))}class IF extends nM{constructor(e){super(e)}nextMatch(e,n,r){let i=ro(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let a=Math.min(e.doc.length,n+this.spec.unquoted.length);i=ro(this.spec,e,0,a).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let a=Math.max(n,i-1e4-this.spec.unquoted.length),l=ro(this.spec,e,a,i),c=null;for(;!l.nextOverlapping().done;)c=l.value;if(c)return c;if(a==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=ro(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let a=ro(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}function qF(t,e,n){return(r,i,a)=>(!n||n(r,i,a))&&t(a[0],e,r,i)}function io(t,e,n,r){let i;return t.wholeWord&&(i=GF(e.charCategorizer(e.selection.main.head))),t.test&&(i=qF(t.test,e,i)),new JA(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function gd(t,e){return t.slice(Qn(t,e,!1),e)}function Od(t,e){return t.slice(e,Qn(t,e))}function GF(t){return(e,n,r)=>!r[0].length||(t(gd(r.input,r.index))!=en.Word||t(Od(r.input,r.index))!=en.Word)&&(t(Od(r.input,r.index+r[0].length))!=en.Word||t(gd(r.input,r.index+r[0].length))!=en.Word)}class UF extends nM{nextMatch(e,n,r){let i=io(this.spec,e,r,e.doc.length).next();return i.done&&(i=io(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let a=Math.max(n,r-i*1e4),l=io(this.spec,e,a,r),c=null;for(;!l.next().done;)c=l.value;if(c&&(a==n||c.from>a+10))return c;if(a==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let a=+r.slice(0,i);if(a>0&&a<e.match.length)return e.match[a]+r.slice(i)}return n})}matchAll(e,n){let r=io(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let a=io(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}const Xu=At.define(),BO=At.define(),ps=Lr.define({create(t){return new g2(v8(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Xu)?t=new g2(n.value.create(),t.panel):n.is(BO)&&(t=new g2(t.query,n.value?YO:null));return t},provide:t=>od.from(t,e=>e.panel)});class g2{constructor(e,n){this.query=e,this.panel=n}}const WF=Je.mark({class:"cm-searchMatch"}),KF=Je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),JF=yr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ps))}update(t){let e=t.state.field(ps);(e!=t.startState.field(ps)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Je.none;let{view:n}=this,r=new ol;for(let i=0,a=n.visibleRanges,l=a.length;i<l;i++){let{from:c,to:u}=a[i];for(;i<l-1&&u>a[i+1].from-500;)u=a[++i].to;t.highlight(n.state,c,u,(h,p)=>{let O=n.state.selection.ranges.some(x=>x.from==h&&x.to==p);r.add(h,p,O?KF:WF)})}return r.finish()}},{decorations:t=>t.decorations});function d0(t){return e=>{let n=e.state.field(ps,!1);return n&&n.query.spec.valid?t(e,n):aM(e)}}const xd=d0((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=ge.single(r.from,r.to),a=t.state.facet(qo);return t.dispatch({selection:i,effects:[IO(t,r),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),iM(t),!0}),yd=d0((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let a=ge.single(i.from,i.to),l=t.state.facet(qo);return t.dispatch({selection:a,effects:[IO(t,i),l.scrollToMatch(a.main,t)],userEvent:"select.search"}),iM(t),!0}),eB=d0((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:ge.create(n.map(r=>ge.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),tB=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],l=0;for(let c=new Vo(t.doc,t.sliceDoc(r,i));!c.next().done;){if(a.length>1e3)return!1;c.value.from==r&&(l=a.length),a.push(ge.range(c.value.from,c.value.to))}return e(t.update({selection:ge.create(a,l),userEvent:"select.search.matches"})),!0},ov=d0((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=e.nextMatch(n,r,r);if(!a)return!1;let l=a,c=[],u,h,p=[];l.precise?l.from==r&&l.to==i&&(h=n.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:h}),p.push(Ee.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):l=e.nextMatch(n,l.from,l.to);let O=t.state.changes(c);return l&&(u=ge.single(l.from,l.to).map(O),p.push(IO(t,l)),p.push(n.facet(qo).scrollToMatch(u.main,t))),t.dispatch({changes:O,selection:u,effects:p,userEvent:"input.replace"}),!0}),nB=d0((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let i of e.matchAll(t.state,1e9)){let{from:a,to:l,precise:c}=i;c&&n.push({from:a,to:l,insert:e.getReplacement(i)})}if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ee.announce.of(r),userEvent:"input.replace.all"}),!0});function YO(t){return t.state.facet(qo).createPanel(t)}function v8(t,e){var n,r,i,a,l;let c=t.selection.main,u=c.empty||c.to>c.from+100?"":t.sliceDoc(c.from,c.to);if(e&&!u)return e;let h=t.facet(qo);return new tM({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:h.literal,regexp:(a=e==null?void 0:e.regexp)!==null&&a!==void 0?a:h.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:h.wholeWord})}function rM(t){let e=zk(t,YO);return e&&e.dom.querySelector("[main-field]")}function iM(t){let e=rM(t);e&&e==t.root.activeElement&&e.select()}const aM=t=>{let e=t.state.field(ps,!1);if(e&&e.panel){let n=rM(t);if(n&&n!=t.root.activeElement){let r=v8(t.state,e.query.spec);r.valid&&t.dispatch({effects:Xu.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[BO.of(!0),e?Xu.of(v8(t.state,e.query.spec)):At.appendConfig.of(sB)]});return!0},sM=t=>{let e=t.state.field(ps,!1);if(!e||!e.panel)return!1;let n=zk(t,YO);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:BO.of(!1)}),!0},rB=[{key:"Mod-f",run:aM,scope:"editor search-panel"},{key:"F3",run:xd,shift:yd,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:xd,shift:yd,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sM,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tB},{key:"Mod-Alt-g",run:QF},{key:"Mod-d",run:FF,preventDefault:!0}];class iB{constructor(e){this.view=e;let n=this.query=e.state.field(ps).query.spec;this.commit=this.commit.bind(this),this.searchField=jn("input",{value:n.search,placeholder:Pr(e,"Find"),"aria-label":Pr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=jn("input",{value:n.replace,placeholder:Pr(e,"Replace"),"aria-label":Pr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=jn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=jn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=jn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,a,l){return jn("button",{class:"cm-button",name:i,onclick:a,type:"button"},l)}this.dom=jn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>xd(e),[Pr(e,"next")]),r("prev",()=>yd(e),[Pr(e,"previous")]),r("select",()=>eB(e),[Pr(e,"all")]),jn("label",null,[this.caseField,Pr(e,"match case")]),jn("label",null,[this.reField,Pr(e,"regexp")]),jn("label",null,[this.wordField,Pr(e,"by word")]),...e.state.readOnly?[]:[jn("br"),this.replaceField,r("replace",()=>ov(e),[Pr(e,"replace")]),r("replaceAll",()=>nB(e),[Pr(e,"replace all")])],jn("button",{name:"close",onclick:()=>sM(e),"aria-label":Pr(e,"close"),type:"button"},["×"])])}commit(){let e=new tM({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Xu.of(e)}))}keydown(e){OH(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?yd:xd)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ov(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Xu)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(qo).top}}function Pr(t,e){return t.state.phrase(e)}const cf=30,uf=/[\s\.,:;?!]/;function IO(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,a=Math.max(r.from,e-cf),l=Math.min(i,n+cf),c=t.state.sliceDoc(a,l);if(a!=r.from){for(let u=0;u<cf;u++)if(!uf.test(c[u+1])&&uf.test(c[u])){c=c.slice(u);break}}if(l!=i){for(let u=c.length-1;u>c.length-cf;u--)if(!uf.test(c[u-1])&&uf.test(c[u])){c=c.slice(0,u);break}}return Ee.announce.of(`${t.state.phrase("current match")}. ${c} ${t.state.phrase("on line")} ${r.number}.`)}const aB=Ee.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),sB=[ps,s0.low(JF),aB],lB="#e5c07b",cv="#e06c75",oB="#56b6c2",cB="#ffffff",Lf="#abb2bf",S8="#7d8799",uB="#61afef",fB="#98c379",uv="#d19a66",dB="#c678dd",hB="#21252b",fv="#2c313a",dv="#282c34",O2="#353a42",mB="#3E4451",hv="#528bff",pB=Ee.theme({"&":{color:Lf,backgroundColor:dv},".cm-content":{caretColor:hv},".cm-cursor, .cm-dropCursor":{borderLeftColor:hv},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:mB},".cm-panels":{backgroundColor:hB,color:Lf},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:dv,color:S8,border:"none"},".cm-activeLineGutter":{backgroundColor:fv},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:O2},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:O2,borderBottomColor:O2},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:fv,color:Lf}}},{dark:!0}),gB=nh.define([{tag:te.keyword,color:dB},{tag:[te.name,te.deleted,te.character,te.propertyName,te.macroName],color:cv},{tag:[te.function(te.variableName),te.labelName],color:uB},{tag:[te.color,te.constant(te.name),te.standard(te.name)],color:uv},{tag:[te.definition(te.name),te.separator],color:Lf},{tag:[te.typeName,te.className,te.number,te.changed,te.annotation,te.modifier,te.self,te.namespace],color:lB},{tag:[te.operator,te.operatorKeyword,te.url,te.escape,te.regexp,te.link,te.special(te.string)],color:oB},{tag:[te.meta,te.comment],color:S8},{tag:te.strong,fontWeight:"bold"},{tag:te.emphasis,fontStyle:"italic"},{tag:te.strikethrough,textDecoration:"line-through"},{tag:te.link,color:S8,textDecoration:"underline"},{tag:te.heading,fontWeight:"bold",color:cv},{tag:[te.atom,te.bool,te.special(te.variableName)],color:uv},{tag:[te.processingInstruction,te.string,te.inserted],color:fB},{tag:te.invalid,color:cB}]),OB=[pB,$X(gB)];var mv={};class bd{constructor(e,n,r,i,a,l,c,u,h,p=0,O){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=a,this.score=l,this.buffer=c,this.bufferBase=u,this.curContext=h,this.lookAhead=p,this.parent=O}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new bd(e,[],n,r,r,0,[],0,i?new pv(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:a}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=a.dynamicPrecedence(i);if(c&&(this.score+=c),r==0){i<a.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(a.getGoto(this.state,i,!0),this.reducePos),i<a.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),h=u?this.stack[u-2]:this.p.ranges[0].from;i<a.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let p=this.reducePos-h;p>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=p):this.p.lastBigReductionSize<p&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=p));let O=u?this.stack[u-1]:0,x=this.bufferBase+this.buffer.length-O;if(i<a.minRepeatTerm||e&131072){let y=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,h,y,x+4,!0)}if(e&262144)this.state=this.stack[u];else{let y=this.stack[u-3];this.state=a.getGoto(y,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,h)}storeNode(e,n,r,i=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this.buffer.length;if(l>0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(n==r)return;if(this.buffer[l-2]>=n){this.buffer[l-2]=r;return}}}if(!a||this.pos==r)this.buffer.push(e,n,r,i);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let c=!1;for(let u=l;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){c=!0;break}if(c)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4)}this.buffer[l]=e,this.buffer[l+1]=n,this.buffer[l+2]=r,this.buffer[l+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let a=e,{parser:l}=this.p;this.pos=i;let c=l.stateFlag(a,1);!c&&(i>r||n<=l.maxNode)&&(this.reducePos=i),this.pushState(a,c?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=l.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new bd(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new xB(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let a=0,l;a<n.length;a+=2)(l=n[a+1])!=this.state&&this.p.parser.hasAction(l,e)&&i.push(n[a],l);if(this.stack.length<120)for(let a=0;i.length<8&&a<n.length;a+=2){let l=n[a+1];i.some((c,u)=>u&1&&c==l)||i.push(n[a],l)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let a=n[i+1];if(a==this.state)continue;let l=this.split();l.pushState(a,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(n[i],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,a=this.stack.length-r*3;if(a<0||e.getGoto(this.stack[a],i,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;n=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,a)=>{if(!n.includes(i))return n.push(i),e.allActions(i,l=>{if(!(l&393216))if(l&65536){let c=(l>>19)-a;if(c>1){let u=l&65535,h=this.stack.length-c*3;if(h>=0&&e.getGoto(this.stack[h],u,!1)>=0)return c<<19|65536|u}}else{let c=r(l,a+1);if(c!=null)return c}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new pv(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class pv{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class xB{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class vd{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new vd(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new vd(this.stack,this.pos,this.index)}}function ru(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let a=0;for(;;){let l=t.charCodeAt(r++),c=!1;if(l==126){a=65535;break}l>=92&&l--,l>=34&&l--;let u=l-32;if(u>=46&&(u-=46,c=!0),a+=u,c)break;a*=46}n?n[i++]=a:n=new e(a)}return n}class _f{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gv=new _f;class yB{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gv,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,a=this.pos+e;for(;a<r.from;){if(!i)return null;let l=this.ranges[--i];a-=r.from-l.to,r=l}for(;n<0?a>r.to:a>=r.to;){if(i==this.ranges.length-1)return null;let l=this.ranges[++i];a+=l.from-r.to,r=l}return a}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let a=this.resolveOffset(e,1);if(a==null)return-1;if(r=a,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,c=this.range;for(;c.to<=r;)c=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=gv,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class vo{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;lM(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}vo.prototype.contextual=vo.prototype.fallback=vo.prototype.extend=!1;class Sd{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?ru(e):e}token(e,n){let r=e.pos,i=0;for(;;){let a=e.next<0,l=e.resolveOffset(1,1);if(lM(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,l==null)break;e.reset(l,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}Sd.prototype.contextual=vo.prototype.fallback=vo.prototype.extend=!1;class _r{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function lM(t,e,n,r,i,a){let l=0,c=1<<r,{dialect:u}=n.p.parser;e:for(;(c&t[l])!=0;){let h=t[l+1];for(let y=l+3;y<h;y+=2)if((t[y+1]&c)>0){let b=t[y];if(u.allows(b)&&(e.token.value==-1||e.token.value==b||bB(b,e.token.value,i,a))){e.acceptToken(b);break}}let p=e.next,O=0,x=t[l+2];if(e.next<0&&x>O&&t[h+x*3-3]==65535){l=t[h+x*3-1];continue e}for(;O<x;){let y=O+x>>1,b=h+y+(y<<1),S=t[b],k=t[b+1]||65536;if(p<S)x=y;else if(p>=k)O=y+1;else{l=t[b+2],e.advance();continue e}}break}}function Ov(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function bB(t,e,n,r){let i=Ov(n,r,e);return i<0||Ov(n,r,t)<i}const Qr=typeof process<"u"&&mv&&/\bparse\b/.test(mv.LOG);let x2=null;function xv(t,e,n){let r=t.cursor(Pt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class vB{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xv(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xv(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=r.children[i],l=this.start[n]+r.positions[i];if(l>e)return this.nextStart=l,null;if(a instanceof tn){if(l==e){if(l<this.safeFrom)return null;let c=l+a.length;if(c<=this.safeTo){let u=a.prop(st.lookAhead);if(!u||c+u<this.fragment.to)return a}}this.index[n]++,l+a.length>=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(l),this.index.push(0))}else this.index[n]++,this.nextStart=l+a.length}}}class SB{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new _f)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:a}=i,l=i.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,u=0;for(let h=0;h<a.length;h++){if((1<<h&l)==0)continue;let p=a[h],O=this.tokens[h];if(!(r&&!p.fallback)&&((p.contextual||O.start!=e.pos||O.mask!=l||O.context!=c)&&(this.updateCachedToken(O,p,e),O.mask=l,O.context=c),O.lookAhead>O.end+25&&(u=Math.max(O.lookAhead,u)),O.value!=0)){let x=n;if(O.extended>-1&&(n=this.addActions(e,O.extended,O.end,n)),n=this.addActions(e,O.value,O.end,n),!p.extend&&(r=O,n>x))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new _f,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new _f,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:a}=r.p;for(let l=0;l<a.specialized.length;l++)if(a.specialized[l]==e.value){let c=a.specializers[l](this.stream.read(e.start,e.end),r);if(c>=0&&r.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let a=0;a<i;a+=3)if(this.actions[a]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:a}=e,{parser:l}=e.p,{data:c}=l;for(let u=0;u<2;u++)for(let h=l.stateSlot(a,u?2:1);;h+=3){if(c[h]==65535)if(c[h+1]==1)h=ha(c,h+2);else{i==0&&c[h+1]==2&&(i=this.putAction(ha(c,h+2),n,r,i));break}c[h]==n&&(i=this.putAction(ha(c,h+1),n,r,i))}return i}}class wB{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new yB(n,i),this.tokens=new SB(e,this.stream),this.topTerm=e.top[1];let{from:a}=i[0];this.stacks=[bd.start(this,e.top[0],a)],this.fragments=r.length&&this.stream.end-a>e.bufferLength*4?new vB(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,a;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let c=e[l];for(;;){if(this.tokens.mainToken=null,c.pos>n)r.push(c);else{if(this.advanceStack(c,r,e))continue;{i||(i=[],a=[]),i.push(c);let u=this.tokens.getMainToken(c);a.push(u.value,u.end)}}break}}if(!r.length){let l=i&&AB(i);if(l)return Qr&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Qr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let l=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,r);if(l)return Qr&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((c,u)=>u.score-c.score);r.length>l;)r.pop();r.some(c=>c.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let c=r[l];for(let u=l+1;u<r.length;u++){let h=r[u];if(c.sameState(h)||c.buffer.length>500&&h.buffer.length>500)if((c.score-h.score||c.buffer.length-h.buffer.length)>0)r.splice(u--,1);else{r.splice(l--,1);continue e}}}r.length>12&&(r.sort((l,c)=>c.score-l.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:a}=this,l=Qr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,p=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(i);O;){let x=this.parser.nodeSet.types[O.type.id]==O.type?a.getGoto(e.state,O.type.id):-1;if(x>-1&&O.length&&(!h||(O.prop(st.contextHash)||0)==p))return e.useNode(O,x),Qr&&console.log(l+this.stackID(e)+` (via reuse of ${a.getName(O.type.id)})`),!0;if(!(O instanceof tn)||O.children.length==0||O.positions[0]>0)break;let y=O.children[0];if(y instanceof tn&&O.positions[0]==0)O=y;else break}}let c=a.stateSlot(e.state,4);if(c>0)return e.reduce(c),Qr&&console.log(l+this.stackID(e)+` (via always-reduce ${a.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let h=0;h<u.length;){let p=u[h++],O=u[h++],x=u[h++],y=h==u.length||!r,b=y?e:e.split(),S=this.tokens.mainToken;if(b.apply(p,O,S?S.start:b.pos,x),Qr&&console.log(l+this.stackID(b)+` (via ${(p&65536)==0?"shift":`reduce of ${a.getName(p&65535)}`} for ${a.getName(O)} @ ${i}${b==e?"":", split"})`),y)return!0;b.pos>i?n.push(b):r.push(b)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return yv(e,n),!0}}runRecovery(e,n,r){let i=null,a=!1;for(let l=0;l<e.length;l++){let c=e[l],u=n[l<<1],h=n[(l<<1)+1],p=Qr?this.stackID(c)+" -> ":"";if(c.deadEnd&&(a||(a=!0,c.restart(),Qr&&console.log(p+this.stackID(c)+" (restarted)"),this.advanceFully(c,r))))continue;let O=c.split(),x=p;for(let y=0;y<10&&O.forceReduce()&&(Qr&&console.log(x+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,r));y++)Qr&&(x=this.stackID(O)+" -> ");for(let y of c.recoverByInsert(u))Qr&&console.log(p+this.stackID(y)+" (via recover-insert)"),this.advanceFully(y,r);this.stream.end>c.pos?(h==c.pos&&(h++,u=0),c.recoverByDelete(u,h),Qr&&console.log(p+this.stackID(c)+` (via recover-delete ${this.parser.getName(u)})`),yv(c,r)):(!i||i.score<O.score)&&(i=O)}return i}stackToTree(e){return e.close(),tn.build({buffer:vd.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(x2||(x2=new WeakMap)).get(e);return n||x2.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function yv(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class kB{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const y2=t=>t;class oM{constructor(e){this.start=e.start,this.shift=e.shift||y2,this.reduce=e.reduce||y2,this.reuse=e.reuse||y2,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Lo extends eA{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let c=0;c<e.repeatNodeCount;c++)n.push("");let r=Object.keys(e.topRules).map(c=>e.topRules[c][1]),i=[];for(let c=0;c<n.length;c++)i.push([]);function a(c,u,h){i[c].push([u,u.deserialize(String(h))])}if(e.nodeProps)for(let c of e.nodeProps){let u=c[0];typeof u=="string"&&(u=st[u]);for(let h=1;h<c.length;){let p=c[h++];if(p>=0)a(p,u,c[h++]);else{let O=c[h+-p];for(let x=-p;x>0;x--)a(c[h++],u,O);h++}}}this.nodeSet=new TO(n.map((c,u)=>ir.define({name:u>=this.minRepeatTerm?void 0:c,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Gk;let l=ru(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(bv),this.states=ru(e.states,Uint32Array),this.data=ru(e.stateData),this.goto=ru(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new vo(l,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new wB(this,e,n,r);for(let a of this.wrappers)i=a(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let a=i[n+1];;){let l=i[a++],c=l&1,u=i[a++];if(c&&r)return u;for(let h=a+(l>>1);a<h;a++)if(i[a]==e)return u;if(c)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let a=this.stateSlot(e,i?2:1),l;;a+=3){if((l=r[a])==65535)if(r[a+1]==1)l=r[a=ha(r,a+2)];else{if(r[a+1]==2)return ha(r,a+2);break}if(l==n||l==0)return ha(r,a+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let a=this.stateSlot(e,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=ha(this.data,a+2);else break;i=n(ha(this.data,a+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ha(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((a,l)=>l&1&&a==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Lo.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(a=>a.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let a=e.specializers.find(c=>c.from==r.external);if(!a)return r;let l=Object.assign(Object.assign({},r),{external:a.to});return n.specializers[i]=bv(l),l})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let a of e.split(" ")){let l=n.indexOf(a);l>=0&&(r[l]=!0)}let i=null;for(let a=0;a<n.length;a++)if(!r[a])for(let l=this.dialects[n[a]],c;(c=this.data[l++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[c]=1;return new kB(e,r,i)}static deserialize(e){return new Lo(e)}}function ha(t,e){return t[e]|t[e+1]<<16}function AB(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function bv(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const MB=55,CB=1,TB=56,EB=2,$B=57,jB=3,vv=4,PB=5,qO=6,cM=7,uM=8,fM=9,dM=10,QB=11,ZB=12,NB=13,b2=58,RB=14,VB=15,Sv=59,hM=21,LB=23,mM=24,_B=25,w8=27,pM=28,DB=29,HB=32,XB=35,zB=37,FB=38,BB=0,YB=1,IB={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},qB={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},wv={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function GB(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let kv=null,Av=null,Mv=0;function k8(t,e){let n=t.pos+e;if(Mv==n&&Av==t)return kv;let r=t.peek(e),i="";for(;GB(r);)i+=String.fromCharCode(r),r=t.peek(++e);return Av=t,Mv=n,kv=i?i.toLowerCase():r==UB||r==WB?void 0:null}const gM=60,wd=62,GO=47,UB=63,WB=33,KB=45;function Cv(t,e){this.name=t,this.parent=e}const JB=[qO,dM,cM,uM,fM],eY=new oM({start:null,shift(t,e,n,r){return JB.indexOf(e)>-1?new Cv(k8(r,1)||"",t):t},reduce(t,e){return e==hM&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==qO||i==zB?new Cv(k8(r,1)||"",t):t},strict:!1}),tY=new _r((t,e)=>{if(t.next!=gM){t.next<0&&e.context&&t.acceptToken(b2);return}t.advance();let n=t.next==GO;n&&t.advance();let r=k8(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?VB:RB);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(QB);if(i&&qB[i])return t.acceptToken(b2,-2);if(e.dialectEnabled(BB))return t.acceptToken(ZB);for(let a=e.context;a;a=a.parent)if(a.name==r)return;t.acceptToken(NB)}else{if(r=="script")return t.acceptToken(cM);if(r=="style")return t.acceptToken(uM);if(r=="textarea")return t.acceptToken(fM);if(IB.hasOwnProperty(r))return t.acceptToken(dM);i&&wv[i]&&wv[i][r]?t.acceptToken(b2,-1):t.acceptToken(qO)}},{contextual:!0}),nY=new _r(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(Sv);break}if(t.next==KB)e++;else if(t.next==wd&&e>=2){n>=3&&t.acceptToken(Sv,-2);break}else e=0;t.advance()}});function rY(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const iY=new _r((t,e)=>{if(t.next==GO&&t.peek(1)==wd){let n=e.dialectEnabled(YB)||rY(e.context);t.acceptToken(n?PB:vv,2)}else t.next==wd&&t.acceptToken(vv,1)});function UO(t,e,n){let r=2+t.length;return new _r(i=>{for(let a=0,l=0,c=0;;c++){if(i.next<0){c&&i.acceptToken(e);break}if(a==0&&i.next==gM||a==1&&i.next==GO||a>=2&&a<r&&i.next==t.charCodeAt(a-2))a++,l++;else if(a==r&&i.next==wd){c>l?i.acceptToken(e,-l):i.acceptToken(n,-(l-2));break}else if((i.next==10||i.next==13)&&c){i.acceptToken(e,1);break}else a=l=0;i.advance()}})}const aY=UO("script",MB,CB),sY=UO("style",TB,EB),lY=UO("textarea",$B,jB),oY=Wd({"Text RawText IncompleteTag IncompleteCloseTag":te.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":te.angleBracket,TagName:te.tagName,"MismatchedCloseTag/TagName":[te.tagName,te.invalid],AttributeName:te.attributeName,"AttributeValue UnquotedAttributeValue":te.attributeValue,Is:te.definitionOperator,"EntityReference CharacterReference":te.character,Comment:te.blockComment,ProcessingInst:te.processingInstruction,DoctypeDecl:te.documentMeta}),cY=Lo.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:eY,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[oY],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[aY,sY,lY,iY,tY,nY,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function OM(t,e){let n=Object.create(null);for(let r of t.getChildren(mM)){let i=r.getChild(_B),a=r.getChild(w8)||r.getChild(pM);i&&(n[e.read(i.from,i.to)]=a?a.type.id==w8?e.read(a.from+1,a.to-1):e.read(a.from,a.to):"")}return n}function Tv(t,e){let n=t.getChild(LB);return n?e.read(n.from,n.to):" "}function v2(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=OM(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function xM(t=[],e=[]){let n=[],r=[],i=[],a=[];for(let c of t)(c.tag=="script"?n:c.tag=="style"?r:c.tag=="textarea"?i:a).push(c);let l=e.length?Object.create(null):null;for(let c of e)(l[c.name]||(l[c.name]=[])).push(c);return BH((c,u)=>{let h=c.type.id;if(h==DB)return v2(c,u,n);if(h==HB)return v2(c,u,r);if(h==XB)return v2(c,u,i);if(h==hM&&a.length){let p=c.node,O=p.firstChild,x=O&&Tv(O,u),y;if(x){for(let b of a)if(b.tag==x&&(!b.attrs||b.attrs(y||(y=OM(O,u))))){let S=p.lastChild,k=S.type.id==FB?S.from:p.to;if(k>O.to)return{parser:b.parser,overlay:[{from:O.to,to:k}]}}}}if(l&&h==mM){let p=c.node,O;if(O=p.firstChild){let x=l[u.read(O.from,O.to)];if(x)for(let y of x){if(y.tagName&&y.tagName!=Tv(p.parent,u))continue;let b=p.lastChild;if(b.type.id==w8){let S=b.from+1,k=b.lastChild,A=b.to-(k&&k.isError?0:1);if(A>S)return{parser:y.parser,overlay:[{from:S,to:A}],bracketed:!0}}else if(b.type.id==pM)return{parser:y.parser,overlay:[{from:b.from,to:b.to}]}}}}return null})}const uY=135,Ev=1,fY=136,dY=137,yM=2,hY=138,mY=3,pY=4,bM=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],gY=58,OY=40,vM=95,xY=91,Df=45,yY=46,bY=35,vY=37,SY=38,wY=92,kY=10,AY=42;function zu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function WO(t){return t>=48&&t<=57}function $v(t){return WO(t)||t>=97&&t<=102||t>=65&&t<=70}const SM=(t,e,n)=>(r,i)=>{for(let a=!1,l=0,c=0;;c++){let{next:u}=r;if(zu(u)||u==Df||u==vM||a&&WO(u))!a&&(u!=Df||c>0)&&(a=!0),l===c&&u==Df&&l++,r.advance();else if(u==wY&&r.peek(1)!=kY){if(r.advance(),$v(r.next)){do r.advance();while($v(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(l==2&&i.canShift(yM)?e:u==OY?n:t);break}}},MY=new _r(SM(fY,yM,dY),{contextual:!0}),CY=new _r(SM(hY,mY,pY),{contextual:!0}),TY=new _r(t=>{if(bM.includes(t.peek(-1))){let{next:e}=t;(zu(e)||e==vM||e==bY||e==yY||e==AY||e==xY||e==gY&&zu(t.peek(1))||e==Df||e==SY)&&t.acceptToken(uY)}}),EY=new _r(t=>{if(!bM.includes(t.peek(-1))){let{next:e}=t;if(e==vY&&(t.advance(),t.acceptToken(Ev)),zu(e)){do t.advance();while(zu(t.next)||WO(t.next));t.acceptToken(Ev)}}}),$Y=Wd({"AtKeyword import charset namespace keyframes media supports font-feature-values":te.definitionKeyword,"from to selector scope MatchFlag":te.keyword,NamespaceName:te.namespace,KeyframeName:te.labelName,KeyframeRangeName:te.operatorKeyword,TagName:te.tagName,ClassName:te.className,PseudoClassName:te.constant(te.className),IdName:te.labelName,"FeatureName PropertyName":te.propertyName,AttributeName:te.attributeName,NumberLiteral:te.number,KeywordQuery:te.keyword,UnaryQueryOp:te.operatorKeyword,"CallTag ValueName FontName":te.atom,VariableName:te.variableName,Callee:te.operatorKeyword,Unit:te.unit,"UniversalSelector NestingSelector":te.definitionOperator,"MatchOp CompareOp":te.compareOperator,"ChildOp SiblingOp, LogicOp":te.logicOperator,BinOp:te.arithmeticOperator,Important:te.modifier,Comment:te.blockComment,ColorLiteral:te.color,"ParenthesizedContent StringLiteral":te.string,":":te.punctuation,"PseudoOp #":te.derefOperator,"; , |":te.separator,"( )":te.paren,"[ ]":te.squareBracket,"{ }":te.brace}),jY={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},PY={__proto__:null,or:104,and:104,not:112,only:112,layer:186},QY={__proto__:null,selector:118,layer:182},ZY={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},NY={__proto__:null,to:223},RY=Lo.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[$Y],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[TY,EY,MY,CY,1,2,3,4,new Sd("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>jY[t]||-1},{term:138,get:t=>PY[t]||-1},{term:4,get:t=>QY[t]||-1},{term:28,get:t=>ZY[t]||-1},{term:136,get:t=>NY[t]||-1}],tokenPrec:2256});let S2=null;function w2(){if(!S2&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));S2=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return S2||[]}const jv=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),Pv=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),VY=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),LY=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),da=/^(\w[\w-]*|-\w[\w-]*|)$/,_Y=/^-(-[\w-]*)?$/;function DY(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const Qv=new Jk,HY=["Declaration"];function XY(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function wM(t,e,n){if(e.to-e.from>4096){let r=Qv.get(e);if(r)return r;let i=[],a=new Set,l=e.cursor(Pt.IncludeAnonymous);if(l.firstChild())do for(let c of wM(t,l.node,n))a.has(c.label)||(a.add(c.label),i.push(c));while(l.nextSibling());return Qv.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(a=>{var l;if(n(a)&&a.matchContext(HY)&&((l=a.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let c=t.sliceString(a.from,a.to);i.has(c)||(i.add(c),r.push({label:c,type:"variable"}))}}),r}}const zY=t=>e=>{let{state:n,pos:r}=e,i=mn(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(a||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:w2(),validFor:da};if(i.name=="ValueName")return{from:i.from,options:Pv,validFor:da};if(i.name=="PseudoClassName")return{from:i.from,options:jv,validFor:da};if(t(i)||(e.explicit||a)&&DY(i,n.doc))return{from:t(i)||a?i.from:r,options:wM(n.doc,XY(i),t),validFor:_Y};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:w2(),validFor:da};return{from:i.from,options:VY,validFor:da}}if(i.name=="AtKeyword")return{from:i.from,options:LY,validFor:da};if(!e.explicit)return null;let l=i.resolve(r),c=l.childBefore(r);return c&&c.name==":"&&l.name=="PseudoClassSelector"?{from:r,options:jv,validFor:da}:c&&c.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:r,options:Pv,validFor:da}:l.name=="Block"||l.name=="Styles"?{from:r,options:w2(),validFor:da}:null},FY=zY(t=>t.name=="VariableName"),kd=No.define({name:"css",parser:RY.configure({props:[eh.add({Declaration:Vf()}),th.add({"Block KeyframeList":lA})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function kM(){return new QO(kd,kd.data.of({autocomplete:FY}))}const BY=316,YY=317,Zv=1,IY=2,qY=3,GY=4,UY=318,WY=320,KY=321,JY=5,eI=6,tI=0,A8=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],AM=125,nI=59,M8=47,rI=42,iI=43,aI=45,sI=60,lI=44,oI=63,cI=46,uI=91,fI=new oM({start:!1,shift(t,e){return e==JY||e==eI||e==WY?t:e==KY},strict:!1}),dI=new _r((t,e)=>{let{next:n}=t;(n==AM||n==-1||e.context)&&t.acceptToken(UY)},{contextual:!0,fallback:!0}),hI=new _r((t,e)=>{let{next:n}=t,r;A8.indexOf(n)>-1||n==M8&&((r=t.peek(1))==M8||r==rI)||n!=AM&&n!=nI&&n!=-1&&!e.context&&t.acceptToken(BY)},{contextual:!0}),mI=new _r((t,e)=>{t.next==uI&&!e.context&&t.acceptToken(YY)},{contextual:!0}),pI=new _r((t,e)=>{let{next:n}=t;if(n==iI||n==aI){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(Zv);t.acceptToken(r?Zv:IY)}}else n==oI&&t.peek(1)==cI&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(qY))},{contextual:!0});function k2(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const gI=new _r((t,e)=>{if(t.next!=sI||!e.dialectEnabled(tI)||(t.advance(),t.next==M8))return;let n=0;for(;A8.indexOf(t.next)>-1;)t.advance(),n++;if(k2(t.next,!0)){for(t.advance(),n++;k2(t.next,!1);)t.advance(),n++;for(;A8.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==lI)return;for(let r=0;;r++){if(r==7){if(!k2(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(GY,-n)}),OI=Wd({"get set async static":te.modifier,"for while do if else switch try catch finally return throw break continue default case defer":te.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":te.operatorKeyword,"let var const using function class extends":te.definitionKeyword,"import export from":te.moduleKeyword,"with debugger new":te.keyword,TemplateString:te.special(te.string),super:te.atom,BooleanLiteral:te.bool,this:te.self,null:te.null,Star:te.modifier,VariableName:te.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":te.function(te.variableName),VariableDefinition:te.definition(te.variableName),Label:te.labelName,PropertyName:te.propertyName,PrivatePropertyName:te.special(te.propertyName),"CallExpression/MemberExpression/PropertyName":te.function(te.propertyName),"FunctionDeclaration/VariableDefinition":te.function(te.definition(te.variableName)),"ClassDeclaration/VariableDefinition":te.definition(te.className),"NewExpression/VariableName":te.className,PropertyDefinition:te.definition(te.propertyName),PrivatePropertyDefinition:te.definition(te.special(te.propertyName)),UpdateOp:te.updateOperator,"LineComment Hashbang":te.lineComment,BlockComment:te.blockComment,Number:te.number,String:te.string,Escape:te.escape,ArithOp:te.arithmeticOperator,LogicOp:te.logicOperator,BitOp:te.bitwiseOperator,CompareOp:te.compareOperator,RegExp:te.regexp,Equals:te.definitionOperator,Arrow:te.function(te.punctuation),": Spread":te.punctuation,"( )":te.paren,"[ ]":te.squareBracket,"{ }":te.brace,"InterpolationStart InterpolationEnd":te.special(te.brace),".":te.derefOperator,", ;":te.separator,"@":te.meta,TypeName:te.typeName,TypeDefinition:te.definition(te.typeName),"type enum interface implements namespace module declare":te.definitionKeyword,"abstract global Privacy readonly override":te.modifier,"is keyof unique infer asserts":te.operatorKeyword,JSXAttributeValue:te.attributeValue,JSXText:te.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":te.angleBracket,"JSXIdentifier JSXNameSpacedName":te.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":te.attributeName,"JSXBuiltin/JSXIdentifier":te.standard(te.tagName)}),xI={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},yI={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},bI={__proto__:null,"<":193},vI=Lo.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hOTX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WOPP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:fI,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[OI],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[hI,mI,pI,gI,2,3,4,5,6,7,8,9,10,11,12,13,14,dI,new Sd("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Sd("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>xI[t]||-1},{term:343,get:t=>yI[t]||-1},{term:95,get:t=>bI[t]||-1}],tokenPrec:15201}),MM=[hr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),hr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),hr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),hr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),hr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),hr(`try {
|
|
110
|
+
\${}
|
|
111
|
+
} catch (\${error}) {
|
|
112
|
+
\${}
|
|
113
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),hr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),hr(`if (\${}) {
|
|
114
|
+
\${}
|
|
115
|
+
} else {
|
|
116
|
+
\${}
|
|
117
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),hr(`class \${name} {
|
|
118
|
+
constructor(\${params}) {
|
|
119
|
+
\${}
|
|
120
|
+
}
|
|
121
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),hr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),hr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],SI=MM.concat([hr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),hr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),hr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Nv=new Jk,CM=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function qc(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const wI=["FunctionDeclaration"],kI={FunctionDeclaration:qc("function"),ClassDeclaration:qc("class"),ClassExpression:()=>!0,EnumDeclaration:qc("constant"),TypeAliasDeclaration:qc("type"),NamespaceDeclaration:qc("namespace"),VariableDefinition(t,e){t.matchContext(wI)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function TM(t,e){let n=Nv.get(e);if(n)return n;let r=[],i=!0;function a(l,c){let u=t.sliceString(l.from,l.to);r.push({label:u,type:c})}return e.cursor(Pt.IncludeAnonymous).iterate(l=>{if(i)i=!1;else if(l.name){let c=kI[l.name];if(c&&c(l,a)||CM.has(l.name))return!1}else if(l.to-l.from>8192){for(let c of TM(t,l.node))r.push(c);return!1}}),Nv.set(e,r),r}const Rv=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,EM=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function AI(t){let e=mn(t.state).resolveInner(t.pos,-1);if(EM.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Rv.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)CM.has(i.name)&&(r=r.concat(TM(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Rv}}const zi=No.define({name:"javascript",parser:vI.configure({props:[eh.add({IfStatement:Vf({except:/^\s*({|else\b)/}),TryStatement:Vf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:gX,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:pX({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Vf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),th.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":lA,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),$M={test:t=>/^JSX/.test(t.name),facet:rA({commentTokens:{block:{open:"{/*",close:"*/}"}}})},jM=zi.configure({dialect:"ts"},"typescript"),PM=zi.configure({dialect:"jsx",props:[PO.add(t=>t.isTop?[$M]:void 0)]}),QM=zi.configure({dialect:"jsx ts",props:[PO.add(t=>t.isTop?[$M]:void 0)]},"typescript");let ZM=t=>({label:t,type:"keyword"});const NM="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ZM),MI=NM.concat(["declare","implements","private","protected","public"].map(ZM));function RM(t={}){let e=t.jsx?t.typescript?QM:PM:t.typescript?jM:zi,n=t.typescript?SI.concat(MI):MM.concat(NM);return new QO(e,[zi.data.of({autocomplete:lF(EM,sF(n))}),zi.data.of({autocomplete:AI}),t.jsx?EI:[]])}function CI(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function Vv(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const TI=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),EI=Ee.inputHandler.of((t,e,n,r,i)=>{if((TI?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!zi.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:l}=a,c=l.changeByRange(u=>{var h;let{head:p}=u,O=mn(l).resolveInner(p-1,-1),x;if(O.name=="JSXStartTag"&&(O=O.parent),!(l.doc.sliceString(p-1,p)!=r||O.name=="JSXAttributeValue"&&O.to>p)){if(r==">"&&O.name=="JSXFragmentTag")return{range:u,changes:{from:p,insert:"</>"}};if(r=="/"&&O.name=="JSXStartCloseTag"){let y=O.parent,b=y.parent;if(b&&y.from==p-2&&((x=Vv(l.doc,b.firstChild,p))||((h=b.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let S=`${x}>`;return{range:ge.cursor(p+S.length,-1),changes:{from:p,insert:S}}}}else if(r==">"){let y=CI(O);if(y&&y.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(l.doc.sliceString(p,p+2))&&(x=Vv(l.doc,y,p)))return{range:u,changes:{from:p,insert:`</${x}>`}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([a,l.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Gc=["_blank","_self","_top","_parent"],A2=["ascii","utf-8","utf-16","latin1","latin1"],M2=["get","post","put","delete"],C2=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Zr=["true","false"],Ne={},$I={a:{attrs:{href:null,ping:null,type:null,media:null,target:Gc,hreflang:null}},abbr:Ne,address:Ne,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ne,aside:Ne,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ne,base:{attrs:{href:null,target:Gc}},bdi:Ne,bdo:Ne,blockquote:{attrs:{cite:null}},body:Ne,br:Ne,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:C2,formmethod:M2,formnovalidate:["novalidate"],formtarget:Gc,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ne,center:Ne,cite:Ne,code:Ne,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ne,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ne,div:Ne,dl:Ne,dt:Ne,em:Ne,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ne,figure:Ne,footer:Ne,form:{attrs:{action:null,name:null,"accept-charset":A2,autocomplete:["on","off"],enctype:C2,method:M2,novalidate:["novalidate"],target:Gc}},h1:Ne,h2:Ne,h3:Ne,h4:Ne,h5:Ne,h6:Ne,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ne,hgroup:Ne,hr:Ne,html:{attrs:{manifest:null}},i:Ne,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:C2,formmethod:M2,formnovalidate:["novalidate"],formtarget:Gc,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ne,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ne,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ne,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:A2,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ne,noscript:Ne,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ne,param:{attrs:{name:null,value:null}},pre:Ne,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ne,rt:Ne,ruby:Ne,samp:Ne,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:A2}},section:Ne,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ne,source:{attrs:{src:null,type:null,media:null}},span:Ne,strong:Ne,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ne,summary:Ne,sup:Ne,table:Ne,tbody:Ne,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ne,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ne,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ne,time:{attrs:{datetime:null}},title:Ne,tr:Ne,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ne,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ne},VM={accesskey:null,class:null,contenteditable:Zr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Zr,autocorrect:Zr,autocapitalize:Zr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Zr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Zr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Zr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Zr,"aria-hidden":Zr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Zr,"aria-multiselectable":Zr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Zr,"aria-relevant":null,"aria-required":Zr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},LM="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of LM)VM[t]=null;class Ad{constructor(e,n){this.tags={...$I,...e},this.globalAttrs={...VM,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Ad.default=new Ad;function _o(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Do(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function _M(t,e,n){let r=n.tags[_o(t,Do(e))];return(r==null?void 0:r.children)||n.allTags}function KO(t,e){let n=[];for(let r=Do(e);r&&!r.type.isTop;r=Do(r.parent)){let i=_o(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const DM=/^[:\-\.\w\u00b7-\uffff]*$/;function Lv(t,e,n,r,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",l=Do(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:_M(t.doc,l,e).map(c=>({label:c,type:"type"})).concat(KO(t.doc,n).map((c,u)=>({label:"/"+c,apply:"/"+c+a,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function _v(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:KO(t.doc,e).map((a,l)=>({label:a,apply:a+i,type:"type",boost:99-l})),validFor:DM}}function jI(t,e,n,r){let i=[],a=0;for(let l of _M(t.doc,n,e))i.push({label:"<"+l,type:"type"});for(let l of KO(t.doc,n))i.push({label:"</"+l+">",type:"type",boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function PI(t,e,n,r,i){let a=Do(n),l=a?e.tags[_o(t.doc,a)]:null,c=l&&l.attrs?Object.keys(l.attrs):[],u=l&&l.globalAttrs===!1?c:c.length?c.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(h=>({label:h,type:"property"})),validFor:DM}}function QI(t,e,n,r,i){var a;let l=(a=n.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),c=[],u;if(l){let h=t.sliceDoc(l.from,l.to),p=e.globalAttrs[h];if(!p){let O=Do(n),x=O?e.tags[_o(t.doc,O)]:null;p=(x==null?void 0:x.attrs)&&x.attrs[h]}if(p){let O=t.sliceDoc(r,i).toLowerCase(),x='"',y='"';/^['"]/.test(O)?(u=O[0]=='"'?/^[^"]*$/:/^[^']*$/,x="",y=t.sliceDoc(i,i+1)==O[0]?"":O[0],O=O.slice(1),r++):u=/^[^\s<>='"]*$/;for(let b of p)c.push({label:b,apply:x+b+y,type:"constant"})}}return{from:r,to:i,options:c,validFor:u}}function ZI(t,e){let{state:n,pos:r}=e,i=mn(n).resolveInner(r,-1),a=i.resolve(r);for(let l=r,c;a==i&&(c=i.childBefore(l));){let u=c.lastChild;if(!u||!u.type.isError||u.from<u.to)break;a=i=c,l=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?_v(n,i,i.from,r):Lv(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?Lv(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?_v(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?PI(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?QI(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?jI(n,t,i,r):null}function NI(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new Ad(e,n):Ad.default;return i=>ZI(r,i)}const RI=zi.parser.configure({top:"SingleExpression"}),HM=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:jM.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:PM.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:QM.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:RI},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:zi.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:kd.parser}],XM=[{name:"style",parser:kd.parser.configure({top:"Styles"})}].concat(LM.map(t=>({name:t,parser:zi.parser}))),zM=No.define({name:"html",parser:cY.configure({props:[eh.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),th.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),pA.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Hf=zM.configure({wrap:xM(HM,XM)});function Dv(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=xM((t.nestedLanguages||[]).concat(HM),(t.nestedAttributes||[]).concat(XM)));let r=n?zM.configure({wrap:n,dialect:e}):e?Hf.configure({dialect:e}):Hf;return new QO(r,[Hf.data.of({autocomplete:NI(t)}),t.autoCloseTags!==!1?VI:[],RM().support,kM().support])}const Hv=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),VI=Ee.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Hf.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:l}=a,c=l.changeByRange(u=>{var h,p,O;let x=l.doc.sliceString(u.from-1,u.to)==r,{head:y}=u,b=mn(l).resolveInner(y,-1),S;if(x&&r==">"&&b.name=="EndTag"){let k=b.parent;if(((p=(h=k.parent)===null||h===void 0?void 0:h.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=_o(l.doc,k.parent,y))&&!Hv.has(S)){let A=y+(l.doc.sliceString(y,y+1)===">"?1:0),C=`</${S}>`;return{range:u,changes:{from:y,to:A,insert:C}}}}else if(x&&r=="/"&&b.name=="IncompleteCloseTag"){let k=b.parent;if(b.from==y-2&&((O=k.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&(S=_o(l.doc,k,y))&&!Hv.has(S)){let A=y+(l.doc.sliceString(y,y+1)===">"?1:0),C=`${S}>`;return{range:ge.cursor(y+C.length,-1),changes:{from:y,to:A,insert:C}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([a,l.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function LI(t){switch(t){case"html":return Dv();case"css":return kM();case"javascript":case"js":case"typescript":case"ts":return RM({typescript:t==="typescript"||t==="ts"});default:return Dv()}}function _I(t){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"";return{html:"html",htm:"html",css:"css",js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",json:"javascript"}[e]??"html"}const DI=d.memo(function({content:e,filePath:n,language:r,onChange:i,readOnly:a=!1,revealOffset:l}){const c=d.useRef(null),u=d.useRef(null),h=d.useRef(i);h.current=i;const p=d.useRef(e);p.current=e;const O=d.useCallback(x=>{if(c.current&&(c.current.destroy(),c.current=null),!x)return;u.current=x;const y=r??(n?_I(n):"html"),b=Ee.updateListener.of(k=>{k.docChanged&&h.current&&h.current(k.state.doc.toString())}),S=wt.create({doc:p.current,extensions:[ZH(),bH(),VH(),ez(),CX(),xX(),_X(),vF(),RF(),CO.of([...AF,...iF,...rB,...cz]),LI(y),OB,b,wt.readOnly.of(a),Ee.theme({"&":{height:"100%"},".cm-scroller":{overflow:"auto"}})]});c.current=new Ee({state:S,parent:x})},[n,r,a]);return d.useEffect(()=>{const x=c.current;if(!x)return;const y=x.state.doc.toString();y!==e&&x.dispatch({changes:{from:0,to:y.length,insert:e}})},[e]),d.useEffect(()=>{const x=c.current;if(!x||l==null||l<0)return;const y=x.state.doc.length,b=Math.min(l,y);x.dispatch({selection:{anchor:b},effects:Ee.scrollIntoView(b,{y:"center"})})},[l]),m.jsx("div",{ref:O,className:"h-full w-full overflow-hidden"})}),uo={width:1920,height:1080},Xv=80,zv=45,Fv=3,HI=10;function XI(t){const e=Number.isFinite(t.stageWidth)&&t.stageWidth>0?t.stageWidth:uo.width,n=Number.isFinite(t.stageHeight)&&t.stageHeight>0?t.stageHeight:uo.height,r=t.cardWidth/e,i=t.cardHeight/n;return Math.min(r,i)}function zI(t){return Number.isFinite(t)&&t!=null&&t>0&&t<Fv?t/2:Fv}function Bv(t){if(t==null)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function FI(t){var e,n;try{const r=t==null?void 0:t.contentWindow,i=(n=(e=r==null?void 0:r.__player)==null?void 0:e.getDuration)==null?void 0:n.call(e);if(Number.isFinite(i)&&i!=null&&i>0)return i}catch{}try{const r=t==null?void 0:t.contentDocument,i=(r==null?void 0:r.querySelector("[data-composition-id]"))??(r==null?void 0:r.documentElement)??null;return Bv((i==null?void 0:i.getAttribute("data-composition-duration"))??null)??Bv((i==null?void 0:i.getAttribute("data-duration"))??null)}catch{return null}}function BI(t,e){var n,r,i,a;try{const l=(n=t==null?void 0:t.contentWindow)==null?void 0:n.__player;return l?e?((r=l.play)==null||r.call(l),!0):((i=l.pause)==null||i.call(l),(a=l.seek)==null||a.call(l,zI(FI(t))),!0):!1}catch{return!1}}function YI({projectId:t,comp:e,isActive:n,onSelect:r,onRender:i,isRendering:a,lintInfo:l}){const[c,u]=d.useState(!1),[h,p]=d.useState(uo),O=d.useRef(null),x=d.useRef(null),y=d.useRef(null),b=d.useCallback(E=>{y.current&&(clearTimeout(y.current),y.current=null);const $=N=>{BI(O.current,E)||N<=0||(y.current=setTimeout(()=>$(N-1),100))};$(HI)},[]),S=()=>{x.current=setTimeout(()=>u(!0),300)},k=()=>{x.current&&(clearTimeout(x.current),x.current=null),u(!1)},A=e.replace(/^compositions\//,"").replace(/\.html$/,""),C=`/api/projects/${t}/preview/comp/${e}`,T=XI({cardWidth:Xv,cardHeight:zv,stageWidth:h.width,stageHeight:h.height}),j=(Xv-h.width*T)/2,M=(zv-h.height*T)/2;return d.useEffect(()=>{b(c)},[c,b]),d.useEffect(()=>()=>{x.current&&clearTimeout(x.current),y.current&&clearTimeout(y.current)},[]),m.jsxs("div",{onClick:r,onPointerEnter:S,onPointerLeave:k,className:`group/card w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${n?"bg-studio-accent/10 border-l-2 border-studio-accent":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[m.jsx("div",{className:"w-20 h-[45px] rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:m.jsx("iframe",{ref:O,src:C,sandbox:"allow-scripts allow-same-origin",loading:"lazy",className:"absolute border-none pointer-events-none",style:{transformOrigin:"0 0",width:h.width,height:h.height,left:j,top:M,transform:`scale(${T})`},onLoad:E=>{var $;try{const D=($=E.currentTarget.contentDocument)==null?void 0:$.querySelector("[data-composition-id]"),z=Number(D==null?void 0:D.getAttribute("data-width"))||uo.width,B=Number(D==null?void 0:D.getAttribute("data-height"))||uo.height;p({width:z,height:B}),b(c)}catch{p(uo)}},title:`${A} preview`,tabIndex:-1})}),m.jsxs("div",{className:"min-w-0 flex-1",title:l&&l.count>0?l.messages.join(`
|
|
122
|
+
`):void 0,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate",children:A}),l&&l.count>0&&m.jsx("span",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-amber-400"})]}),m.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]}),i&&m.jsx("button",{type:"button",title:a?"Rendering...":`Render ${A}`,"aria-label":a?"Rendering...":`Render ${A}`,disabled:a,onClick:E=>{E.stopPropagation(),i()},className:`flex-shrink-0 p-1 rounded transition-colors ${a?"text-neutral-600 cursor-not-allowed":"text-neutral-600 hover:text-studio-accent hover:bg-neutral-800"}`,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}const II=d.memo(function({projectId:e,compositions:n,activeComposition:r,onSelect:i,onRenderComposition:a,isRendering:l,lintFindingsByFile:c}){return n.length===0?m.jsx("div",{className:"flex-1 flex items-center justify-center px-4",children:m.jsx("p",{className:"text-xs text-neutral-600 text-center",children:"No compositions found"})}):m.jsx("div",{className:"flex-1 overflow-y-auto",children:n.map(u=>m.jsx(YI,{projectId:e,comp:u,isActive:r===u,onSelect:()=>i(u),onRender:a?()=>a(u):void 0,isRendering:l,lintInfo:c==null?void 0:c.get(u)},u))})});function FM({src:t}){const[e,n]=d.useState(null);return d.useEffect(()=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.muted=!0,r.preload="metadata";const i=document.createElement("canvas"),a=i.getContext("2d"),l=()=>{r.src="",r.load()};return r.addEventListener("loadedmetadata",()=>{r.currentTime=Math.min(2,r.duration*.1||2)}),r.addEventListener("seeked",()=>{a&&(i.width=r.videoWidth,i.height=r.videoHeight,a.drawImage(r,0,0),n(i.toDataURL("image/jpeg",.7)),l())}),r.addEventListener("error",l),r.src=t,r.load(),l},[t]),e?m.jsx("img",{src:e,alt:"",draggable:!1,className:"w-full h-full object-contain"}):m.jsx("div",{className:"w-full h-full bg-neutral-800 animate-pulse"})}function qI({serveUrl:t,name:e,isImage:n,isVideo:r,isAudio:i}){return m.jsxs(m.Fragment,{children:[n&&m.jsx("img",{src:t,alt:e,loading:"lazy",className:"w-full h-full object-contain",onError:a=>{a.target.style.display="none"}}),r&&m.jsx(FM,{src:t}),i&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-purple-400",children:[m.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("circle",{cx:"6",cy:"18",r:"3"}),m.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}),!n&&!r&&!i&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function GI({projectId:t,asset:e,onCopy:n,isCopied:r,onDelete:i,onRename:a}){const[l,c]=d.useState(!1),[u,h]=d.useState(null),[p,O]=d.useState(!1),[x,y]=d.useState(""),[b,S]=d.useState(!1),k=e.split("/").pop()??e,A=`/api/projects/${t}/preview/${e}`,C=D8.test(e);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{draggable:!0,onClick:()=>n(e),onDragStart:T=>{T.dataTransfer.effectAllowed="copy",T.dataTransfer.setData(fg,JSON.stringify({path:e})),T.dataTransfer.setData("text/plain",e)},onContextMenu:T=>{T.preventDefault(),h({x:T.clientX,y:T.clientY})},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),className:`w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${r?"bg-studio-accent/10 border-l-2 border-studio-accent":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[m.jsxs("div",{className:"w-16 h-10 rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:[m.jsx(qI,{serveUrl:A,name:k,isImage:Su.test(e),isVideo:C,isAudio:H8.test(e)}),C&&l&&m.jsx("video",{src:A,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-contain"})]}),m.jsx("div",{className:"min-w-0 flex-1",children:p?m.jsx("input",{autoFocus:!0,value:x,onChange:T=>y(T.target.value),onKeyDown:T=>{if(T.key==="Enter"){T.preventDefault();const j=x.trim();if(j&&j!==k){const M=e.includes("/")?e.slice(0,e.lastIndexOf("/")+1):"";a==null||a(e,M+j)}O(!1)}else T.key==="Escape"&&O(!1)},onBlur:()=>{const T=x.trim();if(T&&T!==k){const j=e.includes("/")?e.slice(0,e.lastIndexOf("/")+1):"";a==null||a(e,j+T)}O(!1)},onClick:T=>T.stopPropagation(),className:"w-full bg-neutral-800 text-neutral-200 text-[11px] px-1.5 py-0.5 rounded border border-neutral-600 outline-none focus:border-studio-accent",spellCheck:!1}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate block",children:k}),r?m.jsx("span",{className:"text-[9px] text-studio-accent",children:"Copied!"}):m.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]})})]}),u&&m.jsx("div",{className:"fixed inset-0 z-[200]",onClick:()=>h(null),onContextMenu:T=>{T.preventDefault(),h(null)},children:m.jsxs("div",{className:"absolute bg-neutral-900 border border-neutral-700 rounded-lg shadow-xl py-1 min-w-[140px] text-xs",style:{left:u.x,top:u.y},children:[m.jsx("button",{onClick:T=>{T.stopPropagation(),n(e),h(null)},className:"w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors",children:"Copy path"}),a&&m.jsx("button",{onClick:T=>{T.stopPropagation(),y(k),O(!0),h(null)},className:"w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors",children:"Rename"}),i&&m.jsx("button",{onClick:T=>{T.stopPropagation(),S(!0),h(null)},className:"w-full text-left px-3 py-1.5 text-red-400 hover:bg-neutral-800 transition-colors",children:"Delete"})]})}),b&&m.jsxs("div",{className:"px-2 py-1.5 bg-red-950/30 border-l-2 border-red-500 flex items-center justify-between gap-2",children:[m.jsxs("span",{className:"text-[10px] text-red-400 truncate",children:["Delete ",k,"?"]}),m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[m.jsx("button",{onClick:T=>{T.stopPropagation(),i==null||i(e),S(!1)},className:"px-2 py-0.5 text-[10px] rounded bg-red-600 text-white hover:bg-red-500 transition-colors",children:"Delete"}),m.jsx("button",{onClick:T=>{T.stopPropagation(),S(!1)},className:"px-2 py-0.5 text-[10px] rounded text-neutral-400 hover:text-neutral-200 transition-colors",children:"Cancel"})]})]})]})}const UI=d.memo(function({projectId:e,assets:n,onImport:r,onDelete:i,onRename:a}){const l=d.useRef(null),[c,u]=d.useState(!1),[h,p]=d.useState(null),O=d.useCallback(b=>{b.preventDefault(),u(!1),b.dataTransfer.files.length&&(r==null||r(b.dataTransfer.files))},[r]),x=d.useCallback(async b=>{await vu(b)&&(p(b),setTimeout(()=>p(null),1500))},[]),y=n.filter(b=>g7.test(b));return m.jsxs("div",{className:`flex-1 flex flex-col min-h-0 transition-colors ${c?"bg-studio-accent/[0.05]":""}`,onDragOver:b=>{b.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:O,children:[r&&m.jsxs("div",{className:"px-3 py-2 border-b border-neutral-800/40 flex-shrink-0",children:[m.jsxs("button",{onClick:()=>{var b;return(b=l.current)==null?void 0:b.click()},className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-[11px] rounded-lg border border-dashed border-neutral-700/50 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600 transition-colors",children:[m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:m.jsx("path",{d:"M12 5v14M5 12h14"})}),"Import media"]}),m.jsx("input",{ref:l,type:"file",accept:"video/*,image/*,audio/*",multiple:!0,className:"hidden",onChange:b=>{var S;(S=b.target.files)!=null&&S.length&&(r(b.target.files),b.target.value="")}})]}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-700",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"17 8 12 3 7 8",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15",strokeLinecap:"round"})]}),m.jsx("p",{className:"text-[10px] text-neutral-600 text-center",children:"Drop media files here"})]}):y.map(b=>m.jsx(GI,{projectId:e,asset:b,onCopy:x,isCopied:h===b,onDelete:i,onRename:a},b))})]})}),Md=[{id:"captions",label:"Captions",color:"cyan"},{id:"vfx",label:"VFX",color:"purple"},{id:"transitions",label:"Transitions",color:"blue"},{id:"effects",label:"Effects",color:"rose"},{id:"text-effects",label:"Text Effects",color:"violet"},{id:"social",label:"Social",color:"pink"},{id:"data",label:"Data",color:"green"},{id:"scenes",label:"Scenes",color:"amber"}];function WI(t){if(!t||t.length===0)return"scenes";const e=new Set(t);return e.has("captions")||e.has("caption-style")?"captions":e.has("transition")?"transitions":e.has("social")||e.has("overlay")?"social":e.has("data")||e.has("chart")||e.has("map")?"data":e.has("html-in-canvas")||e.has("webgl")||e.has("shader")?"vfx":e.has("text-effect")?"text-effects":e.has("effect")||e.has("grain")||e.has("vignette")?"effects":"scenes"}const KI={transitions:{bg:"bg-blue-500/15",text:"text-blue-400",dot:"bg-blue-400"},vfx:{bg:"bg-purple-500/15",text:"text-purple-400",dot:"bg-purple-400"},social:{bg:"bg-pink-500/15",text:"text-pink-400",dot:"bg-pink-400"},data:{bg:"bg-green-500/15",text:"text-green-400",dot:"bg-green-400"},scenes:{bg:"bg-amber-500/15",text:"text-amber-400",dot:"bg-amber-400"},captions:{bg:"bg-cyan-500/15",text:"text-cyan-400",dot:"bg-cyan-400"},effects:{bg:"bg-rose-500/15",text:"text-rose-400",dot:"bg-rose-400"},"text-effects":{bg:"bg-violet-500/15",text:"text-violet-400",dot:"bg-violet-400"}};function BM(t){return KI[t]}function JI(){const[t,e]=d.useState([]),[n,r]=d.useState(!0),[i,a]=d.useState(null),[l,c]=d.useState(""),[u,h]=d.useState(null);d.useEffect(()=>{let O=!1;return(async()=>{try{const x=await fetch("/api/registry/blocks");if(!x.ok)throw new Error("Failed to load catalog");const y=await x.json();if(O)return;const b=y.map(S=>({...S,category:WI(S.tags)})).sort((S,k)=>{const A=Md.findIndex(T=>T.id===S.category),C=Md.findIndex(T=>T.id===k.category);return(A===-1?99:A)-(C===-1?99:C)});e(b)}catch(x){if(O)return;a(x instanceof Error?x.message:"Failed to load catalog")}finally{O||r(!1)}})(),()=>{O=!0}},[]);const p=d.useMemo(()=>{let O=t;if(u&&(O=O.filter(x=>x.category===u)),l.trim()){const x=l.toLowerCase();O=O.filter(y=>{var b;return y.title.toLowerCase().includes(x)||y.description.toLowerCase().includes(x)||y.category.toLowerCase().includes(x)||((b=y.tags)==null?void 0:b.some(S=>S.toLowerCase().includes(x)))})}return O},[t,u,l]);return{blocks:t,loading:n,error:i,search:l,setSearch:c,category:u,setCategory:h,filteredBlocks:p}}const eq=d.memo(function({onAddBlock:e,onPreviewBlock:n}){const{loading:r,error:i,search:a,setSearch:l,category:c,setCategory:u,filteredBlocks:h}=JI(),[p,O]=d.useState(null);return r?m.jsx("div",{className:"flex flex-1 items-center justify-center text-neutral-600 text-xs",children:"Loading blocks…"}):i?m.jsx("div",{className:"flex flex-1 items-center justify-center text-red-400 text-xs px-4 text-center",children:i}):m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[m.jsx("div",{className:"px-3 pt-2 pb-1 flex-shrink-0",children:m.jsxs("div",{className:"relative",children:[m.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"11",cy:"11",r:"8"}),m.jsx("path",{d:"m21 21-4.35-4.35"})]}),m.jsx("input",{type:"text",value:a,onChange:x=>l(x.target.value),placeholder:"Search by name, category, or tag…",className:"w-full bg-neutral-900 border border-neutral-800 rounded-md pl-7 pr-2 py-1.5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:border-neutral-700 transition-colors"})]})}),m.jsx("div",{className:"px-3 pt-1 pb-2 flex-shrink-0 overflow-x-auto",children:m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Yv,{label:"All",active:c===null,onClick:()=>u(null)}),Md.map(x=>m.jsx(Yv,{label:x.label,category:x.id,active:c===x.id,onClick:()=>u(c===x.id?null:x.id)},x.id))]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 pb-2",children:[c==="vfx"&&m.jsxs("div",{className:"mb-2 px-2 py-1.5 rounded-md bg-purple-500/10 border border-purple-500/20 text-[9px] text-purple-300 leading-relaxed",children:["VFX blocks use WebGL via HTML-in-Canvas. Enable"," ",m.jsx("span",{className:"font-mono text-purple-200",children:"chrome://flags/#html-in-canvas"})," for preview."]}),h.length===0?m.jsx("div",{className:"flex items-center justify-center h-32 text-neutral-600 text-xs",children:"No blocks match your search"}):m.jsx("div",{className:"grid gap-1.5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(120px, 1fr))"},children:h.map(x=>{var b,S;const y="duration"in x?x.duration:void 0;return m.jsx(rq,{name:x.name,title:x.title,description:x.description,blockType:x.type,duration:y,category:x.category,tags:x.tags,posterUrl:(b=x.preview)==null?void 0:b.poster,videoUrl:(S=x.preview)==null?void 0:S.video,onPreview:n,onShowPrompt:O,onAdd:x.category==="vfx"||x.category==="social"||x.category==="scenes"?()=>e==null?void 0:e(x.name):void 0},x.name)})})]}),p&&L8.createPortal(m.jsx(iq,{title:p.title,prompt:p.prompt,onClose:()=>O(null)}),document.body)]})});function Yv({label:t,category:e,active:n,onClick:r}){const i=e?BM(e):null;return m.jsx("button",{type:"button",onClick:r,className:`flex-shrink-0 px-2 py-1 rounded-full text-[10px] font-medium transition-colors ${n?i?`${i.bg} ${i.text}`:"bg-neutral-700 text-neutral-200":"bg-neutral-900 text-neutral-500 hover:text-neutral-300"}`,children:t})}function tq(t){const e=[`Playback time: ${Cn(t.currentTime)}`,`Active composition: ${t.activeCompPath||"index.html"}`];t.compositionDimensions&&e.push(`Dimensions: ${t.compositionDimensions.width}x${t.compositionDimensions.height}`);const n=t.elements.filter(i=>t.currentTime>=i.start&&t.currentTime<i.start+i.duration);n.length>0&&e.push("",`Elements visible at ${Cn(t.currentTime)}:`,...n.map(i=>`- ${i.label||i.id} (track ${i.track}, ${Cn(i.start)}–${Cn(i.start+i.duration)}${i.compositionSrc?`, src: ${i.compositionSrc}`:""})`));const r=t.elements.length>0?Math.max(...t.elements.map((i,a)=>a+1)):0;return e.push("",`Highest track index: ${r}`),e.join(`
|
|
123
|
+
`)}function nq(t,e,n,r,i,a){const c=i==="hyperframes:component"?"component":"block",u=tq(a);return[{captions:[`Using /hyperframes, add the "${t}" caption style (registry: ${e}) to my composition.`,`${n}`,"Transcribe the audio with /hyperframes-media, then wire the transcript into this caption component. Match the font colors and animation timing to my composition's design tokens. Place it as an overlay above the main content with the highest z-index."].join(`
|
|
124
|
+
|
|
125
|
+
`),vfx:[`Using /hyperframes, add the "${t}" VFX (registry: ${e}) as a full-screen overlay on my composition.`,`${n}`,"This is a WebGL effect that requires chrome://flags/#html-in-canvas. Layer it on top of all content, adjust the shader uniforms and color palette to complement my scene, and set the duration to match the composition length."].join(`
|
|
126
|
+
|
|
127
|
+
`),transitions:[`Using /hyperframes, add the "${t}" transition (registry: ${e}) between my scenes.`,`${n}`,"Place this transition at the cut point between the current scene and the next. Set the duration to 0.5–1s, position it at the scene boundary on the timeline, and make sure the z-index is above both scenes. Adjust colors to match my palette."].join(`
|
|
128
|
+
|
|
129
|
+
`),effects:[`Using /hyperframes, add the "${t}" effect (registry: ${e}) as an overlay on my composition.`,`${n}`,"Layer this on top of the current content. Adjust the opacity, colors, and animation timing to enhance the scene without overwhelming the main content."].join(`
|
|
130
|
+
|
|
131
|
+
`),social:[`Using /hyperframes, add the "${t}" template (registry: ${e}) to my composition.`,`${n}`,"Replace the placeholder text, handle, and avatar with my actual content. Match the typography and colors to my brand. Adjust timing so the elements animate in sync with the voiceover."].join(`
|
|
132
|
+
|
|
133
|
+
`),data:[`Using /hyperframes, add the "${t}" visualization (registry: ${e}) to my composition.`,`${n}`,"Replace the placeholder data with my actual values and labels. Adjust the color scale, animation stagger timing, and typography to match my composition's design system. Size it to fit the current viewport."].join(`
|
|
134
|
+
|
|
135
|
+
`),scenes:[`Using /hyperframes, add the "${t}" scene (registry: ${e}) to my composition.`,`${n}`,"Replace all placeholder text, images, and content with my actual material. Match fonts, colors, and layout to my existing design tokens. Set the timeline position and duration to fit the narrative flow."].join(`
|
|
136
|
+
|
|
137
|
+
`)}[r]??[`Using /hyperframes, add the "${t}" ${c} (registry: ${e}) to my composition.`,`${n}`,"Customize it to match my composition's design and timeline."].join(`
|
|
138
|
+
|
|
139
|
+
`),"","## Current composition state","",u].join(`
|
|
140
|
+
`)}function rq({name:t,title:e,description:n,blockType:r,duration:i,category:a,tags:l,posterUrl:c,videoUrl:u,onAdd:h,onShowPrompt:p,onPreview:O}){var D;const[x,y]=d.useState(!1),[b,S]=d.useState(!1),k=d.useRef(null),A=BM(a),C=(l==null?void 0:l.includes("html-in-canvas"))||(l==null?void 0:l.includes("webgl")),T=d.useCallback(()=>{k.current=setTimeout(()=>{y(!0),O==null||O({videoUrl:u,posterUrl:c,title:e})},300)},[O,u,c,e]),j=d.useCallback(()=>{k.current&&(clearTimeout(k.current),k.current=null),y(!1),O==null||O(null)},[O]);d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const M=d.useCallback(z=>{z.stopPropagation(),!(b||!h)&&(S(!0),h(),setTimeout(()=>S(!1),1e3))},[h,b]),{activeCompPath:E,compositionDimensions:$}=hl(),N=d.useCallback(z=>{z.stopPropagation();const B=oe.getState(),X={currentTime:B.currentTime,activeCompPath:E,elements:B.elements.map(I=>({id:I.id,start:I.start,duration:I.duration,track:I.track,label:I.label,compositionSrc:I.compositionSrc})),compositionDimensions:$??void 0},U=nq(e,t,n,a,r,X);p==null||p({title:e,prompt:U})},[e,t,n,a,r,E,$,p]);return m.jsxs("div",{className:"group/card rounded-md overflow-hidden cursor-pointer transition-colors bg-neutral-900 hover:bg-neutral-800",onPointerEnter:T,onPointerLeave:j,children:[m.jsxs("div",{className:"aspect-video w-full overflow-hidden relative",children:[x&&u?m.jsx("video",{src:u,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover"}):c?m.jsx("img",{src:c,alt:e,loading:"lazy",className:"w-full h-full object-cover"}):u?m.jsx("video",{src:u,muted:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}):m.jsx("div",{className:`w-full h-full flex items-center justify-center ${A.bg}`,children:m.jsx("span",{className:`text-[9px] font-medium ${A.text}`,children:a.toUpperCase()})}),m.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 transition-opacity",children:[h&&m.jsxs("button",{type:"button",onClick:M,title:"Add to composition at current time",className:"flex items-center gap-1 px-3 py-1.5 rounded-md bg-white text-black text-[10px] font-semibold hover:bg-neutral-200 transition-colors",children:[m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M12 5v14M5 12h14"})}),b?"Added!":"Add"]}),m.jsxs("button",{type:"button",onClick:N,title:"Generate a prompt to paste into your AI agent",className:`flex items-center gap-1.5 px-3 ${h?"py-1":"py-1.5"} rounded-md transition-colors ${h?"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:[m.jsxs("svg",{width:h?9:11,height:h?9:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),m.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"]})]}),m.jsxs("div",{className:"absolute top-1 right-1 flex items-center gap-0.5 pointer-events-none",children:[C&&m.jsx("span",{className:"px-1 py-px rounded text-[7px] font-semibold text-purple-300 bg-purple-900/70",children:"WebGL"}),i!=null&&m.jsxs("span",{className:"px-1 py-px rounded text-[8px] font-medium text-white/80 bg-black/50",children:[i,"s"]})]})]}),m.jsxs("div",{className:"px-1.5 py-1.5",children:[m.jsx("div",{className:"text-[10px] font-medium text-neutral-200 truncate leading-tight",children:e}),m.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[m.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${A.dot}`}),m.jsx("span",{className:`text-[8px] ${A.text}`,children:(D=Md.find(z=>z.id===a))==null?void 0:D.label})]})]})]})}function iq({title:t,prompt:e,onClose:n}){const[r,i]=d.useState(e),[a,l]=d.useState(!1),c=d.useRef(null);d.useEffect(()=>{requestAnimationFrame(()=>{var h;return(h=c.current)==null?void 0:h.focus()})},[]);const u=d.useCallback(()=>{navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),1500)},[r]);return m.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:n,children:m.jsxs("div",{className:"w-[560px] max-h-[80vh] flex flex-col rounded-2xl border border-neutral-800 bg-neutral-950 shadow-2xl",onClick:h=>h.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800/60",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-medium text-neutral-200",children:"Ask agent"}),m.jsx("p",{className:"text-xs text-neutral-500 mt-0.5",children:t})]}),m.jsx("button",{className:"p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50",onClick:n,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[m.jsx("p",{className:"text-[11px] text-neutral-500 mb-2",children:"Edit the prompt below, then copy and paste into your AI agent"}),m.jsx("textarea",{ref:c,value:r,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&u(),h.key==="Escape"&&n()},className:"w-full min-h-[240px] text-[11px] text-neutral-200 leading-relaxed font-mono bg-neutral-900/60 rounded-lg p-3 border border-neutral-800 resize-y focus:outline-none focus:border-studio-accent/60 focus:ring-1 focus:ring-studio-accent/30"})]}),m.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-neutral-800/60",children:[m.jsxs("span",{className:"text-[11px] text-neutral-600",children:[navigator.platform.includes("Mac")?"⌘":"Ctrl","+Enter to copy"]}),m.jsx("button",{className:`px-4 py-1.5 rounded-lg text-xs font-medium transition-colors ${a?"bg-emerald-500 text-white":"bg-studio-accent/90 text-neutral-950 hover:bg-studio-accent"}`,onClick:u,children:a?"Copied!":"Copy prompt"})]})]})})}const _n=14,Dn="duotone";function YM({path:t}){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"",n="flex-shrink-0";return e==="html"?m.jsx(CZ,{size:_n,weight:Dn,color:"#E44D26",className:n}):e==="css"?m.jsx(MZ,{size:_n,weight:Dn,color:"#264DE4",className:n}):e==="js"||e==="mjs"||e==="cjs"?m.jsx(EZ,{size:_n,weight:Dn,color:"#F0DB4F",className:n}):e==="jsx"?m.jsx($Z,{size:_n,weight:Dn,color:"#61DAFB",className:n}):e==="ts"||e==="mts"?m.jsx(ZZ,{size:_n,weight:Dn,color:"#3178C6",className:n}):e==="tsx"?m.jsx(NZ,{size:_n,weight:Dn,color:"#3178C6",className:n}):e==="json"?m.jsx(AZ,{size:_n,weight:Dn,color:"#4ADE80",className:n}):e==="svg"?m.jsx(QZ,{size:_n,weight:Dn,color:"#F97316",className:n}):e==="md"||e==="mdx"?m.jsx(jZ,{size:_n,weight:Dn,color:"#9CA3AF",className:n}):e==="txt"?m.jsx(RZ,{size:_n,weight:Dn,color:"#9CA3AF",className:n}):e==="png"?m.jsx(PZ,{size:_n,weight:Dn,color:"#22C55E",className:n}):e==="jpg"||e==="jpeg"?m.jsx(TZ,{size:_n,weight:Dn,color:"#22C55E",className:n}):e==="webp"||e==="gif"||e==="ico"?m.jsx(XZ,{size:_n,weight:Dn,color:"#22C55E",className:n}):e==="mp4"||e==="webm"||e==="mov"?m.jsx(VZ,{size:_n,weight:Dn,color:"#A855F7",className:n}):e==="mp3"||e==="wav"||e==="ogg"||e==="m4a"?m.jsx(eN,{size:_n,weight:Dn,color:"#3CE6AC",className:n}):e==="woff"||e==="woff2"||e==="ttf"||e==="otf"?m.jsx(WZ,{size:_n,weight:Dn,color:"#6B7280",className:n}):m.jsx(kZ,{size:_n,weight:Dn,color:"#6B7280",className:n})}function aq(t){const e={name:"",fullPath:"",children:new Map,isFile:!1};for(const n of t){const r=n.split("/");let i=e;for(let a=0;a<r.length;a++){const l=r[a],c=a===r.length-1,u=r.slice(0,a+1).join("/");i.children.has(l)||i.children.set(l,{name:l,fullPath:u,children:new Map,isFile:c}),i=i.children.get(l),c&&(i.isFile=!0)}}return e}function IM(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 JO(t,e){if(!e)return!1;if(t.fullPath===e)return!0;for(const n of t.children.values())if(JO(n,e))return!0;return!1}const sq=14;function lq({state:t,onClose:e,onNewFile:n,onNewFolder:r,onRename:i,onDuplicate:a,onDelete:l}){const c=d.useRef(null);d.useEffect(()=>{const O=y=>{c.current&&!c.current.contains(y.target)&&e()},x=y=>{y.key==="Escape"&&e()};return document.addEventListener("mousedown",O),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",x)}},[e]);const u=Math.min(t.x,window.innerWidth-180),h=Math.min(t.y,window.innerHeight-200),p=t.targetIsFolder?t.targetPath:t.targetPath.includes("/")?t.targetPath.slice(0,t.targetPath.lastIndexOf("/")):"";return m.jsxs("div",{ref: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:h},children:[t.targetIsFolder&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{n(t.targetPath),e()},children:[m.jsx(z5,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{r(t.targetPath),e()},children:[m.jsx(fw,{size:12,weight:"duotone",className:"text-neutral-500"}),"New Folder"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),!t.targetIsFolder&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{n(p),e()},children:[m.jsx(z5,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{i(t.targetPath),e()},children:[m.jsx(IZ,{size:12,weight:"duotone",className:"text-neutral-500"}),"Rename"]}),!t.targetIsFolder&&m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{a(t.targetPath),e()},children:[m.jsx(SZ,{size:12,weight:"duotone",className:"text-neutral-500"}),"Duplicate"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-900/30 cursor-pointer text-left",onClick:()=>{l(t.targetPath),e()},children:[m.jsx(JZ,{size:12,weight:"duotone"}),"Delete"]})]})}function Cd({defaultValue:t,depth:e,isFolder:n,onCommit:r,onCancel:i}){const a=d.useRef(null),l=d.useRef(!1),[c,u]=d.useState(t);d.useEffect(()=>{const x=a.current;if(x)if(x.focus(),t&&t.includes(".")){const y=t.lastIndexOf(".");x.setSelectionRange(0,y)}else x.select()},[t]);const h=x=>{l.current||(l.current=!0,r(x))},p=x=>{if(x.key==="Enter"){x.preventDefault();const y=c.trim();y&&!(/[/\\]/.test(y)||y.includes(".."))?h(y):i()}else x.key==="Escape"&&(x.preventDefault(),i())},O=()=>{const x=c.trim();x&&x!==t&&!(/[/\\]/.test(x)||x.includes(".."))?h(x):i()};return m.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?m.jsx(_Z,{size:sq,weight:"duotone",color:"#6B7280",className:"flex-shrink-0"}):m.jsx(YM,{path:c}),m.jsx("input",{ref:a,value:c,onChange:x=>u(x.target.value),onKeyDown:p,onBlur:O,className:"flex-1 min-w-0 bg-neutral-800 text-neutral-200 text-xs px-1.5 py-0.5 rounded border border-neutral-600 outline-none focus:border-[#3CE6AC]",spellCheck:!1})]})}function oq({name:t,onConfirm:e,onCancel:n}){const r=d.useRef(null);return d.useEffect(()=>{const i=l=>{l.key==="Escape"&&n()},a=l=>{r.current&&!r.current.contains(l.target)&&n()};return document.addEventListener("keydown",i),document.addEventListener("mousedown",a),()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",a)}},[n]),m.jsxs("div",{ref:r,className:"mx-1 my-0.5 p-2 bg-neutral-800 border border-neutral-700 rounded-md text-xs",children:[m.jsxs("p",{className:"text-neutral-300 mb-2",children:["Delete ",m.jsx("span",{className:"font-medium text-neutral-100",children:t}),"?"]}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx("button",{onClick:n,className:"flex-1 px-2 py-1 rounded bg-neutral-700 text-neutral-300 hover:bg-neutral-600 transition-colors",children:"Cancel"}),m.jsx("button",{onClick:e,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 C8=d.memo(function({node:e,depth:n,activeFile:r,onSelectFile:i,onContextMenu:a,inlineInput:l,onDragStart:c,lintInfo:u}){const h=e.fullPath===r;return(l==null?void 0:l.mode)==="rename"&&l.originalPath===e.fullPath?m.jsx(Cd,{defaultValue:l.originalName??e.name,depth:n,isFolder:!1,onCommit:O=>{var x;(x=l==null?void 0:l.onCommit)==null||x.call(l,O)},onCancel:()=>{var O;(O=l==null?void 0:l.onCancel)==null||O.call(l)}}):m.jsxs("button",{draggable:!0,onDragStart:O=>c(O,e.fullPath),onClick:()=>i(e.fullPath),onContextMenu:O=>{O.preventDefault(),a(O,e.fullPath,!1)},className:`w-full flex items-center gap-2 py-1 min-h-7 text-left transition-all text-xs ${h?"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:[m.jsx(YM,{path:e.name}),m.jsx("span",{className:"truncate flex-1",children:e.name}),u&&u.count>0&&m.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:u.messages.join(`
|
|
141
|
+
`),children:u.count})]})}),cq=d.memo(function t({node:e,depth:n,activeFile:r,onSelectFile:i,defaultOpen:a,onContextMenu:l,inlineInput:c,onDragStart:u,onDragOver:h,onDrop:p,onDragLeave:O,dragOverFolder:x,lintFindingsByFile:y}){const[b,S]=d.useState(a),k=d.useCallback(()=>S(M=>!M),[]),A=d.useMemo(()=>IM(e.children),[e.children]),C=b?LL:_L,T=x===e.fullPath;return(c==null?void 0:c.mode)==="rename"&&c.originalPath===e.fullPath?m.jsx(Cd,{defaultValue:c.originalName??e.name,depth:n,isFolder:!0,onCommit:M=>{var E;(E=c==null?void 0:c.onCommit)==null||E.call(c,M)},onCancel:()=>{var M;(M=c==null?void 0:c.onCancel)==null||M.call(c)}}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{draggable:!0,onDragStart:M=>u(M,e.fullPath),onClick:k,onContextMenu:M=>{M.preventDefault(),l(M,e.fullPath,!0)},onDragOver:M=>{M.preventDefault(),M.stopPropagation(),h(M,e.fullPath)},onDrop:M=>{M.preventDefault(),M.stopPropagation(),p(M,e.fullPath)},onDragLeave:O,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 ${T?"bg-[#3CE6AC]/10 outline outline-1 outline-[#3CE6AC]/40":""}`,style:{paddingLeft:`${8+n*12}px`},children:[m.jsx(C,{size:10,className:"flex-shrink-0 text-neutral-600"}),m.jsx("span",{className:"truncate font-medium",children:e.name})]}),b&&m.jsxs(m.Fragment,{children:[c&&(c.mode==="new-file"||c.mode==="new-folder")&&c.parentPath===e.fullPath&&m.jsx(Cd,{defaultValue:"",depth:n+1,isFolder:c.mode==="new-folder",onCommit:M=>{var E;(E=c==null?void 0:c.onCommit)==null||E.call(c,M)},onCancel:()=>{var M;(M=c==null?void 0:c.onCancel)==null||M.call(c)}}),A.map(M=>M.isFile&&M.children.size===0?m.jsx(C8,{node:M,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:l,inlineInput:c,onDragStart:u,lintInfo:y==null?void 0:y.get(M.fullPath)},M.fullPath):M.children.size>0?m.jsx(t,{node:M,depth:n+1,activeFile:r,onSelectFile:i,defaultOpen:JO(M,r),onContextMenu:l,inlineInput:c,onDragStart:u,onDragOver:h,onDrop:p,onDragLeave:O,dragOverFolder:x,lintFindingsByFile:y},M.fullPath):m.jsx(C8,{node:M,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:l,inlineInput:c,onDragStart:u,lintInfo:y==null?void 0:y.get(M.fullPath)},M.fullPath))]})]})}),uq=d.memo(function({files:e,activeFile:n,onSelectFile:r,onCreateFile:i,onCreateFolder:a,onDeleteFile:l,onRenameFile:c,onDuplicateFile:u,onMoveFile:h,onImportFiles:p,lintFindingsByFile:O}){const x=d.useMemo(()=>aq(e),[e]),y=d.useMemo(()=>IM(x.children),[x]),[b,S]=d.useState(null),[k,A]=d.useState(null),[C,T]=d.useState(null),[j,M]=d.useState(null),E=d.useRef(null),$=!!(i||a||l||c||u),N=d.useCallback((P,L,V)=>{$&&(P.preventDefault(),S({x:P.clientX,y:P.clientY,targetPath:L,targetIsFolder:V}))},[$]),D=d.useCallback(()=>S(null),[]),z=d.useCallback(P=>{A({parentPath:P,mode:"new-file",onCommit:L=>{const V=P?`${P}/${L}`:L;i==null||i(V),A(null)},onCancel:()=>A(null)})},[i]),B=d.useCallback(P=>{A({parentPath:P,mode:"new-folder",onCommit:L=>{const V=P?`${P}/${L}`:L;a==null||a(V),A(null)},onCancel:()=>A(null)})},[a]),X=d.useCallback(P=>{const L=P.includes("/")?P.slice(P.lastIndexOf("/")+1):P,V=P.includes("/")?P.slice(0,P.lastIndexOf("/")):"";A({parentPath:V,mode:"rename",originalPath:P,originalName:L,onCommit:W=>{if(W!==L){const ee=V?`${V}/${W}`:W;c==null||c(P,ee)}A(null)},onCancel:()=>A(null)})},[c]),U=d.useCallback(P=>{u==null||u(P)},[u]),I=d.useCallback(P=>{T(P)},[]),K=d.useCallback(()=>{C&&(l==null||l(C),T(null))},[C,l]),Z=d.useCallback(()=>{T(null)},[]),F=d.useCallback((P,L)=>{E.current=L,P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",L)},[]),_=d.useCallback((P,L)=>{M(L)},[]),q=d.useCallback((P,L)=>{if(P.dataTransfer.files.length>0&&!E.current){P.preventDefault(),p==null||p(P.dataTransfer.files,L||void 0),M(null);return}const V=E.current;if(!V||!h){M(null);return}const W=V.includes("/")?V.slice(V.lastIndexOf("/")+1):V,ee=L?`${L}/${W}`:W;ee!==V&&!L.startsWith(V+"/")&&h(V,ee),M(null),E.current=null},[h,p]),G=d.useCallback(()=>{M(null)},[]),R=d.useCallback(P=>{$&&P.target===P.currentTarget&&(P.preventDefault(),S({x:P.clientX,y:P.clientY,targetPath:"",targetIsFolder:!0}))},[$]);return m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[$&&m.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-b border-neutral-800/50 flex-shrink-0",children:[m.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-neutral-600 uppercase",children:"Files"}),m.jsxs("div",{className:"flex items-center gap-0.5",children:[m.jsx("button",{onClick:()=>z(""),className:"p-0.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 transition-colors",title:"New File",children:m.jsx(vw,{size:12,weight:"bold"})}),m.jsx("button",{onClick:()=>B(""),className:"p-0.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 transition-colors",title:"New Folder",children:m.jsx(fw,{size:12,weight:"duotone"})})]})]}),m.jsxs("div",{className:`flex-1 overflow-y-auto py-1 transition-colors ${j===""?"bg-[#3CE6AC]/5 outline outline-1 outline-[#3CE6AC]/30 -outline-offset-1":""}`,onContextMenu:R,onDragOver:P=>{P.preventDefault(),P.target===P.currentTarget&&M("")},onDragLeave:P=>{P.target===P.currentTarget&&M(null)},onDrop:P=>{P.preventDefault(),q(P,"")},children:[k&&(k.mode==="new-file"||k.mode==="new-folder")&&k.parentPath===""&&m.jsx(Cd,{defaultValue:"",depth:0,isFolder:k.mode==="new-folder",onCommit:P=>{var L;return(L=k.onCommit)==null?void 0:L.call(k,P)},onCancel:()=>{var P;return(P=k.onCancel)==null?void 0:P.call(k)}}),y.map(P=>P.isFile&&P.children.size===0?m.jsx(C8,{node:P,depth:0,activeFile:n,onSelectFile:r,onContextMenu:N,inlineInput:k,onDragStart:F,lintInfo:O==null?void 0:O.get(P.fullPath)},P.fullPath):m.jsx(cq,{node:P,depth:0,activeFile:n,onSelectFile:r,defaultOpen:JO(P,n),onContextMenu:N,inlineInput:k,onDragStart:F,onDragOver:_,onDrop:q,onDragLeave:G,dragOverFolder:j,lintFindingsByFile:O},P.fullPath))]}),C&&m.jsx("div",{className:"border-t border-neutral-800/50 flex-shrink-0",children:m.jsx(oq,{name:C.includes("/")?C.slice(C.lastIndexOf("/")+1):C,onConfirm:K,onCancel:Z})}),b&&m.jsx(lq,{state:b,onClose:D,onNewFile:z,onNewFolder:B,onRename:X,onDuplicate:U,onDelete:I})]})}),qM="hf-studio-sidebar-tab";function fq(){const t=localStorage.getItem(qM);return t==="assets"?"assets":t==="code"?"code":t==="blocks"?"blocks":"compositions"}const dq=d.memo(d.forwardRef(function({width:e=240,projectId:n,compositions:r,assets:i,activeComposition:a,onSelectComposition:l,onImportFiles:c,fileTree:u,editingFile:h,onSelectFile:p,onCreateFile:O,onCreateFolder:x,onDeleteFile:y,onRenameFile:b,onDuplicateFile:S,onMoveFile:k,codeChildren:A,onRenderComposition:C,isRendering:T,onLint:j,linting:M,lintFindingCount:E,lintFindingsByFile:$,onToggleCollapse:N,onAddBlock:D,onPreviewBlock:z,takeoverContent:B},X){const[U,I]=d.useState(fq),K=d.useRef(U);K.current=U;const Z=d.useCallback(_=>{I(_),localStorage.setItem(qM,_),Yt("tab_switch",{panel:"left_sidebar",tab:_})},[]),F=d.useCallback(()=>K.current,[]);return d.useImperativeHandle(X,()=>({selectTab:Z,getTab:F}),[Z,F]),m.jsx("div",{className:"flex flex-col h-full bg-neutral-950 border-r border-neutral-800/50",style:{width:e},children:B?m.jsx("div",{className:"flex min-h-0 flex-1",children:B}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"border-b border-neutral-800/50 px-3 py-3 flex-shrink-0",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("div",{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:jp?"1fr 1fr 1fr 1fr":"1fr 1fr 1fr"},children:[m.jsx(Xt,{label:"Source code editor",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>Z("code"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${U==="code"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Code"})}),m.jsx(Xt,{label:"Compositions and sub-compositions",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>Z("compositions"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${U==="compositions"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Comps"})}),m.jsx(Xt,{label:"Videos, images, audio, fonts",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>Z("assets"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${U==="assets"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Assets"})}),jp&&m.jsx(Xt,{label:"Browse blocks and components",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>Z("blocks"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${U==="blocks"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Catalog"})})]}),N&&m.jsx("button",{type:"button",onClick:N,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:m.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:[m.jsx("path",{d:"m14 7-5 5 5 5"}),m.jsx("path",{d:"M19 4v16"})]})})]})}),U==="compositions"&&m.jsx(II,{projectId:n,compositions:r,activeComposition:a,onSelect:l,onRenderComposition:C,isRendering:T,lintFindingsByFile:$}),U==="assets"&&m.jsx(UI,{projectId:n,assets:i,onImport:c,onDelete:y,onRename:b}),U==="code"&&m.jsxs("div",{className:"flex flex-1 min-h-0",children:[((u==null?void 0:u.length)??0)>0&&m.jsx("div",{className:"w-[160px] flex-shrink-0 border-r border-neutral-800 overflow-y-auto",children:m.jsx(uq,{files:u??[],activeFile:(h==null?void 0:h.path)??null,onSelectFile:p??(()=>{}),onCreateFile:O,onCreateFolder:x,onDeleteFile:y,onRenameFile:b,onDuplicateFile:S,onMoveFile:k,onImportFiles:c,lintFindingsByFile:$})}),m.jsx("div",{className:"flex-1 overflow-hidden min-w-0",children:A??m.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to edit"})})]}),jp&&U==="blocks"&&m.jsx(eq,{onAddBlock:D,onPreviewBlock:z}),j&&m.jsx("div",{className:"border-t border-neutral-800 p-2 flex-shrink-0",children:m.jsxs("button",{onClick:j,disabled:M,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 hover:text-amber-300 hover:bg-neutral-800 transition-colors disabled:opacity-40",children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("path",{d:"M9 11l3 3L22 4"}),m.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),M?"Linting…":"Lint",!M&&E!=null&&E>0&&m.jsx("span",{className:"ml-1 min-w-[16px] rounded-full bg-amber-500/20 px-1 text-[9px] font-bold text-amber-400",children:E})]})})]})})}));function hq({projectId:t,filePath:e}){const n=`/api/projects/${t}/preview/${e}`,r=e.split("/").pop()??e;return Su.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[m.jsx("img",{src:n,alt:r,className:"max-w-full max-h-[70%] object-contain rounded border border-neutral-800"}),m.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):D8.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[m.jsx("video",{src:n,controls:!0,className:"max-w-full max-h-[70%] rounded border border-neutral-800"}),m.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):H8.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-3",children:[m.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("circle",{cx:"6",cy:"18",r:"3"}),m.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),m.jsx("audio",{src:n,controls:!0,className:"w-full max-w-[280px]"}),m.jsx("span",{className:"text-[11px] text-neutral-500 font-mono",children:e})]}):m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[m.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:r}),m.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),m.jsx("span",{className:"text-[10px] text-neutral-600",children:"Binary file — preview not available"})]})}const GM=d.createContext(null);function UM(){const t=d.useContext(GM);if(!t)throw new Error("useFileManagerContext must be used within FileManagerProvider");return t}function mq({value:{editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:a,editingPathRef:l,projectIdRef:c,saveRafRef:u,importedFontAssetsRef:h,readProjectFile:p,writeProjectFile:O,readOptionalProjectFile:x,updateEditingFileContent:y,revealSourceOffset:b,openSourceForSelection:S,handleFileSelect:k,handleContentChange:A,refreshFileTree:C,uploadProjectFiles:T,handleCreateFile:j,handleCreateFolder:M,handleDeleteFile:E,handleRenameFile:$,handleDuplicateFile:N,handleMoveFile:D,handleImportFiles:z,handleImportFonts:B,compositions:X,assets:U,fontAssets:I},children:K}){const Z=d.useMemo(()=>({editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:a,editingPathRef:l,projectIdRef:c,saveRafRef:u,importedFontAssetsRef:h,readProjectFile:p,writeProjectFile:O,readOptionalProjectFile:x,updateEditingFileContent:y,revealSourceOffset:b,openSourceForSelection:S,handleFileSelect:k,handleContentChange:A,refreshFileTree:C,uploadProjectFiles:T,handleCreateFile:j,handleCreateFolder:M,handleDeleteFile:E,handleRenameFile:$,handleDuplicateFile:N,handleMoveFile:D,handleImportFiles:z,handleImportFonts:B,compositions:X,assets:U,fontAssets:I}),[t,e,n,r,i,a,l,c,u,h,p,O,x,y,b,S,k,A,C,T,j,M,E,$,N,D,z,B,X,U,I]);return m.jsx(GM,{value:Z,children:K})}const WM="hf-studio-render-settings";function KM(){try{const t=localStorage.getItem(WM);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 T2(t,e,n){try{localStorage.setItem(WM,JSON.stringify({format:t,quality:e,fps:n}))}catch{}}function pq({leftSidebarRef:t,onSelectComposition:e,onAddBlock:n,onPreviewBlock:r,onLint:i,linting:a,lintFindingCount:l,lintFindingsByFile:c}){const{leftCollapsed:u,leftWidth:h,toggleLeftSidebar:p,handlePanelResizeStart:O,handlePanelResizeMove:x,handlePanelResizeEnd:y}=dO(),{projectId:b,renderQueue:S,waitForPendingDomEditSaves:k}=hl(),{compositions:A,assets:C,editingFile:T,fileTree:j,revealSourceOffset:M,handleFileSelect:E,handleCreateFile:$,handleCreateFolder:N,handleDeleteFile:D,handleRenameFile:z,handleDuplicateFile:B,handleMoveFile:X,handleImportFiles:U,handleContentChange:I}=UM(),K=d.useCallback(async Z=>{await k();const{format:F,quality:_,fps:q}=KM();await S.startRender({composition:Z,format:F,quality:_,fps:q})},[S,k]);return u?m.jsx("div",{className:"flex w-10 flex-shrink-0 flex-col items-center border-r border-neutral-800/50 bg-neutral-950 pt-1",children:m.jsx("button",{type:"button",onClick:p,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:m.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:[m.jsx("path",{d:"M5 4v16"}),m.jsx("path",{d:"m10 7 5 5-5 5"})]})})}):m.jsxs(m.Fragment,{children:[m.jsx(dq,{ref:t,width:h,projectId:b,compositions:A,assets:C,activeComposition:(T==null?void 0:T.path)??null,onSelectComposition:e,fileTree:j,editingFile:T,onSelectFile:E,onCreateFile:$,onCreateFolder:N,onDeleteFile:D,onRenameFile:z,onDuplicateFile:B,onMoveFile:X,onImportFiles:U,codeChildren:T?O7(T.path)?m.jsx(hq,{projectId:b,filePath:T.path}):m.jsx(DI,{content:T.content??"",filePath:T.path,onChange:I,revealOffset:M}):void 0,onRenderComposition:K,isRendering:S.isRendering,onLint:i,linting:a,lintFindingCount:l,lintFindingsByFile:c,onToggleCollapse:p,onAddBlock:n,onPreviewBlock:r}),m.jsx("div",{className:"group w-2 flex-shrink-0 cursor-col-resize flex items-center justify-center",style:{touchAction:"none"},onPointerDown:Z=>O("left",Z),onPointerMove:x,onPointerUp:y,children:m.jsx("div",{className:"h-[52px] w-px bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})})]})}const gq=25,Oq=400,xq='[data-preview-pan-surface="true"]',Td=48,T8={zoomPercent:100,panX:0,panY:0},yq=.007,Iv=10;function os(t){return Math.round(t*1e4)/1e4}function ba(t){return Number.isFinite(t)?Math.min(Oq,Math.max(gq,t)):100}function bq(t){return t===1}function E2(t,e){return t instanceof Element?e!=null&&e.contains(t)?!0:!!t.closest(xq):!1}function vq(t,e){if(!Number.isFinite(t))return ba(e);const r=-(Math.abs(t)>Iv?Iv*Math.sign(t):t)*yq,i=ba(e);return ba(i*Math.exp(r))}function JM(t){const e=ba(t.zoomPercent)/100,n=t.contentWidth??t.viewportWidth,r=t.contentHeight??t.viewportHeight,i=Math.max(0,(n*e-t.viewportWidth)/2)+Td,a=Math.max(0,(r*e-t.viewportHeight)/2)+Td;return{panX:Math.min(i,Math.max(-i,t.panX)),panY:Math.min(a,Math.max(-a,t.panY))}}function Sq(t,e,n,r,i,a,l){const c=ba(n)/100,u=Math.abs(a*c-r)/2+Td,h=Math.abs(l*c-i)/2+Td;return{panX:Math.min(u,Math.max(-u,t)),panY:Math.min(h,Math.max(-h,e))}}function wq(t){const e=ba(t.state.zoomPercent),n=vq(t.deltaY,e),r=e/100,i=n/100;let a=t.state.panX,l=t.state.panY;if(t.cursorX!==void 0&&t.cursorY!==void 0){const p=i/r;a=t.cursorX*(1-p)+a*p,l=t.cursorY*(1-p)+l*p}const c=t.contentWidth??t.viewportWidth,u=t.contentHeight??t.viewportHeight,h=Sq(a,l,n,t.viewportWidth,t.viewportHeight,c,u);return{zoomPercent:n,...h}}function kq(t){const e=JM({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:ba(t.state.zoomPercent),...e}}function Aq({projectId:t,directUrl:e}){return e??t}const Mq=1200,Cq=200,qv=16;function $2(t){return Math.abs(t.zoomPercent-100)<.5&&Math.abs(t.panX)<.1&&Math.abs(t.panY)<.1}function Tq(){const t=gs().previewZoom;return t?{zoomPercent:ba(t.zoomPercent),panX:t.panX,panY:t.panY}:T8}function Eq(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 Gv(t,e,n,r){const i=Math.max(0,t-qv),a=Math.max(0,e-qv),l=n&&n.width>0&&n.height>0?n.width/n.height:r?9/16:16/9;if(i===0||a===0)return{width:0,height:0};let c=i,u=c/l;return u>a&&(u=a,c=u*l),{width:os(c),height:os(u)}}const $q=d.memo(function({projectId:e,iframeRef:n,onIframeLoad:r,onCompositionLoadingChange:i,portrait:a,directUrl:l,suppressLoadingOverlay:c,onStageRef:u}){const h=Aq({projectId:e,directUrl:l}),p=d.useRef(null),O=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{u==null||u(O)},[u]);const[y,b]=d.useState(null),[S,k]=d.useState(()=>Gv(0,0,null,a)),A=d.useRef(Tq()),[C,T]=d.useState(()=>A.current),j=d.useRef(null),M=d.useRef(null),E=d.useRef(null),$=d.useRef(!1),N=d.useRef(null);d.useEffect(()=>()=>{E.current&&clearTimeout(E.current),M.current&&clearTimeout(M.current)},[]),d.useEffect(()=>{const _=p.current;if(!_)return;const q=()=>{const R=_.getBoundingClientRect();k(Gv(R.width,R.height,y,a))};q();const G=new ResizeObserver(q);return G.observe(_),()=>G.disconnect()},[y,a]);const D=d.useCallback(()=>{const _=Eq(x.current);b(q=>(q==null?void 0:q.width)===(_==null?void 0:_.width)&&(q==null?void 0:q.height)===(_==null?void 0:_.height)?q:_)},[]),z=d.useCallback(_=>{x.current=_,n.current=_},[n]),B=d.useRef(S);B.current=S;const X=d.useCallback(_=>{const q=O.current;if(!q)return;const G=os(_.zoomPercent/100),R=os(_.panX),P=os(_.panY);q.style.transform=`translate3d(${R}px, ${P}px, 0) scale(${G})`},[]),U=d.useCallback((_,q)=>{const G={zoomPercent:ba(_.zoomPercent),panX:Number.isFinite(_.panX)?_.panX:0,panY:Number.isFinite(_.panY)?_.panY:0};if(A.current=G,q&&!$.current){$.current=!0;const R=j.current;R&&(R.style.opacity="1")}X(G),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{$.current=!1;const R=A.current;if(wo({previewZoom:R}),T(P=>P.zoomPercent===R.zoomPercent&&P.panX===R.panX&&P.panY===R.panY?P:R),q){const P=j.current;P&&(P.textContent=$2(R)?"Fit":`${Math.round(R.zoomPercent)}%`,M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{j.current&&(j.current.style.opacity="0")},Mq))}},Cq)},[X]),I=d.useCallback(_=>U(_,!0),[U]),K=d.useCallback(_=>U(_,!1),[U]),Z=d.useCallback(()=>{const _=A.current;(Math.abs(_.zoomPercent-100)>.5||Math.abs(_.panX)>.1||Math.abs(_.panY)>.1)&&X(_)},[X]);d.useEffect(()=>{const _=p.current;if(!_)return;const q=G=>{const R=_.getBoundingClientRect();if(G.clientX<R.left||G.clientX>R.right||G.clientY<R.top||G.clientY>R.bottom)return;if(G.ctrlKey||G.metaKey){G.preventDefault(),G.stopPropagation();const W=B.current,ee=G.clientX-(R.left+R.width/2),ue=G.clientY-(R.top+R.height/2),ae=wq({state:A.current,deltaY:G.deltaY,viewportWidth:R.width,viewportHeight:R.height,contentWidth:W.width,contentHeight:W.height,cursorX:ee,cursorY:ue});I(ae);return}if(!E2(G.target,O.current))return;G.preventDefault(),G.stopPropagation();const L=B.current,V=kq({state:A.current,deltaX:G.deltaX,deltaY:G.deltaY,viewportWidth:R.width,viewportHeight:R.height,contentWidth:L.width,contentHeight:L.height});K(V)};return document.addEventListener("wheel",q,{passive:!1,capture:!0}),()=>document.removeEventListener("wheel",q,{capture:!0})},[I,K]),d.useEffect(()=>{const _=p.current;if(!_)return;const q=G=>{if($2(A.current))return;const R=_.getBoundingClientRect();G.clientX<R.left||G.clientX>R.right||G.clientY<R.top||G.clientY>R.bottom||I(T8)};return document.addEventListener("dblclick",q,{capture:!0}),()=>document.removeEventListener("dblclick",q,{capture:!0})},[I]),d.useEffect(()=>{const _=(L,V)=>{const W=p.current;if(!W)return null;const ee=W.getBoundingClientRect();return L<ee.left||L>ee.right||V<ee.top||V>ee.bottom?null:ee},q=L=>{_(L.clientX,L.clientY)&&E2(L.target,O.current)&&bq(L.button)&&(L.preventDefault(),N.current={pointerId:L.pointerId,startX:L.clientX,startY:L.clientY,originX:A.current.panX,originY:A.current.panY})},G=L=>{const V=N.current,W=p.current;if(!V||!W||V.pointerId!==L.pointerId)return;L.preventDefault();const ee=W.getBoundingClientRect(),ue=B.current,ae=JM({panX:V.originX+L.clientX-V.startX,panY:V.originY+L.clientY-V.startY,zoomPercent:A.current.zoomPercent,viewportWidth:ee.width,viewportHeight:ee.height,contentWidth:ue.width,contentHeight:ue.height});K({...A.current,...ae})},R=L=>{var V;((V=N.current)==null?void 0:V.pointerId)===L.pointerId&&(N.current=null)},P=L=>{L.button===1&&_(L.clientX,L.clientY)&&E2(L.target,O.current)&&L.preventDefault()};return document.addEventListener("pointerdown",q,{capture:!0}),document.addEventListener("pointermove",G,{capture:!0}),document.addEventListener("pointerup",R,{capture:!0}),document.addEventListener("pointercancel",R,{capture:!0}),document.addEventListener("auxclick",P,{capture:!0}),()=>{document.removeEventListener("pointerdown",q,{capture:!0}),document.removeEventListener("pointermove",G,{capture:!0}),document.removeEventListener("pointerup",R,{capture:!0}),document.removeEventListener("pointercancel",R,{capture:!0}),document.removeEventListener("auxclick",P,{capture:!0})}},[K]);const F=A.current;return m.jsx("div",{className:"flex flex-col h-full min-h-0",children:m.jsxs("div",{ref:p,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-700",tabIndex:0,"aria-label":"Composition preview",children:[m.jsx("div",{className:"absolute inset-2 flex items-center justify-center pointer-events-none",children:m.jsxs("div",{ref:O,className:"relative shrink-0 pointer-events-auto",style:{width:`${S.width}px`,height:`${S.height}px`,transform:`translate3d(${os(F.panX)}px, ${os(F.panY)}px, 0) scale(${os(F.zoomPercent/100)})`,transformOrigin:"center center"},"data-testid":"preview-zoom-stage",children:[(l==null?void 0:l.includes("/components/"))&&m.jsx(ig,{projectId:e,onLoad:()=>{},portrait:a,suppressLoadingOverlay:!0,style:{position:"absolute",inset:0,zIndex:0}},`backdrop-${e}`),m.jsx(ig,{ref:z,projectId:l?void 0:e,directUrl:l,onLoad:()=>{D(),r(),Z()},onCompositionLoadingChange:i,portrait:a,suppressLoadingOverlay:c,style:l!=null&&l.includes("/components/")?{position:"absolute",inset:0,zIndex:1}:void 0},h)]})}),m.jsx("div",{ref:j,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 300ms ease-out"},"aria-live":"polite"}),!$2(C)&&m.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:()=>I(T8),"aria-label":"Reset zoom to fit","data-testid":"preview-reset-zoom",children:[Math.round(C.zoomPercent),"% — Reset"]})]})})});function jq({stack:t,onNavigate:e}){return t.length<=1?null:m.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:[m.jsx("button",{type:"button",onClick:()=>{var n;Yt("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 transition-colors",title:"Back (Esc)",children:m.jsx(pZ,{size:12,weight:"bold"})}),t.map((n,r)=>{const i=r===t.length-1;return m.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&m.jsx(D7,{size:10,className:"text-neutral-600 flex-shrink-0"}),i?m.jsx("span",{className:"text-xs text-neutral-200 font-medium",children:n.label}):m.jsx("button",{type:"button",onClick:()=>{Yt("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 Pq(t){try{const e=JSON.parse(t);return e.name?e:null}catch{return null}}function Qq(t,e,n,r){if(n.width===0||n.height===0)return null;const i=(t-n.left)/n.width,a=(e-n.top)/n.height,l=r?1080:1920,c=r?1920:1080;return{left:Math.max(0,Math.min(i*l,l)),top:Math.max(0,Math.min(a*c,c))}}function Zq(t,e){var i,a;const n=((i=e.dimensions)==null?void 0:i.width)??0,r=((a=e.dimensions)==null?void 0:a.height)??0;return{left:Math.max(0,t.left-n/2),top:Math.max(0,t.top-r/2)}}function Nq({portrait:t,stageRef:e,onBlockDrop:n}){const[r,i]=d.useState(!1),a=d.useCallback(u=>{n&&u.dataTransfer.types.includes(Xf)&&(u.preventDefault(),u.dataTransfer.dropEffect="copy",i(!0))},[n]),l=d.useCallback(()=>{i(!1)},[]),c=d.useCallback(u=>{if(i(!1),!n)return;const h=u.dataTransfer.getData(Xf);if(!h)return;u.preventDefault();const p=Pq(h),O=e.current;if(!p||!O)return;const x=Qq(u.clientX,u.clientY,O.getBoundingClientRect(),t);x&&n(p.name,Zq(x,p))},[n,e,t]);return{isDragOver:r,handleDragOver:a,handleDragLeave:l,handleDrop:c}}function Rq({projectId:t,activeCompositionPath:e,onCompositionChange:n}){const[r,i]=d.useState([{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`}]),a=d.useRef(n);a.current=n;const l=d.useCallback(y=>{i(b=>{var A;const S=typeof y=="function"?y(b):y,k=(A=S[S.length-1])==null?void 0:A.id;return queueMicrotask(()=>{var C;return(C=a.current)==null?void 0:C.call(a,k==="master"?null:k)}),S})},[]),c=d.useRef(0),[u,h]=d.useState(new Map),p=d.useRef(u);p.current=u;const O=d.useCallback(y=>{y===0&&c.current>0&&oe.getState().setCurrentTime(c.current),oe.getState().setElements([]),l(b=>b.slice(0,y+1))},[]),x=d.useCallback(y=>{if(!y.compositionSrc)return;c.current=oe.getState().currentTime;const b=y.id;let S=p.current.get(b);if(!S){const k=y.compositionSrc,A=k.match(/compositions\/.*\.html/);S=A?A[0]:k}oe.getState().setElements([]),l(k=>{var j;if(k[k.length-1].id===S&&k.length>1)return k.slice(0,-1);const C=((j=S.split("/").pop())==null?void 0:j.replace(/\.html$/,""))||S,T=`/api/projects/${t}/preview/comp/${S}`;return[...k,{id:S,label:C,previewUrl:T}]})},[t]);return d.useEffect(()=>{if(e==="index.html")oe.getState().setElements([]),l(y=>y.length>1?[y[0]]:y);else if(e&&e.startsWith("compositions/")){const y=e.replace(/^compositions\//,"").replace(/\.html$/,""),b=`/api/projects/${t}/preview/comp/${e}`;oe.getState().setElements([]),l(S=>{var k;return((k=S[S.length-1])==null?void 0:k.id)===e?S:[{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`},{id:e,label:y,previewUrl:b}]})}else e||oe.getState().setElements([])},[e,t,l]),{compositionStack:r,updateCompositionStack:l,handleNavigateComposition:O,handleDrillDown:x,masterSeekRef:c,compIdToSrc:u,setCompIdToSrc:h}}const Vq=100,Lq=220,_q=120;function Dq(t){return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)}function Hq(){return document.fullscreenElement}const Xq=d.memo(function({projectId:e,portrait:n,previewOverlay:r,timelineToolbar:i,timelineFooter:a,refreshKey:l,activeCompositionPath:c,onIframeRef:u,onCompositionChange:h,renderClipContent:p,onFileDrop:O,onDeleteElement:x,onAssetDrop:y,onBlockDrop:b,onPreviewBlockDrop:S,onMoveElement:k,onResizeElement:A,onBlockedEditAttempt:C,onSplitElement:T,onRazorSplit:j,onRazorSplitAll:M,onSelectTimelineElement:E,onDeleteKeyframe:$,onDeleteAllKeyframes:N,onChangeKeyframeEase:D,onMoveKeyframe:z,onToggleKeyframeAtPlayhead:B,onCompIdToSrcChange:X,timelineVisible:U,onToggleTimeline:I,onCompositionLoadingChange:K}){const{iframeRef:Z,togglePlay:F,seek:_,onIframeLoad:q,refreshPlayer:G}=gQ(),R=d.useRef(e);R.current!==e&&(R.current=e,oe.getState().reset());const P=d.useRef(null),L=d.useCallback(Le=>{P.current=Le.current},[]),{isDragOver:V,handleDragOver:W,handleDragLeave:ee,handleDrop:ue}=Nq({portrait:n,stageRef:P,onBlockDrop:S}),ae=d.useRef(l);d.useEffect(()=>{l!==ae.current&&(ae.current=l,G())},[l,G]);const Y=d.useCallback(()=>{q(),u==null||u(Z.current)},[q,Z,u]),{compositionStack:re,updateCompositionStack:he,handleNavigateComposition:xe,handleDrillDown:ke,compIdToSrc:be,setCompIdToSrc:Se}=Rq({projectId:e,activeCompositionPath:c,onCompositionChange:h}),Ve=Z,Te=d.useCallback(Le=>{var We;if(!Le.compositionSrc)return;const Ue=Le.id;let Mt=be.get(Ue);if(!Mt)try{const bt=(We=Ve.current)==null?void 0:We.contentDocument;if(bt){const Et=bt.querySelector(`[data-composition-id="${Ue}"][data-composition-src]`);Et&&(Mt=Et.getAttribute("data-composition-src")||void 0)}}catch{}ke({id:Ue,compositionSrc:Mt??Le.compositionSrc})},[be,ke,Ve]),Ze=d.useRef(be);Ze.current=be,Wt(()=>{fetch(`/api/projects/${e}/files/index.html`).then(Le=>Le.json()).then(Le=>{const Ue=Le.content||"",Mt=new Map,We=/data-composition-id=["']([^"']+)["'][^>]*data-composition-src=["']([^"']+)["']|data-composition-src=["']([^"']+)["'][^>]*data-composition-id=["']([^"']+)["']/g;let bt;for(;(bt=We.exec(Ue))!==null;){const Et=bt[1]||bt[4],It=bt[2]||bt[3];Et&&It&&Mt.set(Et,It)}Se(Mt),X==null||X(Mt)}).catch(()=>{})}),d.useEffect(()=>{if(be.size===0)return;const Le=We=>{const bt=Ze.current;if(bt.size===0)return null;let Et=!1;const It=We.map(qt=>{if(qt.compositionSrc)return qt;const Tn=bt.get(qt.id)??bt.get(qt.id.replace(/-(host|comp|layer)$/,""));return Tn?(Et=!0,{...qt,compositionSrc:Tn}):qt});return Et?It:null},Ue=Le(oe.getState().elements);Ue&&oe.getState().setElements(Ue);let Mt=!1;return oe.subscribe((We,bt)=>{if(Mt||We.elements===bt.elements||We.elements.length===0||We.elements.every(It=>It.compositionSrc))return;Mt=!0;const Et=Le(We.elements);Et&&We.setElements(Et),Mt=!1})},[be]);const[Xe,ze]=d.useState(Lq),et=d.useRef(!1),[Ot,He]=d.useState(!0),ct=d.useCallback(Le=>{Le||(et.current=!0),!(Le&&et.current)&&He(Le)},[]),yt=Ot;d.useEffect(()=>{K==null||K(Ot)},[Ot,K]);const Oe=d.useSyncExternalStore(Dq,Hq),Ge=U??!0,Re=d.useRef(!1),qe=d.useRef(null),Ie=Oe===qe.current&&Oe!=null,$e=d.useCallback(()=>{qe.current&&(document.fullscreenElement?document.exitFullscreen():qe.current.requestFullscreen())},[]),ut=re[re.length-1],Ae=re.length>1?ut.previewUrl:void 0,Be=d.useRef(u);Be.current=u,d.useEffect(()=>{var Le;(Le=Be.current)==null||Le.call(Be,Z.current)},[re.length,l,Z]);const lt=d.useCallback(Le=>{yt||(Le.preventDefault(),Re.current=!0,Le.target.setPointerCapture(Le.pointerId))},[yt]),ot=d.useCallback(Le=>{if(yt||!Re.current||!qe.current)return;const Ue=qe.current.getBoundingClientRect(),Mt=Le.clientY-Ue.top,We=Ue.height,bt=Math.max(Vq,Math.min(We-_q,We-Mt));ze(bt)},[yt]),gn=d.useCallback(()=>{Re.current=!1},[]),at=d.useCallback(Le=>{Le.key==="Escape"&&re.length>1&&he(Ue=>Ue.slice(0,-1))},[re.length]);return m.jsxs("div",{ref:qe,className:"flex flex-col h-full min-h-0 bg-neutral-950",onKeyDown:at,tabIndex:-1,"data-studio-fullscreen-target":"",children:[m.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[m.jsxs("div",{className:"flex-1 min-h-0 relative overflow-hidden","data-preview-pan-surface":"true",onDragOver:W,onDragLeave:ee,onDrop:ue,children:[m.jsx($q,{projectId:e,iframeRef:Z,onIframeLoad:Y,onCompositionLoadingChange:ct,portrait:n,directUrl:Ae,suppressLoadingOverlay:et.current,onStageRef:L}),V&&m.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"}),!Ie&&r]}),m.jsxs("div",{className:"bg-neutral-950 border-t border-neutral-800/50 flex-shrink-0",children:[!Ie&&re.length>1&&m.jsx(jq,{stack:re,onNavigate:xe}),m.jsx(cj,{onTogglePlay:F,onSeek:_,disabled:yt,isFullscreen:Ie,onToggleFullscreen:$e})]})]}),!Ie&&Ge?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group h-2 flex-shrink-0 cursor-row-resize flex items-center justify-center z-10",style:{touchAction:"none"},onPointerDown:lt,onPointerMove:ot,onPointerUp:gn,children:m.jsx("div",{className:"h-px w-full bg-white/10 transition-colors group-hover:bg-white/16 group-active:bg-white/22"})}),m.jsxs("div",{className:"relative flex flex-col flex-shrink-0",style:{height:Xe},"aria-disabled":yt||void 0,children:[m.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden bg-neutral-950",onDoubleClick:Le=>{Le.target.closest("[data-clip]")||yt||re.length>1&&he(Ue=>Ue.slice(0,-1))},children:[m.jsx("div",{className:"flex-shrink-0",children:i}),m.jsx(qP,{onSeek:_,onDrillDown:Te,renderClipContent:p,onFileDrop:O,onDeleteElement:x,onAssetDrop:y,onBlockDrop:b,onMoveElement:k,onResizeElement:A,onBlockedEditAttempt:C,onSplitElement:T,onRazorSplit:j,onRazorSplitAll:M,onSelectElement:E,onDeleteKeyframe:$,onDeleteAllKeyframes:N,onChangeKeyframeEase:D,onMoveKeyframe:z,onToggleKeyframeAtPlayhead:B})]}),a&&m.jsx("div",{className:"flex-shrink-0",children:a}),yt&&m.jsx("div",{className:"absolute inset-0 z-30 cursor-not-allowed bg-black/18","data-testid":"timeline-loading-disabled-overlay","aria-hidden":"true",onPointerDown:Le=>Le.preventDefault(),onDragOver:Le=>Le.preventDefault(),onDrop:Le=>Le.preventDefault()})]})]}):!Ie&&I?m.jsx("div",{className:"flex-shrink-0 border-t border-neutral-800/50 bg-neutral-950/96",children:m.jsxs("div",{className:"flex h-10 items-center justify-between px-3",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-neutral-500",children:"Timeline"}),m.jsxs("button",{type:"button",onClick:I,className:"flex h-7 items-center gap-1.5 rounded-md border border-neutral-800 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-700 hover:bg-neutral-900 hover:text-neutral-100",title:m9(!1),"aria-label":"Show timeline editor",children:[m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("rect",{x:"3",y:"13",width:"18",height:"8",rx:"1"}),m.jsx("path",{d:"M7 9h10"}),m.jsx("path",{d:"M8 5h8"})]}),m.jsx("span",{children:"Show"}),m.jsx("span",{className:"hidden rounded bg-white/5 px-1 py-0.5 font-mono text-[9px] text-neutral-500 sm:inline",children:h9})]})]})}):null]})}),zq=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Fq(t){return t.metaKey||t.ctrlKey||t.altKey?!1:zq.has(t.key)}function Bq(t,e,n){var y,b;let r=null,i=null;try{r=t.contentDocument,i=t.contentWindow}catch{return[]}if(!r||!i)return[];const a=t.getBoundingClientRect(),l=n.getBoundingClientRect(),c=parseFloat(t.style.width)||a.width,u=a.width/c,h=a.left-l.left,p=a.top-l.top,O=r.querySelectorAll(".caption-group"),x=[];for(let S=0;S<e.groupOrder.length;S++){const k=e.groupOrder[S],A=e.groups.get(k);if(!A)continue;const C=O[S];if(!C)continue;const T=i.getComputedStyle(C);if(parseFloat(T.opacity)<=.01||T.visibility==="hidden")continue;const j=[];for(const M of C.children){const E=M;if(E.dataset.captionWrapper==="true"){const $=E.querySelector(":scope > span");$&&j.push($)}else E.tagName==="SPAN"&&j.push(E)}if(j.length===0&&((y=C.textContent)!=null&&y.trim())){const M=C.childNodes[0];if(M&&M.nodeType===Node.TEXT_NODE){const E=(M.textContent||"").split(/\s+/).filter(Boolean),$=r.createDocumentFragment();for(const N of E){const D=r.createElement("span");D.textContent=N+" ",D.style.display="inline",$.appendChild(D),j.push(D)}C.replaceChild($,M)}else{const E=C.querySelector(":scope > span");if(E&&((b=E.textContent)!=null&&b.trim())){const $=E.textContent.split(/\s+/).filter(Boolean),N=r.createDocumentFragment();for(const D of $){const z=r.createElement("span");z.textContent=D+" ",z.style.display="inline",N.appendChild(z),j.push(z)}E.replaceWith(N)}}}for(let M=0;M<A.segmentIds.length;M++){const E=A.segmentIds[M],$=j[M];if(!$)continue;const N=$.getBoundingClientRect();x.push({segmentId:E,groupId:k,groupIndex:S,wordIndex:M,x:N.left*u+h,y:N.top*u+p,width:N.width*u,height:N.height*u})}}return x}function ff(t,e,n){let r=null;try{r=t.contentDocument}catch{return null}if(!r)return null;const i=r.querySelectorAll(".caption-group")[e];if(!i)return null;const a=[];for(const l of i.children){const c=l;if(c.dataset.captionWrapper==="true"){const u=c.querySelector(":scope > span");u&&a.push(u)}else c.tagName==="SPAN"&&a.push(c)}return a[n]??null}function iu(t,e){const n=e.gsap;if(n&&n.getProperty)return{x:n.getProperty(t,"x")||0,y:n.getProperty(t,"y")||0,scale:n.getProperty(t,"scale")||1,rotation:n.getProperty(t,"rotation")||0};const r=t.style.transform||"",i=r.match(/scale\(([^)]+)\)/),a=r.match(/rotate\(([^)]+)deg\)/),l=r.match(/translate\(([^,]+)px,\s*([^)]+)px\)/);return{x:l?parseFloat(l[1]):0,y:l?parseFloat(l[2]):0,scale:i?parseFloat(i[1]):1,rotation:a?parseFloat(a[1]):0}}function fo(t){var i;if(t.dataset.captionWrapper==="true")return t;const e=t.parentElement;if(e&&e.dataset.captionWrapper==="true")return e;const r=t.ownerDocument.createElement("span");return r.style.display="inline-block",r.dataset.captionWrapper="true",(i=t.parentNode)==null||i.insertBefore(r,t),r.appendChild(t),r}function df(t,e,n,r,i,a){const l=fo(t),c=e.gsap;c&&c.set?c.set(l,{x:n,y:r,scale:i,rotation:a}):l.style.transform=`translate(${n.toFixed(1)}px, ${r.toFixed(1)}px) rotate(${a.toFixed(1)}deg) scale(${i.toFixed(3)})`}function Yq(t,e){const n=fo(t),{x:r,y:i,scale:a,rotation:l}=iu(n,e),c={};return Math.abs(r)>.5&&(c.x=r),Math.abs(i)>.5&&(c.y=i),Math.abs(a-1)>.001&&(c.scaleX=a,c.scaleY=a),Math.abs(l)>.1&&(c.rotation=l),c}const dr=8,j2=20;function Uv(t,e,n){const r=Yq(e,n);Object.keys(r).length>0&&kt.getState().updateSegmentStyle(t,r)}const Iq=d.memo(function({iframeRef:e}){const n=kt(j=>j.isEditMode),r=kt(j=>j.model),i=kt(j=>j.selectedSegmentIds),a=kt(j=>j.selectSegment),l=kt(j=>j.clearSelection),[c,u]=d.useState([]),h=d.useRef(null),p=d.useRef(r);p.current=r;const O=d.useRef(null);Wt(()=>{if(!n)return;let j=[];const M=()=>{const N=e.current,D=p.current,z=h.current;if(!N||!D||!z)return;const B=Bq(N,D,z);B.length===j.length&&B.every((X,U)=>Math.abs(X.x-j[U].x)<.5&&Math.abs(X.y-j[U].y)<.5)||(j=B,u(B))},E=setInterval(M,66);M();const $=N=>{const{selectedSegmentIds:D,model:z}=kt.getState();if(D.size===0||!z)return;const B=N.key;if(!Fq(N))return;N.preventDefault();const X=N.shiftKey?10:1,U=B==="ArrowLeft"?-X:B==="ArrowRight"?X:0,I=B==="ArrowUp"?-X:B==="ArrowDown"?X:0,K=e.current,Z=K==null?void 0:K.contentWindow;if(!(!K||!Z))for(const F of D)for(let _=0;_<z.groupOrder.length;_++){const q=z.groups.get(z.groupOrder[_]);if(!q)continue;const G=q.segmentIds.indexOf(F);if(G<0)continue;const R=ff(K,_,G);if(!R)continue;const P=fo(R),L=iu(P,Z);df(R,Z,L.x+U,L.y+I,L.scale,L.rotation),Uv(F,R,Z);break}};return window.addEventListener("keydown",$),()=>{clearInterval(E),window.removeEventListener("keydown",$)}});const x=d.useCallback(()=>{const j=e.current;if(!j)return 1;const M=j.getBoundingClientRect(),E=parseFloat(j.style.width)||M.width;return M.width/E},[e]),y=d.useCallback((j,M,E,$)=>{$.stopPropagation(),$.currentTarget.setPointerCapture($.pointerId);const N=e.current;if(!N)return;const D=ff(N,j,M),z=N.contentWindow;if(!D||!z)return;const B=iu(fo(D),z);O.current={type:"move",wordEl:D,segmentId:E,startMX:$.clientX,startMY:$.clientY,origTX:B.x,origTY:B.y,origScale:B.scale,origRotation:B.rotation}},[e]),b=d.useCallback((j,M,E,$)=>{var K;$.stopPropagation(),$.preventDefault(),$.currentTarget.setPointerCapture($.pointerId);const N=e.current;if(!N)return;const D=ff(N,j,M),z=N.contentWindow;if(!D||!z)return;const B=D.getBoundingClientRect(),X=x(),U=B.left*X+(((K=e.current)==null?void 0:K.getBoundingClientRect().left)??0)+B.width*X/2,I=iu(fo(D),z);O.current={type:"scale",wordEl:D,segmentId:E,startMX:$.clientX,startDxFromCenter:$.clientX-U,origTX:I.x,origTY:I.y,origScale:I.scale,origRotation:I.rotation}},[e,x]),S=d.useCallback((j,M)=>{M.stopPropagation(),M.preventDefault(),M.currentTarget.setPointerCapture(M.pointerId);const E=e.current;if(!E)return;const $=ff(E,j.groupIndex,j.wordIndex),N=E.contentWindow;if(!$||!N)return;const D=iu(fo($),N);O.current={type:"rotate",wordEl:$,segmentId:j.segmentId,startMX:M.clientX,origTX:D.x,origTY:D.y,origRotation:D.rotation,origScale:D.scale}},[e]),k=d.useCallback(()=>{var j;try{return((j=e.current)==null?void 0:j.contentWindow)??null}catch{return null}},[e]),A=d.useCallback(j=>{const M=O.current;if(!M)return;const E=k();if(E){if(M.type==="move"){const $=x(),N=(j.clientX-M.startMX)/$,D=(j.clientY-M.startMY)/$;df(M.wordEl,E,M.origTX+N,M.origTY+D,M.origScale,M.origRotation)}else if(M.type==="scale"){const $=M.startMX-M.startDxFromCenter,N=Math.abs(M.startDxFromCenter),D=Math.abs(j.clientX-$),z=N>5?D/N:1,B=Math.max(.1,M.origScale*z);df(M.wordEl,E,M.origTX,M.origTY,B,M.origRotation)}else if(M.type==="rotate"){const N=(j.clientX-M.startMX)/200*90;df(M.wordEl,E,M.origTX,M.origTY,M.origScale,M.origRotation+N)}}},[x,k]),C=d.useCallback(()=>{const j=O.current;if(j){const M=k();M&&Uv(j.segmentId,j.wordEl,M),O.current=null}},[k]),T=d.useCallback(j=>{j.target===j.currentTarget&&l()},[l]);return n?m.jsx("div",{ref:h,className:"absolute inset-0 z-50",style:{pointerEvents:"auto"},onClick:T,onPointerMove:A,onPointerUp:C,onLostPointerCapture:C,children:c.map(j=>{const M=i.has(j.segmentId);return m.jsx("div",{className:["absolute",M?"ring-2 ring-studio-accent":"hover:ring-1 hover:ring-white/30"].join(" "),style:{left:j.x,top:j.y,width:j.width,height:j.height,cursor:M?"move":"pointer",touchAction:"none",borderRadius:2},onClick:E=>{E.stopPropagation(),a(j.segmentId,E.shiftKey)},onPointerDown:E=>{M&&y(j.groupIndex,j.wordIndex,j.segmentId,E)},children:M&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{position:"absolute",left:"50%",top:-j2-dr,marginLeft:-dr/2,width:dr,height:dr,borderRadius:"50%",backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",cursor:"grab",touchAction:"none"},onPointerDown:E=>S(j,E)}),m.jsx("div",{style:{position:"absolute",left:"50%",top:-j2,width:1,height:j2,marginLeft:-.5,backgroundColor:"var(--hf-accent, #3CE6AC)",opacity:.5,pointerEvents:"none"}}),[{right:-dr/2,bottom:-dr/2,cursor:"nwse-resize"},{left:-dr/2,top:-dr/2,cursor:"nwse-resize"},{right:-dr/2,top:-dr/2,cursor:"nesw-resize"},{left:-dr/2,bottom:-dr/2,cursor:"nesw-resize"}].map((E,$)=>m.jsx("div",{style:{position:"absolute",...E,width:dr,height:dr,backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",borderRadius:2,touchAction:"none"},onPointerDown:N=>b(j.groupIndex,j.wordIndex,j.segmentId,N)},$))]})},j.segmentId)})}):null}),Wv=["#3CE6AC","#FF6B6B","#4ECDC4","#FFE66D","#A78BFA","#F472B6","#34D399","#FB923C","#60A5FA","#C084FC"],qq=d.memo(function({pixelsPerSecond:e,onSeek:n}){const r=kt(S=>S.model),i=kt(S=>S.selectedSegmentIds),a=kt(S=>S.selectSegment),l=kt(S=>S.updateSegmentTiming),c=kt(S=>S.splitGroup),u=d.useRef(null),h=d.useCallback((S,k,A,C,T)=>{S.stopPropagation(),S.preventDefault(),S.target.setPointerCapture(S.pointerId),u.current={segId:k,edge:A,originalStart:C,originalEnd:T,startX:S.clientX}},[]),p=d.useCallback(S=>{const k=u.current;if(!k)return;const A=(S.clientX-k.startX)/e;if(k.edge==="start"){const C=Math.max(0,k.originalStart+A),T=Math.min(C,k.originalEnd-.05);l(k.segId,T,k.originalEnd)}else{const C=Math.max(k.originalStart+.05,k.originalEnd+A),T=Math.max(0,C);l(k.segId,k.originalStart,T)}},[e,l]),O=d.useCallback(()=>{u.current=null},[]),x=d.useCallback((S,k)=>{S.stopPropagation(),a(k,S.shiftKey)},[a]),y=d.useCallback((S,k,A)=>{S.stopPropagation(),c(k,A)},[c]),b=d.useCallback(S=>{if(!n)return;const k=S.currentTarget.getBoundingClientRect(),A=S.clientX-k.left-32,C=Math.max(0,A/e);n(C)},[n,e]);return r?m.jsx("div",{className:"relative select-none overflow-x-auto",style:{height:40,minWidth:"100%"},onPointerMove:p,onPointerUp:O,onPointerLeave:O,onClick:b,children:r.groupOrder.map((S,k)=>{const A=r.groups.get(S);if(!A)return null;const C=Wv[k%Wv.length];return A.segmentIds.map(T=>{const j=r.segments.get(T);if(!j)return null;const M=32+j.start*e,E=Math.max((j.end-j.start)*e,4),$=i.has(T);return m.jsxs("div",{className:`absolute top-1 bottom-1 rounded flex items-center overflow-hidden cursor-pointer${$?" ring-1 ring-white/50 z-10":""}`,style:{left:M,width:E,backgroundColor:C,zIndex:$?10:1},onClick:N=>x(N,T),onDoubleClick:N=>y(N,S,T),children:[m.jsx("div",{className:"absolute left-0 top-0 bottom-0 cursor-col-resize z-20",style:{width:6},onPointerDown:N=>h(N,T,"start",j.start,j.end)}),m.jsx("span",{className:"flex-1 truncate px-2 pointer-events-none",style:{fontSize:9,color:"#000000",lineHeight:1},children:j.text}),m.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize z-20",style:{width:6},onPointerDown:N=>h(N,T,"end",j.start,j.end)})]},T)})})}):null});function eC(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)return!1;n=n.parentElement}return!0}function hf(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function Gq(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 Uq(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 tl(t,e,n){const r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=e.contentDocument,l=(a==null?void 0:a.querySelector("[data-composition-id]"))??(a==null?void 0:a.documentElement)??null,c=l==null?void 0:l.getBoundingClientRect(),u=hf((l==null?void 0:l.getAttribute("data-width"))??null),h=hf((l==null?void 0:l.getAttribute("data-height"))??null),p=u??(c==null?void 0:c.width),O=h??(c==null?void 0:c.height);if(!p||!O||!c)return null;const x=n.getBoundingClientRect(),y=r.width/p,b=r.height/O,S=Gq(n),k=S==null?void 0:S.getBoundingClientRect(),A=Uq({rootScaleX:y,rootScaleY:b,sourceRectWidth:k==null?void 0:k.width,sourceRectHeight:k==null?void 0:k.height,sourceWidth:hf((S==null?void 0:S.getAttribute("data-width"))??null),sourceHeight:hf((S==null?void 0:S.getAttribute("data-height"))??null)});return{left:r.left-i.left+x.left*y,top:r.top-i.top+x.top*b,width:x.width*y,height:x.height*b,editScaleX:A.scaleX,editScaleY:A.scaleY}}const mf=.5;function Ed(t,e){return t===e?!0:!t||!e?!1:Math.abs(t.left-e.left)<mf&&Math.abs(t.top-e.top)<mf&&Math.abs(t.width-e.width)<mf&&Math.abs(t.height-e.height)<mf&&Math.abs(t.editScaleX-e.editScaleX)<.001&&Math.abs(t.editScaleY-e.editScaleY)<.001}function Wq(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&&Ed(n.rect,i.rect))})}function tC(t){const e=t[0];if(!e)return null;let n=e.left,r=e.top,i=e.left+e.width,a=e.top+e.height;for(const l of t.slice(1))n=Math.min(n,l.left),r=Math.min(r,l.top),i=Math.max(i,l.left+l.width),a=Math.max(a,l.top+l.height);return{left:n,top:r,width:i-n,height:a-r,editScaleX:1,editScaleY:1}}function Kq(t){return t.filter(e=>!t.some(n=>n!==e&&n.element.contains(e.element)))}function cs(t){return[t.sourceFile??"",t.hfId??"",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function Kv(t,e,n,r){const i=cs(e),a=r.current;if((a==null?void 0:a.key)===i&&a.element.isConnected&&a.element.ownerDocument===t)return a.element;const l=mr(t,e,n);return r.current=l?{key:i,element:l}:null,l}const pf=4,gf=20,Jq=.05,Jv=15;function eG(t){t==null||t.focus({preventScroll:!0})}function tG(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1;if(t.uniform){const r=t.dx/e,i=t.dy/n,a=Math.abs(r)>=Math.abs(i)?r:i,l=Math.max(1,Math.max(t.actualWidth,t.actualHeight)+a);return{overlayWidth:Math.max(gf,l*e),overlayHeight:Math.max(gf,l*n),width:l,height:l}}return{overlayWidth:Math.max(gf,t.originWidth+t.dx),overlayHeight:Math.max(gf,t.originHeight+t.dy),width:Math.max(1,t.actualWidth+t.dx/e),height:Math.max(1,t.actualHeight+t.dy/n)}}function eS(t,e,n,r){return Math.atan2(r-e,n-t)*180/Math.PI}function nG(t){return((t+180)%360+360)%360-180}function rG(t){return Math.round(t*10)/10}function tS(t){const e=eS(t.centerX,t.centerY,t.startX,t.startY),n=eS(t.centerX,t.centerY,t.currentX,t.currentY),r=nG(n-e),i=t.actualAngle+r;return{angle:t.snap?Math.round(i/Jv)*Jv:rG(i)}}function iG(t,e){return Math.abs(e-t)>=Jq}function aG(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Ed(t[n],e[n]))return!1;return!0}function sG({iframeRef:t,overlayRef:e,selectionRef:n,activeCompositionPathRef:r,groupSelectionsRef:i,hoverSelectionRef:a,rafPausedRef:l}){const[c,u]=d.useState(null),[h,p]=d.useState(null),[O,x]=d.useState([]),[y,b]=d.useState([]),S=d.useRef(null),k=d.useRef(null),A=d.useRef([]),C=d.useRef(null),T=d.useRef(null),j=d.useRef(new Map),M=d.useRef([]),E=z=>{Ed(S.current,z)||(S.current=z,u(z))},$=z=>{Ed(k.current,z)||(k.current=z,p(z))},N=z=>{Wq(A.current,z)||(A.current=z,x(z))},D=(z,B)=>{const X=cs(B),U=j.current.get(X);if(U!=null&&U.isConnected&&U.ownerDocument===z)return U;const I=mr(z,B,r.current);return I?j.current.set(X,I):j.current.delete(X),I};return Wt(()=>{let z=0;const B=()=>{E(null),$(null),N([])},X=()=>{if(z=requestAnimationFrame(X),l.current){M.current.length>0&&(M.current=[],b([]));return}const U=n.current,I=t.current,K=e.current;if(!I||!K){C.current=null,T.current=null,j.current.clear(),B();return}const Z=I.contentDocument;if(!Z){C.current=null,T.current=null,j.current.clear(),B();return}if(U){const P=Kv(Z,U,r.current,C);if(P&&eC(P)){const L=tl(K,I,P);E(L);const V=P.querySelectorAll("*");if(V.length>0&&V.length<=60){const W=[];for(let ee=0;ee<V.length;ee++){const ue=V[ee];if(!ue.getBoundingClientRect)continue;const ae=tl(K,I,ue);ae&&ae.width>2&&ae.height>2&&W.push(ae)}aG(M.current,W)||(M.current=W,b(W))}else M.current.length>0&&(M.current=[],b([]))}else E(null),M.current.length>0&&(M.current=[],b([]))}else C.current=null,E(null),M.current.length>0&&(M.current=[],b([]));const F=i.current;if(F.length>0){const P=[],L=new Set;for(const V of F){const W=cs(V);L.add(W);const ee=D(Z,V),ue=ee?tl(K,I,ee):null;ee&&ue&&P.push({key:W,selection:V,element:ee,rect:ue})}for(const V of j.current.keys())L.has(V)||j.current.delete(V);N(P)}else j.current.clear(),N([]);const _=a.current,q=!!(U&&_&&cs(U)===cs(_)),G=!!(_&&F.some(P=>cs(P)===cs(_)));if(!_||q||G){T.current=null,$(null);return}const R=Kv(Z,_,r.current,T);if(!R){$(null);return}$(tl(K,I,R))};return z=requestAnimationFrame(X),()=>cancelAnimationFrame(z)}),{overlayRect:c,overlayRectRef:S,setOverlayRect:E,hoverRect:h,hoverRectRef:k,setHoverRect:$,groupOverlayItems:O,groupOverlayItemsRef:A,setGroupOverlayItems:N,childRects:y}}const lG=100,nS=.01,oG=1e-6;function rS(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)}function iS(t){return Math.hypot(t.x,t.y)}function aS(t){return Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.width)&&Number.isFinite(t.height)}function cG(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 uG(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 P2(t){const e=t.getBoundingClientRect();if(!aS(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=uG(r);if(!i)break;const a=i.getBoundingClientRect();if(!aS(a)||a.width<=0||a.height<=0)return null;const l=cG(r);n={x:a.left+n.x*(a.width/l.width),y:a.top+n.y*(a.height/l.height)},r=i.ownerDocument.defaultView}return n}function fG(t){const e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<oG?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e}}function dG(t,e){return{x:t.a*e.x+t.c*e.y,y:t.b*e.x+t.d*e.y}}function hG(t,e,n={}){if(!t.hasAttribute("data-hf-studio-path-offset")&&e.x===0&&e.y===0){const a=n.scaleX||1,l=n.scaleY||1;return{ok:!0,matrix:{a:1/a,b:0,c:0,d:1/l}}}const r=n.probeSize??lG;if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:"Invalid movement probe size."};const i=nO(t);try{$f(t,e);const a=P2(t);if(!a)return{ok:!1,reason:"Element has no measurable box."};$f(t,{x:e.x+r,y:e.y});const l=P2(t);if(!l)return{ok:!1,reason:"Element X movement could not be measured."};$f(t,{x:e.x,y:e.y+r});const c=P2(t);if(!c)return{ok:!1,reason:"Element Y movement could not be measured."};const u={x:(l.x-a.x)/r,y:(l.y-a.y)/r},h={x:(c.x-a.x)/r,y:(c.y-a.y)/r};if(!rS(u)||!rS(h)||iS(u)<nS||iS(h)<nS)return{ok:!1,reason:"Element movement response is too small to measure."};const p={a:u.x,b:u.y,c:h.x,d:h.y},O=fG(p);return O?{ok:!0,matrix:O}:{ok:!1,reason:"Element movement response is not invertible."}}finally{so(t,i)}}function mG(t){const e=dG(t.screenToOffset,{x:t.dx,y:t.dy});return{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y}}function nC(t){var u,h,p,O,x;const e=Sg(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=((h=(u=n==null?void 0:n.gsap)==null?void 0:u.getProperty)==null?void 0:h.call(u,t.element,"x"))||0,i=((O=(p=n==null?void 0:n.gsap)==null?void 0:p.getProperty)==null?void 0:O.call(p,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[b,S]of Object.entries(n.__timelines))try{S!=null&&S.pause&&!((x=S.paused)!=null&&x.call(S))&&(S.pause(),y.push(b))}catch{}y.length>0&&t.element.setAttribute("data-hf-drag-paused-timelines",y.join(","))}const a=nO(t.element),l=Zw(t.element),c=hG(t.element,e,{scaleX:t.rect.editScaleX,scaleY:t.rect.editScaleY});if(!c.ok){const y=t.rect.editScaleX||1,b=t.rect.editScaleY||1;return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,initialPathOffset:a,gestureToken:l,screenToOffset:{a:1/y,b:0,c:0,d:1/b},originRect:t.rect}}}return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,initialPathOffset:a,gestureToken:l,screenToOffset:c.matrix,originRect:t.rect}}}function rC(t,e,n){return mG({initialOffset:t.initialOffset,screenToOffset:t.screenToOffset,dx:e,dy:n})}function sS(t,e,n){const r=rC(t,e,n);return $f(t.element,r),r}function lS(t,e,n){const r=rC(t,e,n);return If(t.element,r),r}function pG(t){so(t.element,t.initialPathOffset),Qi(t.element,t.gestureToken)}function iC(t){for(const e of t)pG(e),$d(e.element)}function oS(t){for(const e of t)Qi(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"),$d(e.element)}function $d(t){var i,a,l,c;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;const r=((a=(i=n.__player)==null?void 0:i.getTime)==null?void 0:a.call(i))??0;(c=(l=n.__player)==null?void 0:l.seek)==null||c.call(l,r)}const Q2=6,cS=1;function Go(t){return t.left+t.width}function Uo(t){return t.top+t.height}function oh(t){return t.left+t.width/2}function ch(t){return t.top+t.height/2}function gG(t){return t.map(({rect:e,id:n})=>({left:e.left,top:e.top,right:Go(e),bottom:Uo(e),centerX:oh(e),centerY:ch(e),id:n}))}function OG(t){return{left:t.left,top:t.top,right:Go(t),bottom:Uo(t),centerX:oh(t),centerY:ch(t),id:"composition"}}function xG(t,e,n){const r=[],i=[];if(e<=0||n<=0)return{x:r,y:i};const a=e*n;let l=t.left+a;const c=t.left+t.width;let u=0;for(;l<c;)r.push({position:l,source:"grid",id:`grid-x-${u}`}),l+=a,u++;let h=t.top+a;const p=t.top+t.height;for(u=0;h<p;)i.push({position:h,source:"grid",id:`grid-y-${u}`}),h+=a,u++;return{x:r,y:i}}function jd(t,e,n,r,i){const a=[];for(const l of e){const c=n(l);for(const u of t)for(const h of c){const p=h-u,O=Math.abs(p);O<=i&&a.push({adjustment:p,distance:O,guidePosition:h,source:l.id==="composition"?"composition":"element",targetId:l.id})}}if(r)for(const l of r)for(const c of t){const u=l.position-c,h=Math.abs(u);h<=i&&a.push({adjustment:u,distance:h,guidePosition:l.position,source:"grid",targetId:l.id})}return a}function Pd(t){if(t.length===0)return null;const e=t.filter(x=>x.source==="element"||x.source==="composition"),n=t.filter(x=>x.source==="grid");let r;const i=e.length?Math.min(...e.map(x=>x.distance)):1/0,a=n.length?Math.min(...n.map(x=>x.distance)):1/0;i<=a?r=e:r=n;const l=Math.min(...r.map(x=>x.distance)),c=r.filter(x=>x.distance===l),u=c.some(x=>x.adjustment>0),h=c.some(x=>x.adjustment<0);if(u&&h)return null;const p=c[0].adjustment,O=r.filter(x=>x.adjustment===p);return{adjustment:p,matches:O}}function yG(t,e,n,r){const i=[];if(t==="x"){i.push(e.top,Uo(e));for(const a of n){const l=r.get(a);l&&i.push(l.top,l.bottom)}}else{i.push(e.left,Go(e));for(const a of n){const l=r.get(a);l&&i.push(l.left,l.right)}}return{from:Math.min(...i),to:Math.max(...i)}}function aC(t,e,n,r){const i=[];for(const[a,l]of[["x",t],["y",e]]){if(!l)continue;const c=new Set;for(const u of l.matches){if(c.has(u.guidePosition))continue;c.add(u.guidePosition);const h=l.matches.filter(O=>O.guidePosition===u.guidePosition).map(O=>O.targetId),p=yG(a,n,h,r);i.push({axis:a,position:u.guidePosition,from:p.from,to:p.to})}}return i}const sC=(t,e)=>({dx:t,dy:e,guides:[],spacingGuides:[]});function uS(t){var O,x;if(t.disabled||t.threshold<=0)return sC(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=jd([n.left,oh(n),Go(n)],t.targets,y=>[y.left,y.centerX,y.right],(O=t.gridEdges)==null?void 0:O.x,t.threshold),i=jd([n.top,ch(n),Uo(n)],t.targets,y=>[y.top,y.centerY,y.bottom],(x=t.gridEdges)==null?void 0:x.y,t.threshold),a=Pd(r),l=Pd(i),c=t.proposedDx+((a==null?void 0:a.adjustment)??0),u=t.proposedDy+((l==null?void 0:l.adjustment)??0),h={left:e.left+c,top:e.top+u,width:e.width,height:e.height},p=new Map(t.targets.map(y=>[y.id,y]));return{dx:c,dy:u,guides:aC(a,l,h,p),spacingGuides:[]}}function bG(t){var x,y;if(t.disabled||t.threshold<=0)return sC(t.proposedDx,t.proposedDy);const e=t.movingRect,n=Go(e)+t.proposedDx,r=Uo(e)+t.proposedDy,i=jd([n],t.targets,b=>[b.left,b.centerX,b.right],(x=t.gridEdges)==null?void 0:x.x,t.threshold),a=jd([r],t.targets,b=>[b.top,b.centerY,b.bottom],(y=t.gridEdges)==null?void 0:y.y,t.threshold),l=Pd(i),c=Pd(a),u=t.proposedDx+((l==null?void 0:l.adjustment)??0),h=t.proposedDy+((c==null?void 0:c.adjustment)??0),p={left:e.left,top:e.top,width:e.width+u,height:e.height+h},O=new Map(t.targets.map(b=>[b.id,b]));return{dx:u,dy:h,guides:aC(l,c,p,O),spacingGuides:[]}}function fS(t){const e=[],n=t.movingRect,r={left:n.left,top:n.top,right:Go(n),bottom:Uo(n),centerX:oh(n),centerY:ch(n),id:"\0__snap_moving__"},i=[...t.targets,r],a=[...i].sort((c,u)=>c.centerX-u.centerX);for(let c=0;c<a.length-2;c++){const u=a[c],h=a[c+1],p=a[c+2],O=h.left-u.right,x=p.left-h.right;if(!(O<0||x<0||!(u.id==="\0__snap_moving__"||h.id==="\0__snap_moving__"||p.id==="\0__snap_moving__"))&&Math.abs(O-x)<=cS){const b=Math.min(u.top,h.top,p.top),S=Math.max(u.bottom,h.bottom,p.bottom);e.push({axis:"x",position:u.right,size:O,from:b,to:S}),e.push({axis:"x",position:h.right,size:x,from:b,to:S})}}const l=[...i].sort((c,u)=>c.centerY-u.centerY);for(let c=0;c<l.length-2;c++){const u=l[c],h=l[c+1],p=l[c+2],O=h.top-u.bottom,x=p.top-h.bottom;if(!(O<0||x<0||!(u.id==="\0__snap_moving__"||h.id==="\0__snap_moving__"||p.id==="\0__snap_moving__"))&&Math.abs(O-x)<=cS){const b=Math.min(u.left,h.left,p.left),S=Math.max(u.right,h.right,p.right);e.push({axis:"y",position:u.bottom,size:O,from:b,to:S}),e.push({axis:"y",position:h.bottom,size:x,from:b,to:S})}}return e}function dS(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}const vG=new Set(["script","style","link","meta","base","template","br","wbr"]);function SG(t){return t.nodeType===1}function wG(t,e,n){const r=[],i=a=>{if(!(r.length>=n))for(const l of Array.from(a.children))SG(l)&&(vG.has(l.tagName.toLowerCase())||l.hasAttribute("data-composition-id")||e.has(l)||eC(l)&&(r.push(l),i(l)))};return i(t),r}function lC(t){const e=gs(),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,a=i==null?void 0:i.getBoundingClientRect(),l=dS((i==null?void 0:i.getAttribute("data-width"))??null),c=dS((i==null?void 0:i.getAttribute("data-height"))??null),u=l??(a==null?void 0:a.width),h=c??(a==null?void 0:a.height);if(!u||!h||!a)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const p=t.iframe.getBoundingClientRect(),O=t.overlayEl.getBoundingClientRect(),x=p.width/u;p.height/h;const y={left:p.left-O.left,top:p.top-O.top,width:p.width,height:p.height},b=OG(y),S=80,k=wG(i,t.excludeElements,S);k.length>=S&&console.warn(`[snap] Target cap reached (${S}). Elements beyond this limit are excluded from snap alignment.`);const A=[];for(let E=0;E<k.length;E++){const $=tl(t.overlayEl,t.iframe,k[E]);$&&A.push({rect:$,id:`snap-target-${E}`})}const C=gG(A);let T=null;const j=e.gridSpacing??50;return(e.snapToGrid??!1)&&j>0&&(T=xG(y,j,x)),{targets:C,compositionTarget:b,gridEdges:T,snapEnabled:n}}function oC(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}function kG(t,e){var h,p,O;const n=e.groupOverlayItemsRef.current;if(n.length<=1)return!1;const r=(h=n.find(x=>!x.selection.capabilities.canApplyManualOffset))==null?void 0:h.selection;if(r)return t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(r),!1;(O=(p=e.onManualDragStartRef).current)==null||O.call(p);const i=Kq(n),a=[];for(const x of i){const y=nC({key:x.key,selection:x.selection,element:x.element,rect:x.rect});if(!y.ok)return iC(a),t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(y.selection),!1;a.push(y.member)}const l=e.overlayRef.current,c=e.iframeRef.current,u=l&&c?lC({overlayEl:l,iframe:c,excludeElements:oC({groupSelections:n.map(x=>x.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:a,snapContext:u},!0}function AG(t,e,n,r){var M,E;const i=(r==null?void 0:r.selection)??n.selectionRef.current,a=(r==null?void 0:r.rect)??n.overlayRectRef.current,l=n.boxRef.current,c=n.overlayRef.current;if(!i||!a||t!=="drag"&&!l)return!1;const u=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(a.width)||!Number.isFinite(a.height)))return!1;const h=Yf(i.element),p=Rw(i.element),O=h.width>0?h.width:a.width/a.editScaleX,x=h.height>0?h.height:a.height/a.editScaleY;let y=nO(i.element),b,S;if(t==="drag"){(E=(M=n.onManualDragStartRef).current)==null||E.call(M),n.rafPausedRef.current=!0;const $=nC({key:cs(i),selection:i,element:i.element,rect:a});if(!$.ok)return n.onBlockedMoveRef.current($.selection),!1;S=$.member,y=$.member.initialPathOffset,b=$.member.gestureToken}else b=Zw(i.element);const k=c==null?void 0:c.getBoundingClientRect(),A=((k==null?void 0:k.left)??0)+a.left+a.width/2,C=((k==null?void 0:k.top)??0)+a.top+a.height/2,T=n.iframeRef.current,j=(t==="drag"||t==="resize")&&c&&T?lC({overlayEl:c,iframe:T,excludeElements:oC({selection:i})}):void 0;return e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),n.rafPausedRef.current=!0,n.gestureRef.current={kind:t,mode:u,selection:i,startX:e.clientX,startY:e.clientY,centerX:A,centerY:C,initialPathOffset:y,initialRotation:WN(i.element),initialBoxSize:UN(i.element),pathOffsetMember:S,originLeft:a.left,originTop:a.top,originWidth:a.width,originHeight:a.height,actualWidth:O,actualHeight:x,actualRotation:p.angle,editScaleX:a.editScaleX,editScaleY:a.editScaleY,manualEditDragToken:b,snapContext:j},!0}function MG(t){const e=p=>{t.setOverlayRect(p)},n=p=>{e({left:p.originLeft,top:p.originTop,width:p.originWidth,height:p.originHeight,editScaleX:p.editScaleX,editScaleY:p.editScaleY})},r=p=>{t.setGroupOverlayItems(p)},i=p=>{iC(p.members),r(p.originItems)};return{startGesture:(p,O,x)=>AG(p,O,t,x),startGroupDrag:p=>kG(p,t),onPointerMove:p=>{const O=t.gestureRef.current,x=t.groupGestureRef.current,y=(O==null?void 0:O.selection)??t.selectionRef.current,b=t.boxRef.current,S=t.blockedMoveRef.current;if(!S&&!O&&!x&&t.onCanvasPointerMoveRef.current(p,{preferClipAncestor:!1}),S&&y){const C=p.clientX-S.startX,T=p.clientY-S.startY;!S.notified&&Math.hypot(C,T)>=pf&&(S.notified=!0,t.suppressNextBoxClickRef.current=!0,t.onBlockedMoveRef.current(y));return}if(x){let C=p.clientX-x.startX,T=p.clientY-x.startY;const j=x.snapContext;if(j!=null&&j.snapEnabled&&j.targets.length>0){const M=tC(x.originItems.map(E=>E.rect));if(M){const E=j.compositionTarget?[...j.targets,j.compositionTarget]:j.targets,$=uS({movingRect:M,proposedDx:C,proposedDy:T,targets:E,gridEdges:j.gridEdges??void 0,threshold:Q2,disabled:p.altKey});C=$.dx,T=$.dy;const N={left:M.left+C,top:M.top+T,width:M.width,height:M.height},D=p.altKey?[]:fS({movingRect:N,targets:E});t.snapGuidesRef.current={guides:$.guides,spacingGuides:D}}}x.lastSnappedDx=C,x.lastSnappedDy=T,r(x.originItems.map(M=>({...M,rect:{...M.rect,left:M.rect.left+C,top:M.rect.top+T}})));for(const M of x.members)sS(M,C,T);return}if(!O||!y)return;let k=p.clientX-O.startX,A=p.clientY-O.startY;if(O.kind==="rotate"){YN(y.element,tS({centerX:O.centerX,centerY:O.centerY,startX:O.startX,startY:O.startY,currentX:p.clientX,currentY:p.clientY,actualAngle:O.actualRotation,snap:p.shiftKey}));return}if(O.kind==="drag"){const C=O.snapContext;if(C!=null&&C.snapEnabled&&C.targets.length>0){const M={left:O.originLeft,top:O.originTop,width:O.originWidth,height:O.originHeight},E=C.compositionTarget?[...C.targets,C.compositionTarget]:C.targets,$=uS({movingRect:M,proposedDx:k,proposedDy:A,targets:E,gridEdges:C.gridEdges??void 0,threshold:Q2,disabled:p.altKey});k=$.dx,A=$.dy;const N={left:M.left+k,top:M.top+A,width:M.width,height:M.height},D=p.altKey?[]:fS({movingRect:N,targets:E});t.snapGuidesRef.current={guides:$.guides,spacingGuides:D}}O.lastSnappedDx=k,O.lastSnappedDy=A;const T=O.originLeft+k,j=O.originTop+A;e({left:T,top:j,width:O.originWidth,height:O.originHeight,editScaleX:O.editScaleX,editScaleY:O.editScaleY}),b&&(b.style.left=`${T}px`,b.style.top=`${j}px`),O.pathOffsetMember&&sS(O.pathOffsetMember,k,A)}else{if(!b)return;const C=O.snapContext;if(C!=null&&C.snapEnabled&&C.targets.length>0){const B={left:O.originLeft,top:O.originTop,width:O.originWidth,height:O.originHeight},X=C.compositionTarget?[...C.targets,C.compositionTarget]:C.targets,U=bG({movingRect:B,proposedDx:k,proposedDy:A,targets:X,gridEdges:C.gridEdges??void 0,threshold:Q2,disabled:p.altKey});k=U.dx,A=U.dy,t.snapGuidesRef.current={guides:U.guides,spacingGuides:[]}}const T=tG({originWidth:O.originWidth,originHeight:O.originHeight,actualWidth:O.actualWidth,actualHeight:O.actualHeight,scaleX:O.editScaleX,scaleY:O.editScaleY,dx:k,dy:A,uniform:p.shiftKey});zN(y.element,T);const j=t.overlayRef.current,M=t.iframeRef.current,E=j&&M?tl(j,M,y.element):null,$=E?E.left:O.originLeft,N=E?E.top:O.originTop,D=E?E.width:T.overlayWidth,z=E?E.height:T.overlayHeight;b.style.left=`${$}px`,b.style.top=`${N}px`,b.style.width=`${D}px`,b.style.height=`${z}px`,e({left:$,top:N,width:D,height:z,editScaleX:O.editScaleX,editScaleY:O.editScaleY})}},onPointerUp:p=>{t.snapGuidesRef.current=null;const O=t.gestureRef.current,x=t.groupGestureRef.current,y=(O==null?void 0:O.selection)??t.selectionRef.current,b=t.boxRef.current;if(t.blockedMoveRef.current=null,x){t.groupGestureRef.current=null,t.rafPausedRef.current=!1;const k=p.clientX-x.startX,A=p.clientY-x.startY;if(Math.hypot(k,A)<pf){i(x),t.suppressNextBoxClickRef.current=!0;return}const C=x.lastSnappedDx??k,T=x.lastSnappedDy??A;r(x.originItems.map(M=>({...M,rect:{...M.rect,left:M.rect.left+C,top:M.rect.top+T}})));const j=x.members.map(M=>({selection:M.selection,next:lS(M,C,T)}));Promise.resolve(t.onGroupPathOffsetCommitRef.current(j)).catch(()=>{for(const M of x.members)M.gestureToken&&N1(M.element,M.gestureToken)&&so(M.element,M.initialPathOffset)}).finally(()=>oS(x.members));return}if(!O||!y){t.gestureRef.current=null,t.rafPausedRef.current=!1;return}t.gestureRef.current=null,t.rafPausedRef.current=!1;const S=Math.hypot(p.clientX-O.startX,p.clientY-O.startY);if(O.kind==="drag"&&S<pf){so(y.element,O.initialPathOffset),Qi(y.element,O.manualEditDragToken),$d(y.element),b&&(b.style.left=`${O.originLeft}px`,b.style.top=`${O.originTop}px`),n(O),t.suppressNextBoxClickRef.current=!0,t.onCanvasMouseDown(p,{preferClipAncestor:!1});return}if(O.kind==="resize"&&S<pf){Vp(y.element,O.initialBoxSize),Qi(y.element,O.manualEditDragToken),b&&(b.style.width=`${O.originWidth}px`,b.style.height=`${O.originHeight}px`),n(O),t.suppressNextBoxClickRef.current=!0;return}if(O.kind==="rotate"){const k=tS({centerX:O.centerX,centerY:O.centerY,startX:O.startX,startY:O.startY,currentX:p.clientX,currentY:p.clientY,actualAngle:O.actualRotation,snap:p.shiftKey});if(!iG(O.actualRotation,k.angle)){Lp(y.element,O.initialRotation),Qi(y.element,O.manualEditDragToken);return}eO(y.element,k),Promise.resolve(t.onRotationCommitRef.current(y,k)).catch(()=>{O.manualEditDragToken&&N1(y.element,O.manualEditDragToken)&&Lp(y.element,O.initialRotation)}).finally(()=>Qi(y.element,O.manualEditDragToken))}else if(O.kind==="drag"){const k=O.lastSnappedDx??p.clientX-O.startX,A=O.lastSnappedDy??p.clientY-O.startY;if(!O.pathOffsetMember)return;const C=lS(O.pathOffsetMember,k,A),T=O.originLeft+k,j=O.originTop+A;e({left:T,top:j,width:O.originWidth,height:O.originHeight,editScaleX:O.editScaleX,editScaleY:O.editScaleY}),b&&(b.style.left=`${T}px`,b.style.top=`${j}px`),Promise.resolve(t.onPathOffsetCommitRef.current(y,C)).catch(()=>{var M;(M=O.pathOffsetMember)!=null&&M.gestureToken&&N1(y.element,O.pathOffsetMember.gestureToken)&&so(y.element,O.initialPathOffset)}).finally(()=>{O.pathOffsetMember&&oS([O.pathOffsetMember])})}else{t.suppressNextBoxClickRef.current=!0;const k=Yf(y.element);K8(y.element,k),Promise.resolve(t.onBoxSizeCommitRef.current(y,k)).catch(()=>{O.manualEditDragToken&&N1(y.element,O.manualEditDragToken)&&Vp(y.element,O.initialBoxSize)}).finally(()=>Qi(y.element,O.manualEditDragToken))}},clearPointerState:p=>{t.snapGuidesRef.current=null;const O=t.groupGestureRef.current;O&&i(O);const x=t.gestureRef.current,y=(x==null?void 0:x.selection)??p.current;(x==null?void 0:x.mode)==="path-offset"&&y&&(so(y.element,x.initialPathOffset),Qi(y.element,x.manualEditDragToken),$d(y.element),n(x)),(x==null?void 0:x.mode)==="box-size"&&y&&(Vp(y.element,x.initialBoxSize),Qi(y.element,x.manualEditDragToken),n(x)),(x==null?void 0:x.mode)==="rotation"&&y&&(Lp(y.element,x.initialRotation),Qi(y.element,x.manualEditDragToken)),t.blockedMoveRef.current=null,t.groupGestureRef.current=null,t.gestureRef.current=null,t.rafPausedRef.current=!1}}}const hS=6,mS=4,pS="rgba(255, 68, 204, 0.85)",Of="rgba(255, 68, 204, 0.6)",CG="rgba(255, 68, 204, 0.15)",TG=d.memo(function({snapGuidesRef:e,overlayWidth:n,overlayHeight:r}){const i=d.useRef([]),a=d.useRef([]),l=d.useRef([]),c=d.useRef(n);c.current=n;const u=d.useRef(r);return u.current=r,Wt(()=>{let h=0;const p=()=>{h=requestAnimationFrame(p);const O=e.current,x=(O==null?void 0:O.guides)??[],y=(O==null?void 0:O.spacingGuides)??[],b=c.current,S=u.current;for(let k=0;k<hS;k++){const A=i.current[k];if(!A)continue;const C=x[k];if(!C){A.style.display="none";continue}A.style.display="",C.axis==="x"?(A.style.left=`${C.position}px`,A.style.top="0",A.style.width="1px",A.style.height=`${S}px`):(A.style.left="0",A.style.top=`${C.position}px`,A.style.width=`${b}px`,A.style.height="1px")}for(let k=0;k<mS;k++){const A=a.current[k],C=l.current[k];if(!A)continue;const T=y[k];if(!T){A.style.display="none";continue}A.style.display="flex",A.style.alignItems="center",A.style.justifyContent="center",T.axis==="x"?(A.style.left=`${T.position}px`,A.style.top=`${T.from}px`,A.style.width=`${T.size}px`,A.style.height=`${T.to-T.from}px`,A.style.borderLeft=`1px dashed ${Of}`,A.style.borderRight=`1px dashed ${Of}`,A.style.borderTop="none",A.style.borderBottom="none"):(A.style.left=`${T.from}px`,A.style.top=`${T.position}px`,A.style.width=`${T.to-T.from}px`,A.style.height=`${T.size}px`,A.style.borderTop=`1px dashed ${Of}`,A.style.borderBottom=`1px dashed ${Of}`,A.style.borderLeft="none",A.style.borderRight="none"),C&&(C.textContent=`${Math.round(T.size)}`)}};return h=requestAnimationFrame(p),()=>cancelAnimationFrame(h)}),m.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[Array.from({length:hS},(h,p)=>m.jsx("div",{ref:O=>{i.current[p]=O},style:{display:"none",position:"absolute",backgroundColor:pS,zIndex:50}},`guide-${p}`)),Array.from({length:mS},(h,p)=>m.jsx("div",{ref:O=>{a.current[p]=O},style:{display:"none",position:"absolute",zIndex:50},children:m.jsx("span",{ref:O=>{l.current[p]=O},style:{fontSize:"10px",fontFamily:"monospace",color:pS,backgroundColor:CG,padding:"0 3px",borderRadius:"2px",lineHeight:"14px",whiteSpace:"nowrap"}})},`spacing-${p}`))]})}),EG=d.memo(function({visible:e,spacing:n,scaleX:r,scaleY:i,compositionLeft:a,compositionTop:l,compositionWidth:c,compositionHeight:u}){if(!e||n<=0)return null;const h=n*r,p=n*i;return h<4||p<4?null:m.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute",style:{left:a,top:l,width:c,height:u,backgroundImage:[`repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${h}px)`,`repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${p}px)`].join(", "),backgroundSize:`${h}px ${p}px`}})}),$G=d.memo(function({iframeRef:e,activeCompositionPath:n,selection:r,groupSelections:i=[],hoverSelection:a,allowCanvasMovement:l=!0,onCanvasMouseDown:c,onCanvasPointerMove:u,onCanvasPointerLeave:h,onSelectionChange:p,onBlockedMove:O,gridVisible:x=!1,gridSpacing:y=50,onManualDragStart:b,onPathOffsetCommit:S,onGroupPathOffsetCommit:k,onBoxSizeCommit:A,onRotationCommit:C}){const T=d.useRef(null),j=d.useRef(null),M=(()=>{const Oe={borderRadius:4,clipPath:void 0};if(!(r!=null&&r.element))return Oe;try{const Ge=r.element.tagName.toLowerCase();if(Ge==="svg"||Ge==="img"||Ge==="video"||Ge==="canvas")return Oe;const Re=r.element.ownerDocument.defaultView;if(!Re)return Oe;const qe=Re.getComputedStyle(r.element),Ie=qe.borderRadius,$e=qe.clipPath;return{borderRadius:Ie&&Ie!=="0px"?Ie:4,clipPath:$e&&$e!=="none"?$e:void 0}}catch{return Oe}})(),E=d.useRef(null),$=d.useRef(null),N=d.useRef(null),D=d.useRef(!1),z=d.useRef(!1),B=d.useRef(!1),X=d.useRef(null),U=d.useRef(!1),I=d.useRef(r);I.current=r;const K=d.useRef(n);K.current=n;const Z=d.useRef(i);Z.current=i;const F=d.useRef(a);F.current=a;const _=d.useRef(S);_.current=S;const q=d.useRef(k);q.current=k;const G=d.useRef(A);G.current=A;const R=d.useRef(C);R.current=C;const P=d.useRef(O);P.current=O;const L=d.useRef(b);L.current=b;const V=d.useRef(u);V.current=u;const W=d.useRef(h);W.current=h;const ee=d.useRef(p);ee.current=p;const{overlayRect:ue,overlayRectRef:ae,setOverlayRect:Y,hoverRect:re,groupOverlayItems:he,groupOverlayItemsRef:xe,setGroupOverlayItems:ke,childRects:be}=sG({iframeRef:e,overlayRef:T,selectionRef:I,activeCompositionPathRef:K,groupSelectionsRef:Z,hoverSelectionRef:F,rafPausedRef:U}),[Se,Ve]=d.useState({left:0,top:0,width:0,height:0,scaleX:1,scaleY:1});Wt(()=>{let Oe=0;const Ge=()=>{Oe=requestAnimationFrame(Ge);const Re=e.current,qe=T.current;if(!Re||!qe)return;const Ie=Re.getBoundingClientRect(),$e=qe.getBoundingClientRect(),ut=Ie.left-$e.left,Ae=Ie.top-$e.top;if(Ie.width<=0||Ie.height<=0)return;const Be=Re.contentDocument,lt=(Be==null?void 0:Be.querySelector("[data-composition-id]"))??(Be==null?void 0:Be.documentElement),ot=Number.parseFloat((lt==null?void 0:lt.getAttribute("data-width"))??""),gn=Number.parseFloat((lt==null?void 0:lt.getAttribute("data-height"))??""),at=ot>0?Ie.width/ot:1,Le=gn>0?Ie.height/gn:1;Ve(Ue=>Math.abs(Ue.left-ut)<.5&&Math.abs(Ue.top-Ae)<.5&&Math.abs(Ue.width-Ie.width)<.5&&Math.abs(Ue.height-Ie.height)<.5&&Math.abs(Ue.scaleX-at)<.001&&Math.abs(Ue.scaleY-Le)<.001?Ue:{left:ut,top:Ae,width:Ie.width,height:Ie.height,scaleX:at,scaleY:Le})};return Oe=requestAnimationFrame(Ge),()=>cancelAnimationFrame(Oe)});const Te=MG({overlayRef:T,iframeRef:e,boxRef:j,selectionRef:I,overlayRectRef:ae,groupOverlayItemsRef:xe,gestureRef:E,groupGestureRef:$,blockedMoveRef:N,rafPausedRef:U,suppressNextBoxClickRef:D,setOverlayRect:Y,setGroupOverlayItems:ke,onBlockedMoveRef:P,onManualDragStartRef:L,onPathOffsetCommitRef:_,onGroupPathOffsetCommitRef:q,onBoxSizeCommitRef:G,onRotationCommitRef:R,onCanvasPointerMoveRef:V,onCanvasMouseDown:c,snapGuidesRef:X}),Ze=d.useMemo(()=>r?`${r.sourceFile}:${r.id??r.selector??r.label}:${r.selectorIndex??0}`:"none",[r]),Xe=d.useMemo(()=>tC(he.map(Oe=>Oe.rect)),[he]),ze=i.length>1,et=ze&&he.length>1&&he.every(Oe=>Oe.selection.capabilities.canApplyManualOffset),Ot=Oe=>{if(!l)return;if(B.current){B.current=!1,z.current=!1,D.current=!1,Oe.preventDefault(),Oe.stopPropagation();return}const Ge=Oe.target;Ge!=null&&Ge.closest('[data-dom-edit-selection-box="true"]')||(c(Oe,{preferClipAncestor:!1}),Oe.shiftKey&&(z.current=!0,D.current=!0))},He=Oe=>{if(!l||Oe.button!==0)return;if(Oe.shiftKey){const Ae=F.current;if(!Ae)return;Oe.preventDefault(),Oe.stopPropagation(),B.current=!0,z.current=!0,D.current=!0,ee.current(Ae,{additive:!0});return}const Ge=Oe.target;if(Ge!=null&&Ge.closest('[data-dom-edit-selection-box="true"]'))return;const Re=F.current;if(!(Re!=null&&Re.capabilities.canApplyManualOffset))return;const qe=T.current,Ie=e.current,$e=qe&&Ie?tl(qe,Ie,Re.element):null;if(!$e)return;if(B.current=!0,I.current=Re,Y($e),!Te.startGesture("drag",Oe,{selection:Re,rect:$e})){B.current=!1;return}ee.current(Re)},ct=Oe=>{if(l&&!(E.current||$.current)){if(D.current){D.current=!1,Oe.stopPropagation();return}c(Oe,{preferClipAncestor:!1})}},yt=Oe=>{z.current&&(z.current=!1,Oe.preventDefault(),Oe.stopPropagation())};return m.jsxs("div",{ref:T,className:"absolute inset-0 z-10 pointer-events-auto outline-none",tabIndex:-1,"aria-label":"Composition canvas",onPointerDownCapture:Oe=>eG(Oe.currentTarget),onPointerDown:He,onMouseDown:Ot,onPointerMove:Te.onPointerMove,onPointerLeave:()=>W.current(),onPointerUp:Te.onPointerUp,onPointerCancel:()=>Te.clearPointerState(I),children:[a&&re&&Se.width>0&&m.jsx("div",{"aria-hidden":"true","data-dom-edit-hover-box":"true",className:"pointer-events-none absolute border border-studio-accent/80 bg-studio-accent/5 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:(()=>{var Re;let Oe=4,Ge;try{const qe=a.element,Ie=qe.tagName.toLowerCase();if(Ie!=="svg"&&Ie!=="img"&&Ie!=="video"&&Ie!=="canvas"){const $e=(Re=qe.ownerDocument.defaultView)==null?void 0:Re.getComputedStyle(qe);$e!=null&&$e.borderRadius&&$e.borderRadius!=="0px"&&(Oe=$e.borderRadius),$e!=null&&$e.clipPath&&$e.clipPath!=="none"&&(Ge=$e.clipPath)}}catch{}return{left:re.left,top:re.top,width:re.width,height:re.height,borderRadius:Oe,clipPath:Ge}})()}),ze&&he.length>1&&Xe&&Se.width>0&&m.jsxs(m.Fragment,{children:[he.map(Oe=>m.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-xl border border-studio-accent/70 bg-studio-accent/[0.03]",style:{left:Oe.rect.left,top:Oe.rect.top,width:Oe.rect.width,height:Oe.rect.height}},Oe.key)),m.jsx("div",{"data-dom-edit-selection-box":"true",className:"pointer-events-auto absolute rounded-xl border border-studio-accent bg-studio-accent/5 shadow-[0_0_0_1px_rgba(60,230,172,0.3)]",style:{left:Xe.left,top:Xe.top,width:Xe.width,height:Xe.height,cursor:l&&et?"move":"default"},onPointerDown:Oe=>{!l||!et||Oe.shiftKey||Te.startGroupDrag(Oe)},onMouseDown:yt,onClick:ct})]}),!ze&&r&&ue&&Se.width>0&&m.jsxs(m.Fragment,{children:[l&&r.capabilities.canApplyManualRotation&&m.jsxs("div",{className:"pointer-events-none absolute",style:{left:ue.left+ue.width/2,top:ue.top-34,width:28,height:34,transform:"translateX(-50%)"},children:[m.jsx("div",{className:"absolute left-1/2 top-3 bottom-0 w-px -translate-x-1/2 bg-studio-accent/60"}),m.jsx("button",{type:"button",className:"pointer-events-auto absolute left-1/2 top-0 h-3 w-3 -translate-x-1/2 rounded-full border border-studio-accent bg-studio-accent p-0 shadow-[0_0_0_2px_rgba(60,230,172,0.18)]",style:{cursor:"grab",touchAction:"none"},title:"Rotate","aria-label":"Rotate selection",onPointerDown:Oe=>{Oe.stopPropagation(),Te.startGesture("rotate",Oe)}})]}),m.jsx("div",{ref:j,"data-dom-edit-selection-box":"true",className:`pointer-events-auto absolute ${M.clipPath?"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)]"} bg-studio-accent/5`,style:{left:ue.left,top:ue.top,width:ue.width,height:ue.height,borderRadius:M.borderRadius,clipPath:M.clipPath,cursor:l&&r.capabilities.canApplyManualOffset?"move":"default"},onPointerDown:Oe=>{if(!(!l||Oe.shiftKey)){if(r.capabilities.canApplyManualOffset){Te.startGesture("drag",Oe);return}Oe.preventDefault(),Oe.stopPropagation(),Oe.currentTarget.setPointerCapture(Oe.pointerId),N.current={pointerId:Oe.pointerId,startX:Oe.clientX,startY:Oe.clientY,notified:!1}}},onMouseDown:yt,onClick:ct,children:l&&r.capabilities.canApplyManualSize&&m.jsx("div",{className:"absolute -right-1.5 -bottom-1.5 w-3 h-3 rounded-sm bg-studio-accent border border-studio-accent/60",style:{cursor:"se-resize",touchAction:"none"},onPointerDown:Oe=>{Oe.stopPropagation(),Te.startGesture("resize",Oe)}})},Ze)]}),be.length>0&&Se.width>0&&be.map((Oe,Ge)=>m.jsx("div",{className:"pointer-events-none absolute border border-dashed border-white/20 rounded-sm",style:{left:Oe.left,top:Oe.top,width:Oe.width,height:Oe.height}},Ge)),m.jsx(EG,{visible:x,spacing:y,scaleX:Se.scaleX,scaleY:Se.scaleY,compositionLeft:Se.left,compositionTop:Se.top,compositionWidth:Se.width,compositionHeight:Se.height}),m.jsx(TG,{snapGuidesRef:X,overlayWidth:Se.width,overlayHeight:Se.height})]})}),xf={snapEnabled:!0,gridVisible:!1,gridSpacing:50,snapToGrid:!1};function Z2(){const t=gs();return{snapEnabled:t.snapEnabled??xf.snapEnabled,gridVisible:t.gridVisible??xf.gridVisible,gridSpacing:t.gridSpacing??xf.gridSpacing,snapToGrid:t.snapToGrid??xf.snapToGrid}}const jG=d.memo(function({onSnapChange:e}){const[n,r]=d.useState(Z2),[i,a]=d.useState(!1),l=d.useRef(null),c=d.useRef(null),u=d.useCallback(O=>{r(x=>{const y={...x,...O};return wo(O),e==null||e(y),y})},[e]),h=d.useCallback(()=>{u({snapEnabled:!n.snapEnabled})},[n.snapEnabled,u]),p=d.useCallback(()=>{u({gridVisible:!n.gridVisible})},[n.gridVisible,u]);return d.useEffect(()=>{const O=x=>{const y=x.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||y instanceof HTMLElement&&y.isContentEditable||y instanceof HTMLIFrameElement||(x.key==="s"&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),u({snapEnabled:!Z2().snapEnabled})),x.key==="g"&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),u({gridVisible:!Z2().gridVisible})))};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[u]),d.useEffect(()=>{if(!i)return;const O=x=>{var b,S;const y=x.target;(b=l.current)!=null&&b.contains(y)||(S=c.current)!=null&&S.contains(y)||a(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[i]),m.jsxs("div",{className:"absolute top-2 right-2 z-50 flex items-center gap-1",children:[m.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors ${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:m.jsx(FZ,{size:16,weight:n.snapEnabled?"fill":"regular"})}),m.jsxs("div",{className:"relative",children:[m.jsx("button",{ref:c,type:"button",className:`rounded-md p-1.5 transition-colors ${n.gridVisible?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:p,onContextMenu:O=>{O.preventDefault(),a(x=>!x)},title:n.gridVisible?"Grid visible (G)":"Grid hidden (G)","aria-label":"Toggle grid",children:m.jsx(HZ,{size:16,weight:n.gridVisible?"fill":"regular"})}),i&&m.jsxs("div",{ref:l,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:[m.jsxs("label",{className:"flex items-center justify-between text-xs text-white/80 mb-2",children:[m.jsx("span",{children:"Grid spacing"}),m.jsx("input",{type:"number",min:10,max:500,step:10,value:n.gridSpacing,onChange:O=>{const x=Number.parseInt(O.target.value,10);Number.isFinite(x)&&x>=10&&x<=500&&u({gridSpacing:x})},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"})]}),m.jsxs("label",{className:"flex items-center gap-2 text-xs text-white/80 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:n.snapToGrid,onChange:()=>u({snapToGrid:!n.snapToGrid}),className:"accent-studio-accent"}),m.jsx("span",{children:"Snap to grid"})]})]})]})]})}),PG=10,QG=2e4;function ZG(){try{return!1}catch{return!1}}function NG(){return PG}const Ho={sessionCount:"hyperframes-studio:feedbackSessionCount",lastPromptedAt:"hyperframes-studio:feedbackLastPromptedAt"};function RG(){if(ZG())return!1;try{const t=parseInt(localStorage.getItem(Ho.sessionCount)||"0",10)||0,e=parseInt(localStorage.getItem(Ho.lastPromptedAt)||"0",10)||0;return t-e>=NG()}catch{return!1}}const gS="hyperframes-studio:feedbackSessionCounted";function VG(){try{if(sessionStorage.getItem(gS))return;sessionStorage.setItem(gS,"1");const t=parseInt(localStorage.getItem(Ho.sessionCount)||"0",10)||0;localStorage.setItem(Ho.sessionCount,String(t+1))}catch{}}function OS(){try{const t=localStorage.getItem(Ho.sessionCount)||"0";localStorage.setItem(Ho.lastPromptedAt,t)}catch{}}const LG=d.memo(function(){const[e,n]=d.useState(!1),[r,i]=d.useState(null),[a,l]=d.useState(""),[c,u]=d.useState(!1),[h,p]=d.useState(!1),O=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{VG();const k=setTimeout(()=>{RG()&&n(!0)},3e3);return()=>clearTimeout(k)},[]),d.useEffect(()=>{if(!(!e||r!==null||c))return x.current=setTimeout(()=>{y()},QG),()=>{x.current&&clearTimeout(x.current)}},[e,r,c]),d.useEffect(()=>{r!==null&&O.current&&O.current.focus()},[r]);const y=d.useCallback(()=>{p(!0),OS(),setTimeout(()=>n(!1),300)},[]),b=d.useCallback(()=>{r!==null&&(f$({rating:r,comment:a.trim()||void 0}),u(!0),OS(),setTimeout(()=>{p(!0),setTimeout(()=>n(!1),300)},1500))},[r,a]),S=d.useCallback(k=>{i(k),x.current&&(clearTimeout(x.current),x.current=null)},[]);return e?m.jsx("div",{className:["flex items-center gap-3 px-4 h-8 border-t border-neutral-800/50 bg-neutral-900/80 text-[11px] transition-all duration-300",h?"opacity-0 translate-y-2":"opacity-100 translate-y-0"].join(" "),children:c?m.jsx("span",{className:"text-neutral-500",children:"Thanks for the feedback!"}):r!==null?m.jsxs(m.Fragment,{children:[m.jsx("input",{ref:O,type:"text",value:a,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&b(),k.key==="Escape"&&y()},placeholder:"Any details? (enter to send, esc to close)",className:"flex-1 bg-transparent border-none text-[11px] text-neutral-300 placeholder-neutral-600 outline-none",maxLength:500}),m.jsx("button",{onClick:b,className:"text-[11px] text-neutral-500 hover:text-neutral-300 transition-colors flex-shrink-0",children:"send"})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-neutral-500 flex-shrink-0",children:"How's the Studio experience?"}),m.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4,5].map(k=>m.jsx("button",{onClick:()=>S(k),className:"w-6 h-6 rounded text-[11px] text-neutral-600 hover:text-neutral-200 hover:bg-neutral-700/50 transition-colors",children:k},k))}),m.jsx("div",{className:"flex-1"}),m.jsx("button",{onClick:y,className:"text-neutral-700 hover:text-neutral-400 transition-colors flex-shrink-0","aria-label":"Dismiss",children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}):null});function _G({timelineToolbar:t,renderClipContent:e,handleTimelineElementDelete:n,handleTimelineAssetDrop:r,handleTimelineBlockDrop:i,handlePreviewBlockDrop:a,handleTimelineFileDrop:l,handleTimelineElementMove:c,handleTimelineElementResize:u,handleBlockedTimelineEdit:h,handleTimelineElementSplit:p,handleRazorSplit:O,handleRazorSplitAll:x,setCompIdToSrc:y,setCompositionLoading:b,shouldShowSelectedDomBounds:S,isGestureRecording:k,blockPreview:A,gestureOverlay:C}){const{projectId:T,refreshKey:j,activeCompPath:M,setActiveCompPath:E,captionEditMode:$,compositionLoading:N,isPlaying:D,previewIframeRef:z,refreshPreviewDocumentVersion:B,handlePreviewIframeRef:X,timelineVisible:U,toggleTimelineVisibility:I}=hl(),{domEditHoverSelection:K,domEditSelection:Z,domEditGroupSelections:F,handleTimelineElementSelect:_,handlePreviewCanvasMouseDown:q,handlePreviewCanvasPointerMove:G,handlePreviewCanvasPointerLeave:R,applyDomSelection:P,handleBlockedDomMove:L,handleDomManualDragStart:V,handleDomPathOffsetCommit:W,handleDomGroupPathOffsetCommit:ee,handleDomBoxSizeCommit:ue,handleDomRotationCommit:ae,selectedGsapAnimations:Y,handleGsapRemoveKeyframe:re,handleGsapUpdateMeta:he,handleGsapAddKeyframe:xe,handleGsapConvertToKeyframes:ke,handleGsapDeleteAnimation:be}=zd(),[Se,Ve]=d.useState(()=>{const Te=gs();return{snapEnabled:Te.snapEnabled??!0,gridVisible:Te.gridVisible??!1,gridSpacing:Te.gridSpacing??50,snapToGrid:Te.snapToGrid??!1}});return m.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",children:[m.jsx("div",{className:"flex-1 min-h-0 relative",children:m.jsx(Xq,{projectId:T,refreshKey:j,activeCompositionPath:M,timelineToolbar:t,renderClipContent:e,onDeleteElement:n,onAssetDrop:r,onBlockDrop:i,onPreviewBlockDrop:a,onFileDrop:l,onMoveElement:c,onResizeElement:u,onBlockedEditAttempt:h,onSplitElement:p,onRazorSplit:O,onRazorSplitAll:x,onSelectTimelineElement:_,onDeleteAllKeyframes:Te=>{const Ze=Y.find(Xe=>Xe.keyframes)??Y[0];Ze&&be(Ze.id)},onDeleteKeyframe:(Te,Ze)=>{const Xe=Y.find(ze=>ze.keyframes);Xe&&re(Xe.id,Ze)},onChangeKeyframeEase:(Te,Ze,Xe)=>{const ze=Y.find(et=>et.keyframes);ze&&he(ze.id,{ease:Xe})},onMoveKeyframe:(Te,Ze,Xe)=>{const ze=Y.find(Ot=>Ot.keyframes);if(!(ze!=null&&ze.keyframes))return;const et=ze.keyframes.keyframes.find(Ot=>Ot.percentage===Ze);if(et){re(ze.id,Ze);for(const[Ot,He]of Object.entries(et.properties))xe(ze.id,Xe,Ot,He)}},onToggleKeyframeAtPlayhead:Te=>{const Ze=oe.getState().currentTime,Xe=Te.duration>0?Math.max(0,Math.min(100,Math.round((Ze-Te.start)/Te.duration*100))):0,ze=Y.find(et=>et.keyframes);if(ze!=null&&ze.keyframes){const et=ze.keyframes.keyframes.find(Ot=>Math.abs(Ot.percentage-Xe)<=1);et?re(ze.id,et.percentage):xe(ze.id,Xe,"x",0)}else{const et=Y.find(Ot=>!Ot.keyframes);et&&ke(et.id)}},onCompIdToSrcChange:y,onCompositionLoadingChange:b,onCompositionChange:Te=>{Te!==M&&(E(Te),B())},onIframeRef:X,previewOverlay:A?m.jsx("div",{className:"absolute inset-0 z-30 bg-black pointer-events-none",children:A.videoUrl?m.jsx("video",{src:A.videoUrl,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-contain"}):A.posterUrl?m.jsx("img",{src:A.posterUrl,alt:A.title,className:"w-full h-full object-contain"}):null}):$?m.jsx(Iq,{iframeRef:z}):Pn?m.jsxs(m.Fragment,{children:[m.jsx($G,{iframeRef:z,activeCompositionPath:M,hoverSelection:hg&&!$&&!N&&!D?K:null,selection:S?Z:null,groupSelections:S?F:[],allowCanvasMovement:uP&&!k,onCanvasMouseDown:q,onCanvasPointerMove:G,onCanvasPointerLeave:R,onSelectionChange:P,onBlockedMove:L,onManualDragStart:V,onPathOffsetCommit:W,onGroupPathOffsetCommit:ee,onBoxSizeCommit:ue,onRotationCommit:ae,gridVisible:Se.gridVisible,gridSpacing:Se.gridSpacing}),m.jsx(jG,{onSnapChange:Ve}),C]}):null,timelineFooter:$?m.jsxs("div",{className:"border-t border-neutral-800/30 flex-shrink-0",style:{height:60},children:[m.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5",children:m.jsx("span",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Captions"})}),m.jsx(qq,{pixelsPerSecond:100})]}):void 0,timelineVisible:U,onToggleTimeline:I})}),m.jsx(LG,{})]})}function Vr(t){return Math.max(0,Math.min(255,Math.round(t)))}function e6(t){return Math.max(0,Math.min(1,t))}function N2(t){return Vr(t).toString(16).padStart(2,"0")}function DG(t){return`${Math.round(e6(t)*100)/100}`}function cC(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[a,l,c]=n[1].split("");return{red:Number.parseInt(a+a,16),green:Number.parseInt(l+l,16),blue:Number.parseInt(c+c,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:Vr(Number.parseFloat(i[1])),green:Vr(Number.parseFloat(i[2])),blue:Vr(Number.parseFloat(i[3])),alpha:e6(i[4]!=null?Number.parseFloat(i[4]):1)}:null}function R2(t){return`#${N2(t.red)}${N2(t.green)}${N2(t.blue)}`}function yf(t){const e=Vr(t.red),n=Vr(t.green),r=Vr(t.blue),i=e6(t.alpha);return i>=1?`rgb(${e}, ${n}, ${r})`:`rgba(${e}, ${n}, ${r}, ${DG(i)})`}function HG(t){const e=Vr(t.red)/255,n=Vr(t.green)/255,r=Vr(t.blue)/255,i=Math.max(e,n,r),a=Math.min(e,n,r),l=i-a;let c=0;return l!==0&&(i===e?c=60*((n-r)/l%6):i===n?c=60*((r-e)/l+2):c=60*((e-n)/l+4)),c<0&&(c+=360),{hue:c,saturation:i===0?0:l/i,value:i}}function xS(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,a=i*(1-Math.abs(e%2-1)),l=r-i;let c=0,u=0,h=0;return e>=0&&e<1?(c=i,u=a):e>=1&&e<2?(c=a,u=i):e>=2&&e<3?(u=i,h=a):e>=3&&e<4?(u=a,h=i):e>=4&&e<5?(c=a,h=i):(c=i,h=a),{red:Vr((c+l)*255),green:Vr((u+l)*255),blue:Vr((h+l)*255)}}const t6=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"]),XG=[...$g,"Inter","system-ui","sans-serif","serif","monospace"];function yS(t){return t.replace(/[^\w .-]+/g," ").replace(/\s+/g," ").trim()}function bf(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 V2(t){const e=new Set;return t.reduce((n,r)=>{const i=r.trim();if(!i)return n;const a=i.toLowerCase();return e.has(a)||(e.add(a),n.push(i)),n},[])}function bS(t){const e=new Set;return t.reduce((n,r)=>{const i=r.family.trim();if(!i)return n;const a=i.toLowerCase();return e.has(a)||(e.add(a),n.push({family:i,source:r.source})),n},[])}function zG(t){return[...t].sort((e,n)=>{const r=vS(e.source)-vS(n.source);if(r!==0)return r;const i=$g.findIndex(c=>c.toLowerCase()===e.family.toLowerCase()),a=$g.findIndex(c=>c.toLowerCase()===n.family.toLowerCase()),l=(i===-1?Number.MAX_SAFE_INTEGER:i)-(a===-1?Number.MAX_SAFE_INTEGER:a);return l===0?e.family.localeCompare(n.family):l})}function vS(t){return t==="Current"?0:t==="Document"?1:t==="Imported"?2:t==="Google"?3:t==="Local"?4:5}const Bi="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",Jt="text-[11px] font-medium text-panel-text-3",Un="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3",FG={},E8="none",uC={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 L2(t){return cC(t)??{red:0,green:0,blue:0,alpha:1}}function us(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function zt(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function gl(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 ma(t){const e=gl(t);return!e||e.unit&&e.unit.toLowerCase()!=="px"?null:e.value}function fC(t,e,n,r){return Number.isFinite(t)?Math.max(e,Math.min(n,t)):r}function BG(t,e={}){const n=gl(t.trim());if(!n||n.unit&&n.unit.toLowerCase()!=="px")return null;const r=fC(n.value,e.min??Number.NEGATIVE_INFINITY,e.max??Number.POSITIVE_INFINITY,e.fallback??0);return`${zt(r)}px`}function nl(t){return`${zt(t)}px`}function SS(t,e){const n=e.trim();if(!n||n==="normal")return n||"normal";const r=gl(n);return r?t==="letter-spacing"?r.unit?n:`${zt(r.value)}px`:r.unit?n:r.value>4?`${zt(r.value)}px`:zt(r.value):n}function YG(t){const e=[];let n="",r=0;for(const i of t.trim()){if(i==="("&&(r+=1),i===")"&&(r=Math.max(0,r-1)),/\s/.test(i)&&r===0){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e}function wS(t,e){const n=t==null?void 0:t.trim();if(!n||n===E8)return 0;const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(?:^|\\s)${r}\\((-?\\d+(?:\\.\\d+)?)px\\)`,"i").exec(n);if(!i)return 0;const a=Number.parseFloat(i[1]);return Number.isFinite(a)?Math.max(0,a):0}function kS(t,e,n){const r=fC(n,0,200,0),i=YG(t&&t.trim()!==E8?t:""),a=e.toLowerCase(),l=i.filter(c=>!c.toLowerCase().startsWith(`${a}(`));return r>0&&l.push(`${e}(${zt(r)}px)`),l.length>0?l.join(" "):E8}function IG(t){const e=(t==null?void 0:t.trim())||"none";for(const[n,r]of Object.entries(uC))if(e===r)return n;return e==="none"?"none":"custom"}function qG(t,e){return t==="custom"?(e==null?void 0:e.trim())||"none":uC[t]}function GG(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 UG(t){const e=/^inset\(\s*(-?\d+(?:\.\d+)?)px\b/i.exec((t==null?void 0:t.trim())??"");if(!e)return 0;const n=Number.parseFloat(e[1]);return Number.isFinite(n)?Math.max(0,n):0}function WG(t,e){const n=[["border-width",t]],r=gl(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 KG(t,e){const n=[["border-style",t]],r=t.trim().toLowerCase();if(!r||r==="none"||r==="hidden")return n;const i=gl((e==null?void 0:e.trim())||"0");return(!i||i.value<=0)&&n.push(["border-width","1px"]),n}function JG(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 ${zt(Math.max(0,e))}px)`:"none"}function eU(t,e){return`inset(${zt(Math.max(0,t))}px round ${zt(Math.max(0,e))}px)`}function AS(t,e,n){const r=gl(t);if(!r)return null;const i=n!=null&&n.altKey?.1:n!=null&&n.shiftKey?10:1,a=r.value+i*e;return`${zt(a)}${r.unit}`}function tU(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]===`
|
|
142
|
+
`||t[r]==="\r"||t[r]===" "||t[r]==="\f");)r+=1;const i=t[r]==='"'||t[r]==="'"?t[r]:null;if(i){r+=1;const l=t.indexOf(i,r);return l>=r?t.slice(r,l):""}const a=t.indexOf(")",r);return a<r?"":t.slice(r,a).trim()}function nU(t,e,n,r){var l;if(!t||e.length===0)return null;const i=r==null?void 0:r.current;if(!(i!=null&&i.contentWindow))return null;const a=n.id?`#${n.id}`:n.selector;if(!a)return null;try{const c=i.contentWindow.gsap;if(!(c!=null&&c.getProperty))return null;const u=(l=i.contentDocument)==null?void 0:l.querySelector(a);if(!u)return null;const h=new Set;for(const O of e){if(O.keyframes)for(const x of O.keyframes.keyframes)for(const y of Object.keys(x.properties))h.add(y);for(const x of Object.keys(O.properties))h.add(x)}const p={};for(const O of h){const x=Number(c.getProperty(u,O));Number.isFinite(x)&&(p[O]=Math.round(x*100)/100)}return Object.keys(p).length>0?p:null}catch{return null}}function rU(t,e,n,r){if((!t||!("borderRadius"in t))&&!e.some(c=>{var u;return"borderRadius"in c.properties||((u=c.keyframes)==null?void 0:u.keyframes.some(h=>"borderRadius"in h.properties))}))return null;const i=r==null?void 0:r.current,a=n.id?`#${n.id}`:n.selector;if(!(i!=null&&i.contentDocument)||!a)return null;try{const l=i.contentDocument.querySelector(a);if(!l)return null;const c=i.contentWindow.getComputedStyle(l),u=h=>Number.parseFloat(h)||0;return{tl:u(c.borderTopLeftRadius),tr:u(c.borderTopRightRadius),br:u(c.borderBottomRightRadius),bl:u(c.borderBottomLeftRadius)}}catch{return null}}function dC({value:t,disabled:e,liveCommit:n,onCommit:r}){const[i,a]=d.useState(t),l=d.useRef(null),c=d.useRef(t),u=d.useRef(i),h=d.useRef(null);c.current=t,u.current=i,d.useEffect(()=>{a(t)},[t]),d.useEffect(()=>{const y=h.current;if(!y)return;const b=S=>{if(e||document.activeElement!==y)return;const k=S.deltaY===0?S.deltaX:S.deltaY;if(k===0)return;const A=AS(u.current,k<0?1:-1,S);A&&(S.preventDefault(),S.stopPropagation(),a(A),x.current(A))};return y.addEventListener("wheel",b,{passive:!1}),()=>y.removeEventListener("wheel",b)},[e]),d.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const p=y=>{l.current&&clearTimeout(l.current),y!==c.current&&r(y)},O=y=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{y!==c.current&&r(y)},120)},x=d.useRef(O);return x.current=O,m.jsx("input",{ref:h,type:"text",value:i,disabled:e,onChange:y=>{a(y.target.value),n&&O(y.target.value)},onBlur:()=>p(i),onKeyDown:y=>{if(y.key==="Enter"){y.target.blur();return}if(y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;const b=AS(i,y.key==="ArrowUp"?1:-1,y);b&&(y.preventDefault(),a(b),O(b))},title:gl(t)?"Scroll or use Arrow keys to adjust":void 0,className:"min-w-0 w-full bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})}function rn({label:t,value:e,disabled:n,liveCommit:r,scrub:i,suffix:a,tooltip:l,onCommit:c}){const u=d.useRef(null),h=d.useCallback(y=>{if(n||!i)return;const b=parseFloat(e);Number.isFinite(b)&&(y.target.setPointerCapture(y.pointerId),u.current={startX:y.clientX,startValue:b,pointerId:y.pointerId})},[n,i,e]),p=d.useCallback(y=>{const b=u.current;if(!b)return;const S=y.clientX-b.startX;c(String(Math.round(b.startValue+S)))},[c]),O=d.useCallback(()=>{u.current=null},[]),x=i&&!n?{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500 cursor-ew-resize select-none",onPointerDown:h,onPointerMove:p,onPointerUp:O}:{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500"};return m.jsx("div",{className:Bi,title:l,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("span",{...x,children:t}),m.jsx(dC,{value:e,disabled:n,liveCommit:r,onCommit:c}),a&&m.jsx("span",{className:"flex-shrink-0 text-[10px] text-neutral-600",children:a})]})})}function n6({label:t,value:e,disabled:n,onCommit:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:t}),m.jsx("div",{className:Bi,children:m.jsx(dC,{value:e,disabled:n,onCommit:r})})]})}function xi({value:t,min:e,max:n,step:r,displayValue:i,formatDisplayValue:a,disabled:l,onCommit:c}){const[u,h]=d.useState(t),p=d.useRef(null),O=d.useRef(t);O.current=t,d.useEffect(()=>{h(t)},[t]),d.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const x=b=>{p.current&&clearTimeout(p.current),b!==O.current&&c(b)},y=b=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{b!==O.current&&c(b)},40)};return m.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2",children:[m.jsx("input",{type:"range",min:e,max:n,step:r,value:u,disabled:l,onChange:b=>{const S=Number(b.target.value);h(S),y(S)},onMouseUp:()=>x(u),onTouchEnd:()=>x(u),onBlur:()=>x(u),className:"h-4 min-w-0 w-full cursor-pointer appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-slider-runnable-track]:h-[2px] [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-panel-border [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:shadow-[0_0_0_2px_#0C0C0E,0_1px_3px_rgba(0,0,0,0.5)] [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb:active]:cursor-grabbing"}),m.jsx("div",{className:"min-w-[44px] rounded-md bg-panel-input px-2 py-1.5 text-right text-[11px] font-medium text-panel-text-1 tabular-nums",children:(a==null?void 0:a(u))??i})]})}function So({options:t,value:e,disabled:n,onChange:r}){return m.jsx("div",{className:"grid min-w-0 gap-[2px] rounded-md bg-panel-input p-[2px]",style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},children:t.map(i=>m.jsx("button",{type:"button",disabled:n,onClick:()=>r(i.value),className:`min-w-0 truncate rounded px-2 py-[5px] text-[11px] font-medium transition-colors disabled:cursor-not-allowed ${i.value===e?"bg-panel-hover text-white":"text-panel-text-4 hover:text-panel-text-2"}`,children:i.label},i.value))})}function Xn({label:t,value:e,disabled:n,options:r,onChange:i}){const a=e&&!r.includes(e)?[e,...r]:r;return m.jsxs("label",{className:`${Bi} flex items-center gap-3`,children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:t}),m.jsx("select",{value:e,disabled:n,onChange:l=>i(l.target.value),className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:a.map(l=>m.jsx("option",{value:l,children:l},l))})]})}function Rr({title:t,icon:e,children:n,accessory:r,defaultCollapsed:i=!1}){const[a,l]=d.useState(i);return m.jsxs("section",{className:"min-w-0 border-t border-panel-border",children:[m.jsxs("button",{type:"button",onClick:()=>l(c=>!c),className:"flex w-full items-center justify-between gap-2 px-4 py-2.5",children:[m.jsx("h3",{className:"text-[12px] font-semibold text-panel-text-1",children:t}),m.jsxs("div",{className:"flex items-center gap-2",children:[r,a&&m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"flex-shrink-0 text-panel-text-5",children:m.jsx("path",{d:"M6 2.5v7M2.5 6h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),!a&&m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",className:"flex-shrink-0 text-panel-text-5",children:m.jsx("path",{d:"M2 3l3 4 3-4z"})})]})]}),!a&&m.jsx("div",{className:"px-4 pb-3",children:n})]})}const iU=new Set(["video","audio"]);function aU(t){return iU.has(t.tagName)}function MS(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function sU({projectDir:t,element:e,styles:n,onSetStyle:r,onSetAttribute:i,onSetHtmlAttribute:a}){const l=e.tagName==="video",c=e.element,u=us(e.dataAttributes.volume??"")??1,h=Math.round(u*100),p=Number.parseFloat(e.dataAttributes["media-start"]??e.dataAttributes["playback-start"]??"0")||0,O=c.hasAttribute("loop"),x=c.hasAttribute("muted"),y=e.dataAttributes["has-audio"]==="true",b=Number.parseFloat(e.dataAttributes["playback-rate"]??"1")||1,S=n["object-fit"]||"contain",k=n["object-position"]||"center",A=Number.parseFloat(e.dataAttributes["source-duration"]??"")||c.duration||0,C=Math.max(30,Math.ceil(A||p+10)),T=c.getAttribute("src")??"",[j,M]=d.useState(!1),E=t&&T&&!T.startsWith("http")?`${t}/${T}`:T;return m.jsx(Rr,{title:l?"Video":"Audio",icon:l?m.jsx(A9,{size:15}):m.jsx(NL,{size:15}),children:m.jsxs("div",{className:"space-y-4",children:[T&&m.jsxs("div",{className:"min-w-0",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsx("div",{className:"text-[11px] font-medium text-neutral-500",children:"Source"}),m.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(E).then(()=>{M(!0),setTimeout(()=>M(!1),1500)})},className:"flex h-6 items-center gap-1 rounded-lg border border-neutral-700 bg-neutral-950 px-2 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-200",children:[j?m.jsx(PL,{size:11}):m.jsx(DL,{size:11}),m.jsx("span",{children:j?"Copied":"Copy"})]})]}),m.jsx("div",{className:"mt-1 truncate text-[11px] font-medium text-neutral-300",title:E,children:E})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Volume"}),m.jsx(xi,{value:h,min:0,max:100,step:1,displayValue:`${h}%`,formatDisplayValue:$=>`${Math.round($)}%`,onCommit:$=>{i("volume",zt($/100))}})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Playback rate"}),m.jsx(xi,{value:b*100,min:25,max:300,step:5,displayValue:`${zt(b)}x`,formatDisplayValue:$=>`${zt($/100)}x`,onCommit:$=>{i("playback-rate",zt($/100))}})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Media start"}),m.jsx(xi,{value:Math.round(p*100),min:0,max:C*100,step:10,displayValue:MS(p),formatDisplayValue:$=>MS($/100),onCommit:$=>{i("media-start",($/100).toFixed(2))}})]}),m.jsxs("div",{className:Un,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Loop"}),m.jsx(So,{value:O?"on":"off",onChange:$=>{a("loop",$==="on"?"true":null)},options:[{label:"On",value:"on"},{label:"Off",value:"off"}]})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Muted"}),m.jsx(So,{value:x?"on":"off",onChange:$=>{a("muted",$==="on"?"true":null)},options:[{label:"On",value:"on"},{label:"Off",value:"off"}]})]})]}),l&&m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Has audio track"}),m.jsx(So,{value:y?"yes":"no",onChange:$=>{$==="yes"?(i("has-audio","true"),a("muted",null)):(i("has-audio",""),a("muted","true"))},options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})]}),l&&m.jsx(m.Fragment,{children:m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Fit",value:S,onChange:$=>{r("object-fit",$)},options:["contain","cover","fill","none","scale-down"]}),m.jsx(Xn,{label:"Position",value:k,onChange:$=>{r("object-position",$)},options:["center","top","bottom","left","right","left top","right top","left bottom","right bottom"]})]})})]})})}function _2(t,e,n){return Math.max(e,Math.min(n,t))}function lU(t,e,n,r){const l=Math.max(12,e.width-n.width-12),c=t.left+t.width/2-n.width/2,u=_2(c,12,l),h=t.bottom+8,p=t.top-n.height-8,O=h+n.height<=e.height-12,x=p>=12;return O||!x?{left:u,top:_2(h,12,Math.max(12,e.height-n.height-12)),placement:"bottom"}:{left:u,top:_2(p,12,Math.max(12,e.height-n.height-12)),placement:"top"}}const CS={width:292,height:386};function TS({label:t,value:e,min:n,max:r,step:i,displayValue:a,background:l,thumbColor:c,disabled:u,onCommit:h}){const p=d.useRef(null),O=(e-n)/(r-n)*100,x=b=>{var C;const S=(C=p.current)==null?void 0:C.getBoundingClientRect();if(!S||S.width<=0)return;const k=n+(b-S.left)/S.width*(r-n),A=Math.round(k/i)*i;h(Math.max(n,Math.min(r,A)))},y=b=>{h(Math.max(n,Math.min(r,b)))};return m.jsxs("div",{className:"grid gap-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Jt,children:t}),m.jsx("span",{className:"text-[10px] font-medium text-neutral-400",children:a})]}),m.jsx("div",{ref:p,role:"slider",tabIndex:u?-1:0,"aria-label":t,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":e,"aria-disabled":u,className:`relative h-4 rounded-full border border-neutral-700 shadow-[inset_0_1px_2px_rgba(0,0,0,0.55)] outline-none focus:border-panel-accent focus:ring-2 focus:ring-panel-accent/40 ${u?"cursor-not-allowed opacity-50":"cursor-ew-resize"}`,style:{background:l},onPointerDown:b=>{u||(b.currentTarget.setPointerCapture(b.pointerId),x(b.clientX))},onPointerUp:b=>{b.currentTarget.blur()},onPointerMove:b=>{u||b.buttons!==1||x(b.clientX)},onKeyDown:b=>{u||(b.key==="ArrowRight"||b.key==="ArrowUp"?(b.preventDefault(),y(e+i)):b.key==="ArrowLeft"||b.key==="ArrowDown"?(b.preventDefault(),y(e-i)):b.key==="Home"?(b.preventDefault(),y(n)):b.key==="End"&&(b.preventDefault(),y(r)))},children:m.jsx("div",{className:"pointer-events-none absolute top-1/2 h-6 w-6 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.85),0_6px_14px_rgba(0,0,0,0.5)]",style:{left:`${Math.max(0,Math.min(100,O))}%`,backgroundColor:c}})})]})}function gu({label:t,value:e,disabled:n,onCommit:r}){const i=d.useRef(null),a=d.useRef(null),[l,c]=d.useState(!1),[u,h]=d.useState(null),[p,O]=d.useState(()=>L2(e)),[x,y]=d.useState(()=>R2(L2(e)).toUpperCase()),b=HG(p),S=yf({...xS({hue:b.hue,saturation:1,value:1}),alpha:1}),k=yf({...p,alpha:1}),A=yf(p),C=Math.round(b.saturation*100),T=Math.round(b.value*100),j=Math.round(p.alpha*100);d.useEffect(()=>{const X=L2(e);O(X),y(R2(X).toUpperCase())},[e]);const M=d.useCallback(()=>{var I,K;const X=(I=i.current)==null?void 0:I.getBoundingClientRect();if(!X)return;const U=(K=a.current)==null?void 0:K.getBoundingClientRect();h(lU(X,{width:window.innerWidth,height:window.innerHeight},{width:(U==null?void 0:U.width)||CS.width,height:(U==null?void 0:U.height)||CS.height}))},[]);d.useLayoutEffect(()=>{if(!l)return;M();const X=()=>M();return window.addEventListener("resize",X),window.addEventListener("scroll",X,!0),()=>{window.removeEventListener("resize",X),window.removeEventListener("scroll",X,!0)}},[l,M]),d.useEffect(()=>{if(!l)return;const X=I=>{var Z,F;const K=I.target;K&&((Z=a.current)!=null&&Z.contains(K)||(F=i.current)!=null&&F.contains(K)||c(!1))},U=I=>{I.key==="Escape"&&c(!1)};return document.addEventListener("pointerdown",X),document.addEventListener("keydown",U),()=>{document.removeEventListener("pointerdown",X),document.removeEventListener("keydown",U)}},[l]);const E=X=>{O(X),y(R2(X).toUpperCase()),r(yf(X))},$=X=>{const U=xS({hue:X.hue??b.hue,saturation:X.saturation??b.saturation,value:X.value??b.value});E({...U,alpha:p.alpha})},N=(X,U,I)=>{const K=I.getBoundingClientRect(),Z=Math.max(0,Math.min(1,(X-K.left)/K.width)),F=Math.max(0,Math.min(1,1-(U-K.top)/K.height));$({saturation:Z,value:F})},D=X=>{y(X);const U=X.trim().startsWith("#")?X.trim():`#${X.trim()}`,I=cC(U);I&&E({...I,alpha:p.alpha})},z=l?L8.createPortal(m.jsxs("div",{ref:a,className:"fixed z-[9999] w-[292px] overflow-hidden rounded-2xl border border-neutral-700 bg-neutral-950 shadow-2xl shadow-black/50",style:{left:(u==null?void 0:u.left)??-9999,top:(u==null?void 0:u.top)??-9999},children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:t}),m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-neutral-600",children:"Color"})]}),m.jsx("button",{type:"button",onClick:()=>c(!1),className:"flex h-7 w-7 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-neutral-900 hover:text-neutral-200","aria-label":"Close color picker",children:m.jsx(Xd,{size:13})})]}),m.jsxs("div",{className:"space-y-3 p-3",children:[m.jsxs("div",{className:"relative h-36 cursor-crosshair overflow-hidden rounded-xl border border-neutral-700 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]",style:{backgroundColor:S},onPointerDown:X=>{X.currentTarget.setPointerCapture(X.pointerId),N(X.clientX,X.clientY,X.currentTarget)},onPointerMove:X=>{X.buttons===1&&N(X.clientX,X.clientY,X.currentTarget)},children:[m.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-white to-transparent"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black to-transparent"}),m.jsx("div",{className:"pointer-events-none absolute top-0 h-full w-px -translate-x-1/2 bg-white/70 shadow-[0_0_0_1px_rgba(0,0,0,0.45)] mix-blend-difference",style:{left:`${b.saturation*100}%`}}),m.jsx("div",{className:"pointer-events-none absolute left-0 h-px w-full -translate-y-1/2 bg-white/70 shadow-[0_0_0_1px_rgba(0,0,0,0.45)] mix-blend-difference",style:{top:`${(1-b.value)*100}%`}}),m.jsx("div",{className:"pointer-events-none absolute h-6 w-6 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.85),0_8px_18px_rgba(0,0,0,0.45)]",style:{left:`${b.saturation*100}%`,top:`${(1-b.value)*100}%`,backgroundColor:k}})]}),m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("div",{className:"h-9 w-9 flex-shrink-0 rounded-xl border border-neutral-600 shadow-[inset_0_1px_0_rgba(255,255,255,0.08)]",style:{backgroundColor:A}}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:A}),m.jsxs("div",{className:"mt-0.5 text-[9px] text-neutral-600",children:["S ",C,"% · B ",T,"% · A ",j,"%"]})]})]}),m.jsx(TS,{label:"Hue",value:b.hue,min:0,max:360,step:1,displayValue:`${Math.round(b.hue)}°`,background:"linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)",thumbColor:S,disabled:n,onCommit:X=>$({hue:X})}),m.jsx(TS,{label:"Alpha",value:p.alpha,min:0,max:1,step:.01,displayValue:`${j}%`,background:`linear-gradient(90deg, transparent, ${k})`,thumbColor:A,disabled:n,onCommit:X=>E({...p,alpha:X})}),m.jsxs("label",{className:"grid gap-1.5",children:[m.jsx("span",{className:Jt,children:"Hex"}),m.jsx("input",{value:x,onChange:X=>D(X.target.value),className:`${Bi} h-10 w-full text-[11px] font-medium outline-none`,spellCheck:!1})]})]})]}),document.body):null,B=()=>{n||(c(X=>!X),l||requestAnimationFrame(M))};return m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:t}),m.jsxs("button",{type:"button",disabled:n,"aria-label":`Pick ${t.toLowerCase()} color`,ref:i,onClick:B,className:`${Bi} flex items-center gap-3 text-left hover:border-neutral-700 disabled:cursor-not-allowed ${l?"border-neutral-600":""}`,children:[m.jsx("div",{className:"relative h-7 w-7 flex-shrink-0 overflow-hidden rounded-lg border border-neutral-700 bg-neutral-950 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",style:{backgroundColor:e||"transparent"}}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-100",children:e})]}),z]})}function oU(t){const e=[];let n="",r=null;for(const i of t){if((i==='"'||i==="'")&&!r){r=i;continue}if(i===r){r=null;continue}if(i===","&&!r){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e.map(i=>i.replace(/^["']|["']$/g,"").trim()).filter(Boolean)}function cU(t){return oU(t)[0]??"inherit"}function uU(t){const e=t.trim();return t6.has(e.toLowerCase())?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function D2(t){const e=t.trim();return e?t6.has(e.toLowerCase())?e:`${uU(e)}, ui-sans-serif, system-ui, sans-serif`:"inherit"}function fU(){if(typeof document>"u")return[];const t=document.fonts;return t?Array.from(t,e=>e.family.replace(/^["']|["']$/g,"").trim()).filter(Boolean).sort((e,n)=>e.localeCompare(n)):[]}function ES(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"")}function dU(t,e){const n=e.trim().toLowerCase();return!n||t.toLowerCase().includes(n)?!0:ES(t).includes(ES(n))}function $S(t){if(typeof document>"u")return;const e=t.trim();if(!e)return;const n=`studio-google-font-${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(document.getElementById(n))return;if(!document.querySelector('link[data-studio-google-font-preconnect="true"]')){const a=document.createElement("link");a.setAttribute("data-studio-google-font-preconnect","true"),a.rel="preconnect",a.href="https://fonts.gstatic.com",a.crossOrigin="anonymous",document.head.appendChild(a)}const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=l9(e),document.head.appendChild(i)}function vf(t){if(typeof document>"u")return;const e=`studio-imported-font-${t.family.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.textContent=q8(t),document.head.appendChild(n)}function hU({value:t,disabled:e,importedFonts:n,onImportFonts:r,onCommit:i}){const a=cU(t),l=d.useRef(null),c=d.useRef(null),u=d.useRef(null),[h,p]=d.useState(!1),[O,x]=d.useState(""),[y,b]=d.useState([]),[S,k]=d.useState([]),[A,C]=d.useState(()=>[...db]),[T,j]=d.useState(!1),[M,E]=d.useState(!1),[$,N]=d.useState(!1),[D,z]=d.useState(null),B=typeof window<"u"&&typeof window.queryLocalFonts=="function";d.useEffect(()=>{if(!h)return;const G=R=>{var L;const P=R.target;P instanceof Node&&((L=l.current)!=null&&L.contains(P)||p(!1))};return document.addEventListener("pointerdown",G),()=>document.removeEventListener("pointerdown",G)},[h]),d.useEffect(()=>{h&&requestAnimationFrame(()=>{var G;return(G=c.current)==null?void 0:G.focus()})},[h]),d.useEffect(()=>{let G=!1;return fetch("/api/fonts").then(R=>R.ok?R.json():null).then(R=>{G||!Array.isArray(R==null?void 0:R.fonts)||b(P=>V2([...P,...R.fonts]))}).catch(()=>{}),()=>{G=!0}},[]),d.useEffect(()=>{let G=!1;return E(!0),fetch("/api/fonts/google").then(R=>R.ok?R.json():null).then(R=>{G||!Array.isArray(R==null?void 0:R.fonts)||C(V2([...R.fonts,...db]))}).catch(()=>{}).finally(()=>{G||E(!1)}),()=>{G=!0}},[]),d.useEffect(()=>{A.some(R=>R.toLowerCase()===a.toLowerCase())&&$S(a);const G=n.find(R=>R.family.toLowerCase()===a.toLowerCase());G&&vf(G)},[a,A,n]);const X=async()=>{if(!B||!window.queryLocalFonts){z("This browser does not expose installed fonts. Import a font file instead.");return}j(!0),z(null);try{const G=await window.queryLocalFonts(),R=[...G].sort((L,V)=>bf(L)-bf(V)),P=R.map(L=>L.family).filter(L=>!!L).map(L=>Co(`${L}.ttf`));k(R),b(L=>V2([...L,...P])),z(G.length===0?"No browser-local fonts were returned.":null)}catch(G){const R=G instanceof Error?G.name:"";z(R==="NotAllowedError"?"Local font access was denied. Import a font file instead.":"Local font access is unavailable. Import a font file instead.")}finally{j(!1)}},U=async G=>{if(!(!(G!=null&&G.length)||!r)){N(!0),z(null);try{const R=await r(G);for(const L of R)vf(L);const P=R[0];P?(i(D2(P.family)),x(""),p(!1)):z("No supported font files were imported.")}finally{N(!1)}}},I=d.useMemo(()=>bS(n.map(G=>({family:G.family,source:"Imported"}))),[n]),K=d.useMemo(()=>{const G=fU(),R=new Set(A.map(L=>L.toLowerCase())),P=y.map(L=>({family:L,source:R.has(L.toLowerCase())?"Google":"Local"}));return zG(bS([{family:a,source:"Current"},...G.map(L=>({family:L,source:"Document"})),...I,...A.map(L=>({family:L,source:"Google"})),...P,...XG.map(L=>({family:L,source:"System"}))]))},[a,A,y,I]),Z=d.useMemo(()=>{const G=K.filter(L=>dU(L.family,O));if(O.trim())return G.slice(0,200);const R=new Map;for(const L of G){const V=R.get(L.source)??[];V.push(L),R.set(L.source,V)}const P=[];for(const L of["Current","Document","Imported"])P.push(...R.get(L)??[]);return P.push(...(R.get("Google")??[]).slice(0,100)),P.push(...(R.get("Local")??[]).slice(0,80)),P.push(...R.get("System")??[]),P},[K,O]),F=async G=>{if(!r)return null;const P=S.filter(ae=>Co(`${ae.family}.ttf`)===G).sort((ae,Y)=>bf(ae)-bf(Y)).find(ae=>typeof ae.blob=="function");if(!(P!=null&&P.blob))return null;const L=await P.blob(),V=yS(P.style??"Regular")||"Regular",W=yS(`${G} ${V}`)||G,ee=new File([L],`${W}.ttf`,{type:L.type||"font/ttf"}),ue=await r([ee]);return ue.find(ae=>ae.family.toLowerCase()===G.toLowerCase())??ue[0]??null},_=async G=>{var ee,ue;if(!r)return null;const R=await fetch(`/api/fonts/file?family=${encodeURIComponent(G)}`);if(!R.ok)return null;const P=await R.blob(),L=((ue=(ee=R.headers.get("Content-Disposition"))==null?void 0:ee.match(/\.(\w+)"?$/))==null?void 0:ue[1])??"ttf",V=new File([P],`${G}.${L}`,{type:P.type||"font/ttf"}),W=await r([V]);return W.find(ae=>ae.family.toLowerCase()===G.toLowerCase())??W[0]??null},q=async G=>{if(G.source==="Local"||G.source==="System"&&!t6.has(G.family.toLowerCase())){N(!0),z(null);try{const L=G.source==="Local"?await F(G.family):await _(G.family);if(L){vf(L),i(D2(L.family)),x(""),p(!1);return}}finally{N(!1)}}G.source==="Google"&&$S(G.family);const P=n.find(L=>L.family.toLowerCase()===G.family.toLowerCase());P&&vf(P),i(D2(G.family)),x(""),p(!1)};return m.jsxs("div",{ref:l,className:"relative grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Font family"}),m.jsxs("button",{type:"button",disabled:e,onClick:()=>p(G=>!G),className:`${Bi} flex h-10 items-center justify-between gap-3 text-left hover:border-neutral-700 disabled:cursor-not-allowed`,children:[m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-100",style:{fontFamily:t},children:a}),m.jsx("span",{className:"flex-shrink-0 text-[10px] uppercase tracking-[0.14em] text-neutral-600",children:"Font"})]}),h&&m.jsxs("div",{className:"absolute left-0 right-0 top-[calc(100%+6px)] z-50 overflow-hidden rounded-xl border border-neutral-700 bg-neutral-950 shadow-2xl",children:[m.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2 border-b border-neutral-800 p-2",children:[m.jsx("input",{ref:c,type:"text",value:O,disabled:e,placeholder:M?"Loading Google Fonts...":"Search fonts",onChange:G=>x(G.target.value),onKeyDown:G=>{G.key==="Escape"&&(G.preventDefault(),p(!1)),G.key==="Enter"&&Z[0]&&(G.preventDefault(),q(Z[0]))},className:"min-w-0 rounded-lg border border-neutral-800 bg-neutral-900 px-2.5 py-2 text-[11px] font-medium text-neutral-100 outline-none placeholder:text-neutral-600 focus:border-neutral-600"}),B&&m.jsx("button",{type:"button",disabled:e||T,onClick:X,className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-100 disabled:cursor-not-allowed disabled:text-neutral-700",children:T?"...":"Local"}),m.jsx("button",{type:"button",disabled:e||$||!r,onClick:()=>{var G;return(G=u.current)==null?void 0:G.click()},className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-100 disabled:cursor-not-allowed disabled:text-neutral-700",children:$?"...":"Import"}),m.jsx("input",{ref:u,type:"file",accept:".ttf,.otf,.ttc,.woff,.woff2,.eot,font/*",multiple:!0,"aria-label":"Import local font files",disabled:e||$||!r,className:"hidden",onChange:async G=>{await U(G.target.files),G.target.value=""}})]}),D&&m.jsx("div",{className:"border-b border-neutral-800 px-3 py-2 text-[10px] leading-4 text-neutral-500",children:D}),m.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:Z.length===0?m.jsx("div",{className:"px-2 py-3 text-[11px] text-neutral-500",children:"No fonts found."}):Z.map(G=>m.jsxs("button",{type:"button",onClick:()=>q(G),className:`flex w-full min-w-0 items-center justify-between gap-3 rounded-lg px-2 py-2 text-left text-[11px] transition-colors ${G.family===a?"bg-studio-accent/15 text-neutral-50":"text-neutral-300 hover:bg-neutral-900 hover:text-neutral-100"}`,children:[m.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[m.jsx("span",{className:"truncate font-medium",children:G.family}),hb(G.family)&&m.jsxs("span",{className:"flex-shrink-0 text-[9px] text-neutral-500",children:["→ ",hb(G.family)]})]}),m.jsx("span",{className:"flex-shrink-0 text-[9px] uppercase tracking-[0.14em] text-neutral-600",children:G.source})]},`${G.source}-${G.family}`))})]})]})}const mU=["closest-side","closest-corner","farthest-side","farthest-corner"];function hC(t){return t===" "||t===`
|
|
143
|
+
`||t==="\r"||t===" "||t==="\f"}function $8(t){return t!=null&&t>="0"&&t<="9"}function mC(t){if(!t)return!1;let e=t[0]==="-"?1:0,n=0;for(;$8(t[e]);)e+=1,n+=1;if(t[e]===".")for(e+=1;$8(t[e]);)e+=1,n+=1;return n>0&&e===t.length}function r6(t){if(!t)return null;const e=t.trim();if(!mC(e))return null;const n=Number(e);return Number.isFinite(n)?n:null}function i6(t){const e=[];let n="";for(const r of t){if(hC(r)){n&&(e.push(n),n="");continue}n+=r}return n&&e.push(n),e}function ho(t,e){return i6(t.toLowerCase()).includes(e)}function Qd(t,e){if(!(t!=null&&t.endsWith("%")))return e;const n=r6(t.slice(0,-1));return n==null?e:h0(n,0,100)}function pC(t){const e=t==null?void 0:t.trim().toLowerCase();return e!=null&&e.endsWith("deg")?r6(e.slice(0,-3)):null}function pU(t){if(!t.endsWith("%"))return null;const e=t.slice(0,-1).trimEnd();let n=e.length;for(;n>0&&($8(e[n-1])||e[n-1]===".");)n-=1;n>0&&e[n-1]==="-"&&(n-=1);const r=e.slice(n);return!mC(r)||n===0||!hC(e[n-1])?null:n}function h0(t,e,n){return Math.min(n,Math.max(e,t))}function Zi(t){return Math.round(t*100)/100}function gU(t,e){const n=r6(t);return n==null?e:h0(n,0,100)}function a6(t){const e=t.trim(),n=pU(e);if(n==null)return{color:e,position:null};const r=e.slice(0,-1).trimEnd();return{color:r.slice(0,n).trim(),position:gU(r.slice(n),0)}}function uh(t){return t.length===0?[{color:"rgba(60, 230, 172, 0.18)",position:0},{color:"rgba(255, 255, 255, 0.04)",position:100}]:t.length===1?[{color:t[0].color,position:0},{color:t[0].color,position:100}]:t.map((n,r)=>({color:n.color,position:n.position??r/(t.length-1)*100})).map(n=>({color:n.color,position:Zi(h0(n.position,0,100))}))}function OU(t){const e=[];let n="",r=0;for(const i of t){if(i==="("&&(r+=1),i===")"&&(r=Math.max(0,r-1)),i===","&&r===0){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e}function xU(t){const e=t.trim().toLowerCase(),n={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};return e in n?n[e]:null}function yU(t){const e=t[0]??"",n=xU(e),r=pC(e),i=r!=null,a=r??n??180,l=i||n!=null?t.slice(1):t;return{kind:"linear",repeating:!1,angle:a,centerX:50,centerY:50,shape:"ellipse",radialSize:"farthest-corner",stops:uh(l.map(a6))}}function bU(t){const e=t[0]??"",n=e.toLowerCase(),r=ho(n,"at")||ho(n,"circle")||ho(n,"ellipse")||n.includes("closest-")||n.includes("farthest-"),i=r?e:"",a=r?t.slice(1):t,l=i.toLowerCase(),c=i6(l),u=c.indexOf("at"),h=ho(l,"circle")?"circle":"ellipse",p=mU.find(O=>c.includes(O))??"farthest-corner";return{kind:"radial",repeating:!1,angle:180,centerX:Qd(c[u+1],50),centerY:Qd(c[u+2],50),shape:h,radialSize:p,stops:uh(a.map(a6))}}function vU(t){const e=t[0]??"",n=e.toLowerCase(),r=ho(n,"from")||ho(n,"at"),i=r?e:"",a=r?t.slice(1):t,l=i6(i.toLowerCase()),c=l.indexOf("from"),u=l.indexOf("at");return{kind:"conic",repeating:!1,angle:pC(l[c+1])??0,centerX:Qd(l[u+1],50),centerY:Qd(l[u+2],50),shape:"ellipse",radialSize:"farthest-corner",stops:uh(a.map(a6))}}function j8(t){return{kind:"linear",repeating:!1,angle:135,centerX:50,centerY:50,shape:"ellipse",radialSize:"farthest-corner",stops:uh([{color:t&&t!=="transparent"?t:"rgba(60, 230, 172, 0.18)",position:0},{color:"rgba(255, 255, 255, 0.04)",position:100}])}}function SU(t){if(!t||t==="none")return null;const e=t.trim(),n=e.indexOf("(");if(n<=0||!e.endsWith(")"))return null;const r=e.slice(0,n).toLowerCase(),a={"linear-gradient":{kind:"linear",repeating:!1},"radial-gradient":{kind:"radial",repeating:!1},"conic-gradient":{kind:"conic",repeating:!1},"repeating-linear-gradient":{kind:"linear",repeating:!0},"repeating-radial-gradient":{kind:"radial",repeating:!0},"repeating-conic-gradient":{kind:"conic",repeating:!0}}[r];if(!a)return null;const{kind:l,repeating:c}=a,u=OU(e.slice(n+1,-1));return{...l==="linear"?yU(u):l==="radial"?bU(u):vU(u),repeating:c}}function wU(t){return`${t.color} ${Zi(t.position)}%`}function Zd(t){const e=`${t.repeating?"repeating-":""}${t.kind}-gradient`,n=t.stops.map(wU).join(", ");return t.kind==="linear"?`${e}(${Zi(t.angle)}deg, ${n})`:t.kind==="radial"?`${e}(${t.shape} ${t.radialSize} at ${Zi(t.centerX)}% ${Zi(t.centerY)}%, ${n})`:`${e}(from ${Zi(t.angle)}deg at ${Zi(t.centerX)}% ${Zi(t.centerY)}%, ${n})`}function H2(t,e,n){return Math.round(t+(e-t)*n)}function X2(t){return t.toString(16).padStart(2,"0")}function kU(t,e){var k;const n=h0(e,0,100),r=[...t.stops].sort((A,C)=>A.position-C.position),i=r.find(A=>Math.abs(A.position-n)<.001);if(i)return i.color;const a=r.find(A=>A.position>n)??r.at(-1),l=[...r].reverse().find(A=>A.position<n)??r[0];if(!l||!a)return((k=r[0])==null?void 0:k.color)??"rgba(255, 255, 255, 1)";if(l===a)return l.color;const c=l.color,u=a.color,h=c?PS(c):null,p=u?PS(u):null;if(!h||!p)return l.color;const O=(n-l.position)/Math.max(1,a.position-l.position),x=H2(h.red,p.red,O),y=H2(h.green,p.green,O),b=H2(h.blue,p.blue,O),S=Zi(h.alpha+(p.alpha-h.alpha)*O);return S>=1?`#${X2(x)}${X2(y)}${X2(b)}`.toUpperCase():`rgba(${x}, ${y}, ${b}, ${S})`}function jS(t,e){const n=Zi(h0(e,0,100)),r=kU(t,n),i=[...t.stops,{color:r,position:n}].sort((a,l)=>a.position-l.position);return{...t,stops:i}}function PS(t){const e=t.trim().toLowerCase();if(e==="transparent")return{red:0,green:0,blue:0,alpha:0};const n=e.match(/^#([0-9a-f]{6})$/i);if(n)return{red:Number.parseInt(n[1].slice(0,2),16),green:Number.parseInt(n[1].slice(2,4),16),blue:Number.parseInt(n[1].slice(4,6),16),alpha:1};const r=e.match(/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i);return r?{red:Number.parseFloat(r[1]),green:Number.parseFloat(r[2]),blue:Number.parseFloat(r[3]),alpha:r[4]!=null?Number.parseFloat(r[4]):1}:null}function Fu(t){const e=t.trim(),n=/^[a-z]+:\/\//i.test(e)?new URL(e).pathname:e;return decodeURIComponent(n).replace(/\\/g,"/").replace(/^\.?\//,"")}function AU(t,e){const n=Fu(t).split("/").filter(Boolean),r=Fu(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 QS(t){return Fu(t)}function MU(t,e,n){const r=Fu(t);if(!r)return null;for(const i of n){const a=Fu(i),l=AU(e,i);if(r===a||r===l||r.endsWith(`/${a}`)||r.endsWith(`/${l}`))return i}return null}function CU({projectId:t,sourceFile:e,value:n,assets:r,disabled:i,onCommit:a,onImportAssets:l}){const c=d.useRef(null),[u,h]=d.useState(!1),p=d.useMemo(()=>r.filter(b=>Su.test(b)),[r]),O=d.useMemo(()=>MU(n,e,p),[p,e,n]),x=O?"":n,y=async b=>{if(!(!(b!=null&&b.length)||!l)){h(!0);try{const k=(await l(b)).find(A=>Su.test(A));k&&a(`url("${QS(k)}")`)}finally{h(!1)}}};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[m.jsx("span",{className:Jt,children:"Project asset"}),m.jsxs("button",{type:"button",disabled:i||u,onClick:()=>{var b;return(b=c.current)==null?void 0:b.click()},className:`inline-flex h-7 max-w-full items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors ${i||u?"cursor-not-allowed text-neutral-600":"cursor-pointer hover:border-neutral-600 hover:text-white"}`,children:[m.jsx(cO,{size:12,className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:u?"Uploading…":"Upload image"})]}),m.jsx("input",{ref:c,type:"file",accept:"image/*","aria-label":"Upload image asset",disabled:i||u,className:"hidden",onChange:async b=>{await y(b.target.files),b.target.value=""}})]}),p.length>0?m.jsxs("div",{className:"space-y-3",children:[O&&m.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-800 bg-neutral-900/80",children:m.jsx("img",{src:`/api/projects/${t}/preview/${O}`,alt:O.split("/").pop()??O,className:"h-28 w-full object-contain bg-neutral-950/80"})}),m.jsx("div",{className:Bi,children:m.jsxs("select",{value:O??"",disabled:i,onChange:b=>{const S=b.target.value;if(!S){a("none");return}a(`url("${QS(S)}")`)},className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx("option",{value:"",children:"None"}),p.map(b=>m.jsx("option",{value:b,children:b},b))]})})]}):m.jsx("div",{className:"rounded-xl border border-dashed border-neutral-800 bg-neutral-900/50 px-3 py-3 text-[11px] leading-5 text-neutral-500",children:"No image assets yet. Upload one here and Studio will also add it to the Assets tab."})]}),m.jsx(n6,{label:"External URL",value:x,disabled:i,onCommit:b=>a(b.trim()?`url("${b.trim()}")`:"none")})]})}function TU({value:t,fallbackColor:e,disabled:n,onCommit:r}){const i=d.useRef(null),a=SU(t)??j8(e),l=x=>r(Zd(x)),c=x=>l({...a,...x}),u=(x,y)=>{const b=a.stops.map((S,k)=>k===x?{...S,...y}:S);l({...a,stops:b})},h=x=>{var b,S;const y=x!=null?jS(a,x):jS(a,((b=a.stops.at(-1))==null?void 0:b.position)!=null?Math.min(100,(((S=a.stops.at(-1))==null?void 0:S.position)??90)+10):100);l(y)},p=x=>{a.stops.length<=2||l({...a,stops:a.stops.filter((y,b)=>b!==x)})},O={backgroundImage:Zd(a)};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:`${Bi} space-y-3 p-3`,children:[m.jsx("div",{ref:i,className:"relative h-11 overflow-hidden rounded-lg border border-neutral-700",style:O,onClick:x=>{var b;if(n)return;const y=(b=i.current)==null?void 0:b.getBoundingClientRect();!y||y.width<=0||h((x.clientX-y.left)/y.width*100)},children:a.stops.map((x,y)=>m.jsx("div",{className:"absolute top-1/2 h-4 w-4 -translate-y-1/2 rounded-full border-2 border-white/90 shadow-[0_0_0_1px_rgba(0,0,0,0.35)]",style:{left:`calc(${x.position}% - 8px)`,backgroundColor:x.color}},`stop-preview-${y}`))}),m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[m.jsx(So,{disabled:n,value:a.kind,onChange:x=>c({kind:x}),options:[{label:"Linear",value:"linear"},{label:"Radial",value:"radial"},{label:"Conic",value:"conic"}]}),m.jsxs("label",{className:"flex items-center gap-2 text-[11px] font-medium text-neutral-400",children:[m.jsx("input",{type:"checkbox",checked:a.repeating,disabled:n,onChange:x=>c({repeating:x.target.checked}),className:"h-4 w-4 rounded border-neutral-700 bg-neutral-950 text-panel-accent focus:ring-panel-accent"}),"Repeat"]}),m.jsxs("button",{type:"button",disabled:n,onClick:()=>l({...a,stops:[...a.stops].reverse().map(x=>({...x,position:100-x.position}))}),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx(fO,{size:12}),"Reverse"]})]})]}),(a.kind==="linear"||a.kind==="conic")&&m.jsxs("div",{className:"grid gap-1.5",children:[m.jsx("span",{className:Jt,children:a.kind==="linear"?"Angle":"Start angle"}),m.jsx(xi,{value:a.angle,min:0,max:360,step:1,disabled:n,displayValue:`${Math.round(a.angle)}°`,formatDisplayValue:x=>`${Math.round(x)}°`,onCommit:x=>c({angle:x})})]}),a.kind==="radial"&&m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Shape",value:a.shape,disabled:n,onChange:x=>c({shape:x}),options:["ellipse","circle"]}),m.jsx(Xn,{label:"Size",value:a.radialSize,disabled:n,onChange:x=>c({radialSize:x}),options:["closest-side","closest-corner","farthest-side","farthest-corner"]})]}),(a.kind==="radial"||a.kind==="conic")&&m.jsxs("div",{className:Un,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Center X"}),m.jsx(xi,{value:a.centerX,min:0,max:100,step:1,disabled:n,displayValue:`${Math.round(a.centerX)}%`,formatDisplayValue:x=>`${Math.round(x)}%`,onCommit:x=>c({centerX:x})})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Center Y"}),m.jsx(xi,{value:a.centerY,min:0,max:100,step:1,disabled:n,displayValue:`${Math.round(a.centerY)}%`,formatDisplayValue:x=>`${Math.round(x)}%`,onCommit:x=>c({centerY:x})})]})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Jt,children:"Stops"}),m.jsxs("button",{type:"button",disabled:n||a.stops.length>=6,onClick:()=>h(),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx(cO,{size:12}),"Add stop"]})]}),m.jsx("div",{className:"space-y-3",children:a.stops.map((x,y)=>m.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_68px_28px] gap-2",children:[m.jsx(gu,{label:`Stop ${y+1}`,value:x.color,disabled:n,onCommit:b=>u(y,{color:b})}),m.jsx(n6,{label:"Pos",value:`${Math.round(x.position)}%`,disabled:n,onCommit:b=>u(y,{position:Number.parseFloat(b.replace("%",""))||0})}),m.jsx("button",{type:"button",disabled:n||a.stops.length<=2,onClick:()=>p(y),className:"mt-[22px] flex h-10 items-center justify-center rounded-lg border border-neutral-700 bg-neutral-950 text-neutral-400 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-700","aria-label":`Remove stop ${y+1}`,children:m.jsx(Xd,{size:12})})]},`stop-editor-${y}`))})]})]})}const Uc=72,Wc=52,gC=26;function EU(t){return Math.max(0,Math.min(gC,t))}function Sf(t,e){return e<=0?0:EU(Math.round(t/Math.max(e,1)*gC))}function $U({tl:t,tr:e,br:n,bl:r,disabled:i,onCommit:a}){const l=t===e&&e===n&&n===r,[c,u]=d.useState(l),h=Math.max(t,e,n,r,1),p=Sf(t,h),O=Sf(e,h),x=Sf(n,h),y=Sf(r,h),b=d.useCallback((A,C)=>{const T=us(C)??0;a(c?"all":A,T)},[c,a]),S=d.useCallback(()=>{!c&&!l&&a("all",t),u(A=>!A)},[c,l,t,a]),k=jU(Uc,Wc,p,O,x,y);return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("svg",{width:Uc,height:Wc,viewBox:`0 0 ${Uc} ${Wc}`,className:"flex-shrink-0",children:[m.jsx("path",{d:k,fill:"rgba(255,255,255,0.06)",stroke:"rgba(255,255,255,0.24)",strokeWidth:1.5}),m.jsx("circle",{cx:p,cy:p,r:3,fill:c?"#3b82f6":"#a78bfa",className:"cursor-pointer"}),m.jsx("circle",{cx:Uc-O,cy:O,r:3,fill:c?"#3b82f6":"#a78bfa",className:"cursor-pointer"}),m.jsx("circle",{cx:Uc-x,cy:Wc-x,r:3,fill:c?"#3b82f6":"#a78bfa",className:"cursor-pointer"}),m.jsx("circle",{cx:y,cy:Wc-y,r:3,fill:c?"#3b82f6":"#a78bfa",className:"cursor-pointer"})]}),m.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",onClick:S,disabled:i,title:c?"Unlink corners":"Link all corners",children:c?m.jsx("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{d:"M6 12H4a4 4 0 010-8h2M10 4h2a4 4 0 010 8h-2M5 8h6"})}):m.jsx("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{d:"M6 12H4a4 4 0 010-8h2M10 4h2a4 4 0 010 8h-2"})})})]}),c?m.jsx(rn,{label:"All",value:zt(t),disabled:i,liveCommit:!0,onCommit:A=>b("tl",A)}):m.jsxs("div",{className:Un,children:[m.jsx(rn,{label:"TL",value:zt(t),disabled:i,liveCommit:!0,onCommit:A=>b("tl",A)}),m.jsx(rn,{label:"TR",value:zt(e),disabled:i,liveCommit:!0,onCommit:A=>b("tr",A)}),m.jsx(rn,{label:"BL",value:zt(r),disabled:i,liveCommit:!0,onCommit:A=>b("bl",A)}),m.jsx(rn,{label:"BR",value:zt(n),disabled:i,liveCommit:!0,onCommit:A=>b("br",A)})]})]})}function jU(t,e,n,r,i,a){return[`M ${n} 0`,`L ${t-r} 0`,`Q ${t} 0 ${t} ${r}`,`L ${t} ${e-i}`,`Q ${t} ${e} ${t-i} ${e}`,`L ${a} ${e}`,`Q 0 ${e} 0 ${e-a}`,`L 0 ${n}`,`Q 0 0 ${n} 0`,"Z"].join(" ")}function PU({projectId:t,element:e,styles:n,assets:r,onSetStyle:i,onImportAssets:a,gsapBorderRadius:l}){const c=!e.capabilities.canEditStyles,u=n.display==="flex"||n.display==="inline-flex",h=us(n["border-radius"])??0,p=(l==null?void 0:l.tl)??us(n["border-top-left-radius"])??h,O=(l==null?void 0:l.tr)??us(n["border-top-right-radius"])??h,x=(l==null?void 0:l.br)??us(n["border-bottom-right-radius"])??h,y=(l==null?void 0:l.bl)??us(n["border-bottom-left-radius"])??h,b=Math.round((us(n.opacity)??1)*100),S=ma(n["border-width"]??"")??ma(n["border-top-width"]??"")??0,k=n.background!=null&&n.background!=="none"&&n.background!==""||n["background-color"]!=null&&n["background-color"]!=="transparent"&&n["background-color"]!=="rgba(0, 0, 0, 0)"&&n["background-color"]!==""||n["background-image"]!=null&&n["background-image"]!=="none"&&n["background-image"]!==""||S>0,A=n["border-style"]||n["border-top-style"]||"none",C=n["border-color"]||n["border-top-color"]||"rgba(255, 255, 255, 0.18)",T=IG(n["box-shadow"]),j=wS(n.filter,"blur"),M=wS(n["backdrop-filter"],"blur"),E=n["clip-path"]||"none",$=GG(E),N=UG(E),D=n["background-image"]??"none",z=sO(e),B=D&&D!=="none"?D.includes("gradient")?"Gradient":"Image":"Solid",[X,U]=d.useState(B),I=tU(D);d.useEffect(()=>{U(B)},[B,e.id,e.selector,D]);const K=Z=>{if(U(Z),Z==="Solid"){i("background-image","none");return}Z==="Gradient"&&!D.includes("gradient")&&i("background-image",Zd(j8(n["background-color"])))};return m.jsxs(m.Fragment,{children:[u&&m.jsx(Rr,{title:"Flex",icon:m.jsx(Uf,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(So,{disabled:c,value:n["flex-direction"]||"row",onChange:Z=>i("flex-direction",Z),options:[{label:"→ Row",value:"row"},{label:"↓ Column",value:"column"}]}),m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Justify",value:n["justify-content"]||"flex-start",disabled:c,onChange:Z=>i("justify-content",Z),options:["flex-start","center","space-between","space-around","space-evenly","flex-end"]}),m.jsx(Xn,{label:"Align",value:n["align-items"]||"stretch",disabled:c,onChange:Z=>i("align-items",Z),options:["stretch","flex-start","center","flex-end","baseline"]})]}),m.jsx(n6,{label:"Gap",value:n.gap??"0px",disabled:c,onCommit:Z=>i("gap",Z.endsWith("px")?Z:`${Z}px`)})]})}),k&&m.jsx(Rr,{title:"Radius",icon:m.jsx(zL,{size:15}),defaultCollapsed:!0,children:m.jsx($U,{tl:p,tr:O,br:x,bl:y,disabled:c,onCommit:(Z,F)=>{const _=`${zt(F)}px`;if(Z==="all")i("border-radius",_);else{const q={tl:"border-top-left-radius",tr:"border-top-right-radius",br:"border-bottom-right-radius",bl:"border-bottom-left-radius"}[Z];i(q,_)}}})}),m.jsx(Rr,{title:"Stroke",icon:m.jsx(VL,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:Un,children:[m.jsx(rn,{label:"Width",value:nl(S),disabled:c,liveCommit:!0,onCommit:async Z=>{const F=BG(Z,{min:0,max:200,fallback:S});if(F)for(const[_,q]of WG(F,A))await i(_,q)}}),m.jsx(Xn,{label:"Style",value:A,disabled:c,onChange:async Z=>{for(const[F,_]of KG(Z,nl(S)))await i(F,_)},options:["none","solid","dashed","dotted","double","hidden","groove","ridge","inset","outset"]})]}),m.jsx(gu,{label:"Stroke color",value:C,disabled:c,onCommit:Z=>i("border-color",Z)})]})}),m.jsx(Rr,{title:"Effects",icon:m.jsx(uO,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(Xn,{label:"Shadow",value:T,disabled:c,onChange:Z=>{Z!=="custom"&&i("box-shadow",qG(Z,n["box-shadow"]))},options:["custom","none","soft","lift","glow"]}),m.jsxs("div",{className:Un,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Layer blur"}),m.jsx(xi,{value:j,min:0,max:Math.max(40,Math.ceil(j)),step:1,disabled:c,displayValue:`${zt(j)}px`,formatDisplayValue:Z=>`${zt(Z)}px`,onCommit:Z=>i("filter",kS(n.filter,"blur",Z))})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Backdrop"}),m.jsx(xi,{value:M,min:0,max:Math.max(60,Math.ceil(M)),step:1,disabled:c,displayValue:`${zt(M)}px`,formatDisplayValue:Z=>`${zt(Z)}px`,onCommit:Z=>i("backdrop-filter",kS(n["backdrop-filter"],"blur",Z))})]})]})]})}),m.jsx(Rr,{title:"Clip",icon:m.jsx(Uf,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Overflow",value:n.overflow||"visible",disabled:c,onChange:Z=>i("overflow",Z),options:["visible","hidden","clip","auto","scroll"]}),m.jsx(Xn,{label:"Mask",value:$,disabled:c,onChange:Z=>{Z!=="custom"&&i("clip-path",JG(Z,h,E))},options:["custom","none","inset","circle"]})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:"Mask inset"}),m.jsx(xi,{value:N,min:0,max:Math.max(120,Math.ceil(N)),step:1,disabled:c,displayValue:`${zt(N)}px`,formatDisplayValue:Z=>`${zt(Z)}px`,onCommit:Z=>i("clip-path",eU(Z,h))})]})]})}),m.jsx(Rr,{title:"Transparency",icon:m.jsx(k9,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(xi,{value:b,min:0,max:100,step:1,disabled:c,displayValue:`${b}%`,formatDisplayValue:Z=>`${Math.round(Z)}%`,onCommit:Z=>i("opacity",zt(Z/100))}),m.jsx(Xn,{label:"Mode",value:n["mix-blend-mode"]||"normal",disabled:c,onChange:Z=>i("mix-blend-mode",Z),options:["normal","multiply","screen","overlay","darken","lighten"]})]})}),m.jsx(Rr,{title:"Fill",icon:m.jsx(RL,{size:15}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(So,{disabled:c,value:X,onChange:K,options:[{label:"Solid",value:"Solid"},{label:"Gradient",value:"Gradient"},{label:"Image",value:"Image"}]}),X==="Solid"?m.jsx(gu,{label:"Fill color",value:n["background-color"]??"transparent",disabled:c,onCommit:Z=>i("background-color",Z)}):X==="Gradient"?m.jsx(TU,{value:D!=="none"?D:Zd(j8(n["background-color"])),fallbackColor:n["background-color"],disabled:c,onCommit:Z=>i("background-image",Z)}):m.jsx(CU,{projectId:t,sourceFile:e.sourceFile,value:I,assets:r,disabled:c,onCommit:Z=>i("background-image",Z),onImportAssets:a}),!z&&m.jsx(gu,{label:"Text color",value:n.color??"rgb(0, 0, 0)",disabled:c,onCommit:Z=>i("color",Z)})]})})]})}function OC(t){const e=t.trim().replace(/\s+/g," ");return e.length<=56?e:`${e.slice(0,55)}…`}function xC(t,e){return t.computedStyles.color||e.color||"rgb(0, 0, 0)"}function Kc(t,e,n,r){return t.computedStyles[n]||e[n]||r}const au=["100","200","300","400","500","600","700","800","900"],QU={100:"100 · Thin",200:"200 · Extra Light",300:"300 · Light",400:"400 · Regular",500:"500 · Medium",600:"600 · Semi Bold",700:"700 · Bold",800:"800 · Extra Bold",900:"900 · Black"};function ZU(t){var i;const e=document.fonts;if(!e)return au;const n=(i=t.split(",")[0])==null?void 0:i.trim().replace(/['"]/g,"");if(!n)return au;const r=[];for(const a of au)e.check(`${a} 16px "${n}"`)&&r.push(a);return r.length>0?r:au}function NU({label:t,value:e,disabled:n,autoFocus:r,onCommit:i}){const[a,l]=d.useState(e),c=d.useRef(null),u=d.useRef(null),h=d.useRef(!1),p=d.useRef(e);p.current=e,d.useEffect(()=>{h.current||l(e)},[e]),d.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]),d.useEffect(()=>{var y;r&&((y=c.current)==null||y.focus())},[r]);const O=y=>{u.current&&clearTimeout(u.current),y!==p.current&&i(y)},x=y=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{y!==p.current&&i(y)},120)};return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Jt,children:t}),m.jsx("div",{className:Bi,children:m.jsx("textarea",{ref:c,value:a,disabled:n,rows:4,onFocus:()=>{h.current=!0},onChange:y=>{l(y.target.value),x(y.target.value)},onBlur:()=>{h.current=!1,O(a)},className:"w-full resize-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})})]})}function RU({value:t,disabled:e,fontFamily:n,onCommit:r}){const i=n?ZU(n):au,a=t&&!i.includes(t)?[t,...i]:i;return m.jsx("div",{className:Bi,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:"Weight"}),m.jsx("select",{value:t,disabled:e,onChange:l=>r(l.target.value),className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:a.map(l=>m.jsx("option",{value:l,children:QU[l]??l},l))})]})})}function VU({field:t,inheritedStyles:e,disabled:n,onCommit:r}){return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Line",value:Kc(t,e,"line-height","normal"),disabled:n,options:["normal","1","1.1","1.2","1.25","1.3","1.4","1.5","1.6","1.75","2"],onChange:i=>r("line-height",SS("line-height",i))}),m.jsx(Xn,{label:"Track",value:Kc(t,e,"letter-spacing","0px"),disabled:n,options:["0px","-0.05em","-0.04em","-0.03em","-0.02em","-0.01em","0em","0.01em","0.02em","0.03em","0.05em","0.1em","0.15em","0.2em"],onChange:i=>r("letter-spacing",SS("letter-spacing",i))})]}),m.jsxs("div",{className:Un,children:[m.jsx(Xn,{label:"Align",value:Kc(t,e,"text-align","start"),disabled:n,onChange:i=>r("text-align",i),options:["start","left","center","right","justify","end"]}),m.jsx(Xn,{label:"Case",value:Kc(t,e,"text-transform","none"),disabled:n,onChange:i=>r("text-transform",i),options:["none","uppercase","lowercase","capitalize"]})]}),m.jsx(Xn,{label:"Style",value:Kc(t,e,"font-style","normal"),disabled:n,onChange:i=>r("font-style",i),options:["normal","italic"]})]})}function ZS({field:t,styles:e,fontAssets:n,onImportFonts:r,showRemove:i,onSetText:a,onSetTextFieldStyle:l,onRemoveTextField:c}){return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:i?"flex min-w-0 items-center justify-between gap-2":"min-w-0",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:OC(t.value)||"Text"}),m.jsx("div",{className:"text-[10px] text-neutral-500",children:t.tagName})]}),i&&m.jsx("button",{type:"button",onClick:()=>c(t.key),className:"inline-flex h-7 flex-shrink-0 items-center rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:"Remove"})]}),m.jsx(NU,{label:"Content",value:t.value,disabled:!1,autoFocus:i,onCommit:u=>a(u,t.key)},t.key),m.jsx(gu,{label:"Text color",value:xC(t,e),disabled:!1,onCommit:u=>l(t.key,"color",u)}),m.jsxs("div",{className:Un,children:[m.jsx(rn,{label:"Size",value:t.computedStyles["font-size"]||e["font-size"]||"16px",disabled:!1,liveCommit:!0,onCommit:u=>l(t.key,"font-size",u)}),m.jsx(RU,{value:t.computedStyles["font-weight"]||e["font-weight"]||"400",fontFamily:t.computedStyles["font-family"]||e["font-family"],disabled:!1,onCommit:u=>l(t.key,"font-weight",u)})]}),m.jsx(hU,{value:t.computedStyles["font-family"]||e["font-family"]||"inherit",disabled:!1,importedFonts:n,onImportFonts:r,onCommit:u=>l(t.key,"font-family",u)}),m.jsx(VU,{field:t,inheritedStyles:e,disabled:!1,onCommit:(u,h)=>l(t.key,u,h)})]})}function LU({element:t,styles:e,fontAssets:n,onImportFonts:r,onSetText:i,onSetTextFieldStyle:a,onAddTextField:l,onRemoveTextField:c}){var y;const u=sO(t),[h,p]=d.useState(((y=t.textFields[0])==null?void 0:y.key)??null);if(d.useEffect(()=>{const b=t.textFields;p(S=>{var k;return S&&b.some(A=>A.key===S)?S:((k=b[0])==null?void 0:k.key)??null})},[t.id,t.selector,t.textFields]),!u)return null;const O=t.textFields,x=O.find(b=>b.key===h)??O[0];return x?O.length===1?m.jsx(Rr,{title:"Text",icon:m.jsx(Zb,{size:15}),defaultCollapsed:!0,children:m.jsx(ZS,{field:x,styles:e,fontAssets:n,onImportFonts:r,showRemove:!1,onSetText:i,onSetTextFieldStyle:a,onRemoveTextField:c})}):m.jsx(Rr,{title:"Text",icon:m.jsx(Zb,{size:15}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid gap-1.5",children:[m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[m.jsx("span",{className:Jt,children:"Text layers"}),m.jsxs("button",{type:"button",onClick:()=>{Promise.resolve(l(x.key)).then(b=>{b&&p(b)})},className:"inline-flex h-7 max-w-full items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:[m.jsx(cO,{size:12,className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:"Add text"})]})]}),m.jsx("div",{className:"grid gap-2",children:O.map((b,S)=>{const k=b.key===x.key;return m.jsx("button",{type:"button",onClick:()=>p(b.key),className:`min-w-0 w-full rounded-xl border px-3 py-2 text-left transition-colors ${k?"border-studio-accent/50 bg-studio-accent/10":"border-neutral-800 bg-neutral-900/80 hover:border-neutral-700 hover:bg-neutral-900"}`,children:m.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{className:"h-4 w-4 flex-shrink-0 rounded border border-neutral-700 bg-neutral-950",style:{backgroundColor:xC(b,e)}}),m.jsx("span",{className:"min-w-0 truncate text-[11px] font-medium text-neutral-100",children:OC(b.value)||`Text ${S+1}`})]}),m.jsx("span",{className:"flex-shrink-0 rounded-md border border-neutral-700 bg-neutral-950 px-1.5 py-0.5 text-[10px] text-neutral-500",children:b.tagName})]})},b.key)})})]}),m.jsx(ZS,{field:x,styles:e,fontAssets:n,onImportFonts:r,showRemove:!0,onSetText:i,onSetTextFieldStyle:a,onRemoveTextField:c})]})}):null}const NS=["x","y","scale","scaleX","scaleY","rotation","skewX","skewY","z","rotationX","rotationY","rotationZ","perspective","transformOrigin","opacity","visibility","autoAlpha","width","height","color","backgroundColor","borderColor","borderRadius","fontSize","letterSpacing","filter","clipPath","innerText"],_U=["none","power1.in","power1.out","power1.inOut","power2.in","power2.out","power2.inOut","power3.in","power3.out","power3.inOut","power4.in","power4.out","power4.inOut","back.in","back.out","back.inOut","elastic.in","elastic.out","elastic.inOut","bounce.in","bounce.out","bounce.inOut","expo.in","expo.out","expo.inOut","spring-gentle","spring-bouncy","spring-stiff","spring-wobbly","spring-heavy","steps(1)"];function RS(t,e){const n=M7[t]??"";return T7.has(t)?`${Math.round(Number(e)*100)}${n}`:`${e}${n}`}function DU(t){const e=t.ease??"none",n=sl[e]??e,r=Object.entries(t.properties),i=t.targetSelector,a=t.duration??0,l=t.position,c=typeof l=="number"?parseFloat(l.toFixed(3)):l,u=r.map(([p,O])=>`${(ms[p]??p).toLowerCase()} to ${RS(p,O)}`),h=u.length>0?u.join(", "):"no properties yet";if(t.method==="set")return`At ${c}s, instantly set ${i}'s ${h}.`;if(t.method==="from")return`Starting at ${c}s, over ${a}s, ${i} enters from ${h} using a ${n.toLowerCase()} curve.`;if(t.method==="fromTo"){const O=Object.entries(t.fromProperties??{}).map(([y,b])=>`${(ms[y]??y).toLowerCase()} ${RS(y,b)}`),x=O.length>0?O.join(", "):"—";return`Starting at ${c}s, over ${a}s, ${i} animates from [${x}] to [${h}] using a ${n.toLowerCase()} curve.`}return`Starting at ${c}s, over ${a}s, animate ${i}'s ${h} using a ${n.toLowerCase()} curve.`}const HU=["none","power2.out","power2.in","power2.inOut","power3.out","back.out","expo.out","elastic.out"];function XU({curve:t,active:e}){const[n,r,i,a]=t,l=24,c=3,u=l-c*2,h=x=>c+u*x,p=x=>l-c-u*x,O=`M${c},${l-c} C${h(n)},${p(r)} ${h(i)},${p(a)} ${l-c},${c}`;return m.jsx("svg",{width:l,height:l,viewBox:`0 0 ${l} ${l}`,children:m.jsx("path",{d:O,fill:"none",stroke:e?"#3CE6AC":"#737373",strokeWidth:"1.5",strokeLinecap:"round"})})}const zU=d.memo(function({currentEase:e,onSelect:n}){return m.jsx("div",{className:"grid grid-cols-4 gap-1 mb-2",children:HU.map(r=>{const i=C7[r];if(!i)return null;const a=e===r;return m.jsxs("button",{type:"button",onClick:()=>n(r),className:`flex flex-col items-center gap-0.5 rounded-md p-1 transition-colors ${a?"bg-panel-accent/10 ring-1 ring-panel-accent/30":"hover:bg-neutral-800"}`,title:sl[r]??r,children:[m.jsx(XU,{curve:i,active:a}),m.jsx("span",{className:`text-[8px] leading-none ${a?"text-panel-accent":"text-neutral-500"}`,children:(sl[r]??r).split(" ").slice(0,2).join(" ")})]},r)})})});function wf(t){return Math.round(t*100)/100}function FU({ease:t,duration:e,onCustomEaseCommit:n}){const r=t.startsWith("custom("),i=C7[t],a=r?HP(t):null,l=r&&a?[a.x1,a.y1,a.x2,a.y2]:i??null,[c,u]=d.useState(null),[h,p]=d.useState(null),O=d.useRef(null),x=d.useRef(null),y=d.useRef(0),b=d.useCallback(()=>{const R=performance.now(),P=1e3,L=V=>{const W=Math.min((V-R)/P,1);p(W),W<1?y.current=requestAnimationFrame(L):setTimeout(()=>p(null),400)};cancelAnimationFrame(y.current),y.current=requestAnimationFrame(L)},[]),S=c??l;if(!S)return null;const[k,A,C,T]=S,j=200,M=100,E=14,$=j-E*2,N=M-E*2,D=(R,P)=>({x:E+$*R,y:M-E-N*P}),z=`M${E},${M-E} C${D(k,A).x},${D(k,A).y} ${D(C,T).x},${D(C,T).y} ${j-E},${E}`;let B=E,X=M-E;if(h!==null){const R=h,P=1-R;B=E+$*(P*P*P*0+3*P*P*R*k+3*P*R*R*C+R*R*R),X=M-E-N*(P*P*P*0+3*P*P*R*A+3*P*R*R*T+R*R*R)}const U=(R,P)=>{P.preventDefault(),P.stopPropagation(),O.current=R,P.target.setPointerCapture(P.pointerId),c||u([k,A,C,T])},I=R=>{if(!O.current||!x.current)return;R.preventDefault();const P=x.current.getBoundingClientRect(),L=(R.clientX-P.left)/P.width*j,V=(R.clientY-P.top)/P.height*M,W=Math.max(0,Math.min(1,(L-E)/$)),ee=Math.max(-1,Math.min(2,(M-E-V)/N)),ue=c??[k,A,C,T],ae=O.current==="p1"?[wf(W),wf(ee),ue[2],ue[3]]:[ue[0],ue[1],wf(W),wf(ee)];u(ae)},K=()=>{if(!O.current||!c)return;O.current=null;const R=`M0,0 C${c[0]},${c[1]} ${c[2]},${c[3]} 1,1`;n(`custom(${R})`),u(null)},Z=D(k,A),F=D(C,T),_=D(0,0),q=D(1,1),G=r?"Custom curve":sl[t]??t;return m.jsxs("div",{className:"rounded-lg bg-neutral-900/50 p-2",children:[m.jsx(zU,{currentEase:t,onSelect:R=>n(R)}),m.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[m.jsx("span",{className:"text-[10px] font-medium text-neutral-500",children:"Speed curve"}),m.jsx("button",{type:"button",onClick:b,className:"rounded px-1.5 py-0.5 text-[10px] font-medium text-panel-accent transition-colors hover:bg-panel-accent/10",children:h!==null?"Playing…":"Preview"})]}),m.jsx("div",{className:"overflow-hidden rounded pt-[72px] -mt-[72px]",style:{aspectRatio:`${j}/${M}`},children:m.jsxs("svg",{ref:x,width:"100%",height:"100%",viewBox:`0 0 ${j} ${M}`,preserveAspectRatio:"none",style:{overflow:"visible"},className:"touch-none select-none",onPointerMove:I,onPointerUp:K,onPointerCancel:K,children:[m.jsx("line",{x1:E,y1:M-E,x2:j-E,y2:M-E,stroke:"white",strokeOpacity:"0.06",strokeWidth:"0.5"}),m.jsx("line",{x1:E,y1:E,x2:E,y2:M-E,stroke:"white",strokeOpacity:"0.06",strokeWidth:"0.5"}),m.jsx("line",{x1:_.x,y1:_.y,x2:Z.x,y2:Z.y,stroke:"rgba(52,211,153,0.25)",strokeWidth:"1"}),m.jsx("line",{x1:q.x,y1:q.y,x2:F.x,y2:F.y,stroke:"rgba(45,212,191,0.25)",strokeWidth:"1"}),m.jsx("path",{d:z,fill:"none",stroke:"#3CE6AC",strokeWidth:"2",strokeLinecap:"round"}),h!==null&&m.jsx("circle",{cx:B,cy:X,r:"4",fill:"#3CE6AC"}),m.jsx("circle",{cx:Z.x,cy:Z.y,r:"5",fill:"#0a0a1a",stroke:"#3CE6AC",strokeWidth:"2",className:"cursor-grab active:cursor-grabbing",onPointerDown:R=>U("p1",R)}),m.jsx("circle",{cx:F.x,cy:F.y,r:"5",fill:"#0a0a1a",stroke:"#3CE6AC",strokeWidth:"2",className:"cursor-grab active:cursor-grabbing",onPointerDown:R=>U("p2",R)}),e!=null&&e>0&&m.jsxs(m.Fragment,{children:[m.jsx("text",{x:E,y:M-1,textAnchor:"start",className:"fill-neutral-600 text-[8px]",children:"0s"}),m.jsxs("text",{x:E+$/2,y:M-1,textAnchor:"middle",className:"fill-neutral-600 text-[8px]",children:[(e/2).toFixed(1),"s"]}),m.jsxs("text",{x:j-E,y:M-1,textAnchor:"end",className:"fill-neutral-600 text-[8px]",children:[e,"s"]})]})]})}),m.jsx("p",{className:"mt-1 text-center text-[10px] text-neutral-500",children:G})]})}const hi={accent:"#3CE6AC",borderInput:"#27272A",textMuted:"#52525B",white:"#FAFAFA"},BU=d.memo(function({arcPath:e,segmentCount:n,onToggle:r,onUpdateSegment:i,onToggleAutoRotate:a,disabled:l}){const c=d.useCallback(()=>{r(!e.enabled)},[e.enabled,r]),u=d.useCallback(()=>{a(!e.autoRotate)},[e.autoRotate,a]);return n<1?m.jsx("div",{className:"rounded-md border border-neutral-800 bg-neutral-900/50 px-3 py-2",children:m.jsx("p",{className:"text-[11px] text-neutral-500",children:"Add at least 2 position keyframes to enable arc motion."})}):m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Jt,children:"Arc Motion"}),m.jsx("button",{type:"button",onClick:c,disabled:l,className:"relative rounded-full transition-all duration-150",style:{width:28,height:16,background:e.enabled?hi.accent:hi.borderInput},title:e.enabled?"Disable arc motion":"Enable arc motion",children:m.jsx("span",{className:"absolute top-[2px] left-0 rounded-full transition-transform duration-150",style:{width:12,height:12,background:e.enabled?hi.white:hi.textMuted,transform:e.enabled?"translateX(14px)":"translateX(2px)"}})})]}),e.enabled&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Jt,children:"Auto-Rotate"}),m.jsx("button",{type:"button",onClick:u,disabled:l,className:"relative rounded-full transition-all duration-150",style:{width:28,height:16,background:e.autoRotate?hi.accent:"#27272A"},title:e.autoRotate?"Disable auto-rotate along path":"Rotate element to follow path tangent",children:m.jsx("span",{className:"absolute top-[2px] left-0 rounded-full transition-transform duration-150",style:{width:12,height:12,background:e.autoRotate?hi.white:hi.textMuted,transform:e.autoRotate?"translateX(14px)":"translateX(2px)"}})})]}),e.segments.map((h,p)=>m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Jt,children:n===1?"Curviness":`Segment ${p+1}`}),h.cp1&&h.cp2&&m.jsx("button",{type:"button",onClick:()=>i(p,{cp1:void 0,cp2:void 0}),className:"text-[9px] font-medium text-neutral-500 transition-colors hover:text-neutral-300",title:"Reset to auto-generated control points",children:"Reset"})]}),m.jsx(xi,{value:h.curviness,min:0,max:3,step:.1,disabled:l,displayValue:h.curviness.toFixed(1),formatDisplayValue:O=>O.toFixed(1),onCommit:O=>i(p,{curviness:O})})]},p))]})]})}),P8=new Set(["visibility"]),YU=new Set(["filter","clipPath"]),IU=[{label:"Blur",value:"blur(4px)"},{label:"Bright",value:"brightness(1.5)"},{label:"Gray",value:"grayscale(1)"},{label:"None",value:"none"}],qU=[{label:"Circle",value:"circle(50% at 50% 50%)"},{label:"Inset",value:"inset(10%)"},{label:"None",value:"none"}];function yC(t){return T7.has(t)}function GU(t,e){return yC(t)?String(Math.round(Math.max(0,Math.min(1,Number(e)))*100)):String(e)}function UU(t,e){if(yC(t))return String(L5(t,Number(e)/100));const n=Number(e);return!Number.isNaN(n)&&E7[t]?String(L5(t,n)):e}function z2({onClick:t,title:e}){return m.jsx("button",{type:"button",onClick:t,className:"flex-shrink-0 rounded p-0.5 text-neutral-600 transition-colors hover:bg-neutral-800 hover:text-red-400",title:e,children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:m.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})}function VS({prop:t,val:e,onCommit:n,onRemove:r,removeTitle:i}){if(P8.has(t)){const a=e==="visible"||e===1;return m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2 px-2 py-1 rounded-lg bg-neutral-900 border border-neutral-800",children:[m.jsx("span",{className:"flex-1 text-[11px] font-medium text-neutral-500",children:ms[t]??t}),m.jsx("button",{type:"button",onClick:()=>n(a?"hidden":"visible"),className:"flex-shrink-0 rounded-full transition-all duration-150 relative",style:{width:28,height:16,background:a?hi.accent:hi.borderInput},title:a?"Visible — click to hide":"Hidden — click to show",children:m.jsx("span",{className:"absolute top-[2px] left-0 rounded-full transition-transform duration-150",style:{width:12,height:12,background:a?hi.white:hi.textMuted,transform:a?"translateX(14px)":"translateX(2px)"}})})]}),m.jsx(z2,{onClick:r,title:i})]})}if(YU.has(t)){const a=t==="filter"?IU:t==="clipPath"?qU:[];return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2 px-2 py-1 rounded-lg bg-neutral-900 border border-neutral-800",children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:ms[t]??t}),m.jsx("input",{type:"text",defaultValue:String(e),className:"flex-1 bg-transparent text-[11px] text-neutral-200 outline-none",onBlur:l=>n(l.currentTarget.value),onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()}})]}),m.jsx(z2,{onClick:r,title:i})]}),a.length>0&&m.jsx("div",{className:"flex gap-1 pl-1",children:a.map(l=>m.jsx("button",{type:"button",onClick:()=>n(l.value),className:"px-1.5 py-0.5 rounded text-[9px] font-medium text-neutral-500 bg-neutral-800/50 hover:bg-neutral-800 hover:text-neutral-300 transition-colors",children:l.label},l.value))})]})}return m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"min-w-0 flex-1",children:m.jsx(rn,{label:ms[t]??t,value:GU(t,e),suffix:M7[t],tooltip:DP[t],scrub:!0,liveCommit:!0,onCommit:a=>n(UU(t,a))})}),m.jsx(z2,{onClick:r,title:i})]})}function LS({adding:t,available:e,addLabel:n,addTitle:r,onAdd:i,onOpen:a,onClose:l,buttonClassName:c}){return t&&e.length>0?m.jsxs("select",{autoFocus:!0,className:"min-w-0 rounded-lg border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-100 outline-none",defaultValue:"",onChange:u=>{u.target.value&&i(u.target.value),l()},onBlur:l,children:[m.jsx("option",{value:"",disabled:!0,children:"Choose property…"}),e.map(u=>m.jsx("option",{value:u,children:ms[u]??u},u))]}):e.length===0?null:m.jsx("button",{type:"button",onClick:a,className:c,title:r,children:n})}function F2(t){const e=Number(t);return Number.isFinite(e)?e:t}const WU=d.memo(function({animation:e,defaultExpanded:n,onUpdateProperty:r,onUpdateMeta:i,onDeleteAnimation:a,onAddProperty:l,onRemoveProperty:c,onUpdateFromProperty:u,onAddFromProperty:h,onRemoveFromProperty:p,onLivePreview:O,onLivePreviewEnd:x,onSetArcPath:y,onUpdateArcSegment:b}){var R,P,L;const[S,k]=d.useState(n),[A,C]=d.useState(!1),[T,j]=d.useState(!1),M=d.useMemo(()=>new Set(Object.keys(e.properties)),[e.properties]),E=d.useMemo(()=>NS.filter(V=>!M.has(V)&&(e.method==="set"||!P8.has(V))),[M,e.method]),$=d.useMemo(()=>new Set(Object.keys(e.fromProperties??{})),[e.fromProperties]),N=d.useMemo(()=>NS.filter(V=>!$.has(V)&&!P8.has(V)),[$]),D=d.useCallback((V,W)=>{const ee=F2(W);r(e.id,V,ee),x==null||x()},[e.id,r,x]),z=d.useCallback((V,W)=>{O==null||O(V,F2(W))},[O]),B=d.useCallback((V,W)=>{const ee=F2(W);u==null||u(e.id,V,ee),x==null||x()},[e.id,u,x]),X=d.useCallback(V=>{const W=Number(V);Number.isFinite(W)&&W>=0&&i(e.id,{duration:Math.max(0,W)})},[e.id,i]),U=d.useCallback(V=>{const W=Number(V);Number.isFinite(W)&&W>=0&&i(e.id,{position:Math.max(0,W)})},[e.id,i]),[I,K]=d.useState(!1),Z=_P[e.method]??e.method,F=e.ease??((R=e.keyframes)==null?void 0:R.easeEach)??"none",_=F.startsWith("custom(")?"Custom curve":sl[F]??F,q=typeof e.position=="number"?e.position+(e.duration??0):e.position,G=d.useMemo(()=>DU(e),[e]);return m.jsxs("div",{className:"border-b border-neutral-800 pb-3",children:[m.jsxs("button",{type:"button",onClick:()=>k(V=>!V),className:"flex w-full items-center gap-2 py-1.5",children:[m.jsx("span",{className:"rounded bg-panel-accent/10 px-1.5 py-0.5 text-[10px] font-semibold text-panel-accent",title:A7[e.method],children:Z}),m.jsxs("span",{className:"text-[11px] font-medium text-neutral-400",title:"When this effect plays",children:[typeof e.position=="number"?`${parseFloat(e.position.toFixed(3))}s`:e.position," ","– ",typeof q=="number"?`${parseFloat(q.toFixed(3))}s`:q]}),m.jsx("span",{className:"ml-auto text-[10px] text-neutral-500",title:F,children:_}),m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",className:`flex-shrink-0 text-neutral-500 transition-transform ${S?"":"-rotate-90"}`,children:m.jsx("path",{d:"M2 3l3 4 3-4z"})})]}),S&&m.jsx("div",{className:"pt-2",children:m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsxs("div",{className:"flex-1",children:[m.jsx("p",{className:"text-[10px] leading-relaxed text-neutral-400 italic",children:G}),e.keyframes&&m.jsxs("p",{className:"mt-1 text-[9px] text-neutral-500",children:[m.jsx("span",{className:"inline-block w-2 h-2 mr-1 align-middle",style:{background:"currentColor",clipPath:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"}}),"Keyframed — edit values in the Layout panel above"]})]}),m.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(G),K(!0),setTimeout(()=>K(!1),1500)},className:"flex-shrink-0 rounded px-1.5 py-0.5 text-[9px] font-medium text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",title:"Copy description to clipboard — paste into agent prompts",children:I?"Copied":"Copy"})]}),m.jsxs("div",{className:Un,children:[e.method!=="set"&&m.jsx(rn,{label:"Length",value:String(Math.max(0,e.duration??0)),suffix:"s",tooltip:"How long this effect lasts",onCommit:X}),m.jsx(rn,{label:"Starts at",value:typeof e.position=="string"?e.position:String(parseFloat(Math.max(0,e.position).toFixed(3))),suffix:typeof e.position=="number"?"s":void 0,tooltip:"When this effect begins on the timeline",onCommit:U})]}),e.method!=="set"&&m.jsxs(m.Fragment,{children:[m.jsx(Xn,{label:"Speed",value:F.startsWith("custom(")?"custom":F,options:[..._U,"custom"],onChange:V=>{if(V==="custom"){const W=Mu(F!=="none"?F:"power2.out"),ee=`M0,0 C${W.x1},${W.y1} ${W.x2},${W.y2} 1,1`;i(e.id,{ease:`custom(${ee})`})}else i(e.id,{ease:V})}}),m.jsx(FU,{ease:F,duration:e.duration,onCustomEaseCommit:V=>i(e.id,{ease:V})})]}),e.method==="fromTo"&&m.jsxs("div",{className:"space-y-1",children:[m.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-wider text-orange-400/70",children:"From"}),m.jsx("div",{className:"space-y-1.5",children:Object.entries(e.fromProperties??{}).map(([V,W])=>m.jsx(VS,{prop:V,val:W,onCommit:ee=>B(V,ee),onRemove:()=>p==null?void 0:p(e.id,V),removeTitle:`Remove from-${ms[V]??V}`},V))}),m.jsx("div",{className:"pt-0.5",children:m.jsx(LS,{adding:T,available:N,addLabel:"+ From property",addTitle:"Add a from-state property",onAdd:V=>h==null?void 0:h(e.id,V),onOpen:()=>j(!0),onClose:()=>j(!1),buttonClassName:"text-[11px] font-medium text-orange-400/70 transition-colors hover:text-orange-300"})})]}),e.method==="fromTo"&&Object.keys(e.properties).length>0&&m.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-wider text-panel-accent/70",children:"To"}),Object.keys(e.properties).length>0&&m.jsx("div",{className:"space-y-1.5",children:Object.entries(e.properties).map(([V,W])=>m.jsx(VS,{prop:V,val:W,onCommit:ee=>{z(V,ee),D(V,ee)},onRemove:()=>c(e.id,V),removeTitle:`Remove ${ms[V]??V}`},V))}),y&&(e.properties.x!=null||e.properties.y!=null||e.keyframes)&&m.jsx("div",{className:"border-t border-neutral-800 pt-3",children:m.jsx(BU,{arcPath:e.arcPath??{enabled:!1,autoRotate:!1,segments:[]},segmentCount:Math.max(e.properties.x!=null||e.properties.y!=null?1:0,(((L=(P=e.keyframes)==null?void 0:P.keyframes)==null?void 0:L.length)??0)-1),onToggle:V=>{var W;return y(e.id,{enabled:V,segments:(W=e.arcPath)==null?void 0:W.segments})},onUpdateSegment:(V,W)=>b==null?void 0:b(e.id,V,W),onToggleAutoRotate:V=>{var W;return y(e.id,{enabled:!0,autoRotate:V,segments:(W=e.arcPath)==null?void 0:W.segments})}})}),m.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[m.jsx(LS,{adding:A,available:E,addLabel:"+ Effect",addTitle:"Add another animated property to this effect",onAdd:V=>l(e.id,V),onOpen:()=>C(!0),onClose:()=>C(!1),buttonClassName:"text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200"}),m.jsx("button",{type:"button",onClick:()=>a(e.id),className:"ml-auto text-[11px] font-medium text-red-400 transition-colors hover:text-red-300",title:"Remove this animation",children:"Remove"})]})]})})]})}),KU=d.memo(function({animations:e,multipleTimelines:n,unsupportedTimelinePattern:r,onUpdateProperty:i,onUpdateMeta:a,onDeleteAnimation:l,onAddProperty:c,onRemoveProperty:u,onUpdateFromProperty:h,onAddFromProperty:p,onRemoveFromProperty:O,onAddAnimation:x,onLivePreview:y,onLivePreviewEnd:b,onSetArcPath:S,onUpdateArcSegment:k}){const[A,C]=d.useState(!1);return m.jsxs(Rr,{title:"Animation",icon:m.jsx(A9,{size:15}),children:[n&&m.jsx("p",{className:"mb-2 rounded-lg bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-400",children:"This file has multiple GSAP timelines. Animation editing is disabled to prevent data loss — consolidate into a single timeline to enable editing."}),r&&m.jsx("p",{className:"mb-2 rounded-lg bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-400",children:"This composition uses a timeline assignment pattern (window.__timelines[...]) that the editor doesn't support. Use a variable declaration (const tl = gsap.timeline()) to enable editing."}),n||r?null:m.jsxs("div",{className:"space-y-2",children:[e.map((T,j)=>m.jsx(WU,{animation:T,defaultExpanded:j===0,onUpdateProperty:i,onUpdateMeta:a,onDeleteAnimation:l,onAddProperty:c,onRemoveProperty:u,onUpdateFromProperty:h,onAddFromProperty:p,onRemoveFromProperty:O,onLivePreview:y,onLivePreviewEnd:b,onSetArcPath:S,onUpdateArcSegment:k},T.id)),m.jsx("div",{className:"relative pt-1",children:A?m.jsxs("div",{className:"flex gap-1.5",children:[XP.map(T=>m.jsx("button",{type:"button",title:A7[T],onClick:()=>{x(T),C(!1)},className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 py-1.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:zP[T]??T},T)),m.jsx("button",{type:"button",onClick:()=>C(!1),className:"px-1.5 text-[11px] text-neutral-500 hover:text-neutral-300",children:"Cancel"})]}):m.jsx("button",{type:"button",onClick:()=>C(!0),className:"text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200",title:"Add a new animation effect to this element",children:"+ Add effect"})})]})]})}),JU=d.memo(function({state:e,onClick:n,title:r,size:i=10,isHold:a=!1}){const l=e==="active",c=e==="ghost"?.25:e==="inactive"?.6:1,u=e==="active"?"#3CE6AC":"#a3a3a3";return m.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),n()},className:"flex-shrink-0 p-0.5 transition-opacity hover:opacity-100",style:{color:u,opacity:c},title:r,children:m.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",children:a?m.jsx("rect",{x:"2",y:"2",width:"6",height:"6",rx:"0.5",fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.2"}):m.jsx("rect",{x:"5",y:"0.7",width:"6",height:"6",rx:"1",transform:"rotate(45 5 0.7)",fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.2"})})})}),B2=.5;function eW({disabled:t}){return m.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",style:{opacity:t?.25:1},children:m.jsx("path",{d:"M5 1L1 5L5 9",stroke:"#a3a3a3",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function tW({disabled:t}){return m.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",style:{opacity:t?.25:1},children:m.jsx("path",{d:"M1 1L5 5L1 9",stroke:"#a3a3a3",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const Us=d.memo(function({property:e,keyframes:n,currentPercentage:r,onSeek:i,onAddKeyframe:a,onRemoveKeyframe:l,onConvertToKeyframes:c}){const u=(n==null?void 0:n.filter(b=>e in b.properties))??[],h=u.filter(b=>b.percentage<r-B2).at(-1)??null,p=u.find(b=>b.percentage>r+B2)??null,O=u.find(b=>Math.abs(b.percentage-r)<=B2)??null;let x;!n||n.length===0?x="ghost":O?x="active":u.length>0?x="inactive":x="ghost";const y=()=>{x==="ghost"?c():x==="active"?l(r):a(r)};return m.jsxs("div",{className:"flex h-5 items-center gap-0.5",children:[m.jsx("button",{type:"button",disabled:!h,onClick:()=>h&&i(h.percentage),className:"flex h-5 w-3 items-center justify-center disabled:cursor-default",children:m.jsx(eW,{disabled:!h})}),m.jsx(JU,{state:x,onClick:y,size:9,title:x==="ghost"?`Convert ${e} to keyframes`:x==="active"?`Remove ${e} keyframe`:`Add ${e} keyframe`}),m.jsx("button",{type:"button",disabled:!p,onClick:()=>p&&i(p.percentage),className:"flex h-5 w-3 items-center justify-center disabled:cursor-default",children:m.jsx(tW,{disabled:!p})})]})});function nW({gsapRuntimeValues:t,gsapAnimId:e,gsapKeyframes:n,currentPct:r,elStart:i,elDuration:a,element:l,onCommitAnimatedProperty:c,onSeekToTime:u,onRemoveKeyframe:h,onConvertToKeyframes:p}){return m.jsxs("div",{className:"mt-3 border-t border-neutral-800/40 pt-3",children:[m.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-neutral-600",children:"3D Transform"}),m.jsxs("div",{className:Un,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"Z",value:nl(t.z??0),scrub:!0,onCommit:O=>{const x=ma(O);x!=null&&c&&c(l,"z",x)}})}),mi&&(e||c)&&m.jsx(Us,{property:"z",keyframes:n,currentPercentage:r,onSeek:O=>u==null?void 0:u(i+O/100*a),onAddKeyframe:()=>{c&&c(l,"z",(t==null?void 0:t.z)??0)},onRemoveKeyframe:O=>e&&(h==null?void 0:h(e,O)),onConvertToKeyframes:()=>e&&(p==null?void 0:p(e))})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"Scale",value:String(t.scale??1),scrub:!0,onCommit:O=>{const x=Number.parseFloat(O);Number.isFinite(x)&&c&&c(l,"scale",x)}})}),mi&&(e||c)&&m.jsx(Us,{property:"scale",keyframes:n,currentPercentage:r,onSeek:O=>u==null?void 0:u(i+O/100*a),onAddKeyframe:()=>{c&&c(l,"scale",(t==null?void 0:t.scale)??1)},onRemoveKeyframe:O=>e&&(h==null?void 0:h(e,O)),onConvertToKeyframes:()=>e&&(p==null?void 0:p(e))})]}),m.jsx(rn,{label:"RotX",value:`${t.rotationX??0}°`,onCommit:O=>{const x=Number.parseFloat(O.replace("°",""));Number.isFinite(x)&&c&&c(l,"rotationX",x)}}),m.jsx(rn,{label:"RotY",value:`${t.rotationY??0}°`,onCommit:O=>{const x=Number.parseFloat(O.replace("°",""));Number.isFinite(x)&&c&&c(l,"rotationY",x)}})]})]})}function Y2(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function I2(t){const e=t.replace(/s$/i,"").trim(),n=Number.parseFloat(e);return Number.isFinite(n)&&n>=0?n:null}function rW({element:t,onSetAttribute:e}){const n=Number.parseFloat(t.dataAttributes.start??"0")||0,r=Number.parseFloat(t.dataAttributes.duration??t.dataAttributes["hf-authored-duration"]??"0")||0,i=n+r,a=u=>{const h=I2(u);h!=null&&e("start",h.toFixed(2))},l=u=>{const h=I2(u);h==null||h<=0||e("duration",h.toFixed(2))},c=u=>{const h=I2(u);h==null||h<=n||e("duration",(h-n).toFixed(2))};return m.jsxs(Rr,{title:"Timing",icon:m.jsx(QL,{size:15}),children:[m.jsxs("div",{className:Un,children:[m.jsx(rn,{label:"Start",value:Y2(n),onCommit:a}),m.jsx(rn,{label:"End",value:Y2(i),onCommit:c})]}),m.jsx("div",{className:"mt-3",children:m.jsx(rn,{label:"Duration",value:Y2(r),onCommit:l})})]})}const iW=d.memo(function({projectId:e,projectDir:n,assets:r,element:i,multiSelectCount:a=0,copiedAgentPrompt:l,onClearSelection:c,onSetStyle:u,onSetAttribute:h,onSetHtmlAttribute:p,onSetManualOffset:O,onSetManualSize:x,onSetManualRotation:y,onSetText:b,onSetTextFieldStyle:S,onAddTextField:k,onRemoveTextField:A,onAskAgent:C,onImportAssets:T,fontAssets:j=[],onImportFonts:M,previewIframeRef:E,gsapAnimations:$=[],gsapMultipleTimelines:N,gsapUnsupportedTimelinePattern:D,onUpdateGsapProperty:z,onUpdateGsapMeta:B,onDeleteGsapAnimation:X,onAddGsapProperty:U,onRemoveGsapProperty:I,onUpdateGsapFromProperty:K,onAddGsapFromProperty:Z,onRemoveGsapFromProperty:F,onAddGsapAnimation:_,onSetArcPath:q,onUpdateArcSegment:G,onAddKeyframe:R,onRemoveKeyframe:P,onConvertToKeyframes:L,onCommitAnimatedProperty:V,onSeekToTime:W,recordingState:ee,recordingDuration:ue,onToggleRecording:ae}){var Fn,ni,ri,ii;const Y=(i==null?void 0:i.computedStyles)??FG,{showToast:re}=hl(),[he,xe]=d.useState(!1),ke=d.useRef(void 0),be=oe(Pe=>Pe.currentTime),Se=oe(Pe=>Pe.isPlaying),Ve=d.useRef(be),[,Te]=d.useState(0);d.useEffect(()=>{if(!Se)return;let Pe=0;const jt=pr.subscribe(Nt=>{Ve.current=Nt,Pe||(Pe=setTimeout(()=>{Pe=0,Te(nn=>nn+1)},33))});return()=>{jt(),Pe&&clearTimeout(Pe)}},[Se]);const Ze=Se?Ve.current:be,Xe=(i==null?void 0:i.id)??(i==null?void 0:i.selector)??"",ze=oe(Pe=>Pe.keyframeCache.get(Xe));if(!i)return m.jsx("div",{className:"flex h-full flex-col bg-neutral-900",children:m.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-6 text-center",children:a>1?m.jsxs(m.Fragment,{children:[m.jsx(Uf,{size:18,className:"mb-3 text-neutral-600"}),m.jsxs("p",{className:"text-sm font-medium text-neutral-200",children:[a," elements selected"]}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"Select a single element to edit its properties. Click an element in the preview or use the timeline layer panel."})]}):m.jsxs(m.Fragment,{children:[m.jsx(k9,{size:18,className:"mb-3 text-neutral-600"}),m.jsx("p",{className:"text-sm font-medium text-neutral-200",children:"Select an element in the preview."}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"The inspector is tuned for element edits with safer geometry controls, color picking, and cleaner grouped layer controls."})]})})});const et=!i.capabilities.canApplyManualOffset,Ot=!i.capabilities.canApplyManualSize,He=i.id?`#${i.id}`:i.selector,ct=i.capabilities.canEditStyles,yt=Sg(i.element),Oe=Yf(i.element),Ge=Oe.width>0?Oe.width:ma(Y.width??"")??i.boundingBox.width,Re=Oe.height>0?Oe.height:ma(Y.height??"")??i.boundingBox.height,qe=(Pe,jt)=>{const Nt=ma(jt);if(Nt==null)return;if(V&&Le){V(i,Pe,Nt);return}if(gn&&at&&R){const Jn=Math.max(0,Math.min(100,Math.round(lt*10)/10));R(at,Jn,Pe,Nt);return}if(Le){re==null||re("Cannot edit position — animation callbacks not available");return}const nn=Sg(i.element);O(i,{x:Pe==="x"?Nt:nn.x,y:Pe==="y"?Nt:nn.y})},Ie=(Pe,jt)=>{const Nt=ma(jt);if(Nt==null||Nt<=0)return;if(V&&Le){V(i,Pe,Nt);return}if(Le){re==null||re("Cannot edit size — animation callbacks not available");return}const nn=Yf(i.element),Jn=nn.width>0?nn.width:ma(Y.width??"")??i.boundingBox.width,Sn=nn.height>0?nn.height:ma(Y.height??"")??i.boundingBox.height;x(i,{width:Pe==="width"?Nt:Jn,height:Pe==="height"?Nt:Sn})},$e=Rw(i.element),ut=Pe=>{const jt=Number.parseFloat(Pe);Number.isFinite(jt)&&y(i,{angle:jt})},Ae=Number.parseFloat(((Fn=i==null?void 0:i.dataAttributes)==null?void 0:Fn.start)??"0")||0,Be=Number.parseFloat(((ni=i==null?void 0:i.dataAttributes)==null?void 0:ni.duration)??"1")||0,lt=Be>0?(Ze-Ae)/Be*100:0,ot=($==null?void 0:$.find(Pe=>Pe.keyframes))??null,gn=((ri=ot==null?void 0:ot.keyframes)==null?void 0:ri.keyframes)??null,at=(ot==null?void 0:ot.id)??((ii=$==null?void 0:$[0])==null?void 0:ii.id)??null,Le=!!(at||$.length>0),Ue=(ze==null?void 0:ze.keyframes)??gn,Mt=Pe=>W==null?void 0:W(Ae+Pe/100*Be),We=nU(at,$,i,E??{current:null}),bt=rU(We,$,i,E??{current:null}),Et=(We==null?void 0:We.x)??yt.x,It=(We==null?void 0:We.y)??yt.y,qt=(We==null?void 0:We.width)??Ge,Tn=(We==null?void 0:We.height)??Re,Zn=(We==null?void 0:We.rotation)??$e.angle;return m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-panel-bg text-panel-text-1",children:[m.jsx("div",{className:"px-4 py-3",children:m.jsxs("div",{className:"flex items-center justify-between gap-4",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[13px] font-semibold text-neutral-100",children:i.label}),m.jsx("div",{className:"mt-0.5 truncate text-[11px] text-neutral-500",children:He})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{type:"button",onClick:()=>{var Sn,Rt,ve;const Pe=i.sourceFile??"index.html";let jt=null;try{const tt=((ve=(Rt=(Sn=E==null?void 0:E.current)==null?void 0:Sn.contentDocument)==null?void 0:Rt.documentElement)==null?void 0:ve.outerHTML)??"";if(tt&&i.id){const wn=tt.indexOf(`id="${i.id}"`);wn>-1&&(jt=tt.slice(0,wn).split(`
|
|
144
|
+
`).length)}if(!jt&&i.selector){const wn=i.tagName.toLowerCase(),vr=i.selector.startsWith(".")?i.selector.slice(1).split(".")[0]:null,Yi=vr?`class="${vr}`:`<${wn}`,Ii=tt.indexOf(Yi);Ii>-1&&(jt=tt.slice(0,Ii).split(`
|
|
145
|
+
`).length)}}catch{}const Nt=jt?`${Pe}:${jt}`:Pe,nn=[`Element: ${i.label} (${He})`,`File: ${Nt}`,`Position: x=${Math.round(i.boundingBox.x)}, y=${Math.round(i.boundingBox.y)}`,`Size: ${Math.round(i.boundingBox.width)}×${Math.round(i.boundingBox.height)}`,`Tag: <${i.tagName}>`];if(i.computedStyles["z-index"]&&i.computedStyles["z-index"]!=="auto"&&nn.push(`Z-index: ${i.computedStyles["z-index"]}`),$.length>0){const tt=$[0];nn.push(`Animation: ${tt.method}() ${tt.duration}s at ${tt.position}s, ease: ${tt.ease??"default"}`);const wn=Object.entries(tt.properties).map(([vr,Yi])=>`${vr}: ${Yi}`).join(", ");wn&&nn.push(`Properties: ${wn}`)}const Jn=nn.join(`
|
|
146
|
+
`);navigator.clipboard.writeText(Jn),re(`Copied element info for ${i.label} — paste into any AI agent`,"info"),xe(!0),clearTimeout(ke.current),ke.current=setTimeout(()=>xe(!1),1500)},className:`flex h-6 w-6 items-center justify-center rounded transition-colors ${he?"text-studio-accent":"text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300"}`,title:he?"Copied!":"Copy element info to clipboard",children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[m.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),m.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"})]})}),m.jsx("button",{type:"button","aria-label":"Clear selection",onClick:c,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:m.jsx(Xd,{size:13})})]})]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto",children:[m.jsx(LU,{element:i,styles:Y,fontAssets:j,onImportFonts:M,onSetText:b,onSetTextFieldStyle:S,onAddTextField:k,onRemoveTextField:A}),i.dataAttributes.start!=null&&m.jsx(rW,{element:i,onSetAttribute:h}),aU(i)&&m.jsx(sU,{projectDir:n,element:i,styles:Y,onSetStyle:u,onSetAttribute:h,onSetHtmlAttribute:p}),m.jsxs(Rr,{title:"Layout",icon:m.jsx(ZL,{size:15}),children:[m.jsxs("div",{className:Un,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"X",value:nl(Et),disabled:et,scrub:!0,onCommit:Pe=>qe("x",Pe)})}),mi&&at&&m.jsx(Us,{property:"x",keyframes:Ue,currentPercentage:lt,onSeek:Mt,onAddKeyframe:()=>V&&void V(i,"x",Et),onRemoveKeyframe:Pe=>P==null?void 0:P(at,Pe),onConvertToKeyframes:()=>L==null?void 0:L(at)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"Y",value:nl(It),disabled:et,scrub:!0,onCommit:Pe=>qe("y",Pe)})}),mi&&at&&m.jsx(Us,{property:"y",keyframes:Ue,currentPercentage:lt,onSeek:Mt,onAddKeyframe:()=>V&&void V(i,"y",It),onRemoveKeyframe:Pe=>P==null?void 0:P(at,Pe),onConvertToKeyframes:()=>L==null?void 0:L(at)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"W",value:nl(qt),disabled:Ot,scrub:!0,onCommit:Pe=>Ie("width",Pe)})}),mi&&at&&m.jsx(Us,{property:"width",keyframes:Ue,currentPercentage:lt,onSeek:Mt,onAddKeyframe:()=>V&&void V(i,"width",qt),onRemoveKeyframe:Pe=>P==null?void 0:P(at,Pe),onConvertToKeyframes:()=>L==null?void 0:L(at)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"H",value:nl(Tn),disabled:Ot,scrub:!0,onCommit:Pe=>Ie("height",Pe)})}),mi&&at&&m.jsx(Us,{property:"height",keyframes:Ue,currentPercentage:lt,onSeek:Mt,onAddKeyframe:()=>V&&void V(i,"height",Tn),onRemoveKeyframe:Pe=>P==null?void 0:P(at,Pe),onConvertToKeyframes:()=>L==null?void 0:L(at)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(rn,{label:"R",value:`${Zn}°`,onCommit:Pe=>ut(Pe.replace("°",""))})}),mi&&at&&m.jsx(Us,{property:"rotation",keyframes:Ue,currentPercentage:lt,onSeek:Mt,onAddKeyframe:()=>V&&void V(i,"rotation",Zn),onRemoveKeyframe:Pe=>P==null?void 0:P(at,Pe),onConvertToKeyframes:()=>L==null?void 0:L(at)})]})]}),We&&m.jsx(nW,{gsapRuntimeValues:We,gsapAnimId:at,gsapKeyframes:Ue,currentPct:lt,elStart:Ae,elDuration:Be,element:i,onCommitAnimatedProperty:V,onSeekToTime:W,onRemoveKeyframe:P,onConvertToKeyframes:L}),m.jsxs("div",{className:"mt-3",children:[m.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-neutral-600",children:"Stacking"}),m.jsx(rn,{label:"Z-index",value:String(parseInt(Y["z-index"]||"auto",10)||0),scrub:!0,onCommit:Pe=>u("z-index",Pe)})]})]}),dg&&z&&B&&X&&U&&_&&m.jsx(KU,{animations:$,multipleTimelines:N,unsupportedTimelinePattern:D,onUpdateProperty:z,onUpdateMeta:B,onDeleteAnimation:X,onAddProperty:U,onRemoveProperty:I??(()=>{}),onUpdateFromProperty:K,onAddFromProperty:Z,onRemoveFromProperty:F,onAddAnimation:_,onSetArcPath:q,onUpdateArcSegment:G}),ae&&m.jsx("div",{className:"px-4 pb-3",children:m.jsxs("button",{type:"button",onMouseDown:Pe=>Pe.preventDefault(),onClick:ae,className:`w-full flex items-center justify-center gap-2 rounded-lg py-2 text-[11px] font-medium transition-colors ${ee==="recording"?"bg-red-500/15 text-red-400 border border-red-500/30 animate-pulse":"bg-panel-input text-panel-text-2 hover:bg-panel-hover border border-panel-border"}`,children:[m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:ee==="recording"?m.jsx("rect",{x:"1",y:"1",width:"8",height:"8",rx:"1",fill:"currentColor"}):m.jsx("circle",{cx:"5",cy:"5",r:"4.5",fill:"currentColor"})}),ee==="recording"?`Stop recording ${(ue??0).toFixed(1)}s — press R`:"Record gesture (R) — move pointer to capture motion"]})}),ct&&m.jsx(PU,{projectId:e,element:i,styles:Y,assets:r,onSetStyle:u,onImportAssets:T,gsapBorderRadius:bt})]})]})}),bC="min-w-0 rounded-xl border border-neutral-800 bg-neutral-900/95 px-3 py-2 text-neutral-100 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors focus-within:border-neutral-600",s6="text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500",_S="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3";function q2(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function G2(t,e,n,r){return t==null||!Number.isFinite(t)?r:Math.min(n,Math.max(e,t))}function U2(t){const e=Number.parseFloat(t.trim());return Number.isFinite(e)?e:null}function aW({value:t,disabled:e,onCommit:n}){const[r,i]=d.useState(t),a=d.useRef(!1);d.useEffect(()=>{a.current||i(t)},[t]);const l=()=>{a.current=!1;const c=r.trim();c!==t&&n(c)};return m.jsx("input",{type:"text",value:r,disabled:e,onFocus:()=>{a.current=!0},onChange:c=>i(c.target.value),onBlur:l,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()},className:"w-full min-w-0 bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})}function kf({label:t,value:e,disabled:n,onCommit:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:s6,children:t}),m.jsx("div",{className:bC,children:m.jsx(aW,{value:e,disabled:n,onCommit:r})})]})}function sW({value:t,options:e,onChange:n}){return m.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-2xl border border-neutral-800 bg-neutral-950 p-1",children:e.map(r=>m.jsx("button",{type:"button",onClick:()=>n(r.value),className:`h-9 rounded-xl text-[11px] font-semibold transition-colors ${r.value===t?"bg-neutral-800 text-white shadow-sm":"text-neutral-500 hover:bg-neutral-900 hover:text-neutral-200"}`,children:r.label},r.value))})}function DS({label:t,value:e,options:n,onChange:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:s6,children:t}),m.jsx("div",{className:bC,children:m.jsx("select",{value:e,onChange:i=>r(i.target.value),className:"w-full min-w-0 appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none",children:n.map(i=>m.jsx("option",{value:i,children:i},i))})})]})}function HS({title:t,children:e,accessory:n}){return m.jsxs("section",{className:"border-b border-neutral-800 px-4 py-5",children:[m.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(uO,{size:15,className:"text-neutral-500"}),m.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-neutral-300",children:t})]}),n]}),e]})}function Af(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function lW(t,e){const n=1-t,r=n*n,i=t*t;return{x:3*r*t*e.x1+3*n*i*e.x2+i*t,y:3*r*t*e.y1+3*n*i*e.y2+i*t}}function oW(t,e){const n=[];for(let r=0;r<=48;r+=1){const i=e(lW(r/48,t));n.push(`${r===0?"M":"L"}${i.x.toFixed(2)},${i.y.toFixed(2)}`)}return n.join(" ")}function cW({points:t,onCommit:e}){const n=d.useRef(null),[r,i]=d.useState(t),a=d.useRef(null);d.useEffect(()=>{i(t)},[t]);const l=324,c=214,u={left:46,top:24,width:242,height:146},h=-.4,p=1.4,O=M=>({x:u.left+M.x*u.width,y:u.top+(p-M.y)/(p-h)*u.height}),x=M=>{var D;const E=(D=n.current)==null?void 0:D.getBoundingClientRect();if(!E)return null;const $=(M.clientX-E.left)/E.width*l,N=(M.clientY-E.top)/E.height*c;return Y8({x1:a.current==="p1"?($-u.left)/u.width:r.x1,y1:a.current==="p1"?p-(N-u.top)/u.height*(p-h):r.y1,x2:a.current==="p2"?($-u.left)/u.width:r.x2,y2:a.current==="p2"?p-(N-u.top)/u.height*(p-h):r.y2})},y=O({x:0,y:0}),b=O({x:1,y:1}),S=O({x:r.x1,y:r.y1}),k=O({x:r.x2,y:r.y2}),A=oW(r,O),C=M=>{if(!a.current)return;M.preventDefault();const E=x(M);E&&i(E)},T=()=>{a.current&&(a.current=null,e(r))},j=(M,E)=>{E.preventDefault(),E.stopPropagation(),a.current=M,E.currentTarget.setPointerCapture(E.pointerId)};return m.jsxs("div",{className:"overflow-hidden rounded-2xl border border-neutral-800 bg-black/40",children:[m.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-neutral-800 px-3 py-2",children:[m.jsxs("div",{children:[m.jsx("div",{className:s6,children:"CustomEase"}),m.jsx("div",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:w7(r)})]}),m.jsxs("button",{type:"button",onClick:()=>{const M=Mu("power3.out");i(M),e(M)},className:"inline-flex h-8 items-center justify-center gap-2 rounded-xl border border-neutral-800 bg-neutral-950 px-3 text-[10px] font-semibold uppercase tracking-[0.14em] text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-100",children:[m.jsx(fO,{size:13}),"Reset"]})]}),m.jsxs("svg",{ref:n,viewBox:`0 0 ${l} ${c}`,className:"block w-full select-none touch-none",onPointerMove:C,onPointerUp:T,onPointerCancel:T,children:[m.jsx("rect",{x:"0",y:"0",width:l,height:c,fill:"transparent"}),[0,.5,1].map(M=>{const E=O({x:0,y:M});return m.jsxs("g",{children:[m.jsx("line",{x1:u.left,x2:u.left+u.width,y1:E.y,y2:E.y,stroke:"rgba(255,255,255,0.12)",strokeDasharray:"5 8"}),m.jsx("text",{x:u.left-12,y:E.y+4,textAnchor:"end",className:"fill-neutral-500 text-[10px] font-semibold",children:M})]},M)}),m.jsx("line",{x1:u.left,x2:u.left+u.width,y1:u.top+u.height,y2:u.top+u.height,stroke:"rgba(255,255,255,0.18)"}),m.jsx("line",{x1:u.left,x2:u.left,y1:u.top,y2:u.top+u.height,stroke:"rgba(255,255,255,0.18)"}),m.jsx("line",{x1:y.x,y1:y.y,x2:S.x,y2:S.y,stroke:"rgba(255,221,87,0.34)"}),m.jsx("line",{x1:b.x,y1:b.y,x2:k.x,y2:k.y,stroke:"rgba(255,221,87,0.34)"}),m.jsx("path",{d:A,fill:"none",stroke:"#ffdd57",strokeWidth:"4",strokeLinecap:"round"}),m.jsx("circle",{cx:y.x,cy:y.y,r:"5",fill:"#ffdd57"}),m.jsx("circle",{cx:b.x,cy:b.y,r:"5",fill:"#ffdd57"}),m.jsx("circle",{cx:S.x,cy:S.y,r:"9",fill:"#141414",stroke:"#ffdd57",strokeWidth:"4",className:"cursor-grab active:cursor-grabbing",onPointerDown:M=>j("p1",M)}),m.jsx("circle",{cx:k.x,cy:k.y,r:"9",fill:"#141414",stroke:"#ffdd57",strokeWidth:"4",className:"cursor-grab active:cursor-grabbing",onPointerDown:M=>j("p2",M)}),m.jsx("text",{x:S.x+12,y:S.y-10,className:"fill-neutral-400 text-[10px] font-semibold",children:"P1"}),m.jsx("text",{x:k.x+12,y:k.y-10,className:"fill-neutral-400 text-[10px] font-semibold",children:"P2"})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-neutral-800 p-3",children:[m.jsxs("div",{className:"rounded-xl border border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[10px] text-neutral-400",children:["P1 ",Af(r.x1),", ",Af(r.y1)]}),m.jsxs("div",{className:"rounded-xl border border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[10px] text-neutral-400",children:["P2 ",Af(r.x2),", ",Af(r.y2)]})]})]})}const uW=[{label:"Fade Up",value:"fade-up"},{label:"Slide",value:"slide"},{label:"Pop",value:"pop"}],fW=["up","down","left","right"];function dW(t){return t?Math.max(Math.abs(t.from.x??0),Math.abs(t.from.y??0),1):32}function hW(t){return t?t.from.scale!=null||t.to.scale!=null?"pop":t.from.x!=null||t.to.x!=null?"slide":"fade-up":"fade-up"}function mW(t){if(!t)return"up";const e=t.from.x??0,n=t.from.y??0;return Math.abs(e)>Math.abs(n)?e<0?"right":"left":n<0?"down":"up"}function XS(t){return`studio-${(t.id||t.selector||t.label||"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}-ease`}const pW=d.memo(function({element:e,motion:n,onClearSelection:r,onSetMotion:i,onClearMotion:a}){var j;const l=hW(n),c=mW(n),u=(n==null?void 0:n.start)??0,h=(n==null?void 0:n.duration)??.6,p=dW(n),O=(n==null?void 0:n.ease)??"power3.out",x=((j=n==null?void 0:n.customEase)==null?void 0:j.data)??"",y=x.trim().length>0,b=d.useMemo(()=>R5(x)??Mu($1.includes(O)?O:"power3.out"),[O,x]);if(!e)return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-neutral-900 px-6 text-center",children:[m.jsx(uO,{size:18,className:"mb-3 text-neutral-600"}),m.jsx("p",{className:"text-sm font-medium text-neutral-200",children:"Select an element for motion."}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"Timeline layers and inspector selections can receive Studio-authored GSAP motion."})]});const S=e.id?`#${e.id}`:e.selector,k=y?"CustomEase":$1.includes(O)?O:"power3.out",A=y?["CustomEase",...$1]:$1,C=M=>{var D;const E=M.customEaseData??x,$=E.trim()?{id:((D=n==null?void 0:n.customEase)==null?void 0:D.id)??XS(e),data:E.trim()}:void 0,N=$?$.id:(M.ease??O).trim()||"none";i(e,QP(M.preset??l,{start:G2(M.start??u,0,3600,0),duration:G2(M.duration??h,.01,3600,.6),distance:G2(M.distance??p,1,2e3,32),direction:M.direction??c,ease:N,customEase:$}))},T=M=>{C({ease:XS(e),customEaseData:w7(M)})};return m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-neutral-900 text-neutral-100",children:[m.jsx("div",{className:"border-b border-neutral-800 px-4 py-5",children:m.jsxs("div",{className:"flex items-start justify-between gap-4",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500",children:"Motion Target"}),m.jsx("div",{className:"mt-3 truncate text-[12px] font-semibold text-neutral-100",children:e.label}),m.jsx("div",{className:"mt-1 truncate text-[11px] text-neutral-500",children:S})]}),m.jsx("button",{type:"button","aria-label":"Clear selection",onClick:r,className:"flex h-9 w-9 items-center justify-center rounded-full border border-neutral-700 bg-neutral-950 text-neutral-500 shadow-[0_1px_2px_rgba(0,0,0,0.2)] transition-colors hover:border-neutral-600 hover:text-neutral-200",children:m.jsx(Xd,{size:13})})]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto",children:[m.jsx(HS,{title:"GSAP Motion",accessory:m.jsx("div",{className:"rounded-full border border-studio-accent/40 bg-studio-accent/10 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-studio-accent",children:"GSAP"}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(sW,{value:l,onChange:M=>C({preset:M}),options:uW}),m.jsxs("div",{className:_S,children:[m.jsx(DS,{label:"Direction",value:c,onChange:M=>C({direction:M}),options:fW}),m.jsx(DS,{label:"Ease",value:k,onChange:M=>{M!=="CustomEase"&&C({ease:M,customEaseData:""})},options:A})]}),m.jsxs("div",{className:_S,children:[m.jsx(kf,{label:"Start",value:q2(u),onCommit:M=>C({start:U2(M)??0})}),m.jsx(kf,{label:"Duration",value:q2(h),onCommit:M=>C({duration:U2(M)??.6})}),m.jsx(kf,{label:"Distance",value:q2(p),onCommit:M=>C({distance:U2(M)??32})})]})]})}),m.jsx(HS,{title:"Ease Curve",accessory:m.jsx("div",{className:"rounded-full border border-yellow-400/30 bg-yellow-400/10 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-yellow-300",children:"CustomEase"}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(cW,{points:b,onCommit:T}),m.jsx(kf,{label:"CustomEase path",value:x,onCommit:M=>{const E=R5(M);E&&T(E)}}),m.jsx("div",{className:"flex justify-end",children:m.jsx("button",{type:"button",onClick:()=>a(e),disabled:!n,className:"inline-flex h-8 items-center rounded-xl border border-neutral-700 bg-neutral-950 px-3 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:border-neutral-800 disabled:text-neutral-600",children:"Clear motion"})})]})})]})]})}),gW=4;function vC(t){if(!(t.selector||t.id))return!1;let e=t.element;for(;e;){if(e.hasAttribute("data-timeline-locked"))return!1;e=e.parentElement}return!0}function OW(t,e){const n=t[e].depth,r=[];let i=e;for(;i>0;)if(i--,t[i].depth<n){i++;break}for(let a=i;a<t.length;a++){const l=t[a].depth;if(l<n)break;l===n&&r.push(a)}return r}function xW(t,e){const n=t.querySelectorAll("[data-layer-index]"),r=[];for(const i of e)for(const a of n)if(a.dataset.layerIndex===String(i)){r.push(a.getBoundingClientRect());break}return r}function yW(t,e){if(e.length===0||t<=e[0].top+e[0].height/2)return 0;for(let r=0;r<e.length-1;r++){const i=(e[r].bottom+e[r+1].top)/2;if(t<=i)return r+1}const n=e[e.length-1];return t<=n.top+n.height/2?e.length-1:e.length}function bW(t,e,n){return e.length===0?null:t<=0?e[0].top-n.top:t>=e.length?e[e.length-1].bottom-n.top:e[t].top-n.top}function vW({visibleLayers:t,scrollContainerRef:e,onReorder:n,onSingleSibling:r}){const i=d.useRef(null),[a,l]=d.useState(null),[c,u]=d.useState(null),h=d.useCallback((x,y)=>{if(y.button!==0)return;const b=t[x];if(!b||!vC(b))return;const S=OW(t,x);if(S.length<=1){r==null||r();return}const k=S.indexOf(x);if(k===-1)return;const A=e.current;A&&(i.current={pointerId:y.pointerId,startY:y.clientY,dragLayerIndex:x,siblingIndices:S,fromSiblingPos:k,insertSiblingPos:k,siblingRects:xW(A,S),activated:!1})},[t,e,r]),p=d.useCallback(x=>{var k;const y=i.current;if(!y)return;if(!y.activated){if(Math.abs(x.clientY-y.startY)<gW)return;y.activated=!0;const A=e.current;if(A&&y.pointerId!=null)try{A.setPointerCapture(y.pointerId)}catch{}l(((k=t[y.dragLayerIndex])==null?void 0:k.key)??null)}const b=yW(x.clientY,y.siblingRects);y.insertSiblingPos=b;const S=e.current;if(S){const A=S.getBoundingClientRect();u(bW(b,y.siblingRects,A))}},[t,e]),O=d.useCallback(()=>{const x=i.current;if(i.current=null,l(null),u(null),!x||!x.activated)return;const y=e.current;if(y)try{y.releasePointerCapture(x.pointerId)}catch{}let b=x.insertSiblingPos;if(b>x.fromSiblingPos&&b--,b===x.fromSiblingPos)return;const S=x.siblingIndices.map(k=>t[k]);n({siblingLayers:S,fromIndex:x.fromSiblingPos,toIndex:b})},[t,e,n]);return{dragKey:a,insertionLineY:c,handleRowPointerDown:h,handleContainerPointerMove:p,handleContainerPointerUp:O}}const SW={video:"Vi",audio:"Au",img:"Im",svg:"Sv",canvas:"Cn",div:"Di",section:"Se",span:"Sp",p:"P",h1:"H1",h2:"H2",h3:"H3",h4:"H4",h5:"H5",h6:"H6",a:"A",button:"Bt",ul:"Ul",ol:"Ol",li:"Li",style:"St",template:"Te"};function wW(t){return SW[t]??t.slice(0,2).toUpperCase()}function kW(t){return t.hasAttribute("data-composition-src")||t.hasAttribute("data-composition-file")}const AW=d.memo(function(){const{previewIframeRef:e,activeCompPath:n,refreshKey:r,compositionLoading:i,timelineElements:a,showToast:l}=hl(),c=oe(_=>_.currentTime),{domEditSelection:u,applyDomSelection:h,updateDomEditHoverSelection:p,handleDomZIndexReorderCommit:O}=zd(),[x,y]=d.useState([]),[b,S]=d.useState({}),k=d.useRef(0),A=d.useRef(null),C=!n||n==="index.html",T=d.useCallback(()=>{const _=e.current;if(!_)return;let q=null;try{q=_.contentDocument}catch{return}if(!q)return;const G=q.querySelector("[data-composition-id]")??q.documentElement??null;if(!G)return;const R=NR(G,{activeCompositionPath:n});y(Z8(R))},[e,n,C]);d.useEffect(()=>{T()},[T,r]),d.useEffect(()=>{const _=e.current;if(!_)return;const q=()=>{k.current+=1,T()};return _.addEventListener("load",q),()=>_.removeEventListener("load",q)},[e,T]),d.useEffect(()=>{if(!i){const _=setTimeout(T,100);return()=>clearTimeout(_)}},[i,T]);const j=d.useCallback(_=>{let q=_.element;if(!q.isConnected){const G=e.current,R=G==null?void 0:G.contentDocument;if(R){const P=(_.id?R.getElementById(_.id):null)??(_.hfId?R.querySelector(`[data-hf-id="${_.hfId}"]`):null)??R.getElementById(_.key);P instanceof HTMLElement&&(q=P)}}return e9(q,{activeCompositionPath:n,isMasterView:C,preferClipAncestor:!1})},[n,C,e]),M=d.useCallback(async _=>{const q=await j(_);if(!q)return;let G=Mg(q,a);if(!G){const R=q.sourceFile??"index.html";let P=_.element.parentElement;for(;P&&!G;){const L=P.id;if(L){const V=a.find(W=>W.domId===L&&(W.sourceFile??"index.html")===R);V&&(G=V.key??V.id)}P=P.parentElement}}if(G){const R=a.find(P=>(P.key??P.id)===G);if(R){const P=uR(c,R);P!=null&&oe.getState().requestSeek(P)}}},[c,j,a]),E=d.useCallback(async _=>{const q=await j(_);q&&(h(q),await M(_))},[j,h,M]),$=d.useCallback(async _=>{if(!_){p(null);return}const q=await j(_);p(q)},[j,p]),N=d.useCallback((_,q)=>{q.stopPropagation(),S(G=>({...G,[_]:!G[_]}))},[]),D=d.useCallback(_=>{const{siblingLayers:q,fromIndex:G,toIndex:R}=_,P=[...q],[L]=P.splice(G,1);P.splice(R,0,L);const W=[...q.map(Y=>Q8(Y.element))].sort((Y,re)=>re-Y),ue=W.some((Y,re)=>re>0&&Y===W[re-1])?P.map((Y,re)=>P.length-re):W,ae=P.map((Y,re)=>({element:Y.element,zIndex:ue[re],id:Y.id,selector:Y.selector,selectorIndex:Y.selectorIndex,sourceFile:Y.sourceFile}));O(ae)},[O]),z=u?t9(u):null,B=MW(x,b),X=d.useCallback(()=>{l("Only one layer at this level","info")},[l]),{dragKey:U,insertionLineY:I,handleRowPointerDown:K,handleContainerPointerMove:Z,handleContainerPointerUp:F}=vW({visibleLayers:B,scrollContainerRef:A,onReorder:D,onSingleSibling:X});return x.length===0?m.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-panel-bg px-6 text-center",children:[m.jsx(Uf,{size:18,className:"mb-3 text-panel-text-5"}),m.jsx("p",{className:"text-sm font-medium text-panel-text-1",children:"No layers"}),m.jsx("p",{className:"mt-1 text-xs text-neutral-500",children:"Load a composition to see its element tree"})]}):m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-panel-bg",onPointerLeave:()=>$(null),children:[m.jsxs("div",{className:"border-b border-panel-border px-3 py-2 text-[11px] text-panel-text-3",children:[x.length," layer",x.length===1?"":"s"]}),m.jsxs("div",{ref:A,className:"relative min-h-0 flex-1 overflow-y-auto py-1",onPointerMove:Z,onPointerUp:F,onPointerCancel:F,children:[B.map((_,q)=>{const G=_.key===z,R=_.key===U,P=vC(_),L=b[_.key]??!1,V=_.childCount>0,W=kW(_.element);return m.jsxs("div",{"data-layer-index":q,role:"button",tabIndex:0,onClick:()=>!U&&E(_),onPointerDown:ee=>K(q,ee),onPointerEnter:()=>!U&&$(_),onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),E(_))},className:`group flex w-full items-center gap-1.5 px-2 py-1 text-left transition-colors ${R?"opacity-40":G?"bg-panel-accent/14 text-panel-accent":"text-panel-text-2 hover:bg-panel-hover/40 hover:text-panel-text-1"} ${U?"cursor-grabbing":P?"cursor-pointer":"cursor-not-allowed opacity-50"}`,style:{paddingLeft:8+_.depth*16},children:[V?m.jsx("button",{type:"button",onClick:ee=>N(_.key,ee),className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded text-neutral-500 hover:text-neutral-300",children:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",className:`transition-transform ${L?"":"rotate-90"}`,children:m.jsx("path",{d:"M2 1l4 3-4 3z"})})}):m.jsx("span",{className:"w-4 flex-shrink-0"}),m.jsx("span",{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded text-[8px] font-bold uppercase ${G?"bg-panel-accent/18 text-panel-accent":W?"bg-panel-accent/40 text-panel-accent":"bg-panel-hover text-panel-text-4"}`,children:wW(_.tagName)}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:_.label}),V&&m.jsx("span",{className:"text-[9px] tabular-nums text-panel-text-5",children:_.childCount})]},_.key)}),I!=null&&m.jsx("div",{className:"pointer-events-none absolute left-2 right-2 h-0.5 bg-studio-accent",style:{top:I}})]})]})});function Q8(t){var e,n;try{const r=(e=t.style)==null?void 0:e.zIndex;if(r&&r!=="auto"){const c=parseInt(r,10);if(Number.isFinite(c))return c}const i=(n=t.ownerDocument)==null?void 0:n.defaultView;if(!i)return 0;const a=i.getComputedStyle(t).zIndex;if(a==="auto"||a==="")return 0;const l=parseInt(a,10);return Number.isFinite(l)?l:0}catch{return 0}}function Z8(t){if(t.length<=1)return t;const e=t[0].depth;for(let i=1;i<t.length;i++)if(t[i].depth<e)return t;const n=[];for(let i=0;i<t.length;i++)if(t[i].depth===e){const a=[];let l=i+1;for(;l<t.length&&t[l].depth>e;)a.push(t[l]),l++;n.push({root:t[i],children:a,domIndex:n.length})}if(n.length<=1){if(n.length===1&&n[0].children.length>0){const i=Z8(n[0].children);return[n[0].root,...i]}return t}n.sort((i,a)=>{const l=Q8(i.root.element),c=Q8(a.root.element);return l!==c?c-l:a.domIndex-i.domIndex});const r=[];for(const i of n)r.push(i.root),i.children.length>0&&r.push(...Z8(i.children));return r}function MW(t,e){if(Object.keys(e).length===0)return t;const n=[];let r=-1;for(const i of t)r>=0&&i.depth>r||(r=-1,n.push(i),e[i.key]&&i.childCount>0&&(r=i.depth));return n}const hs="w-full bg-neutral-900 border border-neutral-800 rounded px-1.5 py-0.5 text-2xs text-neutral-200 font-mono outline-none focus:border-neutral-600";function N8({label:t,children:e}){return m.jsxs("div",{className:"mb-3",children:[m.jsx("div",{className:"flex items-center gap-1.5 mt-2 mb-1.5",children:m.jsx("span",{className:"text-2xs font-medium text-neutral-500 uppercase tracking-wider",children:t})}),m.jsx("div",{className:"space-y-1",children:e})]})}function ga({label:t,children:e}){return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-2xs text-neutral-600 w-14 text-right flex-shrink-0",children:t}),m.jsx("div",{className:"flex-1 min-w-0",children:e})]})}const CW=["none","fade","slide-up","slide-down","slide-left","slide-right","pop","slam","bounce","typewriter","blur-in","flip","drop"],TW=["none","color-change","scale-pop","glow-pulse","underline-sweep","background-fill","bounce"],EW=["none","fade","slide-up","slide-down","slide-left","slide-right","scatter","drop","collapse","blur-out","shrink"],$W=["power1.out","power2.out","power3.out","power4.out","power1.in","power2.in","power3.in","power1.inOut","power2.inOut","back.out(1.7)","elastic.out(1,0.3)","bounce.out"];function W2({label:t,presets:e,animation:n,showIntensity:r,onChange:i}){const a=(n==null?void 0:n.preset)??"none",l=(n==null?void 0:n.duration)??.2,c=(n==null?void 0:n.ease)??"power2.out",u=(n==null?void 0:n.stagger)??0,h=(n==null?void 0:n.intensity)??1;return m.jsxs(N8,{label:t,children:[m.jsx(ga,{label:"Preset",children:m.jsx("select",{value:a,onChange:p=>i({preset:p.target.value}),className:hs,children:e.map(p=>m.jsx("option",{value:p,children:p},p))})}),m.jsx(ga,{label:"Duration",children:m.jsx("input",{type:"number",value:l,step:.05,min:0,max:2,onChange:p=>i({duration:Number(p.target.value)}),className:hs})}),m.jsx(ga,{label:"Ease",children:m.jsx("select",{value:c,onChange:p=>i({ease:p.target.value}),className:hs,children:$W.map(p=>m.jsx("option",{value:p,children:p},p))})}),m.jsx(ga,{label:"Stagger",children:m.jsx("input",{type:"number",value:u,step:.02,min:0,max:.5,onChange:p=>i({stagger:Number(p.target.value)}),className:hs})}),r&&m.jsx(ga,{label:"Intensity",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"range",min:0,max:1,step:.01,value:h,onChange:p=>i({intensity:Number(p.target.value)}),className:"flex-1 accent-studio-accent"}),m.jsx("span",{className:"text-2xs text-neutral-400 font-mono w-8 text-right flex-shrink-0",children:h.toFixed(2)})]})})]})}const jW=d.memo(function(){const e=kt(y=>y.model),n=kt(y=>y.selectedGroupId),r=kt(y=>y.selectedSegmentIds),i=kt(y=>y.updateGroupAnimation),a=kt(y=>y.applyAnimationToAll);let l=n;if(!l&&e&&r.size>0){const y=[...r][0];if(y){for(const[b,S]of e.groups)if(S.segmentIds.includes(y)){l=b;break}}}const c=l?e==null?void 0:e.groups.get(l):void 0,u=c==null?void 0:c.animation,h=d.useCallback(y=>{l&&i(l,"entrance",y)},[l,i]),p=d.useCallback(y=>{l&&i(l,"highlight",y)},[l,i]),O=d.useCallback(y=>{l&&i(l,"exit",y)},[l,i]),x=d.useCallback(()=>{u&&a(u)},[u,a]);return!c||!l||!u?m.jsx("div",{className:"flex items-center justify-center h-full px-4 text-center",children:m.jsx("p",{className:"text-xs text-neutral-500",children:"Select a caption group to edit animations"})}):m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[m.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[m.jsx(W2,{label:"Entrance",presets:CW,animation:u.entrance,onChange:h}),m.jsx(W2,{label:"Highlight",presets:TW,animation:u.highlight,showIntensity:!0,onChange:p}),m.jsx(W2,{label:"Exit",presets:EW,animation:u.exit,onChange:O})]}),m.jsx("div",{className:"flex-shrink-0 px-3 py-2 border-t border-neutral-800",children:m.jsx("button",{type:"button",onClick:x,className:"w-full py-1.5 rounded border border-neutral-700 text-2xs text-neutral-300 hover:border-studio-accent/50 hover:text-studio-accent transition-colors",children:"Apply to all groups"})})]})}),PW=d.memo(function({iframeRef:e}){var E;const n=kt($=>$.model),r=kt($=>$.selectedSegmentIds),i=kt($=>$.selectedGroupId),a=kt($=>$.updateSelectedStyle),l=kt($=>$.updateGroupStyle),[c,u]=d.useState("style"),h=r.size>0?[...r][0]:void 0,p=n==null?void 0:n.segments.get(h??"");let O=null;if(n&&h)for(const $ of n.groupOrder){const N=n.groups.get($);if(N&&N.segmentIds.includes(h)){O=$;break}}const x=O?(E=n==null?void 0:n.groups.get(O))==null?void 0:E.style:void 0,y=(p==null?void 0:p.style)??{},b={...x,...y},S=d.useCallback($=>{var U,I,K;const N=e.current;if(!N||!n)return;let D=null;try{D=N.contentDocument}catch{return}if(!D)return;const z=D.querySelectorAll(".caption-group"),B=[];for(const Z of r)for(let F=0;F<n.groupOrder.length;F++){const _=n.groups.get(n.groupOrder[F]);if(!_)continue;const q=_.segmentIds.indexOf(Z);if(q<0)continue;const G=z[F];if(!G)continue;const R=G.children;let P=0;for(const L of R){const V=L;if(V.dataset.captionWrapper==="true"){const W=V.querySelector(":scope > span");if(W&&P===q){B.push(W);break}}else if(V.tagName==="SPAN"&&P===q){B.push(V);break}P++}break}if($.x!==void 0||$.y!==void 0||$.scaleX!==void 0||$.scaleY!==void 0||$.rotation!==void 0)try{const Z=(I=(U=e.current)==null?void 0:U.contentWindow)==null?void 0:I.gsap;if(Z)for(const F of B){let _=F.parentElement;(!_||_.dataset.captionWrapper!=="true")&&(_=D.createElement("span"),_.style.display="inline-block",_.dataset.captionWrapper="true",(K=F.parentNode)==null||K.insertBefore(_,F),_.appendChild(F));const q=Z.getProperty(_,"x")||0,G=Z.getProperty(_,"y")||0,R=Z.getProperty(_,"scale")||1,P=Z.getProperty(_,"rotation")||0;Z.set(_,{x:$.x??q,y:$.y??G,scale:$.scaleX??R,rotation:$.rotation??P})}}catch{}},[e,n,r]),k=d.useCallback($=>{i?l(i,$):a($),S($)},[i,l,a,S]);if(r.size===0)return m.jsx("div",{className:"flex items-center justify-center h-full px-4 text-center",children:m.jsx("p",{className:"text-xs text-neutral-500",children:"Select caption words to edit their style"})});const A=b.x??0,C=b.y??0,T=b.rotation??0,j=b.scaleX??1,M=r.size===1?"1 word":`${r.size} words`;return m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[m.jsxs("div",{className:"px-3 py-2 border-b border-neutral-800 flex-shrink-0",children:[m.jsx("div",{className:"flex items-center justify-between mb-1.5",children:m.jsx("span",{className:"text-2xs text-neutral-500",children:M})}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("button",{type:"button",onClick:()=>u("style"),className:["flex-1 py-0.5 rounded text-2xs font-medium transition-colors",c==="style"?"bg-studio-accent/20 text-studio-accent border border-studio-accent/50":"text-neutral-500 border border-neutral-800 hover:text-neutral-300 hover:border-neutral-600"].join(" "),children:"Style"}),m.jsx("button",{type:"button",onClick:()=>u("animation"),className:["flex-1 py-0.5 rounded text-2xs font-medium transition-colors",c==="animation"?"bg-studio-accent/20 text-studio-accent border border-studio-accent/50":"text-neutral-500 border border-neutral-800 hover:text-neutral-300 hover:border-neutral-600"].join(" "),children:"Animation"})]})]}),c==="animation"&&m.jsx(jW,{}),c==="style"&&m.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[m.jsxs(N8,{label:"Position",children:[m.jsx(ga,{label:"X",children:m.jsx("input",{type:"number",value:A,onChange:$=>k({x:Number($.target.value)}),className:hs})}),m.jsx(ga,{label:"Y",children:m.jsx("input",{type:"number",value:C,onChange:$=>k({y:Number($.target.value)}),className:hs})})]}),m.jsxs(N8,{label:"Transform",children:[m.jsx(ga,{label:"Scale",children:m.jsx("input",{type:"number",value:j,step:.1,onChange:$=>k({scaleX:Number($.target.value),scaleY:Number($.target.value)}),className:hs})}),m.jsx(ga,{label:"Rotation",children:m.jsx("input",{type:"number",value:T,onChange:$=>k({rotation:Number($.target.value)}),className:hs})})]})]})]})}),QW=d.memo(function({blockTitle:e,params:n,compositionPath:r,onClose:i}){const[a,l]=d.useState(()=>{const u={};for(const h of n)u[h.key]=h.default;return u}),c=d.useCallback((u,h)=>{l(p=>({...p,[u]:h})),console.log(`[BlockParams] ${r} ${u}: ${h}`)},[r]);return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-800",children:[m.jsx("div",{className:"text-[11px] font-semibold text-neutral-200 truncate",children:e}),m.jsx("button",{type:"button",onClick:i,className:"text-neutral-500 hover:text-neutral-300 transition-colors",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 6 6 18"}),m.jsx("path",{d:"m6 6 12 12"})]})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[m.jsx("div",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Parameters"}),n.map(u=>m.jsx(ZW,{param:u,value:a[u.key]??u.default,onChange:h=>c(u.key,h)},u.key))]})]})});function ZW({param:t,value:e,onChange:n}){return m.jsxs("div",{className:"space-y-1",children:[m.jsx("label",{className:"text-[10px] font-medium text-neutral-400",children:t.label}),t.type==="color"&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"color",value:e,onChange:r=>n(r.target.value),className:"w-7 h-7 rounded border border-neutral-700 bg-transparent cursor-pointer"}),m.jsx("input",{type:"text",value:e,onChange:r=>n(r.target.value),className:"flex-1 bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 font-mono focus:outline-none focus:border-neutral-700"})]}),t.type==="number"&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"range",min:t.min??0,max:t.max??100,step:t.step??1,value:e,onChange:r=>n(r.target.value),className:"flex-1"}),m.jsx("span",{className:"text-[10px] text-neutral-400 w-8 text-right tabular-nums",children:e})]}),t.type==="text"&&m.jsx("input",{type:"text",value:e,onChange:r=>n(r.target.value),className:"w-full bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 focus:outline-none focus:border-neutral-700"}),t.type==="select"&&t.options&&m.jsx("select",{value:e,onChange:r=>n(r.target.value),className:"w-full bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 focus:outline-none focus:border-neutral-700",children:t.options.map(r=>m.jsx("option",{value:r.value,children:r.label},r.value))})]})}function NW(t){if(t<1e3)return`${t}ms`;const e=Math.round(t/1e3);return e<60?`${e}s`:`${Math.floor(e/60)}m ${e%60}s`}function RW(t){const e=Date.now()-t;return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:`${Math.floor(e/36e5)}h ago`}const VW=d.memo(function({job:e,projectId:n,onDelete:r}){const[i,a]=d.useState(!1),l=`/api/projects/${n}/renders/file/${e.filename}`,c=d.useCallback(()=>{window.open(l,"_blank")},[l]),u=d.useCallback(O=>{O.stopPropagation();const x=document.createElement("a");x.href=l,x.download=e.filename,x.click()},[l,e.filename]),h=l,p=e.status==="complete";return m.jsx("div",{onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),onClick:p?c:void 0,className:["px-3 py-2.5 border-b border-panel-border last:border-0 transition-colors duration-150",p?"cursor-pointer hover:bg-panel-hover/30":""].filter(Boolean).join(" "),children:m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsxs("div",{className:"w-20 h-[45px] rounded-md overflow-hidden bg-panel-input flex-shrink-0 relative",children:[p&&m.jsxs(m.Fragment,{children:[i&&m.jsx("video",{src:h,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-contain"}),m.jsx("div",{className:"absolute inset-0 transition-opacity duration-150",style:{opacity:i?0:1},children:m.jsx(FM,{src:h})})]}),e.status==="rendering"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-panel-accent animate-pulse"})}),e.status==="failed"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-red-400"})}),e.status==="cancelled"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-neutral-600"})})]}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"text-[11px] font-medium text-panel-text-2 truncate",children:e.filename}),e.durationMs&&m.jsx("span",{className:"text-[9px] text-panel-text-5 flex-shrink-0",children:NW(e.durationMs)})]}),e.status==="rendering"&&m.jsxs("div",{className:"mt-1",children:[m.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[m.jsx("span",{className:"text-[9px] text-panel-text-4",children:e.stage||"Rendering"}),m.jsxs("span",{className:"text-[9px] font-mono text-panel-accent",children:[e.progress,"%"]})]}),m.jsx("div",{className:"w-full h-1 bg-panel-border rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-panel-accent rounded-full transition-all duration-300",style:{width:`${e.progress}%`}})})]}),e.status==="failed"&&e.error&&m.jsx("span",{className:"text-[9px] text-red-400 mt-0.5 block",children:e.error}),e.status!=="rendering"&&m.jsx("span",{className:"text-[9px] text-panel-text-5",children:RW(e.createdAt)})]}),m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[m.jsx("button",{onClick:p?u:void 0,className:`p-1 rounded transition-colors ${p?"text-panel-text-5 hover:text-panel-accent":"text-panel-text-5/30 pointer-events-none"}`,title:p?"Download":"Rendering...",disabled:!p,children:m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),m.jsx("button",{onClick:O=>{O.stopPropagation(),r()},className:"p-1 rounded text-panel-text-5 hover:text-red-400 transition-colors",title:"Remove",children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})})}),LW=["auto","1080p","4k"],zS={auto:"Auto","1080p":"1080p","4k":"4K"},SC={landscape:{width:1920,height:1080},portrait:{width:1080,height:1920},"landscape-4k":{width:3840,height:2160},"portrait-4k":{width:2160,height:3840},square:{width:1080,height:1080},"square-4k":{width:2160,height:2160}};function _W(t){return t==null?"landscape":t.width===t.height?"square":t.height>t.width?"portrait":"landscape"}function wC(t,e){if(t==="auto")return"auto";const n=_W(e);return t==="1080p"?n:n==="landscape"?"landscape-4k":n==="portrait"?"portrait-4k":"square-4k"}function DW(t,e){if(t==="auto")return e??null;const n=wC(t,e);return n==="auto"?null:SC[n]}function HW(t,e){if(t==="auto"||e==null)return!0;const n=wC(t,e);if(n==="auto")return!0;const r=SC[n];return r.width*e.height!==r.height*e.width||r.width<e.width?!1:Number.isInteger(r.width/e.width)}function XW(t,e){const n=DW(t,e);return n?`${zS[t]} · ${n.width}×${n.height}`:zS[t]}const K2={mp4:{label:"MP4",desc:"Best for general use. Smallest file, universal playback."},mov:{label:"MOV (ProRes 4444)",desc:"Transparent video. Works in CapCut, Final Cut Pro, Premiere, DaVinci Resolve, After Effects. Large files."},webm:{label:"WebM (VP9)",desc:"Transparent video for web. Smaller than MOV but limited editor support."}};function zW({format:t}){const[e,n]=d.useState(!1),r=d.useRef(void 0),i=()=>{clearTimeout(r.current),n(!0)},a=()=>{r.current=setTimeout(()=>n(!1),120)};d.useEffect(()=>()=>clearTimeout(r.current),[]);const l=K2[t];return m.jsxs("div",{className:"relative",onPointerEnter:i,onPointerLeave:a,children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-panel-text-5 hover:text-panel-text-3 transition-colors cursor-help",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),m.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e&&m.jsxs("div",{className:"absolute top-full right-0 mt-1.5 w-52 p-2 rounded bg-panel-input border border-neutral-700 shadow-lg z-50",children:[m.jsx("p",{className:"text-[10px] font-semibold text-panel-text-1 mb-0.5",children:l.label}),m.jsx("p",{className:"text-[9px] text-panel-text-3 leading-tight",children:l.desc}),m.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-neutral-800",children:["mp4","mov","webm"].filter(c=>c!==t).map(c=>m.jsxs("p",{className:"text-[9px] text-panel-text-4 leading-relaxed",children:[m.jsx("span",{className:"text-panel-text-3 font-medium",children:K2[c].label})," — ",K2[c].desc]},c))})]})]})}const FW=[{value:"draft",label:"Draft",title:"Fast render, smaller file"},{value:"standard",label:"Standard",title:"Good quality, balanced file size"},{value:"high",label:"High Quality",title:"Best quality, larger file"}];function BW({onStartRender:t,isRendering:e,compositionDimensions:n}){const r=KM(),[i,a]=d.useState(r.format),[l,c]=d.useState(r.quality),[u,h]=d.useState("auto"),[p,O]=d.useState(r.fps),x=i!=="mov",y="h-7 w-full px-2 text-[11px] bg-panel-input rounded-md text-panel-text-1 outline-none cursor-pointer disabled:opacity-50 hover:bg-panel-hover transition-colors";return m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("span",{className:"text-[10px] text-panel-text-4",children:"Format"}),m.jsx(zW,{format:i})]}),m.jsxs("select",{value:i,onChange:b=>{const S=b.target.value;a(S),T2(S,l,p)},disabled:e,className:y,children:[m.jsx("option",{value:"mp4",children:"MP4"}),m.jsx("option",{value:"mov",children:"MOV (ProRes)"}),m.jsx("option",{value:"webm",children:"WebM"})]})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-[10px] text-panel-text-4",children:"Resolution"}),m.jsx("select",{value:u,onChange:b=>h(b.target.value),disabled:e,className:y,children:LW.map(b=>m.jsx("option",{value:b,disabled:!HW(b,n),children:XW(b,n)},b))})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-[10px] text-panel-text-4",children:"Frame rate"}),m.jsxs("select",{value:p,onChange:b=>{const S=Number(b.target.value);O(S),T2(i,l,S)},disabled:e,className:y,children:[m.jsx("option",{value:24,children:"24 fps"}),m.jsx("option",{value:30,children:"30 fps"}),m.jsx("option",{value:60,children:"60 fps"})]})]}),x&&m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-[10px] text-panel-text-4",children:"Quality"}),m.jsx("select",{value:l,onChange:b=>{const S=b.target.value;c(S),T2(i,S,p)},disabled:e,className:y,children:FW.map(b=>m.jsx("option",{value:b.value,children:b.label},b.value))})]})]}),m.jsx("button",{onClick:()=>{Yt("render_start",{format:i,quality:l,resolution:u,fps:p}),t(i,l,u,p)},disabled:e,className:"w-full flex items-center justify-center h-8 text-[11px] font-semibold rounded-md bg-panel-accent text-[#09090B] hover:brightness-110 transition-colors disabled:opacity-50",children:e?"Rendering...":"Export"})]})}const YW=d.memo(function({jobs:e,projectId:n,onDelete:r,onClearCompleted:i,onStartRender:a,isRendering:l,compositionDimensions:c}){const u=d.useRef(null);d.useEffect(()=>{u.current&&u.current.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[e.length]);const h=e.filter(p=>p.status!=="rendering").length;return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsx("div",{className:"px-3 py-3 border-b border-panel-border flex-shrink-0",children:m.jsx(BW,{onStartRender:a,isRendering:l,compositionDimensions:c})}),m.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:e.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[m.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-panel-text-5",children:[m.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M7 2v20M17 2v20M2 12h20M2 7h5M2 17h5M17 17h5M17 7h5",strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("p",{className:"text-[10px] text-panel-text-5 text-center",children:"No renders yet"})]}):m.jsxs("div",{children:[h>0&&m.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-panel-border",children:[m.jsxs("span",{className:"text-[10px] text-panel-text-4",children:[e.length," render",e.length===1?"":"s"]}),m.jsx("button",{onClick:i,className:"text-[10px] text-panel-text-4 hover:text-panel-text-2 transition-colors",children:"Clear"})]}),e.map(p=>m.jsx(VW,{job:p,projectId:n,onDelete:()=>r(p.id)},p.id))]})})]})});function IW({selectedStudioMotion:t,designPanelActive:e,motionPanelActive:n,activeBlockParams:r,onCloseBlockParams:i,recordingState:a,recordingDuration:l,onToggleRecording:c}){const{rightWidth:u,rightPanelTab:h,setRightPanelTab:p,handlePanelResizeStart:O,handlePanelResizeMove:x,handlePanelResizeEnd:y}=dO(),{captionEditMode:b,previewIframeRef:S,projectId:k,activeCompPath:A,compositionDimensions:C,waitForPendingDomEditSaves:T,renderQueue:j}=hl(),{domEditSelection:M,domEditGroupSelections:E,copiedAgentPrompt:$,clearDomSelection:N,handleDomStyleCommit:D,handleDomAttributeCommit:z,handleDomHtmlAttributeCommit:B,handleDomPathOffsetCommit:X,handleDomBoxSizeCommit:U,handleDomRotationCommit:I,handleDomTextCommit:K,handleDomTextFieldStyleCommit:Z,handleDomAddTextField:F,handleDomRemoveTextField:_,handleAskAgent:q,handleDomMotionCommit:G,handleDomMotionClear:R,selectedGsapAnimations:P,gsapMultipleTimelines:L,gsapUnsupportedTimelinePattern:V,handleGsapUpdateProperty:W,handleGsapUpdateMeta:ee,handleGsapDeleteAnimation:ue,handleGsapAddAnimation:ae,handleGsapAddProperty:Y,handleGsapRemoveProperty:re,handleGsapUpdateFromProperty:he,handleGsapAddFromProperty:xe,handleGsapRemoveFromProperty:ke,commitAnimatedProperty:be,handleSetArcPath:Se,handleUpdateArcSegment:Ve,handleGsapAddKeyframe:Te,handleGsapRemoveKeyframe:Ze,handleGsapConvertToKeyframes:Xe}=zd(),{assets:ze,fontAssets:et,projectDir:Ot,handleImportFiles:He,handleImportFonts:ct}=UM(),yt=j.jobs;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group w-2 flex-shrink-0 cursor-col-resize flex items-center justify-center",style:{touchAction:"none"},onPointerDown:Oe=>O("right",Oe),onPointerMove:x,onPointerUp:y,children:m.jsx("div",{className:"h-[52px] w-px bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})}),m.jsx("div",{className:"flex flex-col border-l border-neutral-800 bg-neutral-900 flex-shrink-0",style:{width:u},children:b?m.jsx(PW,{iframeRef:S}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-1 border-b border-neutral-800 px-3 py-2",children:[Pn&&m.jsxs(m.Fragment,{children:[m.jsx(Xt,{label:"Element styles and properties",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>p("design"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${h==="design"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Design"})}),m.jsx(Xt,{label:"Composition layer stack",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>p("layers"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${h==="layers"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Layers"})}),z8&&m.jsx(Xt,{label:"Animation and motion",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>p("motion"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${h==="motion"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Motion"})})]}),m.jsx(Xt,{label:"Render queue and exports",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>p("renders"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${h==="renders"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:yt.length>0?`Renders (${yt.length})`:"Renders"})})]}),m.jsx("div",{className:"min-h-0 flex-1",children:h==="block-params"&&r?m.jsx(QW,{blockName:r.blockName,blockTitle:r.blockTitle,params:r.params,compositionPath:r.compositionPath,onClose:i??(()=>{})}):h==="layers"?m.jsx(AW,{}):e?m.jsx(iW,{projectId:k,projectDir:Ot,assets:ze,element:E.length>1?null:M,multiSelectCount:E.length,copiedAgentPrompt:$,onClearSelection:N,onSetStyle:D,onSetAttribute:z,onSetHtmlAttribute:B,onSetManualOffset:X,onSetManualSize:U,onSetManualRotation:I,onSetText:K,onSetTextFieldStyle:Z,onAddTextField:F,onRemoveTextField:_,onAskAgent:q,onImportAssets:He,fontAssets:et,onImportFonts:ct,previewIframeRef:S,gsapAnimations:P,gsapMultipleTimelines:L,gsapUnsupportedTimelinePattern:V,onUpdateGsapProperty:W,onUpdateGsapMeta:ee,onDeleteGsapAnimation:ue,onAddGsapProperty:Y,onRemoveGsapProperty:re,onUpdateGsapFromProperty:he,onAddGsapFromProperty:xe,onRemoveGsapFromProperty:ke,onAddGsapAnimation:ae,onCommitAnimatedProperty:be,onAddKeyframe:Te,onRemoveKeyframe:Ze,onConvertToKeyframes:Xe,onSeekToTime:Oe=>oe.getState().requestSeek(Oe),onSetArcPath:Se,onUpdateArcSegment:Ve,recordingState:a,recordingDuration:l,onToggleRecording:c}):n?m.jsx(pW,{element:E.length>1?null:M,motion:t,onClearSelection:N,onSetMotion:G,onClearMotion:R}):m.jsx(YW,{jobs:yt,projectId:k,onDelete:j.deleteRender,onClearCompleted:j.clearCompleted,onStartRender:async(Oe,Ge,Re,qe)=>{await T();const Ie=A&&A!=="index.html"?A:void 0;await j.startRender({fps:qe,quality:Ge,format:Oe,resolution:Re,composition:Ie})},compositionDimensions:C,isRendering:j.isRendering})})]})})]})}function J2(t,e,n){const r={};if(!(t!=null&&t.contentWindow))return r;let i;try{i=t.contentWindow.gsap}catch{return r}const a=e.element;if(!(a!=null&&a.isConnected)||!(i!=null&&i.getProperty))return r;const l=n?Object.keys(n.properties):["x","y","opacity"];for(const c of l){const u=Number(i.getProperty(a,c));Number.isFinite(u)&&(r[c]=Math.round(u))}return r}async function qW(t){var i;const e=(i=window.location.hash.match(/project\/([^?/]+)/))==null?void 0:i[1];if(!e)return[];const n=t.sourceFile||"index.html",r=await $o(e,n);return r?Gf(r.animations,{id:t.id,selector:t.selector}):[]}function eg(t,e){var i,a;const n=Number.parseFloat(((i=e.dataAttributes)==null?void 0:i.start)??"0")||0,r=Number.parseFloat(((a=e.dataAttributes)==null?void 0:a.duration)??"1")||1;return r<=0?0:Math.max(0,Math.min(100,Math.round((t-n)/r*1e3)/10))}function GW(t){return d.useCallback(async()=>{var u,h,p;const e=t.current;if(!e)return;const n=e.domEditSelection;if(!n)return;const r=oe.getState().currentTime,i=((u=e.previewIframeRef)==null?void 0:u.current)??null;let a=e.selectedGsapAnimations;a.length===0&&(a=await qW(n));const l=a.find(O=>O.keyframes),c=a.find(O=>!O.keyframes);if(l!=null&&l.keyframes){const O=eg(r,n),x=l.keyframes.keyframes.find(y=>Math.abs(y.percentage-O)<=1);if(x)e.handleGsapRemoveKeyframe(l.id,x.percentage);else if(e.handleGsapAddKeyframeBatch){const y=J2(i,n,l);Object.keys(y).length>0&&await e.handleGsapAddKeyframeBatch(l.id,O,y)}}else if(c){const O=J2(i,n,c),x=Object.keys(O).length>0;await e.handleGsapConvertToKeyframes(c.id,x?O:void 0);const y=eg(r,n);y>1&&y<99&&x&&e.handleGsapAddKeyframeBatch&&(await e.handleGsapAddKeyframeBatch(c.id,y,O),await e.handleGsapAddKeyframeBatch(c.id,100,O))}else{const O=J2(i,n,null),x=eg(r,n),y=Number.parseFloat(((h=n.dataAttributes)==null?void 0:h.start)??"0")||0,b=Number.parseFloat(((p=n.dataAttributes)==null?void 0:p.duration)??"1")||1,S=n.id?`#${n.id}`:n.selector;if(!S){e.handleGsapAddAnimation("to");return}Object.keys(O).length===0&&(O.x=0,O.y=0,O.opacity=1);const k=[{percentage:0,properties:{...O}}];x>1&&x<99&&k.push({percentage:x,properties:{...O}}),k.push({percentage:100,properties:{...O},auto:!0}),e.commitMutation?await e.commitMutation({type:"add-with-keyframes",targetSelector:S,position:Math.round(y*1e3)/1e3,duration:Math.round(b*1e3)/1e3,keyframes:k},{label:"Enable keyframes",softReload:!0}):e.handleGsapAddAnimation("to")}},[t])}function UW(){const t=oe(e=>e.autoKeyframeEnabled);return m.jsx(Xt,{label:t?"Auto-keyframe ON":"Auto-keyframe OFF",children:m.jsx("button",{type:"button",onClick:()=>oe.getState().setAutoKeyframeEnabled(!t),className:`flex h-7 w-7 items-center justify-center rounded transition-colors ${t?"text-red-400":"text-neutral-600 hover:text-neutral-400"}`,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[m.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.5"}),t&&m.jsx("circle",{cx:"7",cy:"7",r:"3",fill:"currentColor"})]})})})}function WW(t){const e=oe(h=>h.currentTime),n=d.useRef(t);n.current=t;const r=GW(n);if(!t)return{state:"none",onToggle:void 0};const i=t.domEditSelection,l=t.selectedGsapAnimations.find(h=>h.keyframes),c=h=>{var x,y;const p=Number.parseFloat(((x=i==null?void 0:i.dataAttributes)==null?void 0:x.start)??"0")||0,O=Number.parseFloat(((y=i==null?void 0:i.dataAttributes)==null?void 0:y.duration)??"1")||1;return O>0?Math.max(0,Math.min(100,Math.round((h-p)/O*1e3)/10)):0};let u="none";if(l!=null&&l.keyframes&&i){const h=c(e);u=l.keyframes.keyframes.some(p=>Math.abs(p.percentage-h)<=1)?"active":"inactive"}return{state:u,onToggle:i?r:void 0}}function KW({toggleTimelineVisibility:t,domEditSession:e,onSplitElement:n}){const r=oe(x=>x.activeTool),i=oe(x=>x.setActiveTool),{zoomMode:a,manualZoomPercent:l,setZoomMode:c,setManualZoomPercent:u}=p7(),h=Rd(a,l),{state:p,onToggle:O}=WW(e);return m.jsx("div",{className:"border-b border-neutral-800/40 bg-neutral-950/96",children:m.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-neutral-500",children:"Timeline"}),y7&&m.jsxs("div",{className:"flex items-center border border-neutral-800 rounded overflow-hidden",children:[m.jsx(Xt,{label:"Selection tool (V)",children:m.jsx("button",{type:"button",onClick:()=>i("select"),className:`flex h-6 w-6 items-center justify-center transition-colors ${r==="select"?"bg-neutral-700 text-neutral-200":"text-neutral-500 hover:text-neutral-300"}`,children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",children:m.jsx("path",{d:"M2 0.5L10 6L6.5 6.5L8.5 11L6.5 11.5L4.5 7L2 9Z"})})})}),m.jsx(Xt,{label:"Razor tool (B)",children:m.jsx("button",{type:"button",onClick:()=>i("razor"),className:`flex h-6 w-6 items-center justify-center transition-colors ${r==="razor"?"bg-neutral-700 text-neutral-200":"text-neutral-500 hover:text-neutral-300"}`,children:m.jsx(Nb,{size:11})})})]}),mi&&O&&m.jsxs(m.Fragment,{children:[m.jsx(Xt,{label:p==="active"?"Remove keyframe at playhead":p==="inactive"?"Add keyframe at playhead":"Enable keyframes",children:m.jsx("button",{type:"button",onClick:O,className:`flex h-7 w-7 items-center justify-center rounded transition-colors ${p==="active"?"text-studio-accent":p==="inactive"?"text-neutral-400 hover:text-studio-accent":"text-neutral-600 hover:text-neutral-400"}`,children:m.jsx("svg",{width:"18",height:"18",viewBox:"0 0 10 10",fill:"currentColor",children:p==="active"?m.jsx("path",{d:"M5 0.5L9.5 5L5 9.5L0.5 5Z"}):m.jsx("path",{d:"M5 1.2L8.8 5L5 8.8L1.2 5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})})})}),m.jsx(UW,{})]}),n&&(()=>{const{selectedElementId:x,elements:y,currentTime:b}=oe.getState(),S=x?y.find(A=>(A.key??A.id)===x):null;if(!S||!wu(S))return null;const k=b>S.start&&b<S.start+S.duration;return m.jsx(Xt,{label:"Split clip at playhead (S)",children:m.jsx("button",{type:"button",disabled:!k,onClick:()=>{k&&n(S,b)},className:`flex h-7 w-7 items-center justify-center rounded transition-colors ${k?"text-neutral-500 hover:text-neutral-200":"text-neutral-700 cursor-not-allowed"}`,children:m.jsx(Nb,{size:15})})})})()]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Xt,{label:"Fit timeline to width",children:m.jsx("button",{type:"button",onClick:()=>c("fit"),className:`h-7 px-2.5 rounded-md border text-[11px] font-medium transition-colors ${a==="fit"?"border-studio-accent/30 bg-studio-accent/10 text-studio-accent":"border-neutral-800 text-neutral-400 hover:border-neutral-700 hover:text-neutral-200"}`,children:"Fit"})}),m.jsx(Xt,{label:"Zoom out",children:m.jsx("button",{type:"button",onClick:()=>{c("manual"),u(k5("out",a,l))},className:"h-7 w-7 rounded-md border border-neutral-800 text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-200",children:"-"})}),m.jsx("div",{className:"min-w-[58px] text-center text-[10px] font-medium tabular-nums text-neutral-500",children:`${h}%`}),m.jsx(Xt,{label:"Zoom in",children:m.jsx("button",{type:"button",onClick:()=>{c("manual"),u(k5("in",a,l))},className:"h-7 w-7 rounded-md border border-neutral-800 text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-200",children:"+"})}),m.jsx(Xt,{label:m9(!0),children:m.jsx("button",{type:"button",onClick:t,className:"ml-1 flex h-7 w-7 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-neutral-900 hover:text-neutral-200","aria-label":"Hide timeline editor",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M5 7h14"}),m.jsx("path",{d:"m8 11 4 4 4-4"})]})})})]})]})})}function JW({waiting:t}){return m.jsx("div",{className:"h-full w-full bg-neutral-950 flex items-center justify-center",children:t?m.jsxs("div",{className:"flex flex-col items-center gap-3 text-center px-6",children:[m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-neutral-700 border-t-neutral-500 animate-spin"}),m.jsxs("p",{className:"text-xs text-neutral-600",children:["Waiting for preview server… run"," ",m.jsx("code",{className:"text-neutral-500 font-mono",children:"npm run dev"})]})]}):m.jsx("div",{className:"w-4 h-4 rounded-full bg-studio-accent animate-pulse"})})}function eK({message:t,tone:e,onDismiss:n}){const r=e==="error";return m.jsx("div",{className:"absolute bottom-6 right-6 z-[91] animate-in fade-in slide-in-from-bottom-2",onClick:n,role:n?"button":void 0,style:n?{cursor:"pointer"}:void 0,children:m.jsxs("div",{className:"relative flex items-center gap-3 overflow-hidden rounded-2xl pl-4 pr-2 py-3 text-[12px]",style:{background:r?"linear-gradient(135deg, rgba(127,29,29,0.55), rgba(80,10,10,0.45))":"linear-gradient(135deg, rgba(38,38,38,0.55), rgba(23,23,23,0.45))",backdropFilter:"blur(16px) saturate(1.6)",WebkitBackdropFilter:"blur(16px) saturate(1.6)",border:`1px solid ${r?"rgba(239,68,68,0.18)":"rgba(255,255,255,0.08)"}`,boxShadow:["0 8px 32px rgba(0,0,0,0.35)",`inset 0 1px 0 ${r?"rgba(239,68,68,0.12)":"rgba(255,255,255,0.06)"}`,"inset 0 -1px 0 rgba(0,0,0,0.15)"].join(", ")},children:[m.jsx("span",{className:r?"text-red-200":"text-neutral-200",children:t}),n&&m.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),n()},className:"flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-white/10 hover:text-neutral-300","aria-label":"Dismiss",children:m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:m.jsx("path",{d:"M2 2l6 6M8 2l-6 6"})})})]})})}function tK(){const[t,e]=d.useState(null),[n,r]=d.useState(!0),[i,a]=d.useState(!1);return Wt(()=>{const l=Tb(window.location.hash);let c=!1,u=null;function h(){a(!0),u=window.setTimeout(p,2e3)}function p(){fetch("/api/projects").then(O=>O.json()).then(O=>{if(!c)if(l)e(l),a(!1);else{const x=(O.projects??[])[0];x?(e(x.id),a(!1),window.location.hash=x9(x.id)):h()}}).catch(()=>{c||h()}).finally(()=>{c||r(!1)})}return p(),()=>{c=!0,u!==null&&clearTimeout(u)}}),d.useEffect(()=>{const l=()=>{const c=Tb(window.location.hash);c&&c!==t&&e(c)};return window.addEventListener("hashchange",l),()=>window.removeEventListener("hashchange",l)},[t]),{projectId:t,resolving:n,waitingForServer:i}}function nK(){const{projectId:t,resolving:e,waitingForServer:n}=tK(),r=d.useRef(wL());d.useEffect(()=>{e||n||GE()||(UE(),o$({has_project:t!=null}))},[t,e,n]);const[i,a]=d.useState(null),[l,c]=d.useState(()=>r.current.activeCompPath==null),[u,h]=d.useState(new Map),[p,O]=d.useState(null),[x,y]=d.useState(!0),[b,S]=d.useState(0),[,k]=d.useState(0),[A,C]=d.useState(null),T=d.useRef(null),j=d.useRef(i);j.current=i;const M=d.useRef(null),E=d$(t),$=kt(ve=>ve.isEditMode),N=kt(ve=>ve.selectedSegmentIds.size>0),D=rN(t),z=oe(ve=>ve.elements),B=oe(ve=>ve.setSelectedElementId),X=oe(ve=>ve.duration),U=oe(ve=>ve.isPlaying),I=!i||i==="index.html",K=i?`/api/projects/${t}/preview/comp/${i}`:null,Z=d.useMemo(()=>{const ve=z.length>0?Math.max(...z.map(tt=>tt.start+tt.duration)):0;return Math.max(X,ve)},[X,z]),F=d.useCallback(()=>{k(ve=>ve+1),window.setTimeout(()=>k(ve=>ve+1),80),window.setTimeout(()=>k(ve=>ve+1),300)},[]),[_,q]=d.useState(()=>r.current.timelineVisible??gs().timelineVisible??!0),G=d.useCallback(()=>{q(ve=>(wo({timelineVisible:!ve}),!ve))},[]),{appToast:R,showToast:P,dismissToast:L}=OL(),V=xN({rightCollapsed:r.current.rightCollapsed,rightPanelTab:r.current.rightPanelTab}),W=ON({projectId:t}),ee=d.useRef(0),ue=d.useRef(new Set),ae=d.useRef(!1),Y=d.useCallback(()=>{S(ve=>ve+1)},[]),re=bN({projectId:t,showToast:P,recordEdit:W.recordEdit,domEditSaveTimestampRef:ee,setRefreshKey:S});d.useEffect(()=>{if(l||!re.fileTreeLoaded)return;const ve=yL(r.current.activeCompPath,re.fileTree);a(tt=>tt===ve?tt:ve),c(!0)},[l,re.fileTree,re.fileTreeLoaded]);const he=aR({projectId:t,showToast:P,readOptionalProjectFile:re.readOptionalProjectFile,writeProjectFile:re.writeProjectFile,recordEdit:W.recordEdit,previewIframeRef:T,activeCompPathRef:j,domEditSaveTimestampRef:ee,reloadPreview:()=>S(ve=>ve+1),pendingTimelineEditPathRef:ue}),xe=pR({projectId:t,activeCompPath:i,timelineElements:z,showToast:P,writeProjectFile:re.writeProjectFile,recordEdit:W.recordEdit,domEditSaveTimestampRef:ee,reloadPreview:Y,previewIframeRef:T,pendingTimelineEditPathRef:ue,uploadProjectFiles:re.uploadProjectFiles,isRecordingRef:ae}),{activeBlockParams:ke,setActiveBlockParams:be,handleAddBlock:Se,handleTimelineBlockDrop:Ve,handlePreviewBlockDrop:Te}=zV({projectId:t,blockCtxDeps:{activeCompPath:i,timelineElements:z,readProjectFile:re.readProjectFile,writeProjectFile:re.writeProjectFile,recordEdit:W.recordEdit,refreshFileTree:re.refreshFileTree,reloadPreview:Y,showToast:P},previewIframeRef:T,setRightCollapsed:V.setRightCollapsed,setRightPanelTab:V.setRightPanelTab}),Ze=d.useRef(()=>{}),Xe=d.useRef(null),ze=d.useRef(async()=>{}),et=ve=>ze.current(ve),Ot=d.useRef(()=>!1),He=d.useRef(()=>{}),ct=d.useRef(()=>{}),{handleCopy:yt,handlePaste:Oe,handleCut:Ge}=UV({projectId:t,activeCompPath:i,domEditSelectionRef:Xe,showToast:P,writeProjectFile:re.writeProjectFile,recordEdit:W.recordEdit,domEditSaveTimestampRef:ee,reloadPreview:Y,handleTimelineElementDelete:xe.handleTimelineElementDelete,handleDomEditElementDelete:et,previewIframeRef:T}),Re=BV({toggleTimelineVisibility:G,handleTimelineElementDelete:xe.handleTimelineElementDelete,handleTimelineElementSplit:xe.handleTimelineElementSplit,handleDomEditElementDelete:et,domEditSelectionRef:Xe,editHistory:W,readOptionalProjectFile:re.readOptionalProjectFile,readProjectFile:re.readProjectFile,writeProjectFile:re.writeProjectFile,domEditSaveTimestampRef:ee,showToast:P,syncHistoryPreviewAfterApply:he.syncHistoryPreviewAfterApply,waitForPendingDomEditSaves:he.waitForPendingDomEditSaves,leftSidebarRef:M,handleCopy:yt,handlePaste:Oe,handleCut:Ge,onResetKeyframes:()=>Ot.current(),onDeleteSelectedKeyframes:()=>He.current(),onAfterUndoRedo:()=>ct.current(),onToggleRecording:mi?()=>It.current():void 0}),qe=d.useCallback(ve=>{var tt;return(tt=M.current)==null?void 0:tt.selectTab(ve)},[]),Ie=d.useCallback(()=>{var ve;return((ve=M.current)==null?void 0:ve.getTab())??"compositions"},[]),$e=DV({projectId:t,activeCompPath:i,isMasterView:I,compIdToSrc:u,captionEditMode:$,compositionLoading:x,previewIframeRef:T,timelineElements:z,setSelectedTimelineElementId:B,setRightCollapsed:V.setRightCollapsed,setRightPanelTab:V.setRightPanelTab,showToast:P,refreshPreviewDocumentVersion:F,queueDomEditSave:he.queueDomEditSave,readProjectFile:re.readProjectFile,writeProjectFile:re.writeProjectFile,updateEditingFileContent:re.updateEditingFileContent,domEditSaveTimestampRef:ee,editHistory:{recordEdit:W.recordEdit},fileTree:re.fileTree,importedFontAssetsRef:re.importedFontAssetsRef,projectDir:re.projectDir,projectIdRef:re.projectIdRef,previewIframe:p,refreshKey:b,rightPanelTab:V.rightPanelTab,applyStudioManualEditsToPreviewRef:he.applyStudioManualEditsToPreviewRef,syncPreviewHistoryHotkey:Re.syncPreviewHistoryHotkey,reloadPreview:Y,setRefreshKey:S,openSourceForSelection:re.openSourceForSelection,selectSidebarTab:qe,getSidebarTab:Ie});Xe.current=$e.domEditSelection,Ze.current=$e.clearDomSelection,ze.current=$e.handleDomEditElementDelete,Ot.current=$e.handleResetSelectedElementKeyframes,ct.current=$e.invalidateGsapCache,He.current=()=>{const ve=oe.getState().selectedKeyframes,tt=$e.selectedGsapAnimations.find(wn=>wn.keyframes);!tt||ve.size===0||ve.forEach(wn=>{const vr=Number(wn.split(":")[1]);Number.isFinite(vr)&&$e.handleGsapRemoveKeyframe(tt.id,vr)})},nL({projectId:t,activeCompPath:i,compIdToSrc:u,captionEditMode:$,captionHasSelection:N,previewIframeRef:T,captionSync:D,setRightCollapsed:V.setRightCollapsed});const ut=oL({projectIdRef:re.projectIdRef,compIdToSrc:u,activePreviewUrl:K,effectiveTimelineDuration:Z}),Ae=gL(),{lintModal:Be,linting:lt,handleLint:ot,closeLintModal:gn,findingsByElement:at,findingsByFile:Le}=pL(t,b);d.useEffect(()=>{oe.getState().setLintFindingsByElement(at)},[at]);const Ue=hL({projectId:t,activeCompPath:i,showToast:P,waitForPendingDomEditSaves:he.waitForPendingDomEditSaves}),{consoleErrors:Mt,setConsoleErrors:We,resetErrors:bt}=cL(p),Et=TL(re.handleImportFiles),It=d.useRef(()=>{}),qt=d.useRef($e);qt.current=$e;const{gestureState:Tn,gestureRecording:Zn,handleToggleRecording:Fn}=s_({domEditSessionRef:qt,previewIframeRef:T,showToast:P,isGestureRecordingRef:ae});It.current=Fn;const ni=d.useCallback(ve=>{T.current=ve,O(ve),Re.syncPreviewTimelineHotkey(ve),Re.syncPreviewHistoryHotkey(ve),bt(),F()},[Re,bt,F]),ri=d.useCallback(ve=>{a(ve.endsWith(".html")?ve:null),re.setEditingFile({path:ve,content:null}),fetch(`/api/projects/${t}/files/${ve}`).then(tt=>tt.json()).then(tt=>re.setEditingFile({path:ve,content:tt.content})).catch(()=>{})},[t,re]),{selectedStudioMotion:ii,designPanelActive:Pe,motionPanelActive:jt,inspectorPanelActive:Nt,inspectorButtonActive:nn,shouldShowSelectedDomBounds:Jn}=CL(V.rightPanelTab,V.rightCollapsed,U,$e.domEditSelection,Tn==="recording");AL({projectId:t,activeCompPath:i,duration:Z,isPlaying:U,compositionLoading:x,refreshKey:b,previewIframeRef:T,rightPanelTab:V.rightPanelTab,rightCollapsed:V.rightCollapsed,timelineVisible:_,activeCompPathHydrated:l,domEditSelection:$e.domEditSelection,buildDomSelectionFromTarget:$e.buildDomSelectionFromTarget,applyDomSelection:$e.applyDomSelection,initialState:r.current});const Sn=ML({projectId:t,activeCompPath:i,setActiveCompPath:a,showToast:P,previewIframeRef:T,captionEditMode:$,compositionLoading:x,refreshKey:b,setRefreshKey:S,timelineElements:z,isPlaying:U,editHistory:W,handleUndo:Re.handleUndo,handleRedo:Re.handleRedo,renderQueue:{jobs:E.jobs,isRendering:E.isRendering,deleteRender:E.deleteRender,clearCompleted:E.clearCompleted,startRender:E.startRender},compositionDimensions:Ae,waitForPendingDomEditSaves:he.waitForPendingDomEditSaves,handlePreviewIframeRef:ni,refreshPreviewDocumentVersion:F,timelineVisible:_,toggleTimelineVisibility:G});if(e||n||!t)return m.jsx(JW,{waiting:n});const Rt=m.jsx(KW,{toggleTimelineVisibility:G,domEditSession:$e,onSplitElement:xe.handleTimelineElementSplit});return m.jsx(FL,{value:Sn,children:m.jsx(BL,{value:V,children:m.jsx(mq,{value:re,children:m.jsx(YL,{value:$e,children:m.jsxs("div",{className:"flex flex-col h-full w-full bg-neutral-950 relative",onDragOver:Et.onDragOver,onDragEnter:Et.onDragEnter,onDragLeave:Et.onDragLeave,onDrop:Et.onDrop,children:[m.jsx(qL,{captureFrameHref:Ue.captureFrameHref,captureFrameFilename:Ue.captureFrameFilename,handleCaptureFrameClick:Ue.handleCaptureFrameClick,refreshCaptureFrameTime:Ue.refreshCaptureFrameTime,inspectorButtonActive:nn,inspectorPanelActive:Nt,onExport:()=>void E.startRender()}),m.jsxs("div",{className:"flex flex-1 min-h-0",children:[m.jsx(pq,{leftSidebarRef:M,onSelectComposition:ri,onAddBlock:Se,onPreviewBlock:C,onLint:ot,linting:lt,lintFindingCount:(Be==null?void 0:Be.length)??Le.size,lintFindingsByFile:Le}),m.jsx(_G,{timelineToolbar:Rt,renderClipContent:ut,handleTimelineElementDelete:xe.handleTimelineElementDelete,handleTimelineAssetDrop:xe.handleTimelineAssetDrop,handleTimelineBlockDrop:Ve,handlePreviewBlockDrop:Te,handleTimelineFileDrop:xe.handleTimelineFileDrop,handleTimelineElementMove:xe.handleTimelineElementMove,handleTimelineElementResize:xe.handleTimelineElementResize,handleBlockedTimelineEdit:xe.handleBlockedTimelineEdit,handleTimelineElementSplit:xe.handleTimelineElementSplit,handleRazorSplit:xe.handleRazorSplit,handleRazorSplitAll:xe.handleRazorSplitAll,setCompIdToSrc:h,setCompositionLoading:y,shouldShowSelectedDomBounds:Jn,isGestureRecording:Tn==="recording",blockPreview:A,gestureOverlay:Tn==="recording"&&p?m.jsx(l_,{samples:Zn.samplesRef.current,sampleCount:Zn.samplesRef.current.length,trail:Zn.trailRef.current,canvasRect:(()=>{const ve=p.getBoundingClientRect();return{left:ve.left,top:ve.top,width:ve.width,height:ve.height}})(),compositionSize:Ae??void 0,mode:"recording"}):void 0}),!V.rightCollapsed&&m.jsx(IW,{selectedStudioMotion:ii,designPanelActive:Pe,motionPanelActive:jt,activeBlockParams:ke,onCloseBlockParams:()=>{be(null),V.setRightPanelTab("design")},recordingState:Tn,recordingDuration:Zn.recordingDuration,onToggleRecording:mi?Fn:void 0})]}),Be!==null&&m.jsx(F5,{findings:Be,projectId:t,onClose:gn}),Mt!==null&&Mt.length>0&&m.jsx(F5,{findings:Mt,projectId:t,onClose:()=>We(null)}),$e.agentModalOpen&&$e.domEditSelection&&m.jsx($L,{selectionLabel:$e.domEditSelection.label,contextPreview:_R($e.domEditSelection,i),anchorPoint:$e.agentModalAnchorPoint,onSubmit:$e.handleAgentModalSubmit,onClose:()=>{$e.setAgentModalOpen(!1),$e.setAgentPromptSelectionContext(void 0),$e.setAgentModalAnchorPoint(null)}}),Et.active&&m.jsx(jL,{}),R&&m.jsx(eK,{message:R.message,tone:R.tone,onDismiss:L})]})})})})})}class rK extends d.Component{constructor(){super(...arguments);zy(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,a;console.error("[Studio] Uncaught error:",n,r.componentStack),Yt("crash",{error_message:n.message,error_name:n.name,stack_trace:((i=n.stack)==null?void 0:i.slice(0,4e3))??null,component_stack:((a=r.componentStack)==null?void 0:a.slice(0,2e3))??null})}render(){return this.state.error?m.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#0a0a0a",color:"#e5e5e5",fontFamily:"system-ui, -apple-system, sans-serif",gap:16},children:[m.jsx("div",{style:{fontSize:18,fontWeight:600},children:"Something went wrong"}),m.jsx("div",{style:{fontSize:13,color:"#888",maxWidth:480,textAlign:"center"},children:this.state.error.message}),m.jsx("button",{onClick:()=>this.setState({error:null}),style:{marginTop:8,padding:"8px 20px",background:"#2563eb",color:"#fff",border:"none",borderRadius:6,fontSize:14,cursor:"pointer"},children:"Try again"})]}):this.props.children}}Yt("session_start");function kC(t){var e;return t instanceof Error?{error_message:t.message,error_name:t.name,stack_trace:((e=t.stack)==null?void 0:e.slice(0,4e3))??null}:{error_message:String(t),error_name:null,stack_trace:null}}function iK(t,e){return!!(t.includes("Error fetching")&&(t.includes("404")||t.includes("Not Found"))||e==="EncodingError"||t.includes("unsupported or unrecognizable format")||t.includes("MEDIA_ERR_SRC_NOT_SUPPORTED"))}const AC=50;let tg=0,ng=0,FS=!1,BS=!1;window.addEventListener("error",t=>{var e;if((e=t.message)!=null&&e.includes("ResizeObserver loop")){t.stopImmediatePropagation(),t.preventDefault();return}if(tg++,tg>AC){FS||(FS=!0,Yt("error_cap_reached",{count:tg}));return}Yt("unhandled_error",{...kC(t.error),error_message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno})});let Mf=0;window.addEventListener("unhandledrejection",t=>{const e=kC(t.reason);if(iK(e.error_message,e.error_name)){Mf++,(Mf===1||Mf%100===0)&&Yt("composition_asset_error_filtered",{error_message:e.error_message.slice(0,200),error_name:e.error_name,total_filtered:Mf});return}if(ng++,ng>AC){BS||(BS=!0,Yt("rejection_cap_reached",{count:ng}));return}Yt("unhandled_promise_rejection",e)});XE.createRoot(document.getElementById("root")).render(m.jsx(d.StrictMode,{children:m.jsx(rK,{children:m.jsx(nK,{})})}));
|