@gallop.software/studio 2.3.173 → 2.4.1

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.
@@ -0,0 +1,138 @@
1
+ function om(i,c){for(var f=0;f<c.length;f++){const d=c[f];if(typeof d!="string"&&!Array.isArray(d)){for(const h in d)if(h!=="default"&&!(h in i)){const p=Object.getOwnPropertyDescriptor(d,h);p&&Object.defineProperty(i,h,p.get?p:{enumerable:!0,get:()=>d[h]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const p of h)if(p.type==="childList")for(const v of p.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&d(v)}).observe(document,{childList:!0,subtree:!0});function f(h){const p={};return h.integrity&&(p.integrity=h.integrity),h.referrerPolicy&&(p.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?p.credentials="include":h.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function d(h){if(h.ep)return;h.ep=!0;const p=f(h);fetch(h.href,p)}})();function im(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var tu={exports:{}},mi={};var sp;function rm(){if(sp)return mi;sp=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(d,h,p){var v=null;if(p!==void 0&&(v=""+p),h.key!==void 0&&(v=""+h.key),"key"in h){p={};for(var D in h)D!=="key"&&(p[D]=h[D])}else p=h;return h=p.ref,{$$typeof:i,type:d,key:v,ref:h!==void 0?h:null,props:p}}return mi.Fragment=c,mi.jsx=f,mi.jsxs=f,mi}var cp;function sm(){return cp||(cp=1,tu.exports=rm()),tu.exports}var vi=sm(),nu={exports:{}},Ge={};var up;function cm(){if(up)return Ge;up=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),v=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),E=Symbol.iterator;function Y(S){return S===null||typeof S!="object"?null:(S=E&&S[E]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,Q={};function j(S,U,ne){this.props=S,this.context=U,this.refs=Q,this.updater=ne||B}j.prototype.isReactComponent={},j.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},j.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ee(){}ee.prototype=j.prototype;function te(S,U,ne){this.props=S,this.context=U,this.refs=Q,this.updater=ne||B}var ce=te.prototype=new ee;ce.constructor=te,k(ce,j.prototype),ce.isPureReactComponent=!0;var V=Array.isArray;function P(){}var I={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function H(S,U,ne){var re=ne.ref;return{$$typeof:i,type:S,key:U,ref:re!==void 0?re:null,props:ne}}function G(S,U){return H(S.type,U,S.props)}function oe(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function fe(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(ne){return U[ne]})}var de=/\/+/g;function le(S,U){return typeof S=="object"&&S!==null&&S.key!=null?fe(""+S.key):U.toString(36)}function Me(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(P,P):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function T(S,U,ne,re,ke){var Te=typeof S;(Te==="undefined"||Te==="boolean")&&(S=null);var Ye=!1;if(S===null)Ye=!0;else switch(Te){case"bigint":case"string":case"number":Ye=!0;break;case"object":switch(S.$$typeof){case i:case c:Ye=!0;break;case L:return Ye=S._init,T(Ye(S._payload),U,ne,re,ke)}}if(Ye)return ke=ke(S),Ye=re===""?"."+le(S,0):re,V(ke)?(ne="",Ye!=null&&(ne=Ye.replace(de,"$&/")+"/"),T(ke,U,ne,"",function(nn){return nn})):ke!=null&&(oe(ke)&&(ke=G(ke,ne+(ke.key==null||S&&S.key===ke.key?"":(""+ke.key).replace(de,"$&/")+"/")+Ye)),U.push(ke)),1;Ye=0;var gt=re===""?".":re+":";if(V(S))for(var Be=0;Be<S.length;Be++)re=S[Be],Te=gt+le(re,Be),Ye+=T(re,U,ne,Te,ke);else if(Be=Y(S),typeof Be=="function")for(S=Be.call(S),Be=0;!(re=S.next()).done;)re=re.value,Te=gt+le(re,Be++),Ye+=T(re,U,ne,Te,ke);else if(Te==="object"){if(typeof S.then=="function")return T(Me(S),U,ne,re,ke);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Ye}function $(S,U,ne){if(S==null)return S;var re=[],ke=0;return T(S,re,"","",function(Te){return U.call(ne,Te,ke++)}),re}function J(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(ne){(S._status===0||S._status===-1)&&(S._status=1,S._result=ne)},function(ne){(S._status===0||S._status===-1)&&(S._status=2,S._result=ne)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var De=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Xe={map:$,forEach:function(S,U,ne){$(S,function(){U.apply(this,arguments)},ne)},count:function(S){var U=0;return $(S,function(){U++}),U},toArray:function(S){return $(S,function(U){return U})||[]},only:function(S){if(!oe(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ge.Activity=M,Ge.Children=Xe,Ge.Component=j,Ge.Fragment=f,Ge.Profiler=h,Ge.PureComponent=te,Ge.StrictMode=d,Ge.Suspense=w,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(S){return I.H.useMemoCache(S)}},Ge.cache=function(S){return function(){return S.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(S,U,ne){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var re=k({},S.props),ke=S.key;if(U!=null)for(Te in U.key!==void 0&&(ke=""+U.key),U)!ae.call(U,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&U.ref===void 0||(re[Te]=U[Te]);var Te=arguments.length-2;if(Te===1)re.children=ne;else if(1<Te){for(var Ye=Array(Te),gt=0;gt<Te;gt++)Ye[gt]=arguments[gt+2];re.children=Ye}return H(S.type,ke,re)},Ge.createContext=function(S){return S={$$typeof:v,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:p,_context:S},S},Ge.createElement=function(S,U,ne){var re,ke={},Te=null;if(U!=null)for(re in U.key!==void 0&&(Te=""+U.key),U)ae.call(U,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ke[re]=U[re]);var Ye=arguments.length-2;if(Ye===1)ke.children=ne;else if(1<Ye){for(var gt=Array(Ye),Be=0;Be<Ye;Be++)gt[Be]=arguments[Be+2];ke.children=gt}if(S&&S.defaultProps)for(re in Ye=S.defaultProps,Ye)ke[re]===void 0&&(ke[re]=Ye[re]);return H(S,Te,ke)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(S){return{$$typeof:D,render:S}},Ge.isValidElement=oe,Ge.lazy=function(S){return{$$typeof:L,_payload:{_status:-1,_result:S},_init:J}},Ge.memo=function(S,U){return{$$typeof:b,type:S,compare:U===void 0?null:U}},Ge.startTransition=function(S){var U=I.T,ne={};I.T=ne;try{var re=S(),ke=I.S;ke!==null&&ke(ne,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(P,De)}catch(Te){De(Te)}finally{U!==null&&ne.types!==null&&(U.types=ne.types),I.T=U}},Ge.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Ge.use=function(S){return I.H.use(S)},Ge.useActionState=function(S,U,ne){return I.H.useActionState(S,U,ne)},Ge.useCallback=function(S,U){return I.H.useCallback(S,U)},Ge.useContext=function(S){return I.H.useContext(S)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(S,U){return I.H.useDeferredValue(S,U)},Ge.useEffect=function(S,U){return I.H.useEffect(S,U)},Ge.useEffectEvent=function(S){return I.H.useEffectEvent(S)},Ge.useId=function(){return I.H.useId()},Ge.useImperativeHandle=function(S,U,ne){return I.H.useImperativeHandle(S,U,ne)},Ge.useInsertionEffect=function(S,U){return I.H.useInsertionEffect(S,U)},Ge.useLayoutEffect=function(S,U){return I.H.useLayoutEffect(S,U)},Ge.useMemo=function(S,U){return I.H.useMemo(S,U)},Ge.useOptimistic=function(S,U){return I.H.useOptimistic(S,U)},Ge.useReducer=function(S,U,ne){return I.H.useReducer(S,U,ne)},Ge.useRef=function(S){return I.H.useRef(S)},Ge.useState=function(S){return I.H.useState(S)},Ge.useSyncExternalStore=function(S,U,ne){return I.H.useSyncExternalStore(S,U,ne)},Ge.useTransition=function(){return I.H.useTransition()},Ge.version="19.2.4",Ge}var dp;function gu(){return dp||(dp=1,nu.exports=cm()),nu.exports}var x=gu();const yt=im(x),fp=om({__proto__:null,default:yt},[x]);function um(i){if(i.sheet)return i.sheet;for(var c=0;c<document.styleSheets.length;c++)if(document.styleSheets[c].ownerNode===i)return document.styleSheets[c]}function dm(i){var c=document.createElement("style");return c.setAttribute("data-emotion",i.key),i.nonce!==void 0&&c.setAttribute("nonce",i.nonce),c.appendChild(document.createTextNode("")),c.setAttribute("data-s",""),c}var fm=(function(){function i(f){var d=this;this._insertTag=function(h){var p;d.tags.length===0?d.insertionPoint?p=d.insertionPoint.nextSibling:d.prepend?p=d.container.firstChild:p=d.before:p=d.tags[d.tags.length-1].nextSibling,d.container.insertBefore(h,p),d.tags.push(h)},this.isSpeedy=f.speedy===void 0?!0:f.speedy,this.tags=[],this.ctr=0,this.nonce=f.nonce,this.key=f.key,this.container=f.container,this.prepend=f.prepend,this.insertionPoint=f.insertionPoint,this.before=null}var c=i.prototype;return c.hydrate=function(d){d.forEach(this._insertTag)},c.insert=function(d){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(dm(this));var h=this.tags[this.tags.length-1];if(this.isSpeedy){var p=um(h);try{p.insertRule(d,p.cssRules.length)}catch{}}else h.appendChild(document.createTextNode(d));this.ctr++},c.flush=function(){this.tags.forEach(function(d){var h;return(h=d.parentNode)==null?void 0:h.removeChild(d)}),this.tags=[],this.ctr=0},i})(),gn="-ms-",Gr="-moz-",ht="-webkit-",Op="comm",mu="rule",bu="decl",hm="@import",Bp="@keyframes",pm="@layer",gm=Math.abs,Vr=String.fromCharCode,mm=Object.assign;function bm(i,c){return dn(i,0)^45?(((c<<2^dn(i,0))<<2^dn(i,1))<<2^dn(i,2))<<2^dn(i,3):0}function Hp(i){return i.trim()}function ym(i,c){return(i=c.exec(i))?i[0]:i}function pt(i,c,f){return i.replace(c,f)}function fu(i,c){return i.indexOf(c)}function dn(i,c){return i.charCodeAt(c)|0}function wi(i,c,f){return i.slice(c,f)}function ra(i){return i.length}function yu(i){return i.length}function jr(i,c){return c.push(i),i}function xm(i,c){return i.map(c).join("")}var Fr=1,wo=1,Up=0,An=0,It=0,Co="";function Qr(i,c,f,d,h,p,v){return{value:i,root:c,parent:f,type:d,props:h,children:p,line:Fr,column:wo,length:v,return:""}}function bi(i,c){return mm(Qr("",null,null,"",null,null,0),i,{length:-i.length},c)}function vm(){return It}function wm(){return It=An>0?dn(Co,--An):0,wo--,It===10&&(wo=1,Fr--),It}function jn(){return It=An<Up?dn(Co,An++):0,wo++,It===10&&(wo=1,Fr++),It}function ca(){return dn(Co,An)}function Nr(){return An}function ki(i,c){return wi(Co,i,c)}function Si(i){switch(i){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function jp(i){return Fr=wo=1,Up=ra(Co=i),An=0,[]}function Np(i){return Co="",i}function qr(i){return Hp(ki(An-1,hu(i===91?i+2:i===40?i+1:i)))}function Sm(i){for(;(It=ca())&&It<33;)jn();return Si(i)>2||Si(It)>3?"":" "}function Cm(i,c){for(;--c&&jn()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return ki(i,Nr()+(c<6&&ca()==32&&jn()==32))}function hu(i){for(;jn();)switch(It){case i:return An;case 34:case 39:i!==34&&i!==39&&hu(It);break;case 40:i===41&&hu(i);break;case 92:jn();break}return An}function km(i,c){for(;jn()&&i+It!==57;)if(i+It===84&&ca()===47)break;return"/*"+ki(c,An-1)+"*"+Vr(i===47?i:jn())}function zm(i){for(;!Si(ca());)jn();return ki(i,An)}function Mm(i){return Np(Yr("",null,null,null,[""],i=jp(i),0,[0],i))}function Yr(i,c,f,d,h,p,v,D,w){for(var b=0,L=0,M=v,E=0,Y=0,B=0,k=1,Q=1,j=1,ee=0,te="",ce=h,V=p,P=d,I=te;Q;)switch(B=ee,ee=jn()){case 40:if(B!=108&&dn(I,M-1)==58){fu(I+=pt(qr(ee),"&","&\f"),"&\f")!=-1&&(j=-1);break}case 34:case 39:case 91:I+=qr(ee);break;case 9:case 10:case 13:case 32:I+=Sm(B);break;case 92:I+=Cm(Nr()-1,7);continue;case 47:switch(ca()){case 42:case 47:jr(Dm(km(jn(),Nr()),c,f),w);break;default:I+="/"}break;case 123*k:D[b++]=ra(I)*j;case 125*k:case 59:case 0:switch(ee){case 0:case 125:Q=0;case 59+L:j==-1&&(I=pt(I,/\f/g,"")),Y>0&&ra(I)-M&&jr(Y>32?pp(I+";",d,f,M-1):pp(pt(I," ","")+";",d,f,M-2),w);break;case 59:I+=";";default:if(jr(P=hp(I,c,f,b,L,h,D,te,ce=[],V=[],M),p),ee===123)if(L===0)Yr(I,c,P,P,ce,p,M,D,V);else switch(E===99&&dn(I,3)===110?100:E){case 100:case 108:case 109:case 115:Yr(i,P,P,d&&jr(hp(i,P,P,0,0,h,D,te,h,ce=[],M),V),h,V,M,D,d?ce:V);break;default:Yr(I,P,P,P,[""],V,0,D,V)}}b=L=Y=0,k=j=1,te=I="",M=v;break;case 58:M=1+ra(I),Y=B;default:if(k<1){if(ee==123)--k;else if(ee==125&&k++==0&&wm()==125)continue}switch(I+=Vr(ee),ee*k){case 38:j=L>0?1:(I+="\f",-1);break;case 44:D[b++]=(ra(I)-1)*j,j=1;break;case 64:ca()===45&&(I+=qr(jn())),E=ca(),L=M=ra(te=I+=zm(Nr())),ee++;break;case 45:B===45&&ra(I)==2&&(k=0)}}return p}function hp(i,c,f,d,h,p,v,D,w,b,L){for(var M=h-1,E=h===0?p:[""],Y=yu(E),B=0,k=0,Q=0;B<d;++B)for(var j=0,ee=wi(i,M+1,M=gm(k=v[B])),te=i;j<Y;++j)(te=Hp(k>0?E[j]+" "+ee:pt(ee,/&\f/g,E[j])))&&(w[Q++]=te);return Qr(i,c,f,h===0?mu:D,w,b,L)}function Dm(i,c,f){return Qr(i,c,f,Op,Vr(vm()),wi(i,2,-2),0)}function pp(i,c,f,d){return Qr(i,c,f,bu,wi(i,0,d),wi(i,d+1,-1),d)}function xo(i,c){for(var f="",d=yu(i),h=0;h<d;h++)f+=c(i[h],h,i,c)||"";return f}function Am(i,c,f,d){switch(i.type){case pm:if(i.children.length)break;case hm:case bu:return i.return=i.return||i.value;case Op:return"";case Bp:return i.return=i.value+"{"+xo(i.children,d)+"}";case mu:i.value=i.props.join(",")}return ra(f=xo(i.children,d))?i.return=i.value+"{"+f+"}":""}function Tm(i){var c=yu(i);return function(f,d,h,p){for(var v="",D=0;D<c;D++)v+=i[D](f,d,h,p)||"";return v}}function Lm(i){return function(c){c.root||(c=c.return)&&i(c)}}function Em(i){var c=Object.create(null);return function(f){return c[f]===void 0&&(c[f]=i(f)),c[f]}}var Rm=function(c,f,d){for(var h=0,p=0;h=p,p=ca(),h===38&&p===12&&(f[d]=1),!Si(p);)jn();return ki(c,An)},_m=function(c,f){var d=-1,h=44;do switch(Si(h)){case 0:h===38&&ca()===12&&(f[d]=1),c[d]+=Rm(An-1,f,d);break;case 2:c[d]+=qr(h);break;case 4:if(h===44){c[++d]=ca()===58?"&\f":"",f[d]=c[d].length;break}default:c[d]+=Vr(h)}while(h=jn());return c},Om=function(c,f){return Np(_m(jp(c),f))},gp=new WeakMap,Bm=function(c){if(!(c.type!=="rule"||!c.parent||c.length<1)){for(var f=c.value,d=c.parent,h=c.column===d.column&&c.line===d.line;d.type!=="rule";)if(d=d.parent,!d)return;if(!(c.props.length===1&&f.charCodeAt(0)!==58&&!gp.get(d))&&!h){gp.set(c,!0);for(var p=[],v=Om(f,p),D=d.props,w=0,b=0;w<v.length;w++)for(var L=0;L<D.length;L++,b++)c.props[b]=p[w]?v[w].replace(/&\f/g,D[L]):D[L]+" "+v[w]}}},Hm=function(c){if(c.type==="decl"){var f=c.value;f.charCodeAt(0)===108&&f.charCodeAt(2)===98&&(c.return="",c.value="")}};function qp(i,c){switch(bm(i,c)){case 5103:return ht+"print-"+i+i;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ht+i+i;case 5349:case 4246:case 4810:case 6968:case 2756:return ht+i+Gr+i+gn+i+i;case 6828:case 4268:return ht+i+gn+i+i;case 6165:return ht+i+gn+"flex-"+i+i;case 5187:return ht+i+pt(i,/(\w+).+(:[^]+)/,ht+"box-$1$2"+gn+"flex-$1$2")+i;case 5443:return ht+i+gn+"flex-item-"+pt(i,/flex-|-self/,"")+i;case 4675:return ht+i+gn+"flex-line-pack"+pt(i,/align-content|flex-|-self/,"")+i;case 5548:return ht+i+gn+pt(i,"shrink","negative")+i;case 5292:return ht+i+gn+pt(i,"basis","preferred-size")+i;case 6060:return ht+"box-"+pt(i,"-grow","")+ht+i+gn+pt(i,"grow","positive")+i;case 4554:return ht+pt(i,/([^-])(transform)/g,"$1"+ht+"$2")+i;case 6187:return pt(pt(pt(i,/(zoom-|grab)/,ht+"$1"),/(image-set)/,ht+"$1"),i,"")+i;case 5495:case 3959:return pt(i,/(image-set\([^]*)/,ht+"$1$`$1");case 4968:return pt(pt(i,/(.+:)(flex-)?(.*)/,ht+"box-pack:$3"+gn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ht+i+i;case 4095:case 3583:case 4068:case 2532:return pt(i,/(.+)-inline(.+)/,ht+"$1$2")+i;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ra(i)-1-c>6)switch(dn(i,c+1)){case 109:if(dn(i,c+4)!==45)break;case 102:return pt(i,/(.+:)(.+)-([^]+)/,"$1"+ht+"$2-$3$1"+Gr+(dn(i,c+3)==108?"$3":"$2-$3"))+i;case 115:return~fu(i,"stretch")?qp(pt(i,"stretch","fill-available"),c)+i:i}break;case 4949:if(dn(i,c+1)!==115)break;case 6444:switch(dn(i,ra(i)-3-(~fu(i,"!important")&&10))){case 107:return pt(i,":",":"+ht)+i;case 101:return pt(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ht+(dn(i,14)===45?"inline-":"")+"box$3$1"+ht+"$2$3$1"+gn+"$2box$3")+i}break;case 5936:switch(dn(i,c+11)){case 114:return ht+i+gn+pt(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return ht+i+gn+pt(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return ht+i+gn+pt(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return ht+i+gn+i+i}return i}var Um=function(c,f,d,h){if(c.length>-1&&!c.return)switch(c.type){case bu:c.return=qp(c.value,c.length);break;case Bp:return xo([bi(c,{value:pt(c.value,"@","@"+ht)})],h);case mu:if(c.length)return xm(c.props,function(p){switch(ym(p,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xo([bi(c,{props:[pt(p,/:(read-\w+)/,":"+Gr+"$1")]})],h);case"::placeholder":return xo([bi(c,{props:[pt(p,/:(plac\w+)/,":"+ht+"input-$1")]}),bi(c,{props:[pt(p,/:(plac\w+)/,":"+Gr+"$1")]}),bi(c,{props:[pt(p,/:(plac\w+)/,gn+"input-$1")]})],h)}return""})}},jm=[Um],Nm=function(c){var f=c.key;if(f==="css"){var d=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(d,function(k){var Q=k.getAttribute("data-emotion");Q.indexOf(" ")!==-1&&(document.head.appendChild(k),k.setAttribute("data-s",""))})}var h=c.stylisPlugins||jm,p={},v,D=[];v=c.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+f+' "]'),function(k){for(var Q=k.getAttribute("data-emotion").split(" "),j=1;j<Q.length;j++)p[Q[j]]=!0;D.push(k)});var w,b=[Bm,Hm];{var L,M=[Am,Lm(function(k){L.insert(k)})],E=Tm(b.concat(h,M)),Y=function(Q){return xo(Mm(Q),E)};w=function(Q,j,ee,te){L=ee,Y(Q?Q+"{"+j.styles+"}":j.styles),te&&(B.inserted[j.name]=!0)}}var B={key:f,sheet:new fm({key:f,container:v,nonce:c.nonce,speedy:c.speedy,prepend:c.prepend,insertionPoint:c.insertionPoint}),nonce:c.nonce,inserted:p,registered:{},insert:w};return B.sheet.hydrate(D),B},au={exports:{}},bt={};var mp;function qm(){if(mp)return bt;mp=1;var i=typeof Symbol=="function"&&Symbol.for,c=i?Symbol.for("react.element"):60103,f=i?Symbol.for("react.portal"):60106,d=i?Symbol.for("react.fragment"):60107,h=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,v=i?Symbol.for("react.provider"):60109,D=i?Symbol.for("react.context"):60110,w=i?Symbol.for("react.async_mode"):60111,b=i?Symbol.for("react.concurrent_mode"):60111,L=i?Symbol.for("react.forward_ref"):60112,M=i?Symbol.for("react.suspense"):60113,E=i?Symbol.for("react.suspense_list"):60120,Y=i?Symbol.for("react.memo"):60115,B=i?Symbol.for("react.lazy"):60116,k=i?Symbol.for("react.block"):60121,Q=i?Symbol.for("react.fundamental"):60117,j=i?Symbol.for("react.responder"):60118,ee=i?Symbol.for("react.scope"):60119;function te(V){if(typeof V=="object"&&V!==null){var P=V.$$typeof;switch(P){case c:switch(V=V.type,V){case w:case b:case d:case p:case h:case M:return V;default:switch(V=V&&V.$$typeof,V){case D:case L:case B:case Y:case v:return V;default:return P}}case f:return P}}}function ce(V){return te(V)===b}return bt.AsyncMode=w,bt.ConcurrentMode=b,bt.ContextConsumer=D,bt.ContextProvider=v,bt.Element=c,bt.ForwardRef=L,bt.Fragment=d,bt.Lazy=B,bt.Memo=Y,bt.Portal=f,bt.Profiler=p,bt.StrictMode=h,bt.Suspense=M,bt.isAsyncMode=function(V){return ce(V)||te(V)===w},bt.isConcurrentMode=ce,bt.isContextConsumer=function(V){return te(V)===D},bt.isContextProvider=function(V){return te(V)===v},bt.isElement=function(V){return typeof V=="object"&&V!==null&&V.$$typeof===c},bt.isForwardRef=function(V){return te(V)===L},bt.isFragment=function(V){return te(V)===d},bt.isLazy=function(V){return te(V)===B},bt.isMemo=function(V){return te(V)===Y},bt.isPortal=function(V){return te(V)===f},bt.isProfiler=function(V){return te(V)===p},bt.isStrictMode=function(V){return te(V)===h},bt.isSuspense=function(V){return te(V)===M},bt.isValidElementType=function(V){return typeof V=="string"||typeof V=="function"||V===d||V===b||V===p||V===h||V===M||V===E||typeof V=="object"&&V!==null&&(V.$$typeof===B||V.$$typeof===Y||V.$$typeof===v||V.$$typeof===D||V.$$typeof===L||V.$$typeof===Q||V.$$typeof===j||V.$$typeof===ee||V.$$typeof===k)},bt.typeOf=te,bt}var bp;function Ym(){return bp||(bp=1,au.exports=qm()),au.exports}var lu,yp;function Gm(){if(yp)return lu;yp=1;var i=Ym(),c={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},d={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},h={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},p={};p[i.ForwardRef]=d,p[i.Memo]=h;function v(B){return i.isMemo(B)?h:p[B.$$typeof]||c}var D=Object.defineProperty,w=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,L=Object.getOwnPropertyDescriptor,M=Object.getPrototypeOf,E=Object.prototype;function Y(B,k,Q){if(typeof k!="string"){if(E){var j=M(k);j&&j!==E&&Y(B,j,Q)}var ee=w(k);b&&(ee=ee.concat(b(k)));for(var te=v(B),ce=v(k),V=0;V<ee.length;++V){var P=ee[V];if(!f[P]&&!(Q&&Q[P])&&!(ce&&ce[P])&&!(te&&te[P])){var I=L(k,P);try{D(B,P,I)}catch{}}}}return B}return lu=Y,lu}Gm();var Xm=!0;function Vm(i,c,f){var d="";return f.split(" ").forEach(function(h){i[h]!==void 0?c.push(i[h]+";"):h&&(d+=h+" ")}),d}var Yp=function(c,f,d){var h=c.key+"-"+f.name;(d===!1||Xm===!1)&&c.registered[h]===void 0&&(c.registered[h]=f.styles)},Fm=function(c,f,d){Yp(c,f,d);var h=c.key+"-"+f.name;if(c.inserted[f.name]===void 0){var p=f;do c.insert(f===p?"."+h:"",p,c.sheet,!0),p=p.next;while(p!==void 0)}};function Qm(i){for(var c=0,f,d=0,h=i.length;h>=4;++d,h-=4)f=i.charCodeAt(d)&255|(i.charCodeAt(++d)&255)<<8|(i.charCodeAt(++d)&255)<<16|(i.charCodeAt(++d)&255)<<24,f=(f&65535)*1540483477+((f>>>16)*59797<<16),f^=f>>>24,c=(f&65535)*1540483477+((f>>>16)*59797<<16)^(c&65535)*1540483477+((c>>>16)*59797<<16);switch(h){case 3:c^=(i.charCodeAt(d+2)&255)<<16;case 2:c^=(i.charCodeAt(d+1)&255)<<8;case 1:c^=i.charCodeAt(d)&255,c=(c&65535)*1540483477+((c>>>16)*59797<<16)}return c^=c>>>13,c=(c&65535)*1540483477+((c>>>16)*59797<<16),((c^c>>>15)>>>0).toString(36)}var Km={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Zm=/[A-Z]|^ms/g,$m=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gp=function(c){return c.charCodeAt(1)===45},xp=function(c){return c!=null&&typeof c!="boolean"},ou=Em(function(i){return Gp(i)?i:i.replace(Zm,"-$&").toLowerCase()}),vp=function(c,f){switch(c){case"animation":case"animationName":if(typeof f=="string")return f.replace($m,function(d,h,p){return sa={name:h,styles:p,next:sa},h})}return Km[c]!==1&&!Gp(c)&&typeof f=="number"&&f!==0?f+"px":f};function Ci(i,c,f){if(f==null)return"";var d=f;if(d.__emotion_styles!==void 0)return d;switch(typeof f){case"boolean":return"";case"object":{var h=f;if(h.anim===1)return sa={name:h.name,styles:h.styles,next:sa},h.name;var p=f;if(p.styles!==void 0){var v=p.next;if(v!==void 0)for(;v!==void 0;)sa={name:v.name,styles:v.styles,next:sa},v=v.next;var D=p.styles+";";return D}return Wm(i,c,f)}case"function":{if(i!==void 0){var w=sa,b=f(i);return sa=w,Ci(i,c,b)}break}}var L=f;return L}function Wm(i,c,f){var d="";if(Array.isArray(f))for(var h=0;h<f.length;h++)d+=Ci(i,c,f[h])+";";else for(var p in f){var v=f[p];if(typeof v!="object"){var D=v;xp(D)&&(d+=ou(p)+":"+vp(p,D)+";")}else if(Array.isArray(v)&&typeof v[0]=="string"&&c==null)for(var w=0;w<v.length;w++)xp(v[w])&&(d+=ou(p)+":"+vp(p,v[w])+";");else{var b=Ci(i,c,v);switch(p){case"animation":case"animationName":{d+=ou(p)+":"+b+";";break}default:d+=p+"{"+b+"}"}}}return d}var wp=/label:\s*([^\s;{]+)\s*(;|$)/g,sa;function Xp(i,c,f){if(i.length===1&&typeof i[0]=="object"&&i[0]!==null&&i[0].styles!==void 0)return i[0];var d=!0,h="";sa=void 0;var p=i[0];if(p==null||p.raw===void 0)d=!1,h+=Ci(f,c,p);else{var v=p;h+=v[0]}for(var D=1;D<i.length;D++)if(h+=Ci(f,c,i[D]),d){var w=p;h+=w[D]}wp.lastIndex=0;for(var b="",L;(L=wp.exec(h))!==null;)b+="-"+L[1];var M=Qm(h)+b;return{name:M,styles:h,next:sa}}var Jm=function(c){return c()},Im=fp.useInsertionEffect?fp.useInsertionEffect:!1,Pm=Im||Jm,Vp=x.createContext(typeof HTMLElement<"u"?Nm({key:"css"}):null);Vp.Provider;var e1=function(c){return x.forwardRef(function(f,d){var h=x.useContext(Vp);return c(f,h,d)})},t1=x.createContext({}),zi={}.hasOwnProperty,pu="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",xu=function(c,f){var d={};for(var h in f)zi.call(f,h)&&(d[h]=f[h]);return d[pu]=c,d},n1=function(c){var f=c.cache,d=c.serialized,h=c.isStringTag;return Yp(f,d,h),Pm(function(){return Fm(f,d,h)}),null},a1=e1(function(i,c,f){var d=i.css;typeof d=="string"&&c.registered[d]!==void 0&&(d=c.registered[d]);var h=i[pu],p=[d],v="";typeof i.className=="string"?v=Vm(c.registered,p,i.className):i.className!=null&&(v=i.className+" ");var D=Xp(p,void 0,x.useContext(t1));v+=c.key+"-"+D.name;var w={};for(var b in i)zi.call(i,b)&&b!=="css"&&b!==pu&&(w[b]=i[b]);return w.className=v,f&&(w.ref=f),x.createElement(x.Fragment,null,x.createElement(n1,{cache:c,serialized:D,isStringTag:typeof h=="string"}),x.createElement(h,w))}),vu=a1,Pe=vi.Fragment,r=function(c,f,d){return zi.call(f,"css")?vi.jsx(vu,xu(c,f),d):vi.jsx(c,f,d)},y=function(c,f,d){return zi.call(f,"css")?vi.jsxs(vu,xu(c,f),d):vi.jsxs(c,f,d)},iu={exports:{}},yi={},ru={exports:{}},su={};var Sp;function l1(){return Sp||(Sp=1,(function(i){function c(T,$){var J=T.length;T.push($);e:for(;0<J;){var De=J-1>>>1,Xe=T[De];if(0<h(Xe,$))T[De]=$,T[J]=Xe,J=De;else break e}}function f(T){return T.length===0?null:T[0]}function d(T){if(T.length===0)return null;var $=T[0],J=T.pop();if(J!==$){T[0]=J;e:for(var De=0,Xe=T.length,S=Xe>>>1;De<S;){var U=2*(De+1)-1,ne=T[U],re=U+1,ke=T[re];if(0>h(ne,J))re<Xe&&0>h(ke,ne)?(T[De]=ke,T[re]=J,De=re):(T[De]=ne,T[U]=J,De=U);else if(re<Xe&&0>h(ke,J))T[De]=ke,T[re]=J,De=re;else break e}}return $}function h(T,$){var J=T.sortIndex-$.sortIndex;return J!==0?J:T.id-$.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var v=Date,D=v.now();i.unstable_now=function(){return v.now()-D}}var w=[],b=[],L=1,M=null,E=3,Y=!1,B=!1,k=!1,Q=!1,j=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function ce(T){for(var $=f(b);$!==null;){if($.callback===null)d(b);else if($.startTime<=T)d(b),$.sortIndex=$.expirationTime,c(w,$);else break;$=f(b)}}function V(T){if(k=!1,ce(T),!B)if(f(w)!==null)B=!0,P||(P=!0,fe());else{var $=f(b);$!==null&&Me(V,$.startTime-T)}}var P=!1,I=-1,ae=5,H=-1;function G(){return Q?!0:!(i.unstable_now()-H<ae)}function oe(){if(Q=!1,P){var T=i.unstable_now();H=T;var $=!0;try{e:{B=!1,k&&(k=!1,ee(I),I=-1),Y=!0;var J=E;try{t:{for(ce(T),M=f(w);M!==null&&!(M.expirationTime>T&&G());){var De=M.callback;if(typeof De=="function"){M.callback=null,E=M.priorityLevel;var Xe=De(M.expirationTime<=T);if(T=i.unstable_now(),typeof Xe=="function"){M.callback=Xe,ce(T),$=!0;break t}M===f(w)&&d(w),ce(T)}else d(w);M=f(w)}if(M!==null)$=!0;else{var S=f(b);S!==null&&Me(V,S.startTime-T),$=!1}}break e}finally{M=null,E=J,Y=!1}$=void 0}}finally{$?fe():P=!1}}}var fe;if(typeof te=="function")fe=function(){te(oe)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,le=de.port2;de.port1.onmessage=oe,fe=function(){le.postMessage(null)}}else fe=function(){j(oe,0)};function Me(T,$){I=j(function(){T(i.unstable_now())},$)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(T){T.callback=null},i.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<T?Math.floor(1e3/T):5},i.unstable_getCurrentPriorityLevel=function(){return E},i.unstable_next=function(T){switch(E){case 1:case 2:case 3:var $=3;break;default:$=E}var J=E;E=$;try{return T()}finally{E=J}},i.unstable_requestPaint=function(){Q=!0},i.unstable_runWithPriority=function(T,$){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var J=E;E=T;try{return $()}finally{E=J}},i.unstable_scheduleCallback=function(T,$,J){var De=i.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?De+J:De):J=De,T){case 1:var Xe=-1;break;case 2:Xe=250;break;case 5:Xe=1073741823;break;case 4:Xe=1e4;break;default:Xe=5e3}return Xe=J+Xe,T={id:L++,callback:$,priorityLevel:T,startTime:J,expirationTime:Xe,sortIndex:-1},J>De?(T.sortIndex=J,c(b,T),f(w)===null&&T===f(b)&&(k?(ee(I),I=-1):k=!0,Me(V,J-De))):(T.sortIndex=Xe,c(w,T),B||Y||(B=!0,P||(P=!0,fe()))),T},i.unstable_shouldYield=G,i.unstable_wrapCallback=function(T){var $=E;return function(){var J=E;E=$;try{return T.apply(this,arguments)}finally{E=J}}}})(su)),su}var Cp;function o1(){return Cp||(Cp=1,ru.exports=l1()),ru.exports}var cu={exports:{}},pn={};var kp;function i1(){if(kp)return pn;kp=1;var i=gu();function c(w){var b="https://react.dev/errors/"+w;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var L=2;L<arguments.length;L++)b+="&args[]="+encodeURIComponent(arguments[L])}return"Minified React error #"+w+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var d={d:{f,r:function(){throw Error(c(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},h=Symbol.for("react.portal");function p(w,b,L){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:M==null?null:""+M,children:w,containerInfo:b,implementation:L}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function D(w,b){if(w==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,pn.createPortal=function(w,b){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(c(299));return p(w,b,null,L)},pn.flushSync=function(w){var b=v.T,L=d.p;try{if(v.T=null,d.p=2,w)return w()}finally{v.T=b,d.p=L,d.d.f()}},pn.preconnect=function(w,b){typeof w=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,d.d.C(w,b))},pn.prefetchDNS=function(w){typeof w=="string"&&d.d.D(w)},pn.preinit=function(w,b){if(typeof w=="string"&&b&&typeof b.as=="string"){var L=b.as,M=D(L,b.crossOrigin),E=typeof b.integrity=="string"?b.integrity:void 0,Y=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;L==="style"?d.d.S(w,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:M,integrity:E,fetchPriority:Y}):L==="script"&&d.d.X(w,{crossOrigin:M,integrity:E,fetchPriority:Y,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},pn.preinitModule=function(w,b){if(typeof w=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var L=D(b.as,b.crossOrigin);d.d.M(w,{crossOrigin:L,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&d.d.M(w)},pn.preload=function(w,b){if(typeof w=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var L=b.as,M=D(L,b.crossOrigin);d.d.L(w,L,{crossOrigin:M,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},pn.preloadModule=function(w,b){if(typeof w=="string")if(b){var L=D(b.as,b.crossOrigin);d.d.m(w,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:L,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else d.d.m(w)},pn.requestFormReset=function(w){d.d.r(w)},pn.unstable_batchedUpdates=function(w,b){return w(b)},pn.useFormState=function(w,b,L){return v.H.useFormState(w,b,L)},pn.useFormStatus=function(){return v.H.useHostTransitionStatus()},pn.version="19.2.4",pn}var zp;function r1(){if(zp)return cu.exports;zp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),cu.exports=i1(),cu.exports}var Mp;function s1(){if(Mp)return yi;Mp=1;var i=o1(),c=gu(),f=r1();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function D(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function w(e){if(p(e)!==e)throw Error(d(188))}function b(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(d(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var o=l.alternate;if(o===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===o.child){for(o=l.child;o;){if(o===n)return w(l),e;if(o===a)return w(l),t;o=o.sibling}throw Error(d(188))}if(n.return!==a.return)n=l,a=o;else{for(var u=!1,m=l.child;m;){if(m===n){u=!0,n=l,a=o;break}if(m===a){u=!0,a=l,n=o;break}m=m.sibling}if(!u){for(m=o.child;m;){if(m===n){u=!0,n=o,a=l;break}if(m===a){u=!0,a=o,n=l;break}m=m.sibling}if(!u)throw Error(d(189))}}if(n.alternate!==a)throw Error(d(190))}if(n.tag!==3)throw Error(d(188));return n.stateNode.current===n?e:t}function L(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=L(e),t!==null)return t;e=e.sibling}return null}var M=Object.assign,E=Symbol.for("react.element"),Y=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),te=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var de=Symbol.for("react.client.reference");function le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case j:return"Profiler";case Q:return"StrictMode";case V:return"Suspense";case P:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case te:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:le(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var Me=Array.isArray,T=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},De=[],Xe=-1;function S(e){return{current:e}}function U(e){0>Xe||(e.current=De[Xe],De[Xe]=null,Xe--)}function ne(e,t){Xe++,De[Xe]=e.current,e.current=t}var re=S(null),ke=S(null),Te=S(null),Ye=S(null);function gt(e,t){switch(ne(Te,t),ne(ke,e),ne(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Eh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Eh(t),e=Rh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(re),ne(re,e)}function Be(){U(re),U(ke),U(Te)}function nn(e){e.memoizedState!==null&&ne(Ye,e);var t=re.current,n=Rh(t,e.type);t!==n&&(ne(ke,e),ne(re,n))}function Ze(e){ke.current===e&&(U(re),U(ke)),Ye.current===e&&(U(Ye),fi._currentValue=J)}var et,xt;function _t(e){if(et===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);et=t&&t[1]||"",xt=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+et+e+xt}var jt=!1;function Ft(e,t){if(!e||jt)return"";jt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(N){var O=N}Reflect.construct(e,[],K)}else{try{K.call()}catch(N){O=N}e.call(K.prototype)}}else{try{throw Error()}catch(N){O=N}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(N){if(N&&O&&typeof N.stack=="string")return[N.stack,O.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),u=o[0],m=o[1];if(u&&m){var C=u.split(`
4
+ `),_=m.split(`
5
+ `);for(l=a=0;a<C.length&&!C[a].includes("DetermineComponentFrameRoot");)a++;for(;l<_.length&&!_[l].includes("DetermineComponentFrameRoot");)l++;if(a===C.length||l===_.length)for(a=C.length-1,l=_.length-1;1<=a&&0<=l&&C[a]!==_[l];)l--;for(;1<=a&&0<=l;a--,l--)if(C[a]!==_[l]){if(a!==1||l!==1)do if(a--,l--,0>l||C[a]!==_[l]){var X=`
6
+ `+C[a].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=a&&0<=l);break}}}finally{jt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?_t(n):""}function Pt(e,t){switch(e.tag){case 26:case 27:case 5:return _t(e.type);case 16:return _t("Lazy");case 13:return e.child!==t&&t!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return Ft(e.type,!1);case 11:return Ft(e.type.render,!1);case 1:return Ft(e.type,!0);case 31:return _t("Activity");default:return""}}function fn(e){try{var t="",n=null;do t+=Pt(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
7
+ Error generating stack: `+a.message+`
8
+ `+a.stack}}var en=Object.prototype.hasOwnProperty,rt=i.unstable_scheduleCallback,Nt=i.unstable_cancelCallback,pe=i.unstable_shouldYield,Wn=i.unstable_requestPaint,Ot=i.unstable_now,mn=i.unstable_getCurrentPriorityLevel,Tn=i.unstable_ImmediatePriority,xn=i.unstable_UserBlockingPriority,vn=i.unstable_NormalPriority,Z=i.unstable_LowPriority,ie=i.unstable_IdlePriority,Re=i.log,ut=i.unstable_setDisableYieldValue,Ne=null,Ce=null;function Ct(e){if(typeof Re=="function"&&ut(e),Ce&&typeof Ce.setStrictMode=="function")try{Ce.setStrictMode(Ne,e)}catch{}}var lt=Math.clz32?Math.clz32:ko,na=Math.log,Nn=Math.LN2;function ko(e){return e>>>=0,e===0?32:31-(na(e)/Nn|0)|0}var _a=256,Oa=262144,ua=4194304;function Jn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ba(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,o=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var m=a&134217727;return m!==0?(a=m&~o,a!==0?l=Jn(a):(u&=m,u!==0?l=Jn(u):n||(n=m&~e,n!==0&&(l=Jn(n))))):(m=a&~o,m!==0?l=Jn(m):u!==0?l=Jn(u):n||(n=a&~e,n!==0&&(l=Jn(n)))),l===0?0:t!==0&&t!==l&&(t&o)===0&&(o=l&-l,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:l}function da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Rl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 _l(){var e=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),e}function fl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zo(e,t,n,a,l,o){var u=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var m=e.entanglements,C=e.expirationTimes,_=e.hiddenUpdates;for(n=u&~n;0<n;){var X=31-lt(n),K=1<<X;m[X]=0,C[X]=-1;var O=_[X];if(O!==null)for(_[X]=null,X=0;X<O.length;X++){var N=O[X];N!==null&&(N.lane&=-536870913)}n&=~K}a!==0&&Ol(e,a,0),o!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=o&~(u&~t))}function Ol(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-lt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function me(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-lt(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function Ve(e,t){var n=t&-t;return n=(n&42)!==0?1:Fe(n),(n&(e.suspendedLanes|t))!==0?0:n}function Fe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function dt(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:tp(e.type))}function an(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var hn=Math.random().toString(36).slice(2),mt="__reactFiber$"+hn,Lt="__reactProps$"+hn,Ln="__reactContainer$"+hn,Bl="__reactEvents$"+hn,Ha="__reactListeners$"+hn,Ua="__reactHandles$"+hn,Mo="__reactResources$"+hn,hl="__reactMarker$"+hn;function Do(e){delete e[mt],delete e[Lt],delete e[Bl],delete e[Ha],delete e[Ua]}function ha(e){var t=e[mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nh(e);e!==null;){if(n=e[mt])return n;e=Nh(e)}return t}e=n,n=e.parentNode}return null}function ge(e){if(e=e[mt]||e[Ln]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function se(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function ye(e){var t=e[Mo];return t||(t=e[Mo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xe(e){e[hl]=!0}var _e=new Set,He={};function ot(e,t){it(e,t),it(e+"Capture",t)}function it(e,t){for(He[e]=t,e=0;e<t.length;e++)_e.add(t[e])}var Ue=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]*$"),bn={},Ao={};function Jp(e){return en.call(Ao,e)?!0:en.call(bn,e)?!1:Ue.test(e)?Ao[e]=!0:(bn[e]=!0,!1)}function Mi(e,t,n){if(Jp(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Di(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function pa(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function qn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Su(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ip(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var l=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){n=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zr(e){if(!e._valueTracker){var t=Su(e)?"checked":"value";e._valueTracker=Ip(e,t,""+e[t])}}function Cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Su(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Ai(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Pp=/[\n"\\]/g;function Yn(e){return e.replace(Pp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function $r(e,t,n,a,l,o,u,m){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qn(t)):e.value!==""+qn(t)&&(e.value=""+qn(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?Wr(e,u,qn(t)):n!=null?Wr(e,u,qn(n)):a!=null&&e.removeAttribute("value"),l==null&&o!=null&&(e.defaultChecked=!!o),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+qn(m):e.removeAttribute("name")}function ku(e,t,n,a,l,o,u,m){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Zr(e);return}n=n!=null?""+qn(n):"",t=t!=null?""+qn(t):n,m||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=m?e.checked:!!a,e.defaultChecked=!!a,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),Zr(e)}function Wr(e,t,n){t==="number"&&Ai(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Hl(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{for(n=""+qn(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function zu(e,t,n){if(t!=null&&(t=""+qn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+qn(n):""}function Mu(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(d(92));if(Me(a)){if(1<a.length)throw Error(d(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=qn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Zr(e)}function Ul(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var e0=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 Du(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||e0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Au(e,t,n){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&Du(e,l,a)}else for(var o in t)t.hasOwnProperty(o)&&Du(e,o,t[o])}function Jr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t0=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"]]),n0=/^[\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 Ti(e){return n0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ga(){}var Ir=null;function Pr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jl=null,Nl=null;function Tu(e){var t=ge(e);if(t&&(e=t.stateNode)){var n=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if($r(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Yn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[Lt]||null;if(!l)throw Error(d(90));$r(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Cu(a)}break e;case"textarea":zu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Hl(e,!!n.multiple,t,!1)}}}var es=!1;function Lu(e,t,n){if(es)return e(t,n);es=!0;try{var a=e(t);return a}finally{if(es=!1,(jl!==null||Nl!==null)&&(mr(),jl&&(t=jl,e=Nl,Nl=jl=null,Tu(t),e)))for(t=0;t<e.length;t++)Tu(e[t])}}function To(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Lt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(d(231,t,typeof n));return n}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ts=!1;if(ma)try{var Lo={};Object.defineProperty(Lo,"passive",{get:function(){ts=!0}}),window.addEventListener("test",Lo,Lo),window.removeEventListener("test",Lo,Lo)}catch{ts=!1}var ja=null,ns=null,Li=null;function Eu(){if(Li)return Li;var e,t=ns,n=t.length,a,l="value"in ja?ja.value:ja.textContent,o=l.length;for(e=0;e<n&&t[e]===l[e];e++);var u=n-e;for(a=1;a<=u&&t[n-a]===l[o-a];a++);return Li=l.slice(e,1<a?1-a:void 0)}function Ei(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ri(){return!0}function Ru(){return!1}function wn(e){function t(n,a,l,o,u){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=o,this.target=u,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(o):o[m]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ri:Ru,this.isPropagationStopped=Ru,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ri)},persist:function(){},isPersistent:Ri}),t}var pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_i=wn(pl),Eo=M({},pl,{view:0,detail:0}),a0=wn(Eo),as,ls,Ro,Oi=M({},Eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:is,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ro&&(Ro&&e.type==="mousemove"?(as=e.screenX-Ro.screenX,ls=e.screenY-Ro.screenY):ls=as=0,Ro=e),as)},movementY:function(e){return"movementY"in e?e.movementY:ls}}),_u=wn(Oi),l0=M({},Oi,{dataTransfer:0}),o0=wn(l0),i0=M({},Eo,{relatedTarget:0}),os=wn(i0),r0=M({},pl,{animationName:0,elapsedTime:0,pseudoElement:0}),s0=wn(r0),c0=M({},pl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),u0=wn(c0),d0=M({},pl,{data:0}),Ou=wn(d0),f0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h0={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"},p0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=p0[e])?!!t[e]:!1}function is(){return g0}var m0=M({},Eo,{key:function(e){if(e.key){var t=f0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?h0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:is,charCode:function(e){return e.type==="keypress"?Ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),b0=wn(m0),y0=M({},Oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bu=wn(y0),x0=M({},Eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:is}),v0=wn(x0),w0=M({},pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),S0=wn(w0),C0=M({},Oi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),k0=wn(C0),z0=M({},pl,{newState:0,oldState:0}),M0=wn(z0),D0=[9,13,27,32],rs=ma&&"CompositionEvent"in window,_o=null;ma&&"documentMode"in document&&(_o=document.documentMode);var A0=ma&&"TextEvent"in window&&!_o,Hu=ma&&(!rs||_o&&8<_o&&11>=_o),Uu=" ",ju=!1;function Nu(e,t){switch(e){case"keyup":return D0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ql=!1;function T0(e,t){switch(e){case"compositionend":return qu(t);case"keypress":return t.which!==32?null:(ju=!0,Uu);case"textInput":return e=t.data,e===Uu&&ju?null:e;default:return null}}function L0(e,t){if(ql)return e==="compositionend"||!rs&&Nu(e,t)?(e=Eu(),Li=ns=ja=null,ql=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Hu&&t.locale!=="ko"?null:t.data;default:return null}}var E0={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 Yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!E0[e.type]:t==="textarea"}function Gu(e,t,n,a){jl?Nl?Nl.push(a):Nl=[a]:jl=a,t=Cr(t,"onChange"),0<t.length&&(n=new _i("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Oo=null,Bo=null;function R0(e){zh(e,0)}function Bi(e){var t=se(e);if(Cu(t))return e}function Xu(e,t){if(e==="change")return t}var Vu=!1;if(ma){var ss;if(ma){var cs="oninput"in document;if(!cs){var Fu=document.createElement("div");Fu.setAttribute("oninput","return;"),cs=typeof Fu.oninput=="function"}ss=cs}else ss=!1;Vu=ss&&(!document.documentMode||9<document.documentMode)}function Qu(){Oo&&(Oo.detachEvent("onpropertychange",Ku),Bo=Oo=null)}function Ku(e){if(e.propertyName==="value"&&Bi(Bo)){var t=[];Gu(t,Bo,e,Pr(e)),Lu(R0,t)}}function _0(e,t,n){e==="focusin"?(Qu(),Oo=t,Bo=n,Oo.attachEvent("onpropertychange",Ku)):e==="focusout"&&Qu()}function O0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(Bo)}function B0(e,t){if(e==="click")return Bi(t)}function H0(e,t){if(e==="input"||e==="change")return Bi(t)}function U0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:U0;function Ho(e,t){if(En(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!en.call(t,l)||!En(e[l],t[l]))return!1}return!0}function Zu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $u(e,t){var n=Zu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zu(n)}}function Wu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ju(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ai(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ai(e.document)}return t}function us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var j0=ma&&"documentMode"in document&&11>=document.documentMode,Yl=null,ds=null,Uo=null,fs=!1;function Iu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fs||Yl==null||Yl!==Ai(a)||(a=Yl,"selectionStart"in a&&us(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Uo&&Ho(Uo,a)||(Uo=a,a=Cr(ds,"onSelect"),0<a.length&&(t=new _i("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Yl)))}function gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gl={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionrun:gl("Transition","TransitionRun"),transitionstart:gl("Transition","TransitionStart"),transitioncancel:gl("Transition","TransitionCancel"),transitionend:gl("Transition","TransitionEnd")},hs={},Pu={};ma&&(Pu=document.createElement("div").style,"AnimationEvent"in window||(delete Gl.animationend.animation,delete Gl.animationiteration.animation,delete Gl.animationstart.animation),"TransitionEvent"in window||delete Gl.transitionend.transition);function ml(e){if(hs[e])return hs[e];if(!Gl[e])return e;var t=Gl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pu)return hs[e]=t[n];return e}var ed=ml("animationend"),td=ml("animationiteration"),nd=ml("animationstart"),N0=ml("transitionrun"),q0=ml("transitionstart"),Y0=ml("transitioncancel"),ad=ml("transitionend"),ld=new Map,ps="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(" ");ps.push("scrollEnd");function In(e,t){ld.set(e,t),ot(t,[e])}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Gn=[],Xl=0,gs=0;function Ui(){for(var e=Xl,t=gs=Xl=0;t<e;){var n=Gn[t];Gn[t++]=null;var a=Gn[t];Gn[t++]=null;var l=Gn[t];Gn[t++]=null;var o=Gn[t];if(Gn[t++]=null,a!==null&&l!==null){var u=a.pending;u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l}o!==0&&od(n,l,o)}}function ji(e,t,n,a){Gn[Xl++]=e,Gn[Xl++]=t,Gn[Xl++]=n,Gn[Xl++]=a,gs|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function ms(e,t,n,a){return ji(e,t,n,a),Ni(e)}function bl(e,t){return ji(e,null,null,t),Ni(e)}function od(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(l=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,l&&t!==null&&(l=31-lt(n),e=o.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),o):null}function Ni(e){if(50<oi)throw oi=0,zc=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vl={};function G0(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(e,t,n,a){return new G0(e,t,n,a)}function bs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ba(e,t){var n=e.alternate;return n===null?(n=Rn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function id(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function qi(e,t,n,a,l,o){var u=0;if(a=e,typeof e=="function")bs(e)&&(u=1);else if(typeof e=="string")u=Kg(e,n,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=Rn(31,n,t,l),e.elementType=H,e.lanes=o,e;case k:return yl(n.children,l,o,t);case Q:u=8,l|=24;break;case j:return e=Rn(12,n,t,l|2),e.elementType=j,e.lanes=o,e;case V:return e=Rn(13,n,t,l),e.elementType=V,e.lanes=o,e;case P:return e=Rn(19,n,t,l),e.elementType=P,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case te:u=10;break e;case ee:u=9;break e;case ce:u=11;break e;case I:u=14;break e;case ae:u=16,a=null;break e}u=29,n=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=Rn(u,n,t,l),t.elementType=e,t.type=a,t.lanes=o,t}function yl(e,t,n,a){return e=Rn(7,e,a,t),e.lanes=n,e}function ys(e,t,n){return e=Rn(6,e,null,t),e.lanes=n,e}function rd(e){var t=Rn(18,null,null,0);return t.stateNode=e,t}function xs(e,t,n){return t=Rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var sd=new WeakMap;function Xn(e,t){if(typeof e=="object"&&e!==null){var n=sd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:fn(t)},sd.set(e,t),t)}return{value:e,source:t,stack:fn(t)}}var Fl=[],Ql=0,Yi=null,jo=0,Vn=[],Fn=0,Na=null,aa=1,la="";function ya(e,t){Fl[Ql++]=jo,Fl[Ql++]=Yi,Yi=e,jo=t}function cd(e,t,n){Vn[Fn++]=aa,Vn[Fn++]=la,Vn[Fn++]=Na,Na=e;var a=aa;e=la;var l=32-lt(a)-1;a&=~(1<<l),n+=1;var o=32-lt(t)+l;if(30<o){var u=l-l%5;o=(a&(1<<u)-1).toString(32),a>>=u,l-=u,aa=1<<32-lt(t)+l|n<<l|a,la=o+e}else aa=1<<o|n<<l|a,la=e}function vs(e){e.return!==null&&(ya(e,1),cd(e,1,0))}function ws(e){for(;e===Yi;)Yi=Fl[--Ql],Fl[Ql]=null,jo=Fl[--Ql],Fl[Ql]=null;for(;e===Na;)Na=Vn[--Fn],Vn[Fn]=null,la=Vn[--Fn],Vn[Fn]=null,aa=Vn[--Fn],Vn[Fn]=null}function ud(e,t){Vn[Fn++]=aa,Vn[Fn++]=la,Vn[Fn++]=Na,aa=t.id,la=t.overflow,Na=e}var on=null,Et=null,nt=!1,qa=null,Qn=!1,Ss=Error(d(519));function Ya(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw No(Xn(t,e)),Ss}function dd(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[mt]=e,t[Lt]=a,n){case"dialog":We("cancel",t),We("close",t);break;case"iframe":case"object":case"embed":We("load",t);break;case"video":case"audio":for(n=0;n<ri.length;n++)We(ri[n],t);break;case"source":We("error",t);break;case"img":case"image":case"link":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"input":We("invalid",t),ku(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":We("invalid",t);break;case"textarea":We("invalid",t),Mu(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Th(t.textContent,n)?(a.popover!=null&&(We("beforetoggle",t),We("toggle",t)),a.onScroll!=null&&We("scroll",t),a.onScrollEnd!=null&&We("scrollend",t),a.onClick!=null&&(t.onclick=ga),t=!0):t=!1,t||Ya(e,!0)}function fd(e){for(on=e.return;on;)switch(on.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:on=on.return}}function Kl(e){if(e!==on)return!1;if(!nt)return fd(e),nt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||qc(e.type,e.memoizedProps)),n=!n),n&&Et&&Ya(e),fd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Et=jh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Et=jh(e)}else t===27?(t=Et,tl(e.type)?(e=Fc,Fc=null,Et=e):Et=t):Et=on?Zn(e.stateNode.nextSibling):null;return!0}function xl(){Et=on=null,nt=!1}function Cs(){var e=qa;return e!==null&&(zn===null?zn=e:zn.push.apply(zn,e),qa=null),e}function No(e){qa===null?qa=[e]:qa.push(e)}var ks=S(null),vl=null,xa=null;function Ga(e,t,n){ne(ks,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ks.current,U(ks)}function zs(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Ms(e,t,n,a){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var o=l.dependencies;if(o!==null){var u=l.child;o=o.firstContext;e:for(;o!==null;){var m=o;o=l;for(var C=0;C<t.length;C++)if(m.context===t[C]){o.lanes|=n,m=o.alternate,m!==null&&(m.lanes|=n),zs(o.return,n,e),a||(u=null);break e}o=m.next}}else if(l.tag===18){if(u=l.return,u===null)throw Error(d(341));u.lanes|=n,o=u.alternate,o!==null&&(o.lanes|=n),zs(u,n,e),u=null}else u=l.child;if(u!==null)u.return=l;else for(u=l;u!==null;){if(u===e){u=null;break}if(l=u.sibling,l!==null){l.return=u.return,u=l;break}u=u.return}l=u}}function Zl(e,t,n,a){e=null;for(var l=t,o=!1;l!==null;){if(!o){if((l.flags&524288)!==0)o=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var u=l.alternate;if(u===null)throw Error(d(387));if(u=u.memoizedProps,u!==null){var m=l.type;En(l.pendingProps.value,u.value)||(e!==null?e.push(m):e=[m])}}else if(l===Ye.current){if(u=l.alternate,u===null)throw Error(d(387));u.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(fi):e=[fi])}l=l.return}e!==null&&Ms(t,e,n,a),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!En(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wl(e){vl=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rn(e){return hd(vl,e)}function Xi(e,t){return vl===null&&wl(e),hd(e,t)}function hd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xa===null){if(e===null)throw Error(d(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return n}var X0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},V0=i.unstable_scheduleCallback,F0=i.unstable_NormalPriority,Qt={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ds(){return{controller:new X0,data:new Map,refCount:0}}function qo(e){e.refCount--,e.refCount===0&&V0(F0,function(){e.controller.abort()})}var Yo=null,As=0,$l=0,Wl=null;function Q0(e,t){if(Yo===null){var n=Yo=[];As=0,$l=Ec(),Wl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return As++,t.then(pd,pd),t}function pd(){if(--As===0&&Yo!==null){Wl!==null&&(Wl.status="fulfilled");var e=Yo;Yo=null,$l=0,Wl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function K0(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var gd=T.S;T.S=function(e,t){Pf=Ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Q0(e,t),gd!==null&&gd(e,t)};var Sl=S(null);function Ts(){var e=Sl.current;return e!==null?e:Dt.pooledCache}function Vi(e,t){t===null?ne(Sl,Sl.current):ne(Sl,t.pool)}function md(){var e=Ts();return e===null?null:{parent:Qt._currentValue,pool:e}}var Jl=Error(d(460)),Ls=Error(d(474)),Fi=Error(d(542)),Qi={then:function(){}};function bd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ga,ga),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e;default:if(typeof t.status=="string")t.then(ga,ga);else{if(e=Dt,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e}throw kl=t,Jl}}function Cl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(kl=n,Jl):n}}var kl=null;function xd(){if(kl===null)throw Error(d(459));var e=kl;return kl=null,e}function vd(e){if(e===Jl||e===Fi)throw Error(d(483))}var Il=null,Go=0;function Ki(e){var t=Go;return Go+=1,Il===null&&(Il=[]),yd(Il,e,t)}function Xo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zi(e,t){throw t.$$typeof===E?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wd(e){function t(A,z){if(e){var R=A.deletions;R===null?(A.deletions=[z],A.flags|=16):R.push(z)}}function n(A,z){if(!e)return null;for(;z!==null;)t(A,z),z=z.sibling;return null}function a(A){for(var z=new Map;A!==null;)A.key!==null?z.set(A.key,A):z.set(A.index,A),A=A.sibling;return z}function l(A,z){return A=ba(A,z),A.index=0,A.sibling=null,A}function o(A,z,R){return A.index=R,e?(R=A.alternate,R!==null?(R=R.index,R<z?(A.flags|=67108866,z):R):(A.flags|=67108866,z)):(A.flags|=1048576,z)}function u(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function m(A,z,R,F){return z===null||z.tag!==6?(z=ys(R,A.mode,F),z.return=A,z):(z=l(z,R),z.return=A,z)}function C(A,z,R,F){var Ae=R.type;return Ae===k?X(A,z,R.props.children,F,R.key):z!==null&&(z.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===ae&&Cl(Ae)===z.type)?(z=l(z,R.props),Xo(z,R),z.return=A,z):(z=qi(R.type,R.key,R.props,null,A.mode,F),Xo(z,R),z.return=A,z)}function _(A,z,R,F){return z===null||z.tag!==4||z.stateNode.containerInfo!==R.containerInfo||z.stateNode.implementation!==R.implementation?(z=xs(R,A.mode,F),z.return=A,z):(z=l(z,R.children||[]),z.return=A,z)}function X(A,z,R,F,Ae){return z===null||z.tag!==7?(z=yl(R,A.mode,F,Ae),z.return=A,z):(z=l(z,R),z.return=A,z)}function K(A,z,R){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=ys(""+z,A.mode,R),z.return=A,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Y:return R=qi(z.type,z.key,z.props,null,A.mode,R),Xo(R,z),R.return=A,R;case B:return z=xs(z,A.mode,R),z.return=A,z;case ae:return z=Cl(z),K(A,z,R)}if(Me(z)||fe(z))return z=yl(z,A.mode,R,null),z.return=A,z;if(typeof z.then=="function")return K(A,Ki(z),R);if(z.$$typeof===te)return K(A,Xi(A,z),R);Zi(A,z)}return null}function O(A,z,R,F){var Ae=z!==null?z.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return Ae!==null?null:m(A,z,""+R,F);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Y:return R.key===Ae?C(A,z,R,F):null;case B:return R.key===Ae?_(A,z,R,F):null;case ae:return R=Cl(R),O(A,z,R,F)}if(Me(R)||fe(R))return Ae!==null?null:X(A,z,R,F,null);if(typeof R.then=="function")return O(A,z,Ki(R),F);if(R.$$typeof===te)return O(A,z,Xi(A,R),F);Zi(A,R)}return null}function N(A,z,R,F,Ae){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return A=A.get(R)||null,m(z,A,""+F,Ae);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case Y:return A=A.get(F.key===null?R:F.key)||null,C(z,A,F,Ae);case B:return A=A.get(F.key===null?R:F.key)||null,_(z,A,F,Ae);case ae:return F=Cl(F),N(A,z,R,F,Ae)}if(Me(F)||fe(F))return A=A.get(R)||null,X(z,A,F,Ae,null);if(typeof F.then=="function")return N(A,z,R,Ki(F),Ae);if(F.$$typeof===te)return N(A,z,R,Xi(z,F),Ae);Zi(z,F)}return null}function be(A,z,R,F){for(var Ae=null,st=null,Se=z,Ke=z=0,Ie=null;Se!==null&&Ke<R.length;Ke++){Se.index>Ke?(Ie=Se,Se=null):Ie=Se.sibling;var ct=O(A,Se,R[Ke],F);if(ct===null){Se===null&&(Se=Ie);break}e&&Se&&ct.alternate===null&&t(A,Se),z=o(ct,z,Ke),st===null?Ae=ct:st.sibling=ct,st=ct,Se=Ie}if(Ke===R.length)return n(A,Se),nt&&ya(A,Ke),Ae;if(Se===null){for(;Ke<R.length;Ke++)Se=K(A,R[Ke],F),Se!==null&&(z=o(Se,z,Ke),st===null?Ae=Se:st.sibling=Se,st=Se);return nt&&ya(A,Ke),Ae}for(Se=a(Se);Ke<R.length;Ke++)Ie=N(Se,A,Ke,R[Ke],F),Ie!==null&&(e&&Ie.alternate!==null&&Se.delete(Ie.key===null?Ke:Ie.key),z=o(Ie,z,Ke),st===null?Ae=Ie:st.sibling=Ie,st=Ie);return e&&Se.forEach(function(il){return t(A,il)}),nt&&ya(A,Ke),Ae}function Ee(A,z,R,F){if(R==null)throw Error(d(151));for(var Ae=null,st=null,Se=z,Ke=z=0,Ie=null,ct=R.next();Se!==null&&!ct.done;Ke++,ct=R.next()){Se.index>Ke?(Ie=Se,Se=null):Ie=Se.sibling;var il=O(A,Se,ct.value,F);if(il===null){Se===null&&(Se=Ie);break}e&&Se&&il.alternate===null&&t(A,Se),z=o(il,z,Ke),st===null?Ae=il:st.sibling=il,st=il,Se=Ie}if(ct.done)return n(A,Se),nt&&ya(A,Ke),Ae;if(Se===null){for(;!ct.done;Ke++,ct=R.next())ct=K(A,ct.value,F),ct!==null&&(z=o(ct,z,Ke),st===null?Ae=ct:st.sibling=ct,st=ct);return nt&&ya(A,Ke),Ae}for(Se=a(Se);!ct.done;Ke++,ct=R.next())ct=N(Se,A,Ke,ct.value,F),ct!==null&&(e&&ct.alternate!==null&&Se.delete(ct.key===null?Ke:ct.key),z=o(ct,z,Ke),st===null?Ae=ct:st.sibling=ct,st=ct);return e&&Se.forEach(function(lm){return t(A,lm)}),nt&&ya(A,Ke),Ae}function Mt(A,z,R,F){if(typeof R=="object"&&R!==null&&R.type===k&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case Y:e:{for(var Ae=R.key;z!==null;){if(z.key===Ae){if(Ae=R.type,Ae===k){if(z.tag===7){n(A,z.sibling),F=l(z,R.props.children),F.return=A,A=F;break e}}else if(z.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===ae&&Cl(Ae)===z.type){n(A,z.sibling),F=l(z,R.props),Xo(F,R),F.return=A,A=F;break e}n(A,z);break}else t(A,z);z=z.sibling}R.type===k?(F=yl(R.props.children,A.mode,F,R.key),F.return=A,A=F):(F=qi(R.type,R.key,R.props,null,A.mode,F),Xo(F,R),F.return=A,A=F)}return u(A);case B:e:{for(Ae=R.key;z!==null;){if(z.key===Ae)if(z.tag===4&&z.stateNode.containerInfo===R.containerInfo&&z.stateNode.implementation===R.implementation){n(A,z.sibling),F=l(z,R.children||[]),F.return=A,A=F;break e}else{n(A,z);break}else t(A,z);z=z.sibling}F=xs(R,A.mode,F),F.return=A,A=F}return u(A);case ae:return R=Cl(R),Mt(A,z,R,F)}if(Me(R))return be(A,z,R,F);if(fe(R)){if(Ae=fe(R),typeof Ae!="function")throw Error(d(150));return R=Ae.call(R),Ee(A,z,R,F)}if(typeof R.then=="function")return Mt(A,z,Ki(R),F);if(R.$$typeof===te)return Mt(A,z,Xi(A,R),F);Zi(A,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,z!==null&&z.tag===6?(n(A,z.sibling),F=l(z,R),F.return=A,A=F):(n(A,z),F=ys(R,A.mode,F),F.return=A,A=F),u(A)):n(A,z)}return function(A,z,R,F){try{Go=0;var Ae=Mt(A,z,R,F);return Il=null,Ae}catch(Se){if(Se===Jl||Se===Fi)throw Se;var st=Rn(29,Se,null,A.mode);return st.lanes=F,st.return=A,st}}}var zl=wd(!0),Sd=wd(!1),Xa=!1;function Es(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ft&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=Ni(e),od(e,null,n),t}return ji(e,a,t,n),Ni(e)}function Vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,me(e,n)}}function _s(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var u={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?l=o=u:o=o.next=u,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Os=!1;function Fo(){if(Os){var e=Wl;if(e!==null)throw e}}function Qo(e,t,n,a){Os=!1;var l=e.updateQueue;Xa=!1;var o=l.firstBaseUpdate,u=l.lastBaseUpdate,m=l.shared.pending;if(m!==null){l.shared.pending=null;var C=m,_=C.next;C.next=null,u===null?o=_:u.next=_,u=C;var X=e.alternate;X!==null&&(X=X.updateQueue,m=X.lastBaseUpdate,m!==u&&(m===null?X.firstBaseUpdate=_:m.next=_,X.lastBaseUpdate=C))}if(o!==null){var K=l.baseState;u=0,X=_=C=null,m=o;do{var O=m.lane&-536870913,N=O!==m.lane;if(N?(Je&O)===O:(a&O)===O){O!==0&&O===$l&&(Os=!0),X!==null&&(X=X.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var be=e,Ee=m;O=t;var Mt=n;switch(Ee.tag){case 1:if(be=Ee.payload,typeof be=="function"){K=be.call(Mt,K,O);break e}K=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ee.payload,O=typeof be=="function"?be.call(Mt,K,O):be,O==null)break e;K=M({},K,O);break e;case 2:Xa=!0}}O=m.callback,O!==null&&(e.flags|=64,N&&(e.flags|=8192),N=l.callbacks,N===null?l.callbacks=[O]:N.push(O))}else N={lane:O,tag:m.tag,payload:m.payload,callback:m.callback,next:null},X===null?(_=X=N,C=K):X=X.next=N,u|=O;if(m=m.next,m===null){if(m=l.shared.pending,m===null)break;N=m,m=N.next,N.next=null,l.lastBaseUpdate=N,l.shared.pending=null}}while(!0);X===null&&(C=K),l.baseState=C,l.firstBaseUpdate=_,l.lastBaseUpdate=X,o===null&&(l.shared.lanes=0),Wa|=u,e.lanes=u,e.memoizedState=K}}function Cd(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function kd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Cd(n[e],t)}var Pl=S(null),$i=S(0);function zd(e,t){e=Ta,ne($i,e),ne(Pl,t),Ta=e|t.baseLanes}function Bs(){ne($i,Ta),ne(Pl,Pl.current)}function Hs(){Ta=$i.current,U(Pl),U($i)}var _n=S(null),Kn=null;function Qa(e){var t=e.alternate;ne(Xt,Xt.current&1),ne(_n,e),Kn===null&&(t===null||Pl.current!==null||t.memoizedState!==null)&&(Kn=e)}function Us(e){ne(Xt,Xt.current),ne(_n,e),Kn===null&&(Kn=e)}function Md(e){e.tag===22?(ne(Xt,Xt.current),ne(_n,e),Kn===null&&(Kn=e)):Ka()}function Ka(){ne(Xt,Xt.current),ne(_n,_n.current)}function On(e){U(_n),Kn===e&&(Kn=null),U(Xt)}var Xt=S(0);function Wi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xc(n)||Vc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wa=0,Qe=null,kt=null,Kt=null,Ji=!1,eo=!1,Ml=!1,Ii=0,Ko=0,to=null,Z0=0;function qt(){throw Error(d(321))}function js(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!En(e[n],t[n]))return!1;return!0}function Ns(e,t,n,a,l,o){return wa=o,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?uf:ec,Ml=!1,o=n(a,l),Ml=!1,eo&&(o=Ad(t,n,a,l)),Dd(e),o}function Dd(e){T.H=Wo;var t=kt!==null&&kt.next!==null;if(wa=0,Kt=kt=Qe=null,Ji=!1,Ko=0,to=null,t)throw Error(d(300));e===null||Zt||(e=e.dependencies,e!==null&&Gi(e)&&(Zt=!0))}function Ad(e,t,n,a){Qe=e;var l=0;do{if(eo&&(to=null),Ko=0,eo=!1,25<=l)throw Error(d(301));if(l+=1,Kt=kt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}T.H=df,o=t(n,a)}while(eo);return o}function $0(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?Zo(t):t,e=e.useState()[0],(kt!==null?kt.memoizedState:null)!==e&&(Qe.flags|=1024),t}function qs(){var e=Ii!==0;return Ii=0,e}function Ys(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Gs(e){if(Ji){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ji=!1}wa=0,Kt=kt=Qe=null,eo=!1,Ko=Ii=0,to=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Qe.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Vt(){if(kt===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=kt.next;var t=Kt===null?Qe.memoizedState:Kt.next;if(t!==null)Kt=t,kt=e;else{if(e===null)throw Qe.alternate===null?Error(d(467)):Error(d(310));kt=e,e={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Kt===null?Qe.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zo(e){var t=Ko;return Ko+=1,to===null&&(to=[]),e=yd(to,e,t),t=Qe,(Kt===null?t.memoizedState:Kt.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?uf:ec),e}function er(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zo(e);if(e.$$typeof===te)return rn(e)}throw Error(d(438,String(e)))}function Xs(e){var t=null,n=Qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Qe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Pi(),Qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=G;return t.index++,n}function Sa(e,t){return typeof t=="function"?t(e):t}function tr(e){var t=Vt();return Vs(t,kt,e)}function Vs(e,t,n){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=n;var l=e.baseQueue,o=a.pending;if(o!==null){if(l!==null){var u=l.next;l.next=o.next,o.next=u}t.baseQueue=l=o,a.pending=null}if(o=e.baseState,l===null)e.memoizedState=o;else{t=l.next;var m=u=null,C=null,_=t,X=!1;do{var K=_.lane&-536870913;if(K!==_.lane?(Je&K)===K:(wa&K)===K){var O=_.revertLane;if(O===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),K===$l&&(X=!0);else if((wa&O)===O){_=_.next,O===$l&&(X=!0);continue}else K={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},C===null?(m=C=K,u=o):C=C.next=K,Qe.lanes|=O,Wa|=O;K=_.action,Ml&&n(o,K),o=_.hasEagerState?_.eagerState:n(o,K)}else O={lane:K,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},C===null?(m=C=O,u=o):C=C.next=O,Qe.lanes|=K,Wa|=K;_=_.next}while(_!==null&&_!==t);if(C===null?u=o:C.next=m,!En(o,e.memoizedState)&&(Zt=!0,X&&(n=Wl,n!==null)))throw n;e.memoizedState=o,e.baseState=u,e.baseQueue=C,a.lastRenderedState=o}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Fs(e){var t=Vt(),n=t.queue;if(n===null)throw Error(d(311));n.lastRenderedReducer=e;var a=n.dispatch,l=n.pending,o=t.memoizedState;if(l!==null){n.pending=null;var u=l=l.next;do o=e(o,u.action),u=u.next;while(u!==l);En(o,t.memoizedState)||(Zt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function Td(e,t,n){var a=Qe,l=Vt(),o=nt;if(o){if(n===void 0)throw Error(d(407));n=n()}else n=t();var u=!En((kt||l).memoizedState,n);if(u&&(l.memoizedState=n,Zt=!0),l=l.queue,Zs(Rd.bind(null,a,l,e),[e]),l.getSnapshot!==t||u||Kt!==null&&Kt.memoizedState.tag&1){if(a.flags|=2048,no(9,{destroy:void 0},Ed.bind(null,a,l,n,t),null),Dt===null)throw Error(d(349));o||(wa&127)!==0||Ld(a,t,n)}return n}function Ld(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t=Pi(),Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ed(e,t,n,a){t.value=n,t.getSnapshot=a,_d(t)&&Od(e)}function Rd(e,t,n){return n(function(){_d(t)&&Od(e)})}function _d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!En(e,n)}catch{return!0}}function Od(e){var t=bl(e,2);t!==null&&Mn(t,e,2)}function Qs(e){var t=yn();if(typeof e=="function"){var n=e;if(e=n(),Ml){Ct(!0);try{n()}finally{Ct(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:e},t}function Bd(e,t,n,a){return e.baseState=n,Vs(e,kt,typeof a=="function"?a:Sa)}function W0(e,t,n,a,l){if(lr(e))throw Error(d(485));if(e=t.action,e!==null){var o={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(u){o.listeners.push(u)}};T.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,Hd(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Hd(e,t){var n=t.action,a=t.payload,l=e.state;if(t.isTransition){var o=T.T,u={};T.T=u;try{var m=n(l,a),C=T.S;C!==null&&C(u,m),Ud(e,t,m)}catch(_){Ks(e,t,_)}finally{o!==null&&u.types!==null&&(o.types=u.types),T.T=o}}else try{o=n(l,a),Ud(e,t,o)}catch(_){Ks(e,t,_)}}function Ud(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){jd(e,t,a)},function(a){return Ks(e,t,a)}):jd(e,t,n)}function jd(e,t,n){t.status="fulfilled",t.value=n,Nd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Hd(e,n)))}function Ks(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Nd(t),t=t.next;while(t!==a)}e.action=null}function Nd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qd(e,t){return t}function Yd(e,t){if(nt){var n=Dt.formState;if(n!==null){e:{var a=Qe;if(nt){if(Et){t:{for(var l=Et,o=Qn;l.nodeType!==8;){if(!o){l=null;break t}if(l=Zn(l.nextSibling),l===null){l=null;break t}}o=l.data,l=o==="F!"||o==="F"?l:null}if(l){Et=Zn(l.nextSibling),a=l.data==="F!";break e}}Ya(a)}a=!1}a&&(t=n[0])}}return n=yn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qd,lastRenderedState:t},n.queue=a,n=rf.bind(null,Qe,a),a.dispatch=n,a=Qs(!1),o=Ps.bind(null,Qe,!1,a.queue),a=yn(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=W0.bind(null,Qe,l,o,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function Gd(e){var t=Vt();return Xd(t,kt,e)}function Xd(e,t,n){if(t=Vs(e,t,qd)[0],e=tr(Sa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Zo(t)}catch(u){throw u===Jl?Fi:u}else a=t;t=Vt();var l=t.queue,o=l.dispatch;return n!==t.memoizedState&&(Qe.flags|=2048,no(9,{destroy:void 0},J0.bind(null,l,n),null)),[a,o,e]}function J0(e,t){e.action=t}function Vd(e){var t=Vt(),n=kt;if(n!==null)return Xd(t,n,e);Vt(),t=t.memoizedState,n=Vt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function no(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=Pi(),Qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Fd(){return Vt().memoizedState}function nr(e,t,n,a){var l=yn();Qe.flags|=e,l.memoizedState=no(1|t,{destroy:void 0},n,a===void 0?null:a)}function ar(e,t,n,a){var l=Vt();a=a===void 0?null:a;var o=l.memoizedState.inst;kt!==null&&a!==null&&js(a,kt.memoizedState.deps)?l.memoizedState=no(t,o,n,a):(Qe.flags|=e,l.memoizedState=no(1|t,o,n,a))}function Qd(e,t){nr(8390656,8,e,t)}function Zs(e,t){ar(2048,8,e,t)}function I0(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=Pi(),Qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Kd(e){var t=Vt().memoizedState;return I0({ref:t,nextImpl:e}),function(){if((ft&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function Zd(e,t){return ar(4,2,e,t)}function $d(e,t){return ar(4,4,e,t)}function Wd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jd(e,t,n){n=n!=null?n.concat([e]):null,ar(4,4,Wd.bind(null,t,e),n)}function $s(){}function Id(e,t){var n=Vt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&js(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Pd(e,t){var n=Vt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&js(t,a[1]))return a[0];if(a=e(),Ml){Ct(!0);try{e()}finally{Ct(!1)}}return n.memoizedState=[a,t],a}function Ws(e,t,n){return n===void 0||(wa&1073741824)!==0&&(Je&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=th(),Qe.lanes|=e,Wa|=e,n)}function ef(e,t,n,a){return En(n,t)?n:Pl.current!==null?(e=Ws(e,n,a),En(e,t)||(Zt=!0),e):(wa&42)===0||(wa&1073741824)!==0&&(Je&261930)===0?(Zt=!0,e.memoizedState=n):(e=th(),Qe.lanes|=e,Wa|=e,t)}function tf(e,t,n,a,l){var o=$.p;$.p=o!==0&&8>o?o:8;var u=T.T,m={};T.T=m,Ps(e,!1,t,n);try{var C=l(),_=T.S;if(_!==null&&_(m,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var X=K0(C,a);$o(e,t,X,Un(e))}else $o(e,t,a,Un(e))}catch(K){$o(e,t,{then:function(){},status:"rejected",reason:K},Un())}finally{$.p=o,u!==null&&m.types!==null&&(u.types=m.types),T.T=u}}function P0(){}function Js(e,t,n,a){if(e.tag!==5)throw Error(d(476));var l=nf(e).queue;tf(e,l,t,J,n===null?P0:function(){return af(e),n(a)})}function nf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:J},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function af(e){var t=nf(e);t.next===null&&(t=e.alternate.memoizedState),$o(e,t.next.queue,{},Un())}function Is(){return rn(fi)}function lf(){return Vt().memoizedState}function of(){return Vt().memoizedState}function eg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Un();e=Va(n);var a=Fa(t,e,n);a!==null&&(Mn(a,t,n),Vo(a,t,n)),t={cache:Ds()},e.payload=t;return}t=t.return}}function tg(e,t,n){var a=Un();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lr(e)?sf(t,n):(n=ms(e,t,n,a),n!==null&&(Mn(n,e,a),cf(n,t,a)))}function rf(e,t,n){var a=Un();$o(e,t,n,a)}function $o(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lr(e))sf(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,m=o(u,n);if(l.hasEagerState=!0,l.eagerState=m,En(m,u))return ji(e,t,l,0),Dt===null&&Ui(),!1}catch{}if(n=ms(e,t,l,a),n!==null)return Mn(n,e,a),cf(n,t,a),!0}return!1}function Ps(e,t,n,a){if(a={lane:2,revertLane:Ec(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lr(e)){if(t)throw Error(d(479))}else t=ms(e,n,a,2),t!==null&&Mn(t,e,2)}function lr(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function sf(e,t){eo=Ji=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,me(e,n)}}var Wo={readContext:rn,use:er,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};Wo.useEffectEvent=qt;var uf={readContext:rn,use:er,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:Qd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,nr(4194308,4,Wd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nr(4194308,4,e,t)},useInsertionEffect:function(e,t){nr(4,2,e,t)},useMemo:function(e,t){var n=yn();t=t===void 0?null:t;var a=e();if(Ml){Ct(!0);try{e()}finally{Ct(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=yn();if(n!==void 0){var l=n(t);if(Ml){Ct(!0);try{n(t)}finally{Ct(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=tg.bind(null,Qe,e),[a.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:function(e){e=Qs(e);var t=e.queue,n=rf.bind(null,Qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){var n=yn();return Ws(n,e,t)},useTransition:function(){var e=Qs(!1);return e=tf.bind(null,Qe,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Qe,l=yn();if(nt){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),Dt===null)throw Error(d(349));(Je&127)!==0||Ld(a,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Qd(Rd.bind(null,a,o,e),[e]),a.flags|=2048,no(9,{destroy:void 0},Ed.bind(null,a,o,n,t),null),n},useId:function(){var e=yn(),t=Dt.identifierPrefix;if(nt){var n=la,a=aa;n=(a&~(1<<32-lt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ii++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Z0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Is,useFormState:Yd,useActionState:Yd,useOptimistic:function(e){var t=yn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,Qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xs,useCacheRefresh:function(){return yn().memoizedState=eg.bind(null,Qe)},useEffectEvent:function(e){var t=yn(),n={impl:e};return t.memoizedState=n,function(){if((ft&2)!==0)throw Error(d(440));return n.impl.apply(void 0,arguments)}}},ec={readContext:rn,use:er,useCallback:Id,useContext:rn,useEffect:Zs,useImperativeHandle:Jd,useInsertionEffect:Zd,useLayoutEffect:$d,useMemo:Pd,useReducer:tr,useRef:Fd,useState:function(){return tr(Sa)},useDebugValue:$s,useDeferredValue:function(e,t){var n=Vt();return ef(n,kt.memoizedState,e,t)},useTransition:function(){var e=tr(Sa)[0],t=Vt().memoizedState;return[typeof e=="boolean"?e:Zo(e),t]},useSyncExternalStore:Td,useId:lf,useHostTransitionStatus:Is,useFormState:Gd,useActionState:Gd,useOptimistic:function(e,t){var n=Vt();return Bd(n,kt,e,t)},useMemoCache:Xs,useCacheRefresh:of};ec.useEffectEvent=Kd;var df={readContext:rn,use:er,useCallback:Id,useContext:rn,useEffect:Zs,useImperativeHandle:Jd,useInsertionEffect:Zd,useLayoutEffect:$d,useMemo:Pd,useReducer:Fs,useRef:Fd,useState:function(){return Fs(Sa)},useDebugValue:$s,useDeferredValue:function(e,t){var n=Vt();return kt===null?Ws(n,e,t):ef(n,kt.memoizedState,e,t)},useTransition:function(){var e=Fs(Sa)[0],t=Vt().memoizedState;return[typeof e=="boolean"?e:Zo(e),t]},useSyncExternalStore:Td,useId:lf,useHostTransitionStatus:Is,useFormState:Vd,useActionState:Vd,useOptimistic:function(e,t){var n=Vt();return kt!==null?Bd(n,kt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xs,useCacheRefresh:of};df.useEffectEvent=Kd;function tc(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var nc={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Un(),l=Va(a);l.payload=t,n!=null&&(l.callback=n),t=Fa(e,l,a),t!==null&&(Mn(t,e,a),Vo(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Un(),l=Va(a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Fa(e,l,a),t!==null&&(Mn(t,e,a),Vo(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Un(),a=Va(n);a.tag=2,t!=null&&(a.callback=t),t=Fa(e,a,n),t!==null&&(Mn(t,e,n),Vo(t,e,n))}};function ff(e,t,n,a,l,o,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,u):t.prototype&&t.prototype.isPureReactComponent?!Ho(n,a)||!Ho(l,o):!0}function hf(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&nc.enqueueReplaceState(t,t.state,null)}function Dl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=M({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function pf(e){Hi(e)}function gf(e){console.error(e)}function mf(e){Hi(e)}function or(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function bf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function ac(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){or(e,t)},n}function yf(e){return e=Va(e),e.tag=3,e}function xf(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var o=a.value;e.payload=function(){return l(o)},e.callback=function(){bf(t,n,a)}}var u=n.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){bf(t,n,a),typeof l!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function ng(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Zl(t,n,l,!0),n=_n.current,n!==null){switch(n.tag){case 31:case 13:return Kn===null?br():n.alternate===null&&Yt===0&&(Yt=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===Qi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ac(e,a,l)),!1;case 22:return n.flags|=65536,a===Qi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ac(e,a,l)),!1}throw Error(d(435,n.tag))}return Ac(e,a,l),br(),!1}if(nt)return t=_n.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==Ss&&(e=Error(d(422),{cause:a}),No(Xn(e,n)))):(a!==Ss&&(t=Error(d(423),{cause:a}),No(Xn(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=Xn(a,n),l=ac(e.stateNode,a,l),_s(e,l),Yt!==4&&(Yt=2)),!1;var o=Error(d(520),{cause:a});if(o=Xn(o,n),li===null?li=[o]:li.push(o),Yt!==4&&(Yt=2),t===null)return!0;a=Xn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=ac(n.stateNode,a,e),_s(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Ja===null||!Ja.has(o))))return n.flags|=65536,l&=-l,n.lanes|=l,l=yf(l),xf(l,e,n,a),_s(n,l),!1}n=n.return}while(n!==null);return!1}var lc=Error(d(461)),Zt=!1;function sn(e,t,n,a){t.child=e===null?Sd(t,null,n,a):zl(t,e.child,n,a)}function vf(e,t,n,a,l){n=n.render;var o=t.ref;if("ref"in a){var u={};for(var m in a)m!=="ref"&&(u[m]=a[m])}else u=a;return wl(t),a=Ns(e,t,n,u,o,l),m=qs(),e!==null&&!Zt?(Ys(e,t,l),Ca(e,t,l)):(nt&&m&&vs(t),t.flags|=1,sn(e,t,a,l),t.child)}function wf(e,t,n,a,l){if(e===null){var o=n.type;return typeof o=="function"&&!bs(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,Sf(e,t,o,a,l)):(e=qi(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!fc(e,l)){var u=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ho,n(u,a)&&e.ref===t.ref)return Ca(e,t,l)}return t.flags|=1,e=ba(o,a),e.ref=t.ref,e.return=t,t.child=e}function Sf(e,t,n,a,l){if(e!==null){var o=e.memoizedProps;if(Ho(o,a)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=a=o,fc(e,l))(e.flags&131072)!==0&&(Zt=!0);else return t.lanes=e.lanes,Ca(e,t,l)}return oc(e,t,n,a,l)}function Cf(e,t,n,a){var l=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;a=l&~o}else a=0,t.child=null;return kf(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vi(t,o!==null?o.cachePool:null),o!==null?zd(t,o):Bs(),Md(t);else return a=t.lanes=536870912,kf(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(Vi(t,o.cachePool),zd(t,o),Ka(),t.memoizedState=null):(e!==null&&Vi(t,null),Bs(),Ka());return sn(e,t,l,n),t.child}function Jo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kf(e,t,n,a,l){var o=Ts();return o=o===null?null:{parent:Qt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Vi(t,null),Bs(),Md(t),e!==null&&Zl(e,t,a,!0),t.childLanes=l,null}function ir(e,t){return t=sr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zf(e,t,n){return zl(t,e.child,null,n),e=ir(t,t.pendingProps),e.flags|=2,On(t),t.memoizedState=null,e}function ag(e,t,n){var a=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(a.mode==="hidden")return e=ir(t,a),t.lanes=536870912,Jo(null,e);if(Us(t),(e=Et)?(e=Uh(e,Qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:aa,overflow:la}:null,retryLane:536870912,hydrationErrors:null},n=rd(e),n.return=t,t.child=n,on=t,Et=null)):e=null,e===null)throw Ya(t);return t.lanes=536870912,null}return ir(t,a)}var o=e.memoizedState;if(o!==null){var u=o.dehydrated;if(Us(t),l)if(t.flags&256)t.flags&=-257,t=zf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Zt||Zl(e,t,n,!1),l=(n&e.childLanes)!==0,Zt||l){if(a=Dt,a!==null&&(u=Ve(a,n),u!==0&&u!==o.retryLane))throw o.retryLane=u,bl(e,u),Mn(a,e,u),lc;br(),t=zf(e,t,n)}else e=o.treeContext,Et=Zn(u.nextSibling),on=t,nt=!0,qa=null,Qn=!1,e!==null&&ud(t,e),t=ir(t,a),t.flags|=4096;return t}return e=ba(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(d(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function oc(e,t,n,a,l){return wl(t),n=Ns(e,t,n,a,void 0,l),a=qs(),e!==null&&!Zt?(Ys(e,t,l),Ca(e,t,l)):(nt&&a&&vs(t),t.flags|=1,sn(e,t,n,l),t.child)}function Mf(e,t,n,a,l,o){return wl(t),t.updateQueue=null,n=Ad(t,a,n,l),Dd(e),a=qs(),e!==null&&!Zt?(Ys(e,t,o),Ca(e,t,o)):(nt&&a&&vs(t),t.flags|=1,sn(e,t,n,o),t.child)}function Df(e,t,n,a,l){if(wl(t),t.stateNode===null){var o=Vl,u=n.contextType;typeof u=="object"&&u!==null&&(o=rn(u)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=nc,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},Es(t),u=n.contextType,o.context=typeof u=="object"&&u!==null?rn(u):Vl,o.state=t.memoizedState,u=n.getDerivedStateFromProps,typeof u=="function"&&(tc(t,n,u,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(u=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),u!==o.state&&nc.enqueueReplaceState(o,o.state,null),Qo(t,a,o,l),Fo(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var m=t.memoizedProps,C=Dl(n,m);o.props=C;var _=o.context,X=n.contextType;u=Vl,typeof X=="object"&&X!==null&&(u=rn(X));var K=n.getDerivedStateFromProps;X=typeof K=="function"||typeof o.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,X||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m||_!==u)&&hf(t,o,a,u),Xa=!1;var O=t.memoizedState;o.state=O,Qo(t,a,o,l),Fo(),_=t.memoizedState,m||O!==_||Xa?(typeof K=="function"&&(tc(t,n,K,a),_=t.memoizedState),(C=Xa||ff(t,n,C,a,O,_,u))?(X||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),o.props=a,o.state=_,o.context=u,a=C):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,Rs(e,t),u=t.memoizedProps,X=Dl(n,u),o.props=X,K=t.pendingProps,O=o.context,_=n.contextType,C=Vl,typeof _=="object"&&_!==null&&(C=rn(_)),m=n.getDerivedStateFromProps,(_=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==K||O!==C)&&hf(t,o,a,C),Xa=!1,O=t.memoizedState,o.state=O,Qo(t,a,o,l),Fo();var N=t.memoizedState;u!==K||O!==N||Xa||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof m=="function"&&(tc(t,n,m,a),N=t.memoizedState),(X=Xa||ff(t,n,X,a,O,N,C)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(_||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,N,C),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,N,C)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=N),o.props=a,o.state=N,o.context=C,a=X):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,rr(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=zl(t,e.child,null,l),t.child=zl(t,null,n,l)):sn(e,t,n,l),t.memoizedState=o.state,e=t.child):e=Ca(e,t,l),e}function Af(e,t,n,a){return xl(),t.flags|=256,sn(e,t,n,a),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rc(e){return{baseLanes:e,cachePool:md()}}function sc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Hn),e}function Tf(e,t,n){var a=t.pendingProps,l=!1,o=(t.flags&128)!==0,u;if((u=o)||(u=e!==null&&e.memoizedState===null?!1:(Xt.current&2)!==0),u&&(l=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(l?Qa(t):Ka(),(e=Et)?(e=Uh(e,Qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:aa,overflow:la}:null,retryLane:536870912,hydrationErrors:null},n=rd(e),n.return=t,t.child=n,on=t,Et=null)):e=null,e===null)throw Ya(t);return Vc(e)?t.lanes=32:t.lanes=536870912,null}var m=a.children;return a=a.fallback,l?(Ka(),l=t.mode,m=sr({mode:"hidden",children:m},l),a=yl(a,l,n,null),m.return=t,a.return=t,m.sibling=a,t.child=m,a=t.child,a.memoizedState=rc(n),a.childLanes=sc(e,u,n),t.memoizedState=ic,Jo(null,a)):(Qa(t),cc(t,m))}var C=e.memoizedState;if(C!==null&&(m=C.dehydrated,m!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=uc(e,t,n)):t.memoizedState!==null?(Ka(),t.child=e.child,t.flags|=128,t=null):(Ka(),m=a.fallback,l=t.mode,a=sr({mode:"visible",children:a.children},l),m=yl(m,l,n,null),m.flags|=2,a.return=t,m.return=t,a.sibling=m,t.child=a,zl(t,e.child,null,n),a=t.child,a.memoizedState=rc(n),a.childLanes=sc(e,u,n),t.memoizedState=ic,t=Jo(null,a));else if(Qa(t),Vc(m)){if(u=m.nextSibling&&m.nextSibling.dataset,u)var _=u.dgst;u=_,a=Error(d(419)),a.stack="",a.digest=u,No({value:a,source:null,stack:null}),t=uc(e,t,n)}else if(Zt||Zl(e,t,n,!1),u=(n&e.childLanes)!==0,Zt||u){if(u=Dt,u!==null&&(a=Ve(u,n),a!==0&&a!==C.retryLane))throw C.retryLane=a,bl(e,a),Mn(u,e,a),lc;Xc(m)||br(),t=uc(e,t,n)}else Xc(m)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Et=Zn(m.nextSibling),on=t,nt=!0,qa=null,Qn=!1,e!==null&&ud(t,e),t=cc(t,a.children),t.flags|=4096);return t}return l?(Ka(),m=a.fallback,l=t.mode,C=e.child,_=C.sibling,a=ba(C,{mode:"hidden",children:a.children}),a.subtreeFlags=C.subtreeFlags&65011712,_!==null?m=ba(_,m):(m=yl(m,l,n,null),m.flags|=2),m.return=t,a.return=t,a.sibling=m,t.child=a,Jo(null,a),a=t.child,m=e.child.memoizedState,m===null?m=rc(n):(l=m.cachePool,l!==null?(C=Qt._currentValue,l=l.parent!==C?{parent:C,pool:C}:l):l=md(),m={baseLanes:m.baseLanes|n,cachePool:l}),a.memoizedState=m,a.childLanes=sc(e,u,n),t.memoizedState=ic,Jo(e.child,a)):(Qa(t),n=e.child,e=n.sibling,n=ba(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=n,t.memoizedState=null,n)}function cc(e,t){return t=sr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function sr(e,t){return e=Rn(22,e,null,t),e.lanes=0,e}function uc(e,t,n){return zl(t,e.child,null,n),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),zs(e.return,t,n)}function dc(e,t,n,a,l,o){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l,treeForkCount:o}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=n,u.tailMode=l,u.treeForkCount=o)}function Ef(e,t,n){var a=t.pendingProps,l=a.revealOrder,o=a.tail;a=a.children;var u=Xt.current,m=(u&2)!==0;if(m?(u=u&1|2,t.flags|=128):u&=1,ne(Xt,u),sn(e,t,a,n),a=nt?jo:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lf(e,n,t);else if(e.tag===19)Lf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Wi(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),dc(t,!1,l,n,o,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Wi(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}dc(t,!0,n,null,o,a);break;case"together":dc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,n=ba(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ba(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gi(e)))}function lg(e,t,n){switch(t.tag){case 3:gt(t,t.stateNode.containerInfo),Ga(t,Qt,e.memoizedState.cache),xl();break;case 27:case 5:nn(t);break;case 4:gt(t,t.stateNode.containerInfo);break;case 10:Ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Us(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Qa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Tf(e,t,n):(Qa(t),e=Ca(e,t,n),e!==null?e.sibling:null);Qa(t);break;case 19:var l=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Zl(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return Ef(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ne(Xt,Xt.current),a)break;return null;case 22:return t.lanes=0,Cf(e,t,n,t.pendingProps);case 24:Ga(t,Qt,e.memoizedState.cache)}return Ca(e,t,n)}function Rf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zt=!0;else{if(!fc(e,n)&&(t.flags&128)===0)return Zt=!1,lg(e,t,n);Zt=(e.flags&131072)!==0}else Zt=!1,nt&&(t.flags&1048576)!==0&&cd(t,jo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Cl(t.elementType),t.type=e,typeof e=="function")bs(e)?(a=Dl(e,a),t.tag=1,t=Df(null,t,e,a,n)):(t.tag=0,t=oc(null,t,e,a,n));else{if(e!=null){var l=e.$$typeof;if(l===ce){t.tag=11,t=vf(null,t,e,a,n);break e}else if(l===I){t.tag=14,t=wf(null,t,e,a,n);break e}}throw t=le(e)||e,Error(d(306,t,""))}}return t;case 0:return oc(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=Dl(a,t.pendingProps),Df(e,t,a,l,n);case 3:e:{if(gt(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var o=t.memoizedState;l=o.element,Rs(e,t),Qo(t,a,null,n);var u=t.memoizedState;if(a=u.cache,Ga(t,Qt,a),a!==o.cache&&Ms(t,[Qt],n,!0),Fo(),a=u.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Af(e,t,a,n);break e}else if(a!==l){l=Xn(Error(d(424)),t),No(l),t=Af(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Et=Zn(e.firstChild),on=t,nt=!0,qa=null,Qn=!0,n=Sd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xl(),a===l){t=Ca(e,t,n);break e}sn(e,t,a,n)}t=t.child}return t;case 26:return rr(e,t),e===null?(n=Xh(t.type,null,t.pendingProps,null))?t.memoizedState=n:nt||(n=t.type,e=t.pendingProps,a=kr(Te.current).createElement(n),a[mt]=t,a[Lt]=e,cn(a,n,e),xe(a),t.stateNode=a):t.memoizedState=Xh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return nn(t),e===null&&nt&&(a=t.stateNode=qh(t.type,t.pendingProps,Te.current),on=t,Qn=!0,l=Et,tl(t.type)?(Fc=l,Et=Zn(a.firstChild)):Et=l),sn(e,t,t.pendingProps.children,n),rr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((l=a=Et)&&(a=Og(a,t.type,t.pendingProps,Qn),a!==null?(t.stateNode=a,on=t,Et=Zn(a.firstChild),Qn=!1,l=!0):l=!1),l||Ya(t)),nn(t),l=t.type,o=t.pendingProps,u=e!==null?e.memoizedProps:null,a=o.children,qc(l,o)?a=null:u!==null&&qc(l,u)&&(t.flags|=32),t.memoizedState!==null&&(l=Ns(e,t,$0,null,null,n),fi._currentValue=l),rr(e,t),sn(e,t,a,n),t.child;case 6:return e===null&&nt&&((e=n=Et)&&(n=Bg(n,t.pendingProps,Qn),n!==null?(t.stateNode=n,on=t,Et=null,e=!0):e=!1),e||Ya(t)),null;case 13:return Tf(e,t,n);case 4:return gt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=zl(t,null,a,n):sn(e,t,a,n),t.child;case 11:return vf(e,t,t.type,t.pendingProps,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Ga(t,t.type,a.value),sn(e,t,a.children,n),t.child;case 9:return l=t.type._context,a=t.pendingProps.children,wl(t),l=rn(l),a=a(l),t.flags|=1,sn(e,t,a,n),t.child;case 14:return wf(e,t,t.type,t.pendingProps,n);case 15:return Sf(e,t,t.type,t.pendingProps,n);case 19:return Ef(e,t,n);case 31:return ag(e,t,n);case 22:return Cf(e,t,n,t.pendingProps);case 24:return wl(t),a=rn(Qt),e===null?(l=Ts(),l===null&&(l=Dt,o=Ds(),l.pooledCache=o,o.refCount++,o!==null&&(l.pooledCacheLanes|=n),l=o),t.memoizedState={parent:a,cache:l},Es(t),Ga(t,Qt,l)):((e.lanes&n)!==0&&(Rs(e,t),Qo(t,null,null,n),Fo()),l=e.memoizedState,o=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Ga(t,Qt,a)):(a=o.cache,Ga(t,Qt,a),a!==l.cache&&Ms(t,[Qt],n,!0))),sn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function ka(e){e.flags|=4}function hc(e,t,n,a,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(oh())e.flags|=8192;else throw kl=Qi,Ls}else e.flags&=-16777217}function _f(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Zh(t))if(oh())e.flags|=8192;else throw kl=Qi,Ls}function cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_l():536870912,e.lanes|=t,io|=t)}function Io(e,t){if(!nt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function og(e,t,n){var a=t.pendingProps;switch(ws(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(t),null;case 1:return Rt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),va(Qt),Be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Kl(t)?ka(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cs())),Rt(t),null;case 26:var l=t.type,o=t.memoizedState;return e===null?(ka(t),o!==null?(Rt(t),_f(t,o)):(Rt(t),hc(t,l,null,a,n))):o?o!==e.memoizedState?(ka(t),Rt(t),_f(t,o)):(Rt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ka(t),Rt(t),hc(t,l,e,a,n)),null;case 27:if(Ze(t),n=Te.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ka(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Rt(t),null}e=re.current,Kl(t)?dd(t):(e=qh(l,a,n),t.stateNode=e,ka(t))}return Rt(t),null;case 5:if(Ze(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ka(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Rt(t),null}if(o=re.current,Kl(t))dd(t);else{var u=kr(Te.current);switch(o){case 1:o=u.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:o=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":o=u.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":o=u.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":o=u.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?u.createElement("select",{is:a.is}):u.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?u.createElement(l,{is:a.is}):u.createElement(l)}}o[mt]=t,o[Lt]=a;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=o;e:switch(cn(o,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ka(t)}}return Rt(t),hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ka(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=Te.current,Kl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=on,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[mt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Th(e.nodeValue,n)),e||Ya(t,!0)}else e=kr(e).createTextNode(a),e[mt]=t,t.stateNode=e}return Rt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Kl(t),n!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[mt]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Rt(t),e=!1}else n=Cs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(On(t),t):(On(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Rt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Kl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(317));l[mt]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Rt(t),l=!1}else l=Cs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(On(t),t):(On(t),null)}return On(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),cr(t,t.updateQueue),Rt(t),null);case 4:return Be(),e===null&&Bc(t.stateNode.containerInfo),Rt(t),null;case 10:return va(t.type),Rt(t),null;case 19:if(U(Xt),a=t.memoizedState,a===null)return Rt(t),null;if(l=(t.flags&128)!==0,o=a.rendering,o===null)if(l)Io(a,!1);else{if(Yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Wi(e),o!==null){for(t.flags|=128,Io(a,!1),e=o.updateQueue,t.updateQueue=e,cr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)id(n,e),n=n.sibling;return ne(Xt,Xt.current&1|2),nt&&ya(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ot()>pr&&(t.flags|=128,l=!0,Io(a,!1),t.lanes=4194304)}else{if(!l)if(e=Wi(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,cr(t,e),Io(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!nt)return Rt(t),null}else 2*Ot()-a.renderingStartTime>pr&&n!==536870912&&(t.flags|=128,l=!0,Io(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ot(),e.sibling=null,n=Xt.current,ne(Xt,l?n&1|2:n&1),nt&&ya(t,a.treeForkCount),e):(Rt(t),null);case 22:case 23:return On(t),Hs(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),n=t.updateQueue,n!==null&&cr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&U(Sl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Qt),Rt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function ig(e,t){switch(ws(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Qt),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ze(t),null;case 31:if(t.memoizedState!==null){if(On(t),t.alternate===null)throw Error(d(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(On(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Xt),null;case 4:return Be(),null;case 10:return va(t.type),null;case 22:case 23:return On(t),Hs(),e!==null&&U(Sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Qt),null;case 25:return null;default:return null}}function Of(e,t){switch(ws(t),t.tag){case 3:va(Qt),Be();break;case 26:case 27:case 5:Ze(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&On(t);break;case 13:On(t);break;case 19:U(Xt);break;case 10:va(t.type);break;case 22:case 23:On(t),Hs(),e!==null&&U(Sl);break;case 24:va(Qt)}}function Po(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var o=n.create,u=n.inst;a=o(),u.destroy=a}n=n.next}while(n!==l)}}catch(m){wt(t,t.return,m)}}function Za(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var o=l.next;a=o;do{if((a.tag&e)===e){var u=a.inst,m=u.destroy;if(m!==void 0){u.destroy=void 0,l=t;var C=n,_=m;try{_()}catch(X){wt(l,C,X)}}}a=a.next}while(a!==o)}}catch(X){wt(t,t.return,X)}}function Bf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{kd(t,n)}catch(a){wt(e,e.return,a)}}}function Hf(e,t,n){n.props=Dl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){wt(e,t,a)}}function ei(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(l){wt(e,t,l)}}function oa(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){wt(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){wt(e,t,l)}else n.current=null}function Uf(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){wt(e,e.return,l)}}function pc(e,t,n){try{var a=e.stateNode;Ag(a,e.type,n,t),a[Lt]=t}catch(l){wt(e,e.return,l)}}function jf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tl(e.type)||e.tag===4}function gc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mc(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ga));else if(a!==4&&(a===27&&tl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}function ur(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ur(e,t,n),e=e.sibling;e!==null;)ur(e,t,n),e=e.sibling}function Nf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);cn(t,a,n),t[mt]=e,t[Lt]=n}catch(o){wt(e,e.return,o)}}var za=!1,$t=!1,bc=!1,qf=typeof WeakSet=="function"?WeakSet:Set,ln=null;function rg(e,t){if(e=e.containerInfo,jc=Er,e=Ju(e),us(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,m=-1,C=-1,_=0,X=0,K=e,O=null;t:for(;;){for(var N;K!==n||l!==0&&K.nodeType!==3||(m=u+l),K!==o||a!==0&&K.nodeType!==3||(C=u+a),K.nodeType===3&&(u+=K.nodeValue.length),(N=K.firstChild)!==null;)O=K,K=N;for(;;){if(K===e)break t;if(O===n&&++_===l&&(m=u),O===o&&++X===a&&(C=u),(N=K.nextSibling)!==null)break;K=O,O=K.parentNode}K=N}n=m===-1||C===-1?null:{start:m,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nc={focusedElem:e,selectionRange:n},Er=!1,ln=t;ln!==null;)if(t=ln,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ln=e;else for(;ln!==null;){switch(t=ln,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)l=e[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,l=o.memoizedProps,o=o.memoizedState,a=n.stateNode;try{var be=Dl(n.type,l);e=a.getSnapshotBeforeUpdate(be,o),a.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){wt(n,n.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Gc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(d(163))}if(e=t.sibling,e!==null){e.return=t.return,ln=e;break}ln=t.return}}function Yf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Da(e,n),a&4&&Po(5,n);break;case 1:if(Da(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(u){wt(n,n.return,u)}else{var l=Dl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){wt(n,n.return,u)}}a&64&&Bf(n),a&512&&ei(n,n.return);break;case 3:if(Da(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{kd(e,t)}catch(u){wt(n,n.return,u)}}break;case 27:t===null&&a&4&&Nf(n);case 26:case 5:Da(e,n),t===null&&a&4&&Uf(n),a&512&&ei(n,n.return);break;case 12:Da(e,n);break;case 31:Da(e,n),a&4&&Vf(e,n);break;case 13:Da(e,n),a&4&&Ff(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=mg.bind(null,n),Hg(e,n))));break;case 22:if(a=n.memoizedState!==null||za,!a){t=t!==null&&t.memoizedState!==null||$t,l=za;var o=$t;za=a,($t=t)&&!o?Aa(e,n,(n.subtreeFlags&8772)!==0):Da(e,n),za=l,$t=o}break;case 30:break;default:Da(e,n)}}function Gf(e){var t=e.alternate;t!==null&&(e.alternate=null,Gf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Do(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Bt=null,Sn=!1;function Ma(e,t,n){for(n=n.child;n!==null;)Xf(e,t,n),n=n.sibling}function Xf(e,t,n){if(Ce&&typeof Ce.onCommitFiberUnmount=="function")try{Ce.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:$t||oa(n,t),Ma(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$t||oa(n,t);var a=Bt,l=Sn;tl(n.type)&&(Bt=n.stateNode,Sn=!1),Ma(e,t,n),ci(n.stateNode),Bt=a,Sn=l;break;case 5:$t||oa(n,t);case 6:if(a=Bt,l=Sn,Bt=null,Ma(e,t,n),Bt=a,Sn=l,Bt!==null)if(Sn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(n.stateNode)}catch(o){wt(n,t,o)}else try{Bt.removeChild(n.stateNode)}catch(o){wt(n,t,o)}break;case 18:Bt!==null&&(Sn?(e=Bt,Bh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),go(e)):Bh(Bt,n.stateNode));break;case 4:a=Bt,l=Sn,Bt=n.stateNode.containerInfo,Sn=!0,Ma(e,t,n),Bt=a,Sn=l;break;case 0:case 11:case 14:case 15:Za(2,n,t),$t||Za(4,n,t),Ma(e,t,n);break;case 1:$t||(oa(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Hf(n,t,a)),Ma(e,t,n);break;case 21:Ma(e,t,n);break;case 22:$t=(a=$t)||n.memoizedState!==null,Ma(e,t,n),$t=a;break;default:Ma(e,t,n)}}function Vf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{go(e)}catch(n){wt(t,t.return,n)}}}function Ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{go(e)}catch(n){wt(t,t.return,n)}}function sg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qf),t;default:throw Error(d(435,e.tag))}}function dr(e,t){var n=sg(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var l=bg.bind(null,e,a);a.then(l,l)}})}function Cn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],o=e,u=t,m=u;e:for(;m!==null;){switch(m.tag){case 27:if(tl(m.type)){Bt=m.stateNode,Sn=!1;break e}break;case 5:Bt=m.stateNode,Sn=!1;break e;case 3:case 4:Bt=m.stateNode.containerInfo,Sn=!0;break e}m=m.return}if(Bt===null)throw Error(d(160));Xf(o,u,l),Bt=null,Sn=!1,o=l.alternate,o!==null&&(o.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Qf(t,e),t=t.sibling}var Pn=null;function Qf(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cn(t,e),kn(e),a&4&&(Za(3,e,e.return),Po(3,e),Za(5,e,e.return));break;case 1:Cn(t,e),kn(e),a&512&&($t||n===null||oa(n,n.return)),a&64&&za&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var l=Pn;if(Cn(t,e),kn(e),a&512&&($t||n===null||oa(n,n.return)),a&4){var o=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(a){case"title":o=l.getElementsByTagName("title")[0],(!o||o[hl]||o[mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=l.createElement(a),l.head.insertBefore(o,l.querySelector("head > title"))),cn(o,a,n),o[mt]=e,xe(o),a=o;break e;case"link":var u=Qh("link","href",l).get(a+(n.href||""));if(u){for(var m=0;m<u.length;m++)if(o=u[m],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(m,1);break t}}o=l.createElement(a),cn(o,a,n),l.head.appendChild(o);break;case"meta":if(u=Qh("meta","content",l).get(a+(n.content||""))){for(m=0;m<u.length;m++)if(o=u[m],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(m,1);break t}}o=l.createElement(a),cn(o,a,n),l.head.appendChild(o);break;default:throw Error(d(468,a))}o[mt]=e,xe(o),a=o}e.stateNode=a}else Kh(l,e.type,e.stateNode);else e.stateNode=Fh(l,a,e.memoizedProps);else o!==a?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,a===null?Kh(l,e.type,e.stateNode):Fh(l,a,e.memoizedProps)):a===null&&e.stateNode!==null&&pc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cn(t,e),kn(e),a&512&&($t||n===null||oa(n,n.return)),n!==null&&a&4&&pc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cn(t,e),kn(e),a&512&&($t||n===null||oa(n,n.return)),e.flags&32){l=e.stateNode;try{Ul(l,"")}catch(be){wt(e,e.return,be)}}a&4&&e.stateNode!=null&&(l=e.memoizedProps,pc(e,l,n!==null?n.memoizedProps:l)),a&1024&&(bc=!0);break;case 6:if(Cn(t,e),kn(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(be){wt(e,e.return,be)}}break;case 3:if(Dr=null,l=Pn,Pn=zr(t.containerInfo),Cn(t,e),Pn=l,kn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{go(t.containerInfo)}catch(be){wt(e,e.return,be)}bc&&(bc=!1,Kf(e));break;case 4:a=Pn,Pn=zr(e.stateNode.containerInfo),Cn(t,e),kn(e),Pn=a;break;case 12:Cn(t,e),kn(e);break;case 31:Cn(t,e),kn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,dr(e,a)));break;case 13:Cn(t,e),kn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(hr=Ot()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,dr(e,a)));break;case 22:l=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,_=za,X=$t;if(za=_||l,$t=X||C,Cn(t,e),$t=X,za=_,kn(e),a&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||C||za||$t||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(o=C.stateNode,l)u=o.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{m=C.stateNode;var K=C.memoizedProps.style,O=K!=null&&K.hasOwnProperty("display")?K.display:null;m.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(be){wt(C,C.return,be)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=l?"":C.memoizedProps}catch(be){wt(C,C.return,be)}}}else if(t.tag===18){if(n===null){C=t;try{var N=C.stateNode;l?Hh(N,!0):Hh(C.stateNode,!1)}catch(be){wt(C,C.return,be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,dr(e,n))));break;case 19:Cn(t,e),kn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,dr(e,a)));break;case 30:break;case 21:break;default:Cn(t,e),kn(e)}}function kn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(jf(a)){n=a;break}a=a.return}if(n==null)throw Error(d(160));switch(n.tag){case 27:var l=n.stateNode,o=gc(e);ur(e,o,l);break;case 5:var u=n.stateNode;n.flags&32&&(Ul(u,""),n.flags&=-33);var m=gc(e);ur(e,m,u);break;case 3:case 4:var C=n.stateNode.containerInfo,_=gc(e);mc(e,_,C);break;default:throw Error(d(161))}}catch(X){wt(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Da(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yf(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Za(4,t,t.return),Al(t);break;case 1:oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Hf(t,t.return,n),Al(t);break;case 27:ci(t.stateNode);case 26:case 5:oa(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function Aa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,l=e,o=t,u=o.flags;switch(o.tag){case 0:case 11:case 15:Aa(l,o,n),Po(4,o);break;case 1:if(Aa(l,o,n),a=o,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(_){wt(a,a.return,_)}if(a=o,l=a.updateQueue,l!==null){var m=a.stateNode;try{var C=l.shared.hiddenCallbacks;if(C!==null)for(l.shared.hiddenCallbacks=null,l=0;l<C.length;l++)Cd(C[l],m)}catch(_){wt(a,a.return,_)}}n&&u&64&&Bf(o),ei(o,o.return);break;case 27:Nf(o);case 26:case 5:Aa(l,o,n),n&&a===null&&u&4&&Uf(o),ei(o,o.return);break;case 12:Aa(l,o,n);break;case 31:Aa(l,o,n),n&&u&4&&Vf(l,o);break;case 13:Aa(l,o,n),n&&u&4&&Ff(l,o);break;case 22:o.memoizedState===null&&Aa(l,o,n),ei(o,o.return);break;case 30:break;default:Aa(l,o,n)}t=t.sibling}}function yc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&qo(n))}function xc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qo(e))}function ea(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Zf(e,t,n,a),t=t.sibling}function Zf(e,t,n,a){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ea(e,t,n,a),l&2048&&Po(9,t);break;case 1:ea(e,t,n,a);break;case 3:ea(e,t,n,a),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qo(e)));break;case 12:if(l&2048){ea(e,t,n,a),e=t.stateNode;try{var o=t.memoizedProps,u=o.id,m=o.onPostCommit;typeof m=="function"&&m(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){wt(t,t.return,C)}}else ea(e,t,n,a);break;case 31:ea(e,t,n,a);break;case 13:ea(e,t,n,a);break;case 23:break;case 22:o=t.stateNode,u=t.alternate,t.memoizedState!==null?o._visibility&2?ea(e,t,n,a):ti(e,t):o._visibility&2?ea(e,t,n,a):(o._visibility|=2,ao(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),l&2048&&yc(u,t);break;case 24:ea(e,t,n,a),l&2048&&xc(t.alternate,t);break;default:ea(e,t,n,a)}}function ao(e,t,n,a,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,u=t,m=n,C=a,_=u.flags;switch(u.tag){case 0:case 11:case 15:ao(o,u,m,C,l),Po(8,u);break;case 23:break;case 22:var X=u.stateNode;u.memoizedState!==null?X._visibility&2?ao(o,u,m,C,l):ti(o,u):(X._visibility|=2,ao(o,u,m,C,l)),l&&_&2048&&yc(u.alternate,u);break;case 24:ao(o,u,m,C,l),l&&_&2048&&xc(u.alternate,u);break;default:ao(o,u,m,C,l)}t=t.sibling}}function ti(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:ti(n,a),l&2048&&yc(a.alternate,a);break;case 24:ti(n,a),l&2048&&xc(a.alternate,a);break;default:ti(n,a)}t=t.sibling}}var ni=8192;function lo(e,t,n){if(e.subtreeFlags&ni)for(e=e.child;e!==null;)$f(e,t,n),e=e.sibling}function $f(e,t,n){switch(e.tag){case 26:lo(e,t,n),e.flags&ni&&e.memoizedState!==null&&Zg(n,Pn,e.memoizedState,e.memoizedProps);break;case 5:lo(e,t,n);break;case 3:case 4:var a=Pn;Pn=zr(e.stateNode.containerInfo),lo(e,t,n),Pn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ni,ni=16777216,lo(e,t,n),ni=a):lo(e,t,n));break;default:lo(e,t,n)}}function Wf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];ln=a,If(a,e)}Wf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jf(e),e=e.sibling}function Jf(e){switch(e.tag){case 0:case 11:case 15:ai(e),e.flags&2048&&Za(9,e,e.return);break;case 3:ai(e);break;case 12:ai(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,fr(e)):ai(e);break;default:ai(e)}}function fr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];ln=a,If(a,e)}Wf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),fr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,fr(t));break;default:fr(t)}e=e.sibling}}function If(e,t){for(;ln!==null;){var n=ln;switch(n.tag){case 0:case 11:case 15:Za(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:qo(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,ln=a;else e:for(n=e;ln!==null;){a=ln;var l=a.sibling,o=a.return;if(Gf(a),a===n){ln=null;break e}if(l!==null){l.return=o,ln=l;break e}ln=o}}}var cg={getCacheForType:function(e){var t=rn(Qt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return rn(Qt).controller.signal}},ug=typeof WeakMap=="function"?WeakMap:Map,ft=0,Dt=null,$e=null,Je=0,vt=0,Bn=null,$a=!1,oo=!1,vc=!1,Ta=0,Yt=0,Wa=0,Tl=0,wc=0,Hn=0,io=0,li=null,zn=null,Sc=!1,hr=0,Pf=0,pr=1/0,gr=null,Ja=null,tn=0,Ia=null,ro=null,La=0,Cc=0,kc=null,eh=null,oi=0,zc=null;function Un(){return(ft&2)!==0&&Je!==0?Je&-Je:T.T!==null?Ec():dt()}function th(){if(Hn===0)if((Je&536870912)===0||nt){var e=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),Hn=e}else Hn=536870912;return e=_n.current,e!==null&&(e.flags|=32),Hn}function Mn(e,t,n){(e===Dt&&(vt===2||vt===9)||e.cancelPendingCommit!==null)&&(so(e,0),Pa(e,Je,Hn,!1)),fa(e,n),((ft&2)===0||e!==Dt)&&(e===Dt&&((ft&2)===0&&(Tl|=n),Yt===4&&Pa(e,Je,Hn,!1)),ia(e))}function nh(e,t,n){if((ft&6)!==0)throw Error(d(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||da(e,t),l=a?hg(e,t):Dc(e,t,!0),o=a;do{if(l===0){oo&&!a&&Pa(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!dg(n)){l=Dc(e,t,!1),o=!1;continue}if(l===2){if(o=t,e.errorRecoveryDisabledLanes&o)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var m=e;l=li;var C=m.current.memoizedState.isDehydrated;if(C&&(so(m,u).flags|=256),u=Dc(m,u,!1),u!==2){if(vc&&!C){m.errorRecoveryDisabledLanes|=o,Tl|=o,l=4;break e}o=zn,zn=l,o!==null&&(zn===null?zn=o:zn.push.apply(zn,o))}l=u}if(o=!1,l!==2)continue}}if(l===1){so(e,0),Pa(e,t,0,!0);break}e:{switch(a=e,o=l,o){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:Pa(a,t,Hn,!$a);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(l=hr+300-Ot(),10<l)){if(Pa(a,t,Hn,!$a),Ba(a,0,!0)!==0)break e;La=t,a.timeoutHandle=_h(ah.bind(null,a,n,zn,gr,Sc,t,Hn,Tl,io,$a,o,"Throttled",-0,0),l);break e}ah(a,n,zn,gr,Sc,t,Hn,Tl,io,$a,o,null,-0,0)}}break}while(!0);ia(e)}function ah(e,t,n,a,l,o,u,m,C,_,X,K,O,N){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ga},$f(t,o,K);var be=(o&62914560)===o?hr-Ot():(o&4194048)===o?Pf-Ot():0;if(be=$g(K,be),be!==null){La=o,e.cancelPendingCommit=be(dh.bind(null,e,t,o,n,a,l,u,m,C,X,K,null,O,N)),Pa(e,o,u,!_);return}}dh(e,t,o,n,a,l,u,m,C)}function dg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],o=l.getSnapshot;l=l.value;try{if(!En(o(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pa(e,t,n,a){t&=~wc,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var o=31-lt(l),u=1<<o;a[o]=-1,l&=~u}n!==0&&Ol(e,n,t)}function mr(){return(ft&6)===0?(ii(0),!1):!0}function Mc(){if($e!==null){if(vt===0)var e=$e.return;else e=$e,xa=vl=null,Gs(e),Il=null,Go=0,e=$e;for(;e!==null;)Of(e.alternate,e),e=e.return;$e=null}}function so(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Eg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),La=0,Mc(),Dt=e,$e=n=ba(e.current,null),Je=t,vt=0,Bn=null,$a=!1,oo=da(e,t),vc=!1,io=Hn=wc=Tl=Wa=Yt=0,zn=li=null,Sc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-lt(a),o=1<<l;t|=e[l],a&=~o}return Ta=t,Ui(),n}function lh(e,t){Qe=null,T.H=Wo,t===Jl||t===Fi?(t=xd(),vt=3):t===Ls?(t=xd(),vt=4):vt=t===lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Bn=t,$e===null&&(Yt=1,or(e,Xn(t,e.current)))}function oh(){var e=_n.current;return e===null?!0:(Je&4194048)===Je?Kn===null:(Je&62914560)===Je||(Je&536870912)!==0?e===Kn:!1}function ih(){var e=T.H;return T.H=Wo,e===null?Wo:e}function rh(){var e=T.A;return T.A=cg,e}function br(){Yt=4,$a||(Je&4194048)!==Je&&_n.current!==null||(oo=!0),(Wa&134217727)===0&&(Tl&134217727)===0||Dt===null||Pa(Dt,Je,Hn,!1)}function Dc(e,t,n){var a=ft;ft|=2;var l=ih(),o=rh();(Dt!==e||Je!==t)&&(gr=null,so(e,t)),t=!1;var u=Yt;e:do try{if(vt!==0&&$e!==null){var m=$e,C=Bn;switch(vt){case 8:Mc(),u=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(t=!0);var _=vt;if(vt=0,Bn=null,co(e,m,C,_),n&&oo){u=0;break e}break;default:_=vt,vt=0,Bn=null,co(e,m,C,_)}}fg(),u=Yt;break}catch(X){lh(e,X)}while(!0);return t&&e.shellSuspendCounter++,xa=vl=null,ft=a,T.H=l,T.A=o,$e===null&&(Dt=null,Je=0,Ui()),u}function fg(){for(;$e!==null;)sh($e)}function hg(e,t){var n=ft;ft|=2;var a=ih(),l=rh();Dt!==e||Je!==t?(gr=null,pr=Ot()+500,so(e,t)):oo=da(e,t);e:do try{if(vt!==0&&$e!==null){t=$e;var o=Bn;t:switch(vt){case 1:vt=0,Bn=null,co(e,t,o,1);break;case 2:case 9:if(bd(o)){vt=0,Bn=null,ch(t);break}t=function(){vt!==2&&vt!==9||Dt!==e||(vt=7),ia(e)},o.then(t,t);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:bd(o)?(vt=0,Bn=null,ch(t)):(vt=0,Bn=null,co(e,t,o,7));break;case 5:var u=null;switch($e.tag){case 26:u=$e.memoizedState;case 5:case 27:var m=$e;if(u?Zh(u):m.stateNode.complete){vt=0,Bn=null;var C=m.sibling;if(C!==null)$e=C;else{var _=m.return;_!==null?($e=_,yr(_)):$e=null}break t}}vt=0,Bn=null,co(e,t,o,5);break;case 6:vt=0,Bn=null,co(e,t,o,6);break;case 8:Mc(),Yt=6;break e;default:throw Error(d(462))}}pg();break}catch(X){lh(e,X)}while(!0);return xa=vl=null,T.H=a,T.A=l,ft=n,$e!==null?0:(Dt=null,Je=0,Ui(),Yt)}function pg(){for(;$e!==null&&!pe();)sh($e)}function sh(e){var t=Rf(e.alternate,e,Ta);e.memoizedProps=e.pendingProps,t===null?yr(e):$e=t}function ch(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Mf(n,t,t.pendingProps,t.type,void 0,Je);break;case 11:t=Mf(n,t,t.pendingProps,t.type.render,t.ref,Je);break;case 5:Gs(t);default:Of(n,t),t=$e=id(t,Ta),t=Rf(n,t,Ta)}e.memoizedProps=e.pendingProps,t===null?yr(e):$e=t}function co(e,t,n,a){xa=vl=null,Gs(t),Il=null,Go=0;var l=t.return;try{if(ng(e,l,t,n,Je)){Yt=1,or(e,Xn(n,e.current)),$e=null;return}}catch(o){if(l!==null)throw $e=l,o;Yt=1,or(e,Xn(n,e.current)),$e=null;return}t.flags&32768?(nt||a===1?e=!0:oo||(Je&536870912)!==0?e=!1:($a=e=!0,(a===2||a===9||a===3||a===6)&&(a=_n.current,a!==null&&a.tag===13&&(a.flags|=16384))),uh(t,e)):yr(t)}function yr(e){var t=e;do{if((t.flags&32768)!==0){uh(t,$a);return}e=t.return;var n=og(t.alternate,t,Ta);if(n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Yt===0&&(Yt=5)}function uh(e,t){do{var n=ig(e.alternate,e);if(n!==null){n.flags&=32767,$e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=n}while(e!==null);Yt=6,$e=null}function dh(e,t,n,a,l,o,u,m,C){e.cancelPendingCommit=null;do xr();while(tn!==0);if((ft&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(o=t.lanes|t.childLanes,o|=gs,zo(e,n,o,u,m,C),e===Dt&&($e=Dt=null,Je=0),ro=t,Ia=e,La=n,Cc=o,kc=l,eh=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yg(vn,function(){return mh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,l=$.p,$.p=2,u=ft,ft|=4;try{rg(e,t,n)}finally{ft=u,$.p=l,T.T=a}}tn=1,fh(),hh(),ph()}}function fh(){if(tn===1){tn=0;var e=Ia,t=ro,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null;var a=$.p;$.p=2;var l=ft;ft|=4;try{Qf(t,e);var o=Nc,u=Ju(e.containerInfo),m=o.focusedElem,C=o.selectionRange;if(u!==m&&m&&m.ownerDocument&&Wu(m.ownerDocument.documentElement,m)){if(C!==null&&us(m)){var _=C.start,X=C.end;if(X===void 0&&(X=_),"selectionStart"in m)m.selectionStart=_,m.selectionEnd=Math.min(X,m.value.length);else{var K=m.ownerDocument||document,O=K&&K.defaultView||window;if(O.getSelection){var N=O.getSelection(),be=m.textContent.length,Ee=Math.min(C.start,be),Mt=C.end===void 0?Ee:Math.min(C.end,be);!N.extend&&Ee>Mt&&(u=Mt,Mt=Ee,Ee=u);var A=$u(m,Ee),z=$u(m,Mt);if(A&&z&&(N.rangeCount!==1||N.anchorNode!==A.node||N.anchorOffset!==A.offset||N.focusNode!==z.node||N.focusOffset!==z.offset)){var R=K.createRange();R.setStart(A.node,A.offset),N.removeAllRanges(),Ee>Mt?(N.addRange(R),N.extend(z.node,z.offset)):(R.setEnd(z.node,z.offset),N.addRange(R))}}}}for(K=[],N=m;N=N.parentNode;)N.nodeType===1&&K.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<K.length;m++){var F=K[m];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}Er=!!jc,Nc=jc=null}finally{ft=l,$.p=a,T.T=n}}e.current=t,tn=2}}function hh(){if(tn===2){tn=0;var e=Ia,t=ro,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=T.T,T.T=null;var a=$.p;$.p=2;var l=ft;ft|=4;try{Yf(e,t.alternate,t)}finally{ft=l,$.p=a,T.T=n}}tn=3}}function ph(){if(tn===4||tn===3){tn=0,Wn();var e=Ia,t=ro,n=La,a=eh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?tn=5:(tn=0,ro=Ia=null,gh(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Ja=null),tt(n),t=t.stateNode,Ce&&typeof Ce.onCommitFiberRoot=="function")try{Ce.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=T.T,l=$.p,$.p=2,T.T=null;try{for(var o=e.onRecoverableError,u=0;u<a.length;u++){var m=a[u];o(m.value,{componentStack:m.stack})}}finally{T.T=t,$.p=l}}(La&3)!==0&&xr(),ia(e),l=e.pendingLanes,(n&261930)!==0&&(l&42)!==0?e===zc?oi++:(oi=0,zc=e):oi=0,ii(0)}}function gh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qo(t)))}function xr(){return fh(),hh(),ph(),mh()}function mh(){if(tn!==5)return!1;var e=Ia,t=Cc;Cc=0;var n=tt(La),a=T.T,l=$.p;try{$.p=32>n?32:n,T.T=null,n=kc,kc=null;var o=Ia,u=La;if(tn=0,ro=Ia=null,La=0,(ft&6)!==0)throw Error(d(331));var m=ft;if(ft|=4,Jf(o.current),Zf(o,o.current,u,n),ft=m,ii(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot=="function")try{Ce.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{$.p=l,T.T=a,gh(e,t)}}function bh(e,t,n){t=Xn(n,t),t=ac(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(fa(e,2),ia(e))}function wt(e,t,n){if(e.tag===3)bh(e,e,n);else for(;t!==null;){if(t.tag===3){bh(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ja===null||!Ja.has(a))){e=Xn(n,e),n=yf(2),a=Fa(t,n,2),a!==null&&(xf(n,a,t,e),fa(a,2),ia(a));break}}t=t.return}}function Ac(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new ug;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(vc=!0,l.add(n),e=gg.bind(null,e,t,n),t.then(e,e))}function gg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Dt===e&&(Je&n)===n&&(Yt===4||Yt===3&&(Je&62914560)===Je&&300>Ot()-hr?(ft&2)===0&&so(e,0):wc|=n,io===Je&&(io=0)),ia(e)}function yh(e,t){t===0&&(t=_l()),e=bl(e,t),e!==null&&(fa(e,t),ia(e))}function mg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yh(e,n)}function bg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),yh(e,n)}function yg(e,t){return rt(e,t)}var vr=null,uo=null,Tc=!1,wr=!1,Lc=!1,el=0;function ia(e){e!==uo&&e.next===null&&(uo===null?vr=uo=e:uo=uo.next=e),wr=!0,Tc||(Tc=!0,vg())}function ii(e,t){if(!Lc&&wr){Lc=!0;do for(var n=!1,a=vr;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var o=0;else{var u=a.suspendedLanes,m=a.pingedLanes;o=(1<<31-lt(42|e)+1)-1,o&=l&~(u&~m),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Sh(a,o))}else o=Je,o=Ba(a,a===Dt?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||da(a,o)||(n=!0,Sh(a,o));a=a.next}while(n);Lc=!1}}function xg(){xh()}function xh(){wr=Tc=!1;var e=0;el!==0&&Lg()&&(e=el);for(var t=Ot(),n=null,a=vr;a!==null;){var l=a.next,o=vh(a,t);o===0?(a.next=null,n===null?vr=l:n.next=l,l===null&&(uo=n)):(n=a,(e!==0||(o&3)!==0)&&(wr=!0)),a=l}tn!==0&&tn!==5||ii(e),el!==0&&(el=0)}function vh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var u=31-lt(o),m=1<<u,C=l[u];C===-1?((m&n)===0||(m&a)!==0)&&(l[u]=Rl(m,t)):C<=t&&(e.expiredLanes|=m),o&=~m}if(t=Dt,n=Je,n=Ba(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(vt===2||vt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Nt(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||da(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Nt(a),tt(n)){case 2:case 8:n=xn;break;case 32:n=vn;break;case 268435456:n=ie;break;default:n=vn}return a=wh.bind(null,e),n=rt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Nt(a),e.callbackPriority=2,e.callbackNode=null,2}function wh(e,t){if(tn!==0&&tn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xr()&&e.callbackNode!==n)return null;var a=Je;return a=Ba(e,e===Dt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(nh(e,a,t),vh(e,Ot()),e.callbackNode!=null&&e.callbackNode===n?wh.bind(null,e):null)}function Sh(e,t){if(xr())return null;nh(e,t,!0)}function vg(){Rg(function(){(ft&6)!==0?rt(Tn,xg):xh()})}function Ec(){if(el===0){var e=$l;e===0&&(e=_a,_a<<=1,(_a&261888)===0&&(_a=256)),el=e}return el}function Ch(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ti(""+e)}function kh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function wg(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var o=Ch((l[Lt]||null).action),u=a.submitter;u&&(t=(t=u[Lt]||null)?Ch(t.formAction):u.getAttribute("formAction"),t!==null&&(o=t,u=null));var m=new _i("action","action",null,a,l);e.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(el!==0){var C=u?kh(l,u):new FormData(l);Js(n,{pending:!0,data:C,method:l.method,action:o},null,C)}}else typeof o=="function"&&(m.preventDefault(),C=u?kh(l,u):new FormData(l),Js(n,{pending:!0,data:C,method:l.method,action:o},o,C))},currentTarget:l}]})}}for(var Rc=0;Rc<ps.length;Rc++){var _c=ps[Rc],Sg=_c.toLowerCase(),Cg=_c[0].toUpperCase()+_c.slice(1);In(Sg,"on"+Cg)}In(ed,"onAnimationEnd"),In(td,"onAnimationIteration"),In(nd,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(N0,"onTransitionRun"),In(q0,"onTransitionStart"),In(Y0,"onTransitionCancel"),In(ad,"onTransitionEnd"),it("onMouseEnter",["mouseout","mouseover"]),it("onMouseLeave",["mouseout","mouseover"]),it("onPointerEnter",["pointerout","pointerover"]),it("onPointerLeave",["pointerout","pointerover"]),ot("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ot("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ot("onBeforeInput",["compositionend","keypress","textInput","paste"]),ot("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ot("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ot("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ri="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(" "),kg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ri));function zh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var u=a.length-1;0<=u;u--){var m=a[u],C=m.instance,_=m.currentTarget;if(m=m.listener,C!==o&&l.isPropagationStopped())break e;o=m,l.currentTarget=_;try{o(l)}catch(X){Hi(X)}l.currentTarget=null,o=C}else for(u=0;u<a.length;u++){if(m=a[u],C=m.instance,_=m.currentTarget,m=m.listener,C!==o&&l.isPropagationStopped())break e;o=m,l.currentTarget=_;try{o(l)}catch(X){Hi(X)}l.currentTarget=null,o=C}}}}function We(e,t){var n=t[Bl];n===void 0&&(n=t[Bl]=new Set);var a=e+"__bubble";n.has(a)||(Mh(t,e,2,!1),n.add(a))}function Oc(e,t,n){var a=0;t&&(a|=4),Mh(n,e,a,t)}var Sr="_reactListening"+Math.random().toString(36).slice(2);function Bc(e){if(!e[Sr]){e[Sr]=!0,_e.forEach(function(n){n!=="selectionchange"&&(kg.has(n)||Oc(n,!1,e),Oc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sr]||(t[Sr]=!0,Oc("selectionchange",!1,t))}}function Mh(e,t,n,a){switch(tp(t)){case 2:var l=Ig;break;case 8:l=Pg;break;default:l=Wc}n=l.bind(null,t,n,e),l=void 0,!ts||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Hc(e,t,n,a,l){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var u=a.tag;if(u===3||u===4){var m=a.stateNode.containerInfo;if(m===l)break;if(u===4)for(u=a.return;u!==null;){var C=u.tag;if((C===3||C===4)&&u.stateNode.containerInfo===l)return;u=u.return}for(;m!==null;){if(u=ha(m),u===null)return;if(C=u.tag,C===5||C===6||C===26||C===27){a=o=u;continue e}m=m.parentNode}}a=a.return}Lu(function(){var _=o,X=Pr(n),K=[];e:{var O=ld.get(e);if(O!==void 0){var N=_i,be=e;switch(e){case"keypress":if(Ei(n)===0)break e;case"keydown":case"keyup":N=b0;break;case"focusin":be="focus",N=os;break;case"focusout":be="blur",N=os;break;case"beforeblur":case"afterblur":N=os;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=_u;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=o0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=v0;break;case ed:case td:case nd:N=s0;break;case ad:N=S0;break;case"scroll":case"scrollend":N=a0;break;case"wheel":N=k0;break;case"copy":case"cut":case"paste":N=u0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Bu;break;case"toggle":case"beforetoggle":N=M0}var Ee=(t&4)!==0,Mt=!Ee&&(e==="scroll"||e==="scrollend"),A=Ee?O!==null?O+"Capture":null:O;Ee=[];for(var z=_,R;z!==null;){var F=z;if(R=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||R===null||A===null||(F=To(z,A),F!=null&&Ee.push(si(z,F,R))),Mt)break;z=z.return}0<Ee.length&&(O=new N(O,be,null,n,X),K.push({event:O,listeners:Ee}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",O&&n!==Ir&&(be=n.relatedTarget||n.fromElement)&&(ha(be)||be[Ln]))break e;if((N||O)&&(O=X.window===X?X:(O=X.ownerDocument)?O.defaultView||O.parentWindow:window,N?(be=n.relatedTarget||n.toElement,N=_,be=be?ha(be):null,be!==null&&(Mt=p(be),Ee=be.tag,be!==Mt||Ee!==5&&Ee!==27&&Ee!==6)&&(be=null)):(N=null,be=_),N!==be)){if(Ee=_u,F="onMouseLeave",A="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Bu,F="onPointerLeave",A="onPointerEnter",z="pointer"),Mt=N==null?O:se(N),R=be==null?O:se(be),O=new Ee(F,z+"leave",N,n,X),O.target=Mt,O.relatedTarget=R,F=null,ha(X)===_&&(Ee=new Ee(A,z+"enter",be,n,X),Ee.target=R,Ee.relatedTarget=Mt,F=Ee),Mt=F,N&&be)t:{for(Ee=zg,A=N,z=be,R=0,F=A;F;F=Ee(F))R++;F=0;for(var Ae=z;Ae;Ae=Ee(Ae))F++;for(;0<R-F;)A=Ee(A),R--;for(;0<F-R;)z=Ee(z),F--;for(;R--;){if(A===z||z!==null&&A===z.alternate){Ee=A;break t}A=Ee(A),z=Ee(z)}Ee=null}else Ee=null;N!==null&&Dh(K,O,N,Ee,!1),be!==null&&Mt!==null&&Dh(K,Mt,be,Ee,!0)}}e:{if(O=_?se(_):window,N=O.nodeName&&O.nodeName.toLowerCase(),N==="select"||N==="input"&&O.type==="file")var st=Xu;else if(Yu(O))if(Vu)st=H0;else{st=O0;var Se=_0}else N=O.nodeName,!N||N.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?_&&Jr(_.elementType)&&(st=Xu):st=B0;if(st&&(st=st(e,_))){Gu(K,st,n,X);break e}Se&&Se(e,O,_),e==="focusout"&&_&&O.type==="number"&&_.memoizedProps.value!=null&&Wr(O,"number",O.value)}switch(Se=_?se(_):window,e){case"focusin":(Yu(Se)||Se.contentEditable==="true")&&(Yl=Se,ds=_,Uo=null);break;case"focusout":Uo=ds=Yl=null;break;case"mousedown":fs=!0;break;case"contextmenu":case"mouseup":case"dragend":fs=!1,Iu(K,n,X);break;case"selectionchange":if(j0)break;case"keydown":case"keyup":Iu(K,n,X)}var Ke;if(rs)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ql?Nu(e,n)&&(Ie="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ie="onCompositionStart");Ie&&(Hu&&n.locale!=="ko"&&(ql||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ql&&(Ke=Eu()):(ja=X,ns="value"in ja?ja.value:ja.textContent,ql=!0)),Se=Cr(_,Ie),0<Se.length&&(Ie=new Ou(Ie,e,null,n,X),K.push({event:Ie,listeners:Se}),Ke?Ie.data=Ke:(Ke=qu(n),Ke!==null&&(Ie.data=Ke)))),(Ke=A0?T0(e,n):L0(e,n))&&(Ie=Cr(_,"onBeforeInput"),0<Ie.length&&(Se=new Ou("onBeforeInput","beforeinput",null,n,X),K.push({event:Se,listeners:Ie}),Se.data=Ke)),wg(K,e,_,n,X)}zh(K,t)})}function si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cr(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,o=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||o===null||(l=To(e,n),l!=null&&a.unshift(si(e,l,o)),l=To(e,t),l!=null&&a.push(si(e,l,o))),e.tag===3)return a;e=e.return}return[]}function zg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dh(e,t,n,a,l){for(var o=t._reactName,u=[];n!==null&&n!==a;){var m=n,C=m.alternate,_=m.stateNode;if(m=m.tag,C!==null&&C===a)break;m!==5&&m!==26&&m!==27||_===null||(C=_,l?(_=To(n,o),_!=null&&u.unshift(si(n,_,C))):l||(_=To(n,o),_!=null&&u.push(si(n,_,C)))),n=n.return}u.length!==0&&e.push({event:t,listeners:u})}var Mg=/\r\n?/g,Dg=/\u0000|\uFFFD/g;function Ah(e){return(typeof e=="string"?e:""+e).replace(Mg,`
9
+ `).replace(Dg,"")}function Th(e,t){return t=Ah(t),Ah(e)===t}function zt(e,t,n,a,l,o){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ul(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ul(e,""+a);break;case"className":Di(e,"class",a);break;case"tabIndex":Di(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Di(e,n,a);break;case"style":Au(e,a,o);break;case"data":if(t!=="object"){Di(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ti(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&zt(e,t,"name",l.name,l,null),zt(e,t,"formEncType",l.formEncType,l,null),zt(e,t,"formMethod",l.formMethod,l,null),zt(e,t,"formTarget",l.formTarget,l,null)):(zt(e,t,"encType",l.encType,l,null),zt(e,t,"method",l.method,l,null),zt(e,t,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ti(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ga);break;case"onScroll":a!=null&&We("scroll",e);break;case"onScrollEnd":a!=null&&We("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Ti(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":We("beforetoggle",e),We("toggle",e),Mi(e,"popover",a);break;case"xlinkActuate":pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":pa(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":pa(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":pa(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":pa(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Mi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=t0.get(n)||n,Mi(e,n,a))}}function Uc(e,t,n,a,l,o){switch(n){case"style":Au(e,a,o);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Ul(e,a):(typeof a=="number"||typeof a=="bigint")&&Ul(e,""+a);break;case"onScroll":a!=null&&We("scroll",e);break;case"onScrollEnd":a!=null&&We("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ga);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!He.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),o=e[Lt]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,l),typeof a=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,l);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Mi(e,n,a)}}}function cn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",e),We("load",e);var a=!1,l=!1,o;for(o in n)if(n.hasOwnProperty(o)){var u=n[o];if(u!=null)switch(o){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:zt(e,t,o,u,n,null)}}l&&zt(e,t,"srcSet",n.srcSet,n,null),a&&zt(e,t,"src",n.src,n,null);return;case"input":We("invalid",e);var m=o=u=l=null,C=null,_=null;for(a in n)if(n.hasOwnProperty(a)){var X=n[a];if(X!=null)switch(a){case"name":l=X;break;case"type":u=X;break;case"checked":C=X;break;case"defaultChecked":_=X;break;case"value":o=X;break;case"defaultValue":m=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(d(137,t));break;default:zt(e,t,a,X,n,null)}}ku(e,o,m,C,_,u,l,!1);return;case"select":We("invalid",e),a=u=o=null;for(l in n)if(n.hasOwnProperty(l)&&(m=n[l],m!=null))switch(l){case"value":o=m;break;case"defaultValue":u=m;break;case"multiple":a=m;default:zt(e,t,l,m,n,null)}t=o,n=u,e.multiple=!!a,t!=null?Hl(e,!!a,t,!1):n!=null&&Hl(e,!!a,n,!0);return;case"textarea":We("invalid",e),o=l=a=null;for(u in n)if(n.hasOwnProperty(u)&&(m=n[u],m!=null))switch(u){case"value":a=m;break;case"defaultValue":l=m;break;case"children":o=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(d(91));break;default:zt(e,t,u,m,n,null)}Mu(e,a,l,o);return;case"option":for(C in n)n.hasOwnProperty(C)&&(a=n[C],a!=null)&&(C==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":zt(e,t,C,a,n,null));return;case"dialog":We("beforetoggle",e),We("toggle",e),We("cancel",e),We("close",e);break;case"iframe":case"object":We("load",e);break;case"video":case"audio":for(a=0;a<ri.length;a++)We(ri[a],e);break;case"image":We("error",e),We("load",e);break;case"details":We("toggle",e);break;case"embed":case"source":case"link":We("error",e),We("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in n)if(n.hasOwnProperty(_)&&(a=n[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:zt(e,t,_,a,n,null)}return;default:if(Jr(t)){for(X in n)n.hasOwnProperty(X)&&(a=n[X],a!==void 0&&Uc(e,t,X,a,n,void 0));return}}for(m in n)n.hasOwnProperty(m)&&(a=n[m],a!=null&&zt(e,t,m,a,n,null))}function Ag(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,o=null,u=null,m=null,C=null,_=null,X=null;for(N in n){var K=n[N];if(n.hasOwnProperty(N)&&K!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":C=K;default:a.hasOwnProperty(N)||zt(e,t,N,null,a,K)}}for(var O in a){var N=a[O];if(K=n[O],a.hasOwnProperty(O)&&(N!=null||K!=null))switch(O){case"type":o=N;break;case"name":l=N;break;case"checked":_=N;break;case"defaultChecked":X=N;break;case"value":u=N;break;case"defaultValue":m=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(d(137,t));break;default:N!==K&&zt(e,t,O,N,a,K)}}$r(e,u,m,C,_,X,o,l);return;case"select":N=u=m=O=null;for(o in n)if(C=n[o],n.hasOwnProperty(o)&&C!=null)switch(o){case"value":break;case"multiple":N=C;default:a.hasOwnProperty(o)||zt(e,t,o,null,a,C)}for(l in a)if(o=a[l],C=n[l],a.hasOwnProperty(l)&&(o!=null||C!=null))switch(l){case"value":O=o;break;case"defaultValue":m=o;break;case"multiple":u=o;default:o!==C&&zt(e,t,l,o,a,C)}t=m,n=u,a=N,O!=null?Hl(e,!!n,O,!1):!!a!=!!n&&(t!=null?Hl(e,!!n,t,!0):Hl(e,!!n,n?[]:"",!1));return;case"textarea":N=O=null;for(m in n)if(l=n[m],n.hasOwnProperty(m)&&l!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:zt(e,t,m,null,a,l)}for(u in a)if(l=a[u],o=n[u],a.hasOwnProperty(u)&&(l!=null||o!=null))switch(u){case"value":O=l;break;case"defaultValue":N=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(d(91));break;default:l!==o&&zt(e,t,u,l,a,o)}zu(e,O,N);return;case"option":for(var be in n)O=n[be],n.hasOwnProperty(be)&&O!=null&&!a.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:zt(e,t,be,null,a,O));for(C in a)O=a[C],N=n[C],a.hasOwnProperty(C)&&O!==N&&(O!=null||N!=null)&&(C==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":zt(e,t,C,O,a,N));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 Ee in n)O=n[Ee],n.hasOwnProperty(Ee)&&O!=null&&!a.hasOwnProperty(Ee)&&zt(e,t,Ee,null,a,O);for(_ in a)if(O=a[_],N=n[_],a.hasOwnProperty(_)&&O!==N&&(O!=null||N!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(d(137,t));break;default:zt(e,t,_,O,a,N)}return;default:if(Jr(t)){for(var Mt in n)O=n[Mt],n.hasOwnProperty(Mt)&&O!==void 0&&!a.hasOwnProperty(Mt)&&Uc(e,t,Mt,void 0,a,O);for(X in a)O=a[X],N=n[X],!a.hasOwnProperty(X)||O===N||O===void 0&&N===void 0||Uc(e,t,X,O,a,N);return}}for(var A in n)O=n[A],n.hasOwnProperty(A)&&O!=null&&!a.hasOwnProperty(A)&&zt(e,t,A,null,a,O);for(K in a)O=a[K],N=n[K],!a.hasOwnProperty(K)||O===N||O==null&&N==null||zt(e,t,K,O,a,N)}function Lh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var l=n[a],o=l.transferSize,u=l.initiatorType,m=l.duration;if(o&&m&&Lh(u)){for(u=0,m=l.responseEnd,a+=1;a<n.length;a++){var C=n[a],_=C.startTime;if(_>m)break;var X=C.transferSize,K=C.initiatorType;X&&Lh(K)&&(C=C.responseEnd,u+=X*(C<m?1:(m-_)/(C-_)))}if(--a,t+=8*(o+u)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var jc=null,Nc=null;function kr(e){return e.nodeType===9?e:e.ownerDocument}function Eh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Rh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function qc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yc=null;function Lg(){var e=window.event;return e&&e.type==="popstate"?e===Yc?!1:(Yc=e,!0):(Yc=null,!1)}var _h=typeof setTimeout=="function"?setTimeout:void 0,Eg=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,Rg=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(e){return Oh.resolve(null).then(e).catch(_g)}:_h;function _g(e){setTimeout(function(){throw e})}function tl(e){return e==="head"}function Bh(e,t){var n=t,a=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(l),go(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")ci(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ci(n);for(var o=n.firstChild;o;){var u=o.nextSibling,m=o.nodeName;o[hl]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=u}}else n==="body"&&ci(e.ownerDocument.body);n=l}while(n);go(t)}function Hh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Gc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Gc(n),Do(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Og(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[hl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Zn(e.nextSibling),e===null)break}return null}function Bg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zn(e.nextSibling),e===null))return null;return e}function Uh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zn(e.nextSibling),e===null))return null;return e}function Xc(e){return e.data==="$?"||e.data==="$~"}function Vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Zn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Fc=null;function jh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Zn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Nh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function qh(e,t,n){switch(t=kr(n),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function ci(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Do(e)}var $n=new Map,Yh=new Set;function zr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ea=$.d;$.d={f:Ug,r:jg,D:Ng,C:qg,L:Yg,m:Gg,X:Vg,S:Xg,M:Fg};function Ug(){var e=Ea.f(),t=mr();return e||t}function jg(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?af(t):Ea.r(e)}var fo=typeof document>"u"?null:document;function Gh(e,t,n){var a=fo;if(a&&typeof t=="string"&&t){var l=Yn(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Yh.has(l)||(Yh.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),cn(t,"link",e),xe(t),a.head.appendChild(t)))}}function Ng(e){Ea.D(e),Gh("dns-prefetch",e,null)}function qg(e,t){Ea.C(e,t),Gh("preconnect",e,t)}function Yg(e,t,n){Ea.L(e,t,n);var a=fo;if(a&&e&&t){var l='link[rel="preload"][as="'+Yn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+Yn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+Yn(n.imageSizes)+'"]')):l+='[href="'+Yn(e)+'"]';var o=l;switch(t){case"style":o=ho(e);break;case"script":o=po(e)}$n.has(o)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$n.set(o,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(ui(o))||t==="script"&&a.querySelector(di(o))||(t=a.createElement("link"),cn(t,"link",e),xe(t),a.head.appendChild(t)))}}function Gg(e,t){Ea.m(e,t);var n=fo;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Yn(a)+'"][href="'+Yn(e)+'"]',o=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=po(e)}if(!$n.has(o)&&(e=M({rel:"modulepreload",href:e},t),$n.set(o,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(di(o)))return}a=n.createElement("link"),cn(a,"link",e),xe(a),n.head.appendChild(a)}}}function Xg(e,t,n){Ea.S(e,t,n);var a=fo;if(a&&e){var l=ye(a).hoistableStyles,o=ho(e);t=t||"default";var u=l.get(o);if(!u){var m={loading:0,preload:null};if(u=a.querySelector(ui(o)))m.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$n.get(o))&&Qc(e,n);var C=u=a.createElement("link");xe(C),cn(C,"link",e),C._p=new Promise(function(_,X){C.onload=_,C.onerror=X}),C.addEventListener("load",function(){m.loading|=1}),C.addEventListener("error",function(){m.loading|=2}),m.loading|=4,Mr(u,t,a)}u={type:"stylesheet",instance:u,count:1,state:m},l.set(o,u)}}}function Vg(e,t){Ea.X(e,t);var n=fo;if(n&&e){var a=ye(n).hoistableScripts,l=po(e),o=a.get(l);o||(o=n.querySelector(di(l)),o||(e=M({src:e,async:!0},t),(t=$n.get(l))&&Kc(e,t),o=n.createElement("script"),xe(o),cn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Fg(e,t){Ea.M(e,t);var n=fo;if(n&&e){var a=ye(n).hoistableScripts,l=po(e),o=a.get(l);o||(o=n.querySelector(di(l)),o||(e=M({src:e,async:!0,type:"module"},t),(t=$n.get(l))&&Kc(e,t),o=n.createElement("script"),xe(o),cn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Xh(e,t,n,a){var l=(l=Te.current)?zr(l):null;if(!l)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ho(n.href),n=ye(l).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ho(n.href);var o=ye(l).hoistableStyles,u=o.get(e);if(u||(l=l.ownerDocument||l,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,u),(o=l.querySelector(ui(e)))&&!o._p&&(u.instance=o,u.state.loading=5),$n.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},$n.set(e,n),o||Qg(l,e,n,u.state))),t&&a===null)throw Error(d(528,""));return u}if(t&&a!==null)throw Error(d(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=po(n),n=ye(l).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function ho(e){return'href="'+Yn(e)+'"'}function ui(e){return'link[rel="stylesheet"]['+e+"]"}function Vh(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function Qg(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),cn(t,"link",n),xe(t),e.head.appendChild(t))}function po(e){return'[src="'+Yn(e)+'"]'}function di(e){return"script[async]"+e}function Fh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Yn(n.href)+'"]');if(a)return t.instance=a,xe(a),a;var l=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),xe(a),cn(a,"style",l),Mr(a,n.precedence,e),t.instance=a;case"stylesheet":l=ho(n.href);var o=e.querySelector(ui(l));if(o)return t.state.loading|=4,t.instance=o,xe(o),o;a=Vh(n),(l=$n.get(l))&&Qc(a,l),o=(e.ownerDocument||e).createElement("link"),xe(o);var u=o;return u._p=new Promise(function(m,C){u.onload=m,u.onerror=C}),cn(o,"link",a),t.state.loading|=4,Mr(o,n.precedence,e),t.instance=o;case"script":return o=po(n.src),(l=e.querySelector(di(o)))?(t.instance=l,xe(l),l):(a=n,(l=$n.get(o))&&(a=M({},n),Kc(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),xe(l),cn(l,"link",a),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Mr(a,n.precedence,e));return t.instance}function Mr(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,o=l,u=0;u<a.length;u++){var m=a[u];if(m.dataset.precedence===t)o=m;else if(o!==l)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Kc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Dr=null;function Qh(e,t,n){if(Dr===null){var a=new Map,l=Dr=new Map;l.set(n,a)}else l=Dr,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var o=n[l];if(!(o[hl]||o[mt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var u=o.getAttribute(t)||"";u=e+u;var m=a.get(u);m?m.push(o):a.set(u,[o])}}return a}function Kh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Kg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zg(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=ho(a.href),o=t.querySelector(ui(l));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ar.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,xe(o);return}o=t.ownerDocument||t,a=Vh(a),(l=$n.get(l))&&Qc(a,l),o=o.createElement("link"),xe(o);var u=o;u._p=new Promise(function(m,C){u.onload=m,u.onerror=C}),cn(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ar.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Zc=0;function $g(e,t){return e.stylesheets&&e.count===0&&Lr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Zc===0&&(Zc=62500*Tg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Zc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function Ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tr=null;function Lr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tr=new Map,t.forEach(Wg,e),Tr=null,Ar.call(e))}function Wg(e,t){if(!(t.state.loading&4)){var n=Tr.get(e);if(n)var a=n.get(null);else{n=new Map,Tr.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<l.length;o++){var u=l[o];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(n.set(u.dataset.precedence,u),a=u)}a&&n.set(null,a)}l=t.instance,u=l.getAttribute("data-precedence"),o=n.get(u)||a,o===a&&n.set(null,l),n.set(u,l),this.count++,a=Ar.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),o?o.parentNode.insertBefore(l,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var fi={$$typeof:te,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Jg(e,t,n,a,l,o,u,m,C){this.tag=1,this.containerInfo=e,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=fl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fl(0),this.hiddenUpdates=fl(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=o,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function $h(e,t,n,a,l,o,u,m,C,_,X,K){return e=new Jg(e,t,n,u,C,_,X,K,m),t=1,o===!0&&(t|=24),o=Rn(3,null,null,t),e.current=o,o.stateNode=e,t=Ds(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},Es(o),e}function Wh(e){return e?(e=Vl,e):Vl}function Jh(e,t,n,a,l,o){l=Wh(l),a.context===null?a.context=l:a.pendingContext=l,a=Va(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=Fa(e,a,t),n!==null&&(Mn(n,e,t),Vo(n,e,t))}function Ih(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $c(e,t){Ih(e,t),(e=e.alternate)&&Ih(e,t)}function Ph(e){if(e.tag===13||e.tag===31){var t=bl(e,67108864);t!==null&&Mn(t,e,67108864),$c(e,67108864)}}function ep(e){if(e.tag===13||e.tag===31){var t=Un();t=Fe(t);var n=bl(e,t);n!==null&&Mn(n,e,t),$c(e,t)}}var Er=!0;function Ig(e,t,n,a){var l=T.T;T.T=null;var o=$.p;try{$.p=2,Wc(e,t,n,a)}finally{$.p=o,T.T=l}}function Pg(e,t,n,a){var l=T.T;T.T=null;var o=$.p;try{$.p=8,Wc(e,t,n,a)}finally{$.p=o,T.T=l}}function Wc(e,t,n,a){if(Er){var l=Jc(a);if(l===null)Hc(e,t,a,Rr,n),np(e,a);else if(tm(l,e,t,n,a))a.stopPropagation();else if(np(e,a),t&4&&-1<em.indexOf(e)){for(;l!==null;){var o=ge(l);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var u=Jn(o.pendingLanes);if(u!==0){var m=o;for(m.pendingLanes|=2,m.entangledLanes|=2;u;){var C=1<<31-lt(u);m.entanglements[1]|=C,u&=~C}ia(o),(ft&6)===0&&(pr=Ot()+500,ii(0))}}break;case 31:case 13:m=bl(o,2),m!==null&&Mn(m,o,2),mr(),$c(o,2)}if(o=Jc(a),o===null&&Hc(e,t,a,Rr,n),o===l)break;l=o}l!==null&&a.stopPropagation()}else Hc(e,t,a,null,n)}}function Jc(e){return e=Pr(e),Ic(e)}var Rr=null;function Ic(e){if(Rr=null,e=ha(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=D(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rr=e,null}function tp(e){switch(e){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(mn()){case Tn:return 2;case xn:return 8;case vn:case Z:return 32;case ie:return 268435456;default:return 32}default:return 32}}var Pc=!1,nl=null,al=null,ll=null,hi=new Map,pi=new Map,ol=[],em="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 np(e,t){switch(e){case"focusin":case"focusout":nl=null;break;case"dragenter":case"dragleave":al=null;break;case"mouseover":case"mouseout":ll=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pi.delete(t.pointerId)}}function gi(e,t,n,a,l,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[l]},t!==null&&(t=ge(t),t!==null&&Ph(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function tm(e,t,n,a,l){switch(t){case"focusin":return nl=gi(nl,e,t,n,a,l),!0;case"dragenter":return al=gi(al,e,t,n,a,l),!0;case"mouseover":return ll=gi(ll,e,t,n,a,l),!0;case"pointerover":var o=l.pointerId;return hi.set(o,gi(hi.get(o)||null,e,t,n,a,l)),!0;case"gotpointercapture":return o=l.pointerId,pi.set(o,gi(pi.get(o)||null,e,t,n,a,l)),!0}return!1}function ap(e){var t=ha(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,an(e.priority,function(){ep(n)});return}}else if(t===31){if(t=D(n),t!==null){e.blockedOn=t,an(e.priority,function(){ep(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _r(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Ir=a,n.target.dispatchEvent(a),Ir=null}else return t=ge(n),t!==null&&Ph(t),e.blockedOn=n,!1;t.shift()}return!0}function lp(e,t,n){_r(e)&&n.delete(t)}function nm(){Pc=!1,nl!==null&&_r(nl)&&(nl=null),al!==null&&_r(al)&&(al=null),ll!==null&&_r(ll)&&(ll=null),hi.forEach(lp),pi.forEach(lp)}function Or(e,t){e.blockedOn===t&&(e.blockedOn=null,Pc||(Pc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,nm)))}var Br=null;function op(e){Br!==e&&(Br=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Br===e&&(Br=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!="function"){if(Ic(a||n)===null)continue;break}var o=ge(n);o!==null&&(e.splice(t,3),t-=3,Js(o,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function go(e){function t(C){return Or(C,e)}nl!==null&&Or(nl,e),al!==null&&Or(al,e),ll!==null&&Or(ll,e),hi.forEach(t),pi.forEach(t);for(var n=0;n<ol.length;n++){var a=ol[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ol.length&&(n=ol[0],n.blockedOn===null);)ap(n),n.blockedOn===null&&ol.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],o=n[a+1],u=l[Lt]||null;if(typeof o=="function")u||op(n);else if(u){var m=null;if(o&&o.hasAttribute("formAction")){if(l=o,u=o[Lt]||null)m=u.formAction;else if(Ic(l)!==null)continue}else m=u.action;typeof m=="function"?n[a+1]=m:(n.splice(a,3),a-=3),op(n)}}}function ip(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(u){return l=u})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function eu(e){this._internalRoot=e}Hr.prototype.render=eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var n=t.current,a=Un();Jh(n,a,e,t,null,null)},Hr.prototype.unmount=eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jh(e.current,2,null,e,null,null),mr(),t[Ln]=null}};function Hr(e){this._internalRoot=e}Hr.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ol.length&&t!==0&&t<ol[n].priority;n++);ol.splice(n,0,e),n===0&&ap(e)}};var rp=c.version;if(rp!=="19.2.4")throw Error(d(527,rp,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=b(t),e=e!==null?L(e):null,e=e===null?null:e.stateNode,e};var am={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ur=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ur.isDisabled&&Ur.supportsFiber)try{Ne=Ur.inject(am),Ce=Ur}catch{}}return yi.createRoot=function(e,t){if(!h(e))throw Error(d(299));var n=!1,a="",l=pf,o=gf,u=mf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=$h(e,1,!1,null,null,n,a,null,l,o,u,ip),e[Ln]=t.current,Bc(e),new eu(t)},yi.hydrateRoot=function(e,t,n){if(!h(e))throw Error(d(299));var a=!1,l="",o=pf,u=gf,m=mf,C=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(u=n.onCaughtError),n.onRecoverableError!==void 0&&(m=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=$h(e,1,!0,t,n??null,a,l,C,o,u,m,ip),t.context=Wh(null),n=t.current,a=Un(),a=Fe(a),l=Va(a),l.callback=null,Fa(n,l,a),n=a,t.current.lanes=n,fa(t,n),ia(t),e[Ln]=t.current,Bc(e),new Hr(t)},yi.version="19.2.4",yi}var Dp;function c1(){if(Dp)return iu.exports;Dp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),iu.exports=s1(),iu.exports}var u1=c1(),Ap=function(c,f){var d=arguments;if(f==null||!zi.call(f,"css"))return x.createElement.apply(void 0,d);var h=d.length,p=new Array(h);p[0]=vu,p[1]=xu(c,f);for(var v=2;v<h;v++)p[v]=d[v];return x.createElement.apply(null,p)};(function(i){var c;c||(c=i.JSX||(i.JSX={}))})(Ap||(Ap={}));function g(){for(var i=arguments.length,c=new Array(i),f=0;f<i;f++)c[f]=arguments[f];return Xp(c)}function Ut(){var i=g.apply(void 0,arguments),c="animation-"+i.name;return{name:c,styles:"@keyframes "+c+"{"+i.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const d1={showProgress:!1,progressTitle:"",progressState:{current:0,total:0,percent:0,status:"processing"},showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1,actionPaths:[],syncImageCount:0,syncHasRemote:!1,syncHasLocal:!1,processMode:"generate",downloadImageCount:0,downloadTotalSelected:0},f1={isOpen:!1,openStudio:()=>{},closeStudio:()=>{},toggleStudio:()=>{},currentPath:"public",setCurrentPath:()=>{},navigateUp:()=>{},selectedItems:new Set,toggleSelection:()=>{},selectRange:()=>{},selectAll:()=>{},clearSelection:()=>{},lastSelectedPath:null,viewMode:"grid",setViewMode:()=>{},focusedItem:null,setFocusedItem:()=>{},meta:null,setMeta:()=>{},isLoading:!1,setIsLoading:()=>{},refreshKey:0,triggerRefresh:()=>{},editedImageKey:null,setEditedImageKey:()=>{},scanRequested:!1,triggerScan:()=>{},clearScanRequest:()=>{},searchQuery:"",setSearchQuery:()=>{},error:null,showError:()=>{},clearError:()=>{},fileItems:[],setFileItems:()=>{},actionState:d1,requestDelete:()=>{},requestMove:()=>{},requestSync:()=>{},requestDownload:()=>{},requestProcess:()=>{},setProcessMode:()=>{},confirmDelete:async()=>{},confirmMove:async()=>{},confirmSync:async()=>{},confirmProcess:async()=>{},cancelAction:()=>{},closeProgress:()=>{},stopProcessing:()=>{},deleteOrphans:async()=>{}},Fp=x.createContext(f1);function So(){return x.useContext(Fp)}const dl="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif",s={primary:"#635bff",primaryHover:"#5851e5",primaryLight:"#f0f0ff",background:"#f6f9fc",surface:"#ffffff",surfaceHover:"#f6f9fc",border:"#d8dee4",borderLight:"#e3e8ee",borderHover:"#c1c9d2",text:"#1a1f36",textSecondary:"#697386",textMuted:"#8792a2",success:"#0d7d4d",successLight:"#e6f7ef",danger:"#df1b41",dangerHover:"#c41535",dangerLight:"#fff5f7",imagesFolder:"#8b5cf6",hover:"#e8ecf0"},q={xs:"13px",sm:"14px",base:"16px",lg:"19px",xl:"22px"},Ra=g("font-family:",dl,";font-size:",q.base,";line-height:1.5;color:",s.text,";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box;*,*::before,*::after{box-sizing:border-box;}button,input,select,textarea{font-family:inherit;font-size:inherit;}",""),h1=Ut`
10
+ from { opacity: 0; }
11
+ to { opacity: 1; }
12
+ `,p1=Ut`
13
+ from {
14
+ opacity: 0;
15
+ transform: translateY(-8px) scale(0.98);
16
+ }
17
+ to {
18
+ opacity: 1;
19
+ transform: translateY(0) scale(1);
20
+ }
21
+ `,g1=Ut`
22
+ from { transform: rotate(0deg); }
23
+ to { transform: rotate(360deg); }
24
+ `,Oe={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",h1," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:420px;width:90%;animation:",p1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"5e7rpo",styles:"padding:12px 24px 24px"},message:g("font-size:",q.base,";color:",s.textSecondary,";margin:0;line-height:1.6;",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:g("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:g("background-color:",s.danger,";border:1px solid ",s.danger,";color:white;&:hover{background-color:",s.dangerHover,";border-color:",s.dangerHover,";}","")};function vo({title:i,message:c,confirmLabel:f="Confirm",cancelLabel:d="Cancel",variant:h="default",onConfirm:p,onCancel:v}){return r("div",{css:Oe.overlay,onClick:v,children:y("div",{css:Oe.modal,onClick:D=>D.stopPropagation(),children:[r("div",{css:Oe.header,children:r("h3",{css:Oe.title,children:i})}),r("div",{css:Oe.body,children:r("p",{css:Oe.message,children:c})}),y("div",{css:Oe.footer,children:[r("button",{css:[Oe.btn,Oe.btnCancel,"",""],onClick:v,children:d}),r("button",{css:[Oe.btn,h==="danger"?Oe.btnDanger:Oe.btnConfirm,"",""],onClick:p,children:f})]})]})})}const m1={input:g("width:100%;padding:10px 12px;font-size:",q.base,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";margin-top:12px;transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}","")};function El({title:i,message:c,inputLabel:f,defaultValue:d="",placeholder:h,confirmLabel:p="Confirm",cancelLabel:v="Cancel",isLoading:D=!1,loadingLabel:w="Processing...",onConfirm:b,onCancel:L}){const[M,E]=yt.useState(d),Y=B=>{B.preventDefault(),M.trim()&&!D&&b(M.trim())};return r("div",{css:Oe.overlay,onClick:D?void 0:L,children:r("div",{css:Oe.modal,onClick:B=>B.stopPropagation(),children:y("form",{onSubmit:Y,children:[r("div",{css:Oe.header,children:r("h3",{css:Oe.title,children:i})}),y("div",{css:Oe.body,children:[c&&r("p",{css:Oe.message,children:c}),f&&r("label",{css:Oe.message,children:f}),r("input",{css:m1.input,type:"text",value:M,onChange:B=>E(B.target.value),placeholder:h,autoFocus:!0,disabled:D})]}),y("div",{css:Oe.footer,children:[r("button",{type:"button",css:[Oe.btn,Oe.btnCancel,"",""],onClick:L,disabled:D,children:v}),r("button",{type:"submit",css:[Oe.btn,Oe.btnConfirm,"",""],disabled:!M.trim()||D,children:D?y(Pe,{children:[r("span",{css:g("display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:",g1," 0.75s linear infinite;margin-right:6px;","")}),w]}):p})]})]})})})}function Kr({title:i,message:c,buttonLabel:f="OK",onClose:d}){return r("div",{css:Oe.overlay,onClick:d,children:y("div",{css:Oe.modal,onClick:h=>h.stopPropagation(),children:[r("div",{css:Oe.header,children:r("h3",{css:Oe.title,children:i})}),r("div",{css:Oe.body,children:r("p",{css:Oe.message,children:c})}),r("div",{css:Oe.footer,children:r("button",{css:[Oe.btn,Oe.btnConfirm,"",""],onClick:d,children:f})})]})})}const rl={progressContainer:{name:"yz1nei",styles:"margin-top:16px"},progressBar:g("width:100%;height:8px;background-color:",s.background,";border-radius:4px;overflow:hidden;margin-bottom:12px;",""),progressFill:g("height:100%;background:linear-gradient(90deg, ",s.primary,", ",s.primaryHover,");border-radius:4px;transition:width 0.3s ease;",""),progressText:g("font-size:",q.sm,";color:",s.textSecondary,";margin:0;display:flex;justify-content:space-between;align-items:center;",""),currentFile:g("font-size:",q.xs,";color:",s.textMuted,";margin:8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""),errorList:{name:"1lw22n1",styles:"margin-top:12px;padding:12px;background:#fef2f2;border:1px solid #fecaca;border-radius:6px;max-height:200px;overflow-y:auto"},errorItem:g("font-size:",q.xs,";color:#991b1b;margin:0 0 4px;&:last-child{margin-bottom:0;}","")};function ul({title:i,progress:c,onClose:f,onDeleteOrphans:d,onStop:h}){const p=c.status==="complete",v=c.status==="error",D=c.status==="stopped",w=c.status==="stopping",b=p||v||D,L=!b||w;return r("div",{css:Oe.overlay,children:y("div",{css:Oe.modal,onClick:M=>M.stopPropagation(),children:[r("div",{css:Oe.header,children:r("h3",{css:Oe.title,children:i})}),r("div",{css:Oe.body,children:v?r("p",{css:Oe.message,children:c.message||"An error occurred"}):D?y("p",{css:Oe.message,children:["Processing stopped. Processed ",c.processed??c.current," image",(c.processed??c.current)!==1?"s":""," before stopping."]}):p?y(Pe,{children:[y("p",{css:Oe.message,children:[c.message?c.message:c.isDelete?y(Pe,{children:["Deleted ",c.processed," file",c.processed!==1?"s":"",".",c.errors!==void 0&&c.errors>0?y(Pe,{children:[" ",c.errors," error",c.errors!==1?"s":""," occurred."]}):null]}):c.isMove?y(Pe,{children:["Moved ",c.processed," file",c.processed!==1?"s":"",".",c.errors!==void 0&&c.errors>0?y(Pe,{children:[" ",c.errors," error",c.errors!==1?"s":""," occurred."]}):null]}):c.isScan?y(Pe,{children:[c.alreadyProcessed!==void 0&&c.alreadyProcessed>0?y(Pe,{children:[c.alreadyProcessed," image",c.alreadyProcessed!==1?"s":""," already exist. "]}):null,"Scanned ",c.processed," new image",c.processed!==1?"s":"",".",c.orphanedEntries!==void 0&&c.orphanedEntries>0?y(Pe,{children:[" Removed ",c.orphanedEntries," orphaned entr",c.orphanedEntries!==1?"ies":"y","."]}):null,c.pendingUpdates!==void 0&&c.pendingUpdates>0?y(Pe,{children:[" ",c.pendingUpdates," file",c.pendingUpdates!==1?"s have":" has"," local updates pending."]}):null]}):y(Pe,{children:["Processed ",c.processed," new image",c.processed!==1?"s":"",".",c.alreadyProcessed!==void 0&&c.alreadyProcessed>0?y(Pe,{children:[" ",c.alreadyProcessed," already processed."]}):null]}),c.orphansRemoved!==void 0&&c.orphansRemoved>0?y(Pe,{children:[" Removed ",c.orphansRemoved," orphaned thumbnail",c.orphansRemoved!==1?"s":"","."]}):null]}),c.errorMessages&&c.errorMessages.length>0&&y("div",{css:rl.errorList,children:[c.errorMessages.slice(0,10).map((M,E)=>r("p",{css:rl.errorItem,children:M},E)),c.errorMessages.length>10&&y("p",{css:rl.errorItem,children:["...and ",c.errorMessages.length-10," more"]})]})]}):y(Pe,{children:[r("p",{css:Oe.message,children:c.status==="cleanup"?c.message||"Cleaning up...":c.message||"Processing..."}),y("div",{css:rl.progressContainer,children:[r("div",{css:rl.progressBar,children:r("div",{css:rl.progressFill,style:{width:`${c.percent}%`}})}),y("div",{css:rl.progressText,children:[y("span",{children:[c.current," of ",c.total]}),y("span",{children:[c.percent,"%"]})]}),c.currentFile&&r("p",{css:rl.currentFile,title:c.currentFile,children:c.currentFile})]})]})}),y("div",{css:Oe.footer,children:[L&&h&&r("button",{css:[Oe.btn,Oe.btnDanger,"",""],onClick:h,disabled:c.status==="stopping",children:c.status==="stopping"?"Stopping...":"Stop"}),b&&c.orphanedFiles&&c.orphanedFiles.length>0&&d&&y("button",{css:[Oe.btn,Oe.btnDanger,"",""],onClick:d,children:["Delete ",c.orphanedFiles.length," Orphan",c.orphanedFiles.length!==1?"s":""]}),b&&r("button",{css:[Oe.btn,Oe.btnConfirm,"",""],onClick:f,children:"Done"})]})]})})}function wu(i){const{setShowProgress:c,setProgressTitle:f,setProgressState:d,triggerRefresh:h}=i,p=x.useRef(null),v=x.useRef(!1),D=x.useRef(!1),w=x.useRef(null),b=x.useCallback(()=>{p.current&&p.current.abort()},[]);return{execute:x.useCallback(async M=>{const{endpoint:E,body:Y,title:B,operationType:k,onComplete:Q,onError:j}=M;if(v.current){console.warn("Streaming operation already in progress");return}v.current=!0,D.current=!1;const te=`${E.split("/").pop()?.replace("-stream","")||"op"}-${Date.now()}-${Math.random().toString(36).slice(2)}`;w.current=te;const ce=new AbortController;p.current=ce;const V=async()=>{D.current=!0,d(P=>({...P,status:"stopping"}));try{await fetch("/api/studio/cancel-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:te})})}catch{}};ce.signal.addEventListener("abort",V),f(B),c(!0),d({current:0,total:0,percent:0,status:"processing",message:`Starting ${B.toLowerCase()}...`});try{const P=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...Y,operationId:te})});if(!P.ok){const G=await P.json().catch(()=>({}));throw new Error(G.error||`Request failed: ${P.status}`)}if(!P.body)throw new Error("No response body");const I=P.body.getReader(),ae=new TextDecoder;let H="";try{for(;;){const{done:G,value:oe}=await I.read();if(G)break;H+=ae.decode(oe,{stream:!0});const fe=H.split(`
25
+
26
+ `);H=fe.pop()||"";for(const de of fe)if(de.startsWith("data: "))try{const le=JSON.parse(de.slice(6));if(le.type==="start")d(Me=>({...Me,total:le.total||Me.total}));else if(le.type==="progress")d({current:le.current||0,total:le.total||0,percent:le.percent||Math.round((le.current||0)/(le.total||1)*100),status:"processing",currentFile:le.currentFile,message:le.message});else if(le.type==="cleanup")d(Me=>({...Me,status:"cleanup",message:le.message}));else if(le.type==="complete"){const Me=le.cancelled===!0,T=le.processed??le.moved??le.renamed??le.pushed??le.downloaded??le.added??le.imported??le.deleted??le.current??0;d({current:T,total:T,percent:100,status:Me?"stopped":le.errors&&le.errors>0?"error":"complete",message:le.message,processed:T,errors:le.errors,orphanedFiles:le.orphanedFiles,isDelete:k==="delete",isMove:k==="move",isScan:k==="scan"}),h(),Q?.(le)}else le.type==="error"&&(d(Me=>({...Me,status:"error",message:le.message})),j?.(le.message||"Unknown error"))}catch{}}}catch(G){if(!D.current)throw G}finally{ce.signal.removeEventListener("abort",V)}}catch(P){if(!D.current){const I=P instanceof Error?P.message:"Operation failed";console.error(`${B} error:`,P),d({current:0,total:0,percent:0,status:"error",message:I}),j?.(I)}}finally{v.current=!1,p.current=null,w.current=null}},[c,f,d,h]),stop:b,get isRunning(){return v.current}}}const b1=Ut`
27
+ from { opacity: 0; }
28
+ to { opacity: 1; }
29
+ `,y1=Ut`
30
+ from {
31
+ opacity: 0;
32
+ transform: translateY(-8px) scale(0.98);
33
+ }
34
+ to {
35
+ opacity: 1;
36
+ transform: translateY(0) scale(1);
37
+ }
38
+ `,Gt={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",b1," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:80vh;display:flex;flex-direction:column;animation:",y1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"zizupt",styles:"padding:12px 24px 24px;flex:1;overflow-y:auto;min-height:200px;max-height:400px"},message:g("font-size:",q.base,";color:",s.textSecondary,";margin:0 0 16px;line-height:1.6;",""),folderList:{name:"1axgfg3",styles:"display:flex;flex-direction:column;gap:0"},folderItem:g("display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;cursor:pointer;transition:all 0.15s ease;border:1px solid transparent;position:relative;&:hover{background-color:",s.surfaceHover,";}",""),treeIndent:{name:"197dxto",styles:"display:flex;align-items:center;height:100%"},treeLine:g("width:16px;height:100%;position:relative;flex-shrink:0;&::before{content:'';position:absolute;left:8px;top:0;bottom:50%;width:0;border-left:1px dashed ",s.textSecondary,";}&::after{content:'';position:absolute;left:8px;top:50%;width:8px;height:0;border-top:1px dashed ",s.textSecondary,";}",""),folderItemSelected:g("background-color:",s.primaryLight,";border-color:",s.primary,";&:hover{background-color:",s.primaryLight,";}",""),folderItemDisabled:{name:"181lhkw",styles:"opacity:0.5;cursor:not-allowed;&:hover{background-color:transparent;}"},folderIcon:{name:"17bs1oo",styles:"width:20px;height:20px;color:#f9935e;flex-shrink:0"},folderName:g("font-size:",q.base,";color:",s.text,";flex:1;",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:g("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),loading:g("display:flex;align-items:center;justify-content:center;padding:40px;color:",s.textSecondary,";",""),spinner:g("width:24px;height:24px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:spin 0.8s linear infinite;@keyframes spin{to{transform:rotate(360deg);}}","")};function Qp({selectedItems:i,currentPath:c,onMove:f,onCancel:d}){const[h,p]=x.useState([]),[v,D]=x.useState(!0),[w,b]=x.useState(null);x.useEffect(()=>{async function B(){try{const k=await fetch("/api/studio/list-folders");if(k.ok){const Q=await k.json();console.log("Loaded folders:",Q),p(Q.folders||[])}else console.error("Failed to load folders:",k.status,await k.text())}catch(k){console.error("Failed to load folders:",k)}finally{D(!1)}}B()},[]);const L=Array.from(i),M=h.filter(B=>!L.some(k=>B.path===k||B.path.startsWith(k+"/"))),E=B=>B===c,Y=()=>{w&&f(w)};return r("div",{css:Gt.overlay,onClick:d,children:y("div",{css:Gt.modal,onClick:B=>B.stopPropagation(),children:[r("div",{css:Gt.header,children:r("h3",{css:Gt.title,children:"Move Items"})}),y("div",{css:Gt.body,children:[y("p",{css:Gt.message,children:["Select a destination folder for ",i.size," item",i.size!==1?"s":"",":"]}),v?r("div",{css:Gt.loading,children:r("div",{css:Gt.spinner})}):M.length===0?r("div",{css:Gt.loading,children:"No available folders to move to."}):r("div",{css:Gt.folderList,children:M.map(B=>{const k=E(B.path);return y("div",{css:[Gt.folderItem,w===B.path&&Gt.folderItemSelected,k&&Gt.folderItemDisabled,"",""],style:{paddingLeft:12},onClick:()=>!k&&b(B.path),children:[B.depth>0&&r("div",{css:Gt.treeIndent,children:Array.from({length:B.depth}).map((Q,j)=>r("div",{css:Gt.treeLine},j))}),r("svg",{css:Gt.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),y("span",{css:Gt.folderName,children:[B.name,k&&" (current)"]})]},B.path)})})]}),y("div",{css:Gt.footer,children:[r("button",{css:[Gt.btn,Gt.btnCancel,"",""],onClick:d,children:"Cancel"}),r("button",{css:[Gt.btn,Gt.btnConfirm,"",""],onClick:Y,disabled:!w,children:"Move Here"})]})]})})}const x1=`CLOUDFLARE_R2_ACCOUNT_ID=your_account_id
39
+ CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key
40
+ CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_key
41
+ CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name
42
+ CLOUDFLARE_R2_PUBLIC_URL=https://pub-xxx.r2.dev
43
+ NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_URL=https://pub-xxx.r2.dev`,ve={overlay:{name:"8ivopw",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);display:flex;align-items:center;justify-content:center;z-index:1100;padding:20px"},modal:g("background:",s.surface,";border-radius:12px;max-width:560px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 40px rgba(0, 0, 0, 0.3);",""),header:g("display:flex;align-items:center;gap:12px;padding:20px 24px;border-bottom:1px solid ",s.border,";",""),icon:g("width:32px;height:32px;color:",s.primary,";flex-shrink:0;",""),title:g("font-size:",q.xl,";font-weight:600;color:",s.text,";margin:0;",""),closeBtn:g("margin-left:auto;background:none;border:none;padding:4px;cursor:pointer;color:",s.textMuted,";border-radius:4px;&:hover{color:",s.text,";background:",s.surfaceHover,";}",""),closeIcon:{name:"1aynuae",styles:"width:20px;height:20px"},content:{name:"vxuddk",styles:"padding:24px"},intro:g("font-size:",q.base,";color:",s.textSecondary,";margin:0 0 20px 0;line-height:1.6;",""),steps:{name:"1fs2p21",styles:"list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:16px"},step:{name:"1wesxqa",styles:"display:flex;gap:12px"},stepNumber:g("width:28px;height:28px;border-radius:50%;background:",s.primaryLight,";color:",s.primary,";font-size:",q.sm,";font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0;",""),stepContent:{name:"pkc2k3",styles:"flex:1;padding-top:3px"},stepTitle:g("font-size:",q.base,";font-weight:500;color:",s.text,";margin:0 0 4px 0;",""),stepDesc:g("font-size:",q.sm,";color:",s.textSecondary,";margin:0;line-height:1.5;",""),link:g("color:",s.primary,";text-decoration:none;font-weight:500;&:hover{text-decoration:underline;}",""),envVarsWrapper:{name:"1ksolcl",styles:"position:relative;margin-top:20px"},envVars:g("background:",s.background,";border:1px solid ",s.border,";border-radius:8px;padding:16px;padding-right:48px;font-family:'SF Mono',Monaco,'Cascadia Code',monospace;font-size:13px;line-height:1.8;color:",s.text,";overflow-x:auto;",""),envVar:{name:"4zleql",styles:"display:block"},envKey:g("color:",s.primary,";",""),envValue:g("color:",s.textSecondary,";",""),copyBtn:g("position:absolute;top:8px;right:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;color:",s.textMuted,";transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";color:",s.text,";border-color:#d0d5dd;}",""),copyIcon:{name:"157xhr7",styles:"width:16px;height:16px"},copiedTooltip:{name:"9a5yd1",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;&::before{content:'';position:absolute;right:-4px;top:50%;transform:translateY(-50%);border-left:4px solid #1a1f36;border-top:4px solid transparent;border-bottom:4px solid transparent;}"},footer:g("padding:16px 24px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;gap:12px;",""),docsBtn:g("padding:10px 16px;border-radius:6px;font-size:",q.base,";font-weight:500;border:1px solid ",s.border,";background:",s.surface,";color:",s.text,";cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:#d0d5dd;}",""),doneBtn:g("padding:10px 20px;border-radius:6px;font-size:",q.base,";font-weight:500;border:none;background:",s.primary,";color:white;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}",""),externalIcon:{name:"1djxupe",styles:"width:14px;height:14px"}};function Kp({isOpen:i,onClose:c}){const[f,d]=x.useState(!1),h=async()=>{try{await navigator.clipboard.writeText(x1),d(!0),setTimeout(()=>d(!1),2e3)}catch(p){console.error("Failed to copy:",p)}};return i?r("div",{css:ve.overlay,onClick:c,children:y("div",{css:ve.modal,onClick:p=>p.stopPropagation(),children:[y("div",{css:ve.header,children:[r("svg",{css:ve.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("h2",{css:ve.title,children:"Set Up CDN Storage"}),r("button",{css:ve.closeBtn,onClick:c,children:r("svg",{css:ve.closeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),y("div",{css:ve.content,children:[r("p",{css:ve.intro,children:"Sync your images to Cloudflare R2 for faster global delivery. R2 offers generous free tier with no egress fees."}),y("ol",{css:ve.steps,children:[y("li",{css:ve.step,children:[r("span",{css:ve.stepNumber,children:"1"}),y("div",{css:ve.stepContent,children:[r("h4",{css:ve.stepTitle,children:"Create a Cloudflare account"}),y("p",{css:ve.stepDesc,children:["Sign up at"," ",r("a",{css:ve.link,href:"https://dash.cloudflare.com/sign-up",target:"_blank",rel:"noopener noreferrer",children:"dash.cloudflare.com"})," ","if you don't have one already."]})]})]}),y("li",{css:ve.step,children:[r("span",{css:ve.stepNumber,children:"2"}),y("div",{css:ve.stepContent,children:[r("h4",{css:ve.stepTitle,children:"Create an R2 bucket"}),y("p",{css:ve.stepDesc,children:["Go to R2 in your Cloudflare dashboard and create a new bucket. Choose a name like ",r("code",{children:"my-images"}),"."]})]})]}),y("li",{css:ve.step,children:[r("span",{css:ve.stepNumber,children:"3"}),y("div",{css:ve.stepContent,children:[r("h4",{css:ve.stepTitle,children:"Enable public access"}),y("p",{css:ve.stepDesc,children:['In bucket settings, enable "Public Access" and copy the public URL (e.g., ',r("code",{children:"https://pub-xxx.r2.dev"}),")."]})]})]}),y("li",{css:ve.step,children:[r("span",{css:ve.stepNumber,children:"4"}),y("div",{css:ve.stepContent,children:[r("h4",{css:ve.stepTitle,children:"Create API token"}),r("p",{css:ve.stepDesc,children:'Go to R2 → Manage R2 API Tokens → Create API Token. Select "Object Read & Write" permissions for your bucket.'})]})]}),y("li",{css:ve.step,children:[r("span",{css:ve.stepNumber,children:"5"}),y("div",{css:ve.stepContent,children:[r("h4",{css:ve.stepTitle,children:"Add environment variables"}),y("p",{css:ve.stepDesc,children:["Add these to your ",r("code",{children:".env.local"})," file:"]})]})]})]}),y("div",{css:ve.envVarsWrapper,children:[y("div",{css:ve.envVars,children:[y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"CLOUDFLARE_R2_ACCOUNT_ID"}),"=",r("span",{css:ve.envValue,children:"your_account_id"})]}),y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"CLOUDFLARE_R2_ACCESS_KEY_ID"}),"=",r("span",{css:ve.envValue,children:"your_access_key"})]}),y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"CLOUDFLARE_R2_SECRET_ACCESS_KEY"}),"=",r("span",{css:ve.envValue,children:"your_secret_key"})]}),y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"CLOUDFLARE_R2_BUCKET_NAME"}),"=",r("span",{css:ve.envValue,children:"your_bucket_name"})]}),y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"CLOUDFLARE_R2_PUBLIC_URL"}),"=",r("span",{css:ve.envValue,children:"https://pub-xxx.r2.dev"})]}),y("span",{css:ve.envVar,children:[r("span",{css:ve.envKey,children:"NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_URL"}),"=",r("span",{css:ve.envValue,children:"https://pub-xxx.r2.dev"})]})]}),y("button",{css:ve.copyBtn,onClick:h,title:"Copy to clipboard",children:[f&&r("span",{css:ve.copiedTooltip,children:"Copied!"}),r("svg",{css:ve.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]})]}),y("div",{css:ve.footer,children:[y("a",{css:ve.docsBtn,href:"https://developers.cloudflare.com/r2/get-started/",target:"_blank",rel:"noopener noreferrer",children:["R2 Documentation",r("svg",{css:ve.externalIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),r("button",{css:ve.doneBtn,onClick:c,children:"Got it"})]})]})}):null}const v1=Ut`
44
+ from { opacity: 0; }
45
+ to { opacity: 1; }
46
+ `,w1=Ut`
47
+ from {
48
+ opacity: 0;
49
+ transform: translateY(-8px) scale(0.98);
50
+ }
51
+ to {
52
+ opacity: 1;
53
+ transform: translateY(0) scale(1);
54
+ }
55
+ `,At={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",v1," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:520px;width:90%;animation:",w1," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),tabs:g("display:flex;gap:0;margin-top:16px;border-bottom:1px solid ",s.border,";",""),tab:g("padding:12px 20px;font-size:",q.base,";font-weight:500;color:",s.textSecondary,";background:none;border:none;cursor:pointer;position:relative;transition:color 0.15s;&:hover{color:",s.text,";}",""),tabActive:g("color:",s.primary,";&::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;background-color:",s.primary,";}",""),body:{name:"1po9b7e",styles:"padding:24px;min-height:200px"},dropzone:g("border:2px dashed ",s.border,";border-radius:8px;padding:40px 24px;text-align:center;cursor:pointer;transition:all 0.15s;&:hover{border-color:",s.primary,";background-color:",s.primaryLight,";}",""),dropzoneActive:g("border-color:",s.primary,";background-color:",s.primaryLight,";",""),dropzoneIcon:g("width:48px;height:48px;margin:0 auto 16px;color:",s.textMuted,";",""),dropzoneText:g("font-size:",q.base,";color:",s.text,";margin:0 0 4px;",""),dropzoneHint:g("font-size:",q.sm,";color:",s.textSecondary,";margin:0;",""),textarea:g("width:100%;min-height:150px;padding:12px;font-size:",q.sm,";font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace;border:1px solid ",s.border,";border-radius:8px;resize:vertical;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),textareaLabel:g("font-size:",q.sm,";color:",s.textSecondary,";margin:0 0 8px;",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:g("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),fileInput:{name:"eivff4",styles:"display:none"},selectedFiles:g("margin-top:16px;padding:12px;background-color:",s.background,";border-radius:6px;font-size:",q.sm,";color:",s.text,";","")};function S1({currentPath:i,onClose:c,onUploadComplete:f,streamingOperation:d,setShowProgress:h,setProgressTitle:p,setProgressState:v}){const[D,w]=x.useState("upload"),[b,L]=x.useState([]),[M,E]=x.useState(""),[Y,B]=x.useState(!1),[k,Q]=x.useState(!1),[j,ee]=x.useState(!1),te=x.useRef(null),ce=x.useCallback(H=>{H&&L(Array.from(H))},[]),V=x.useCallback(H=>{H.preventDefault(),B(!1),ce(H.dataTransfer.files)},[ce]),P=x.useRef(!1),I=x.useCallback(async()=>{if(b.length!==0){if(h&&p&&v){c(),P.current=!1,p("Uploading Files"),h(!0),v({current:0,total:b.length,percent:0,status:"processing",message:"Uploading..."});let H=0;const G=[];for(let oe=0;oe<b.length;oe++){if(P.current){v(le=>({...le,status:"stopped",message:`Stopped. Uploaded ${H} file${H!==1?"s":""}.`})),f();return}const fe=b[oe],de=new FormData;de.append("file",fe),de.append("path",i);try{(await fetch("/api/studio/upload",{method:"POST",body:de})).ok?H++:G.push(fe.name)}catch{G.push(fe.name)}v({current:oe+1,total:b.length,percent:Math.round((oe+1)/b.length*100),status:"processing",currentFile:fe.name})}v({current:b.length,total:b.length,percent:100,status:"complete",message:`Uploaded ${H} file${H!==1?"s":""}.${G.length>0?` ${G.length} failed.`:""}`}),f();return}Q(!0);try{for(const H of b){const G=new FormData;G.append("file",H),G.append("path",i),await fetch("/api/studio/upload",{method:"POST",body:G})}f(),c()}catch(H){console.error("Upload failed:",H)}finally{Q(!1)}}},[b,i,f,c,h,p,v]),ae=x.useCallback(async()=>{const H=M.split(`
56
+ `).map(G=>G.trim()).filter(G=>G.length>0);if(H.length!==0){if(d){c(),await d.execute({endpoint:"/api/studio/import",body:{urls:H},title:"Importing URLs",onComplete:()=>{f()}});return}ee(!0);try{const oe=(await fetch("/api/studio/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({urls:H})})).body?.getReader();if(!oe)throw new Error("No reader");const fe=new TextDecoder;for(;;){const{done:de,value:le}=await oe.read();if(de)break;const T=fe.decode(le).split(`
57
+
58
+ `).filter($=>$.startsWith("data: "));for(const $ of T)JSON.parse($.replace("data: ","")).type==="complete"&&(f(),c())}}catch(G){console.error("Import failed:",G)}finally{ee(!1)}}},[M,f,c,d]);return r("div",{css:At.overlay,onClick:c,children:y("div",{css:At.modal,onClick:H=>H.stopPropagation(),children:[y("div",{css:At.header,children:[r("h3",{css:At.title,children:"Add New"}),y("div",{css:At.tabs,children:[r("button",{css:[At.tab,D==="upload"&&At.tabActive,"",""],onClick:()=>w("upload"),children:"Upload Files"}),r("button",{css:[At.tab,D==="import"&&At.tabActive,"",""],onClick:()=>w("import"),children:"Import URLs"})]})]}),r("div",{css:At.body,children:D==="upload"?y(Pe,{children:[y("div",{css:[At.dropzone,Y&&At.dropzoneActive,"",""],onClick:()=>te.current?.click(),onDragOver:H=>{H.preventDefault(),B(!0)},onDragLeave:()=>B(!1),onDrop:V,children:[r("svg",{css:At.dropzoneIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),r("p",{css:At.dropzoneText,children:"Drop files here or click to browse"}),r("p",{css:At.dropzoneHint,children:"Supports all file types"})]}),r("input",{ref:te,type:"file",multiple:!0,css:At.fileInput,onChange:H=>ce(H.target.files)}),b.length>0&&y("div",{css:At.selectedFiles,children:[b.length," file",b.length!==1?"s":""," selected"]})]}):y(Pe,{children:[r("p",{css:At.textareaLabel,children:"Paste image URLs (one per line)"}),r("textarea",{css:At.textarea,value:M,onChange:H=>E(H.target.value),placeholder:`https://cdn.example.com/photos/image1.jpg
59
+ https://cdn.example.com/photos/image2.jpg`})]})}),y("div",{css:At.footer,children:[r("button",{css:[At.btn,At.btnCancel,"",""],onClick:c,children:"Cancel"}),D==="upload"?r("button",{css:[At.btn,At.btnConfirm,"",""],onClick:I,disabled:b.length===0||k,children:k?"Uploading...":"Upload"}):r("button",{css:[At.btn,At.btnConfirm,"",""],onClick:ae,disabled:!M.trim()||j,children:j?"Importing...":"Import"})]})]})})}const C1="36px",qe={btn:g("height:",C1,";padding:0 12px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),icon:g("width:16px;height:16px;color:",s.textSecondary,";",""),overlay:{name:"1cy1r91",styles:"position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;align-items:flex-start;justify-content:center;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);overflow-y:auto;scroll-behavior:smooth;padding:48px 24px"},panel:g(Ra," position:relative;background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);width:100%;max-width:512px;padding:24px;margin:auto 0;",""),header:{name:"1o4fids",styles:"display:flex;align-items:center;justify-content:space-between;margin-bottom:24px"},title:g("font-size:",q.xl,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),closeBtn:g("padding:6px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),sections:{name:"klisov",styles:"display:flex;flex-direction:column;gap:24px"},sectionTitle:g("font-size:",q.base,";font-weight:600;color:",s.text,";margin:0 0 12px 0;",""),description:g("font-size:",q.sm,";color:",s.textSecondary,";margin:0 0 12px 0;",""),codeWrapper:{name:"bjn8wh",styles:"position:relative"},code:g("background-color:",s.background,";border-radius:8px;padding:12px;padding-right:40px;font-family:'SF Mono',Monaco,Consolas,monospace;font-size:",q.xs,";color:",s.textSecondary,";border:1px solid ",s.border,";overflow-x:auto;white-space:nowrap;",""),copyBtn:g("position:absolute;top:8px;right:8px;padding:4px;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),tooltip:{name:"6eskey",styles:"position:absolute;bottom:100%;left:50%;transform:translateX(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-bottom:6px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:4px solid transparent;border-top-color:#1a1f36;}"},copyIcon:g("width:14px;height:14px;color:",s.textSecondary,";",""),codeLine:{name:"1bbvuqp",styles:"margin:0 0 4px 0;&:last-child{margin:0;}"},input:g("width:100%;padding:10px 14px;border:1px solid ",s.border,";border-radius:6px;font-size:",q.base,";color:",s.text,";background:",s.surface,";transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),grid:{name:"xtlr5l",styles:"display:grid;grid-template-columns:repeat(3, 1fr);gap:12px"},label:g("font-size:",q.xs,";font-weight:500;color:",s.textSecondary,";display:block;margin-bottom:6px;",""),footer:g("margin-top:24px;padding-top:20px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;gap:12px;",""),cancelBtn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;color:",s.text,";background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),saveBtn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;color:white;background-color:",s.primary,";border:1px solid ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),cdnList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},cdnRow:{name:"197tvr9",styles:"display:flex;gap:8px;align-items:center"},cdnInput:g("flex:1;padding:8px 12px;border:1px solid ",s.border,";border-radius:6px;font-size:",q.sm,";color:",s.text,";background:",s.surface,";transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 3px ",s.primaryLight,";}",""),cdnIndex:g("font-size:",q.xs,";color:",s.textMuted,";width:24px;text-align:center;flex-shrink:0;",""),cdnDeleteBtn:g("padding:6px;background:none;border:none;cursor:pointer;color:",s.textMuted,";transition:color 0.15s;flex-shrink:0;&:hover{color:",s.danger,";}",""),cdnAddBtn:g("padding:8px 12px;font-size:",q.sm,";font-weight:500;color:",s.primary,";background:",s.primaryLight,";border:1px dashed ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;gap:6px;margin-top:8px;&:hover{background:",s.surface,";}",""),warning:g("font-size:",q.xs,";color:",s.danger,";margin-top:8px;padding:8px 12px;background:",s.dangerLight,";border-radius:6px;","")};function k1(){const[i,c]=x.useState(!1);return y(Pe,{children:[r("button",{css:qe.btn,onClick:()=>c(!0),"aria-label":"Settings",children:y("svg",{css:qe.icon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"3"}),r("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"})]})}),i&&r(M1,{onClose:()=>c(!1)})]})}const z1=`# Dev site link (opens from Studio header)
60
+ STUDIO_DEV_SITE_URL=http://localhost:3000
61
+
62
+ # Cloudflare R2 Storage
63
+ CLOUDFLARE_R2_ACCOUNT_ID=your_account_id
64
+ CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key_id
65
+ CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key
66
+ CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name
67
+ CLOUDFLARE_R2_PUBLIC_URL=https://your-cdn.example.com`;function M1({onClose:i}){const{triggerRefresh:c}=So(),[f,d]=x.useState(!1),[h,p]=x.useState([]),[v,D]=x.useState(!0),[w,b]=x.useState(!1),[L,M]=x.useState(!1);x.useEffect(()=>{async function j(){try{const te=await(await fetch("/api/studio/cdns")).json();p(te.cdns||[])}catch(ee){console.error("Failed to load CDN URLs:",ee)}finally{D(!1)}}j()},[]);const E=()=>{navigator.clipboard.writeText(z1),d(!0),setTimeout(()=>d(!1),2e3)},Y=x.useCallback((j,ee)=>{p(te=>{const ce=[...te];return ce[j]=ee,ce}),M(!0)},[]),B=x.useCallback(()=>{p(j=>[...j,""]),M(!0)},[]),k=x.useCallback(j=>{p(ee=>ee.filter((te,ce)=>ce!==j)),M(!0)},[]),Q=x.useCallback(async()=>{b(!0);try{(await fetch("/api/studio/cdns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cdns:h})})).ok&&(M(!1),c(),i())}catch(j){console.error("Failed to save CDN URLs:",j)}finally{b(!1)}},[h,c,i]);return r("div",{css:qe.overlay,onClick:i,children:y("div",{css:qe.panel,onClick:j=>j.stopPropagation(),children:[y("div",{css:qe.header,children:[r("h2",{css:qe.title,children:"Settings"}),r("button",{css:qe.closeBtn,onClick:i,children:r("svg",{css:qe.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),y("div",{css:qe.sections,children:[y("section",{children:[r("h3",{css:qe.sectionTitle,children:"CDN URLs"}),r("p",{css:qe.description,children:"Manage CDN base URLs used by your images:"}),v?r("p",{css:qe.description,children:"Loading..."}):y(Pe,{children:[r("div",{css:qe.cdnList,children:h.map((j,ee)=>y("div",{css:qe.cdnRow,children:[r("span",{css:qe.cdnIndex,children:ee}),r("input",{css:qe.cdnInput,type:"text",value:j,onChange:te=>Y(ee,te.target.value),placeholder:"https://cdn.example.com"}),r("button",{css:qe.cdnDeleteBtn,onClick:()=>k(ee),title:"Delete CDN URL",children:r("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},ee))}),y("button",{css:qe.cdnAddBtn,onClick:B,children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add CDN URL"]}),h.length>0&&r("p",{css:qe.warning,children:"Warning: Changing CDN URLs may break image references. The index numbers correspond to image `c` values."})]})]}),y("section",{children:[r("h3",{css:qe.sectionTitle,children:"Environment Variables"}),y("p",{css:qe.description,children:["Configure in ",r("code",{children:".env.local"})," file (local development only, not needed in production):"]}),y("div",{css:qe.codeWrapper,children:[y("button",{css:qe.copyBtn,onClick:E,title:"Copy to clipboard",children:[f&&r("span",{css:qe.tooltip,children:"Copied!"}),r("svg",{css:qe.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),y("div",{css:qe.code,children:[r("p",{css:qe.codeLine,children:"NEXT_PUBLIC_PRODUCTION_URL=http://localhost:3000"}),r("p",{css:qe.codeLine,children:" "}),r("p",{css:qe.codeLine,children:"# Cloudflare R2 Storage"}),r("p",{css:qe.codeLine,children:"CLOUDFLARE_R2_ACCOUNT_ID=your_account_id"}),r("p",{css:qe.codeLine,children:"CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key_id"}),r("p",{css:qe.codeLine,children:"CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key"}),r("p",{css:qe.codeLine,children:"CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name"}),r("p",{css:qe.codeLine,children:"CLOUDFLARE_R2_PUBLIC_URL=https://your-cdn.example.com"})]})]})]}),y("section",{children:[r("h3",{css:qe.sectionTitle,children:"Thumbnail Sizes"}),y("div",{css:qe.grid,children:[y("div",{children:[r("label",{css:qe.label,children:"Small"}),r("input",{css:qe.input,type:"number",defaultValue:300})]}),y("div",{children:[r("label",{css:qe.label,children:"Medium"}),r("input",{css:qe.input,type:"number",defaultValue:700})]}),y("div",{children:[r("label",{css:qe.label,children:"Large"}),r("input",{css:qe.input,type:"number",defaultValue:1400})]})]})]})]}),y("div",{css:qe.footer,children:[r("button",{css:qe.cancelBtn,onClick:i,children:"Cancel"}),r("button",{css:qe.saveBtn,onClick:Q,disabled:w||!L,children:w?"Saving...":"Save Changes"})]})]})})}const uu="36px",D1=Ut`
68
+ to { transform: rotate(360deg); }
69
+ `,ze={toolbar:g("display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background-color:",s.surface,";border-bottom:1px solid ",s.border,";overflow:visible;min-width:0;@media (min-width: 768px){padding:12px 24px;}",""),left:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},right:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},btn:g("display:inline-flex;align-items:center;justify-content:center;gap:6px;height:",uu,";padding:0 14px;border-radius:6px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";cursor:pointer;transition:all 0.15s ease;color:",s.text,";letter-spacing:-0.01em;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{cursor:not-allowed;opacity:0.5;}",""),btnPrimary:g("background:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:g("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),btnCloud:{name:"1lzbs29",styles:"color:#f59e0b;&:hover:not(:disabled){background-color:rgba(245, 158, 11, 0.1);border-color:#f59e0b;}"},cloudDropdownWrapper:{name:"bjn8wh",styles:"position:relative"},dropdownArrow:{name:"1j1hlpy",styles:"width:12px;height:12px;margin-left:4px"},cloudDropdown:g("position:absolute;top:100%;left:0;z-index:1000;min-width:160px;margin-top:4px;background:white;border:1px solid ",s.border,";border-radius:6px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);overflow:hidden;",""),cloudDropdownItem:g("display:flex;align-items:center;gap:8px;width:100%;padding:10px 14px;border:none;background:none;font-size:",q.sm,";color:",s.text,";cursor:pointer;text-align:left;white-space:nowrap;&:hover{background-color:",s.hover,";}svg{width:16px;height:16px;flex-shrink:0;color:#f59e0b;}",""),cloudDropdownItemDefault:g("svg{color:",s.text,";}",""),cloudDropdownItemDanger:g("color:",s.danger,";svg{color:",s.danger,";}",""),cloudDropdownDivider:g("height:1px;background-color:",s.border,";margin:4px 0;",""),icon:{name:"157xhr7",styles:"width:16px;height:16px"},iconSpin:g("animation:",D1," 1s linear infinite;",""),selectionCount:g("font-size:",q.base,";color:",s.textSecondary,";display:flex;align-items:center;gap:8px;margin-right:8px;",""),clearBtn:g("color:",s.primary,";background:none;border:none;cursor:pointer;font-size:",q.base,";font-weight:500;padding:0;&:hover{text-decoration:underline;}",""),divider:g("width:1px;height:24px;background:",s.border,";margin:0 4px;",""),viewToggle:g("display:flex;align-items:center;height:",uu,";background-color:",s.surface,";border:1px solid ",s.border,";border-radius:6px;overflow:hidden;",""),searchWrapper:{name:"9iujih",styles:"position:relative;display:flex;align-items:center"},searchInput:g("height:",uu,";padding:0 32px 0 12px;border:1px solid ",s.border,";border-radius:6px;font-size:",q.base,";background:",s.surface,";color:",s.text,";width:180px;transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),searchClearBtn:g("position:absolute;right:5px;top:5px;bottom:5px;background:",s.primary,";border:none;padding:0 6px;cursor:pointer;color:white;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.15s ease;&:hover{background:",s.primaryHover,";}",""),viewBtn:g("height:100%;padding:0 10px;background:transparent;border:none;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";background-color:",s.surfaceHover,";}",""),viewBtnActive:g("background-color:",s.primaryLight,";color:",s.primary,";&:hover{background-color:",s.primaryLight,";color:",s.primary,";}","")};function A1(){const{selectedItems:i,viewMode:c,setViewMode:f,clearSelection:d,currentPath:h,triggerRefresh:p,focusedItem:v,scanRequested:D,clearScanRequest:w,fileItems:b,requestProcess:L,setProcessMode:M,actionState:E,cancelAction:Y}=So(),B=x.useRef(null),k=x.useRef(null),[Q,j]=x.useState(!1),[ee,te]=x.useState(!1),[ce,V]=x.useState(!1),[P,I]=x.useState(!1),[ae,H]=x.useState(!1),[G,oe]=x.useState(0),[fe,de]=x.useState(!1),[le,Me]=x.useState(0),[T,$]=x.useState(!1),[J,De]=x.useState(!1),[Xe,S]=x.useState(!1),[U,ne]=x.useState(0),[re,ke]=x.useState(!1),[Te,Ye]=x.useState("Processing Images"),[gt,Be]=x.useState({current:0,total:0,percent:0,status:"processing"}),[nn,Ze]=x.useState(null),[et,xt]=x.useState(!1),[_t,jt]=x.useState(!1),[Ft,Pt]=x.useState(!1),[fn,en]=x.useState(!1),[rt,Nt]=x.useState(!1),[pe,Wn]=x.useState(!1),[Ot,mn]=x.useState(!1),[Tn,xn]=x.useState(!1),vn=x.useRef(null),Z=x.useRef(null),ie=wu({setShowProgress:ke,setProgressTitle:Ye,setProgressState:Be,triggerRefresh:p}),Re=h==="public/images"||h.startsWith("public/images/");x.useCallback(()=>{B.current?.click()},[]);const ut=x.useCallback(()=>{I(!0),p(),setTimeout(()=>I(!1),600)},[p]),Ne=x.useCallback(async()=>{V(!0),Ye("Scanning Files"),ke(!0),Be({current:0,total:0,percent:0,status:"processing",message:"Scanning for files..."});try{const se=(await fetch("/api/studio/scan",{method:"POST"})).body?.getReader();if(!se)throw new Error("No reader");const ye=new TextDecoder;let xe="";for(;;){const{done:_e,value:He}=await se.read();if(_e)break;xe+=ye.decode(He,{stream:!0});const ot=xe.split(`
70
+
71
+ `);xe=ot.pop()||"";for(const it of ot){if(!it.startsWith("data: "))continue;const Ue=JSON.parse(it.slice(6));if(Ue.type==="start")Be({current:0,total:Ue.total,percent:0,status:"processing",message:`Scanning ${Ue.total} files...`});else if(Ue.type==="progress")Be({current:Ue.current,total:Ue.total,percent:Ue.percent,status:"processing",currentFile:Ue.currentFile});else if(Ue.type==="cleanup")Be(bn=>({...bn,message:Ue.message}));else if(Ue.type==="complete"){let bn=Ue.renamed>0?`${Ue.renamed} file(s) renamed due to conflicts. `:"";Ue.orphanedFiles&&Ue.orphanedFiles.length>0&&(bn+=`Found ${Ue.orphanedFiles.length} orphaned thumbnail(s) in images folder.`),Be({current:Ue.total||0,total:Ue.total||0,percent:100,status:"complete",processed:Ue.added,alreadyProcessed:Ue.existingCount,errors:Ue.errors,orphanedFiles:Ue.orphanedFiles,pendingUpdates:Ue.pendingUpdates,orphanedEntries:Ue.orphanedEntries,message:bn||void 0,isScan:!0}),p()}else Ue.type==="error"&&Be({current:0,total:0,percent:0,status:"error",message:Ue.message||"Scan failed"})}}}catch(ge){console.error("Scan error:",ge),Be({current:0,total:0,percent:0,status:"error",message:"Scan failed"})}finally{V(!1)}},[p]);x.useEffect(()=>{const ge=se=>{vn.current&&!vn.current.contains(se.target)&&mn(!1),Z.current&&!Z.current.contains(se.target)&&xn(!1)};return document.addEventListener("mousedown",ge),()=>document.removeEventListener("mousedown",ge)},[]),x.useEffect(()=>{D&&!ce&&(w(),Ne())},[D,ce,w,Ne]);const Ce=x.useCallback(async ge=>{const se=ge.target.files;if(!se||se.length===0)return;const ye=Array.from(se);ye.length>1?(Be({current:0,total:ye.length,percent:0,status:"processing",message:"Uploading files..."}),ke(!0)):te(!0);let xe=0,_e=0;try{for(let He=0;He<ye.length;He++){const ot=ye[He],it=new FormData;it.append("file",ot),it.append("path",h);try{const Ue=await fetch("/api/studio/upload",{method:"POST",body:it});if(Ue.ok)xe++;else{const bn=await Ue.json();_e++,ye.length===1&&(Ue.status>=500?(console.error("Upload error:",bn),Ze({title:"Upload Failed",message:`Failed to upload ${ot.name}: ${bn.error||"Unknown error"}`})):Ze({title:"Cannot Upload Here",message:bn.error||"Upload not allowed in this location."}))}}catch{_e++}ye.length>1&&Be({current:He+1,total:ye.length,percent:Math.round((He+1)/ye.length*100),status:"processing",currentFile:ot.name})}ye.length>1&&Be({current:ye.length,total:ye.length,percent:100,status:"complete",processed:xe,errors:_e}),p()}catch(He){console.error("Upload error:",He),ye.length>1?Be({current:0,total:0,percent:0,status:"error",message:"Upload failed."}):Ze({title:"Upload Failed",message:"Upload failed. Check console for details."})}finally{te(!1),B.current&&(B.current.value="")}},[h,p]),Ct=x.useCallback(async ge=>{if(i.size>0){const ye=Array.from(i),xe=ye.filter(He=>(He.split("/").pop()||"").includes(".")&&!He.endsWith("/")),_e=ye.filter(He=>!(He.split("/").pop()||"").includes(".")||He.endsWith("/"));if(_e.length>0)try{const ot=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(_e.join(","))}`)).json();if(ot.images)for(const it of ot.images){const Ue=`public/${it}`;xe.includes(Ue)||xe.push(Ue)}}catch(He){console.error("Failed to get folder files:",He)}if(xe.length===0){Ze({title:"No Files Found",message:"No files found in the selected items."});return}M(ge),L(xe)}else try{const xe=await(await fetch("/api/studio/count-images")).json();if(!xe.images||xe.images.length===0){Ze({title:"No Images Found",message:"No images found in the public folder to process."});return}const _e=xe.images.map(He=>`public/${He}`);M(ge),L(_e)}catch(ye){console.error("Failed to get images:",ye),Ze({title:"Error",message:"Failed to get images."})}},[i,L,M]),lt=x.useCallback(()=>{ie.stop(),k.current&&(Be(ge=>({...ge,status:"stopping"})),k.current.abort())},[ie]),na=x.useCallback(async()=>{const ge=gt.orphanedFiles;if(!(!ge||ge.length===0))try{const se=await fetch("/api/studio/delete-orphans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:ge})}),ye=await se.json();se.ok?(Be(xe=>({...xe,orphanedFiles:void 0,orphansRemoved:ye.deleted,message:`Deleted ${ye.deleted} orphaned thumbnail${ye.deleted!==1?"s":""}.`})),p()):Ze({title:"Delete Failed",message:ye.error||"Failed to delete orphaned files."})}catch(se){console.error("Delete orphans error:",se),Ze({title:"Delete Failed",message:"Failed to delete orphaned files. Check console for details."})}},[gt.orphanedFiles,p]),Nn=x.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),se=ge.filter(_e=>(_e.split("/").pop()||"").includes(".")&&!_e.endsWith("/")),ye=ge.filter(_e=>!(_e.split("/").pop()||"").includes(".")||_e.endsWith("/"));let xe=se.length;if(ye.length>0)try{const He=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(ye.join(","))}`)).json();He.images&&(xe+=He.images.length)}catch(_e){console.error("Failed to get folder files:",_e)}oe(xe),H(!0)},[i]),ko=x.useCallback(async()=>{H(!1);const ge=Array.from(i);ge.length!==0&&await ie.execute({endpoint:"/api/studio/delete-stream",body:{paths:ge},title:"Deleting Files",operationType:"delete",onComplete:()=>{d()}})},[i,d,ie]),_a=x.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),se=ge.filter(it=>(it.split("/").pop()||"").includes(".")&&!it.endsWith("/")),ye=ge.filter(it=>!(it.split("/").pop()||"").includes(".")||it.endsWith("/")),xe=ye.length>0;if(xe)try{const Ue=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(ye.join(","))}`)).json();if(Ue.images)for(const bn of Ue.images){const Ao=`public/${bn}`;se.includes(Ao)||se.push(Ao)}}catch(it){console.error("Failed to get folder files:",it)}if(se.length===0){Ze({title:"No Files Found",message:"No files found in the selected items."});return}let _e=!1,He=!1,ot=0;for(const it of se){const Ue=b.find(bn=>bn.path===it);Ue?Ue.isRemote?_e=!0:Ue.cdnPushed?ot++:He=!0:xe&&(He=!0)}if(!xe&&ot===se.length){Ze({title:"Already Pushed",message:`All ${se.length} file${se.length!==1?"s are":" is"} already on the CDN.`});return}Me(se.length),$(_e),De(He),de(!0)},[i,b]),Oa=x.useCallback(async()=>{de(!1);const ge=Array.from(i),se=ge.filter(_e=>(_e.split("/").pop()||"").includes(".")&&!_e.endsWith("/")),ye=ge.filter(_e=>!(_e.split("/").pop()||"").includes(".")||_e.endsWith("/"));if(ye.length>0)try{const He=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(ye.join(","))}`)).json();if(He.images)for(const ot of He.images){const it=`public/${ot}`;se.includes(it)||se.push(it)}}catch(_e){console.error("Failed to get folder files:",_e)}const xe=se.map(_e=>"/"+_e.replace(/^public\//,""));xe.length!==0&&await ie.execute({endpoint:"/api/studio/sync-stream",body:{imageKeys:xe},title:"Pushing to CDN",onComplete:()=>{d()},onError:_e=>{(_e.includes("R2 not configured")||_e.includes("CLOUDFLARE_R2"))&&(ke(!1),Nt(!0))}})},[i,d,ie]),[ua,Jn]=x.useState([]),[Ba,da]=x.useState(0),Rl=x.useCallback(async()=>{if(i.size===0)return;const ge=Array.from(i),se=ge.filter(He=>(He.split("/").pop()||"").includes(".")&&!He.endsWith("/")),ye=ge.filter(He=>!(He.split("/").pop()||"").includes(".")||He.endsWith("/")),xe=ye.length>0;if(xe)try{const ot=await(await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(ye.join(","))}`)).json();if(ot.images)for(const it of ot.images){const Ue=`public/${it}`;se.includes(Ue)||se.push(Ue)}}catch(He){console.error("Failed to get folder files:",He)}if(se.length===0){Ze({title:"No Files Found",message:"No files found in the selected items."});return}let _e;if(xe)_e=se;else if(_e=se.filter(He=>{const ot=b.find(it=>it.path===He);return ot&&ot.cdnPushed&&!ot.isRemote}),_e.length===0){Ze({title:"No CDN Files",message:`None of the ${se.length} selected file${se.length!==1?"s are":" is"} on the CDN.`});return}Jn(_e),da(se.length),ne(_e.length),S(!0)},[i,b]),_l=x.useCallback(async()=>{S(!1),E.showDownloadConfirm&&Y();const se=(E.showDownloadConfirm?E.actionPaths:ua).map(ye=>"/"+ye.replace(/^public\//,""));await ie.execute({endpoint:"/api/studio/download-stream",body:{imageKeys:se},title:"Downloading from CDN",onComplete:()=>d()})},[ua,d,E.showDownloadConfirm,E.actionPaths,Y,ie]),fl=x.useCallback(async()=>{if(i.size===0)return;const se=Array.from(i).filter(ye=>{const xe=b.find(_e=>_e.path===ye);return xe&&(xe.hasUpdate||xe.type==="folder"&&xe.updateCount&&xe.updateCount>0)});if(se.length===0){Ze({title:"No Updates",message:"No files with pending updates in selection."});return}await ie.execute({endpoint:"/api/studio/push-updates-stream",body:{paths:se},title:"Pushing Updates",onComplete:()=>d()})},[i,b,d,ie]),fa=x.useCallback(async()=>{if(i.size===0)return;const se=Array.from(i).filter(ye=>{const xe=b.find(_e=>_e.path===ye);return xe&&(xe.hasUpdate||xe.type==="folder"&&xe.updateCount&&xe.updateCount>0)});if(se.length!==0)try{const ye=await fetch("/api/studio/cancel-updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:se})});if(ye.ok)d(),p();else{const xe=await ye.json();Ze({title:"Cancel Failed",message:xe.error||"Unknown error"})}}catch(ye){console.error("Cancel updates error:",ye),Ze({title:"Cancel Failed",message:"Failed to cancel updates. Check console for details."})}},[i,b,d,p]),zo=x.useCallback(async ge=>{xt(!1);try{const se=await fetch("/api/studio/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:h,name:ge})});if(se.ok)p();else{const ye=await se.json();Ze({title:"Create Folder Failed",message:ye.error||"Unknown error"})}}catch(se){console.error("Create folder error:",se),Ze({title:"Create Folder Failed",message:"Failed to create folder. Check console for details."})}},[h,p]),Ol=x.useCallback(()=>{i.size!==0&&en(!0)},[i]),me=x.useCallback(async ge=>{const se=Array.from(i);await ie.execute({endpoint:"/api/studio/move",body:{paths:se,destination:ge},title:"Moving Files",onComplete:()=>d()})},[i,d,ie]),{searchQuery:Ve,setSearchQuery:Fe}=So(),tt=x.useCallback(ge=>{Fe(ge.target.value)},[Fe]),dt=x.useCallback(ge=>{ge.key==="Escape"&&(ge.stopPropagation(),Fe(""),ge.target.blur())},[Fe]),an=i.size>0;an&&Array.from(i).some(ge=>{const se=b.find(ye=>ye.path===ge);return se&&se.cdnPushed&&!se.isRemote}),an&&Array.from(i).every(ge=>{const se=b.find(ye=>ye.path===ge);return se&&se.type==="file"&&se.cdnPushed&&!se.isRemote});const hn=an&&Array.from(i).some(ge=>{const se=b.find(ye=>ye.path===ge);return se&&(se.hasUpdate||se.type==="folder"&&se.updateCount&&se.updateCount>0)}),mt=Array.from(i),Lt=mt.length===1&&!mt[0].includes("."),Ln=Lt?mt[0]:null,Bl=Ln&&Ln.split("/").pop()||"",Ha=mt.length===1&&mt[0].includes("."),Ua=Ha?mt[0]:null,Mo=Ua&&Ua.split("/").pop()||"",hl=x.useCallback(async ge=>{Ln&&(jt(!1),await ie.execute({endpoint:"/api/studio/rename-stream",body:{oldPath:Ln,newName:ge},title:"Renaming Folder",onComplete:()=>d()}))},[Ln,d,ie]),Do=x.useCallback(async ge=>{Ua&&(Pt(!1),await ie.execute({endpoint:"/api/studio/rename-stream",body:{oldPath:Ua,newName:ge},title:"Renaming File",onComplete:()=>d()}))},[Ua,d,ie]),ha=y(Pe,{children:[(Xe||E.showDownloadConfirm)&&r(vo,{title:"Download from CDN",message:(()=>{const ge=E.showDownloadConfirm?E.downloadImageCount:U,se=E.showDownloadConfirm?E.downloadTotalSelected:Ba;return se>ge?`Download ${ge} of ${se} selected file${se!==1?"s":""} from Cloudflare R2? (${se-ge} not on CDN)`:`Download ${ge} image${ge!==1?"s":""} from Cloudflare R2 to local storage? Images will be removed from the CDN.`})(),confirmLabel:"Download",onConfirm:_l,onCancel:()=>{S(!1),E.showDownloadConfirm&&Y()}}),re&&r(ul,{title:Te,progress:gt,onStop:lt,onDeleteOrphans:na,onClose:()=>{ke(!1),Be({current:0,total:0,percent:0,status:"processing"}),p()}})]});return v?ha:y(Pe,{children:[ha,ae&&r(vo,{title:"Delete Items",message:`Are you sure you want to delete ${G} file${G!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:ko,onCancel:()=>H(!1)}),fe&&r(vo,{title:"Push to CDN",message:`Push ${le} image${le!==1?"s":""} to Cloudflare R2?${T?" Remote images will be downloaded first.":""}${J?" After pushing, local files will be deleted.":""}`,confirmLabel:"Push",onConfirm:Oa,onCancel:()=>de(!1)}),et&&r(El,{title:"New Folder",message:"Enter a name for the new folder:",placeholder:"Folder name",confirmLabel:"Create",onConfirm:zo,onCancel:()=>xt(!1)}),fn&&r(Qp,{selectedItems:i,currentPath:h,onMove:ge=>{en(!1),me(ge)},onCancel:()=>en(!1)}),_t&&Ln&&r(El,{title:"Rename Folder",message:"Enter a new name for the folder:",placeholder:Bl,defaultValue:Bl,confirmLabel:"Rename",onConfirm:hl,onCancel:()=>jt(!1)}),Ft&&Ua&&r(El,{title:"Rename File",message:"Enter a new name for the file:",placeholder:Mo,defaultValue:Mo,confirmLabel:"Rename",onConfirm:Do,onCancel:()=>Pt(!1)}),nn&&r(Kr,{title:nn.title,message:nn.message,onClose:()=>{Ze(null),p()}}),r(Kp,{isOpen:rt,onClose:()=>Nt(!1)}),Q&&r(S1,{currentPath:h,onClose:()=>j(!1),onUploadComplete:()=>{j(!1),p()},streamingOperation:ie,setShowProgress:ke,setProgressTitle:Ye,setProgressState:Be}),y("div",{css:ze.toolbar,children:[r("input",{ref:B,type:"file",multiple:!0,accept:"*/*",onChange:Ce,style:{display:"none"}}),y("div",{css:ze.left,children:[y("button",{css:[ze.btn,ze.btnPrimary,"",""],onClick:()=>j(!0),disabled:ee||Re,children:[r(T1,{}),"Add New"]}),y("button",{css:ze.btn,onClick:()=>{Ha?Pt(!0):Lt?jt(!0):xt(!0)},disabled:Re&&!Lt&&!Ha,title:Re&&!Lt&&!Ha?"Cannot create folders in protected images folder":void 0,children:[Ha||Lt?r(O1,{}):r(_1,{}),Ha?"Rename File":Lt?"Rename Folder":"New Folder"]}),r("div",{css:ze.divider}),y("div",{css:ze.cloudDropdownWrapper,ref:Z,children:[y("button",{css:ze.btn,onClick:()=>xn(!Tn),disabled:E.showProgress||Re,title:Re?"Cannot process images folder":void 0,children:[r(Y1,{}),"Thumbnails",r("svg",{css:ze.dropdownArrow,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Tn&&y("div",{css:ze.cloudDropdown,children:[y("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDefault,"",""],onClick:()=>{xn(!1),Ct("generate")},children:[r(G1,{}),"Generate Thumbnails"]}),y("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDanger,"",""],onClick:()=>{xn(!1),Ct("remove")},children:[r(X1,{}),"Remove Thumbnails"]})]})]}),y("button",{css:[ze.btn,ze.btnDanger,"",""],onClick:Nn,disabled:!an,children:[r(R1,{}),"Delete"]}),y("button",{css:ze.btn,onClick:Ol,disabled:!an,children:[r(B1,{}),"Move"]}),y("div",{css:ze.cloudDropdownWrapper,ref:vn,children:[y("button",{css:[ze.btn,ze.btnCloud,"",""],onClick:()=>mn(!Ot),disabled:!an,children:[r(Tp,{}),"Cloud",r("svg",{css:ze.dropdownArrow,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Ot&&an&&y("div",{css:ze.cloudDropdown,children:[hn&&y(Pe,{children:[y("button",{css:ze.cloudDropdownItem,onClick:()=>{mn(!1),fl()},children:[r(H1,{}),"Push Update"]}),y("button",{css:[ze.cloudDropdownItem,ze.cloudDropdownItemDanger,"",""],onClick:()=>{mn(!1),fa()},children:[r(U1,{}),"Cancel Update"]}),r("div",{css:ze.cloudDropdownDivider})]}),y("button",{css:ze.cloudDropdownItem,onClick:()=>{mn(!1),_a()},children:[r(Tp,{}),"Push CDN"]}),y("button",{css:ze.cloudDropdownItem,onClick:()=>{mn(!1),Rl()},children:[r(j1,{}),"Download"]})]})]}),y("div",{css:ze.searchWrapper,children:[r("input",{css:ze.searchInput,type:"text",placeholder:"Search images...",value:Ve,onChange:tt,onKeyDown:dt}),Ve&&r("button",{css:ze.searchClearBtn,onClick:()=>Fe(""),title:"Clear search",children:r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),y("div",{css:ze.right,children:[an&&y("span",{css:ze.selectionCount,children:[i.size," selected",r("button",{css:ze.clearBtn,onClick:d,children:"Clear"})]}),y("button",{css:ze.btn,onClick:Ne,disabled:ce,children:[r(L1,{spinning:ce}),"Scan"]}),r("button",{css:ze.btn,onClick:ut,title:"Refresh view",disabled:P,children:r(E1,{spinning:P})}),y("div",{css:ze.viewToggle,children:[r("button",{css:[ze.viewBtn,c==="grid"&&ze.viewBtnActive,"",""],onClick:()=>f("grid"),"aria-label":"Grid view",children:r(N1,{})}),r("button",{css:[ze.viewBtn,c==="list"&&ze.viewBtnActive,"",""],onClick:()=>f("list"),"aria-label":"List view",children:r(q1,{})})]}),r(k1,{})]})]})]})}function T1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}function L1({spinning:i}){return r("svg",{css:[ze.icon,i&&ze.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}function E1({spinning:i}){return r("svg",{css:[ze.icon,i&&ze.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function R1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}function _1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})})}function O1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}function B1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}function Tp(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}function H1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function U1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}function j1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})})}function N1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function q1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}function Y1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}function G1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}function X1(){return r("svg",{css:ze.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}class V1{async get(c){const f=await fetch(c,{cache:"no-store",headers:{"Cache-Control":"no-cache"}});if(!f.ok){const d=await f.json().catch(()=>({}));throw new Error(d.error||`Request failed: ${f.status}`)}return f.json()}async post(c,f){const d=await fetch(c,{method:"POST",headers:f?{"Content-Type":"application/json"}:void 0,body:f?JSON.stringify(f):void 0});if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.error||`Request failed: ${d.status}`)}return d.json()}async list(c="public"){return this.get(`/api/studio/list?path=${encodeURIComponent(c)}`)}async search(c,f="public"){return this.get(`/api/studio/search?q=${encodeURIComponent(c)}&path=${encodeURIComponent(f)}`)}async listFolders(){return this.get("/api/studio/list-folders")}async countImages(){return this.get("/api/studio/count-images")}async folderImages(c){return this.get(`/api/studio/folder-images?folders=${encodeURIComponent(c.join(","))}`)}async upload(c,f="public"){const d=new FormData;d.append("file",c),d.append("path",f);const h=await fetch("/api/studio/upload",{method:"POST",body:d});if(!h.ok){const p=await h.json().catch(()=>({}));throw new Error(p.error||`Upload failed: ${h.status}`)}return h.json()}async delete(c){return this.post("/api/studio/delete",{paths:c})}async createFolder(c,f){return this.post("/api/studio/create-folder",{parentPath:c,name:f})}async rename(c,f){return this.post("/api/studio/rename",{oldPath:c,newName:f})}async move(c,f){return this.post("/api/studio/move",{paths:c,destination:f})}async push(c){return this.post("/api/studio/sync",{imageKeys:c})}async reprocess(c){return this.post("/api/studio/reprocess",{imageKeys:c})}processAllStream(){return new EventSource("/api/studio/process-all")}async checkFeaturedImage(){return this.get("/api/studio/check-featured-image")}async getFeaturedImageOptions(){return this.get("/api/studio/featured-image-options")}}const xi=new V1;function Zp(){const{currentPath:i,setCurrentPath:c,navigateUp:f,selectedItems:d,toggleSelection:h,selectRange:p,lastSelectedPath:v,selectAll:D,clearSelection:w,refreshKey:b,setFocusedItem:L,triggerRefresh:M,triggerScan:E,searchQuery:Y,showError:B,setFileItems:k,editedImageKey:Q}=So(),[j,ee]=x.useState([]),[te,ce]=x.useState(!0),[V,P]=x.useState(!1),[I,ae]=x.useState(null),H=x.useRef(!0),G=x.useRef(i);x.useEffect(()=>{async function S(){const U=G.current!==i;(H.current||U)&&ce(!0),G.current=i;try{const ne=Y&&Y.length>=2?await xi.search(Y,i):await xi.list(i),re=ne.items||[];ee(re),k(re),P(ne.isEmpty===!0)}catch(ne){const re=ne instanceof Error?ne.message:"Failed to load items";B("Load Error",re),ee([]),k([]),P(!1)}ce(!1),H.current=!1}S()},[i,b,Y,B,k]),x.useEffect(()=>{async function S(){if(i!=="public"){ae(null);return}try{const U=await xi.checkFeaturedImage();ae(U)}catch{ae(null)}}S()},[i,b]);const oe=i==="public",fe=Y&&Y.length>=2,de=[...j].sort((S,U)=>S.type==="folder"&&U.type!=="folder"?-1:S.type!=="folder"&&U.type==="folder"?1:S.name.localeCompare(U.name)),le=de.length>0&&de.every(S=>d.has(S.path)),Me=de.some(S=>d.has(S.path)),T=x.useCallback((S,U)=>{U.shiftKey&&v?p(v,S.path,de):h(S.path)},[v,p,de,h]),$=x.useCallback(S=>{S.type==="folder"?c(S.path):L(S)},[c,L]),J=x.useCallback(async S=>{try{const U="/"+S.path.replace(/^public\//,"");await xi.reprocess([U]),M()}catch(U){const ne=U instanceof Error?U.message:"Failed to generate thumbnail";B("Processing Error",ne)}},[M,B]),De=x.useCallback(()=>{le?w():D(de)},[le,w,D,de]),Xe=I&&!I.exists?I:null;return{items:j,loading:te,sortedItems:de,metaEmpty:V,missingFeaturedImage:Xe,isAtRoot:oe,isSearching:fe,allItemsSelected:le,someItemsSelected:Me,currentPath:i,selectedItems:d,navigateUp:f,editedImageKey:Q,handleItemClick:T,handleOpen:$,handleGenerateThumbnail:J,handleSelectAll:De,triggerScan:E,triggerRefresh:M}}const F1=Ut`
72
+ from { opacity: 0; }
73
+ to { opacity: 1; }
74
+ `,Q1=Ut`
75
+ from { transform: translateY(-20px); opacity: 0; }
76
+ to { transform: translateY(0); opacity: 1; }
77
+ `,K1=Ut`
78
+ to { transform: rotate(360deg); }
79
+ `,un={overlay:g("position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:rgba(0, 0, 0, 0.5);animation:",F1," 0.15s ease;",""),modal:g("background:",s.surface,";border-radius:12px;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);width:100%;max-width:440px;animation:",Q1," 0.2s ease;overflow:hidden;",""),header:g("padding:20px 24px;border-bottom:1px solid ",s.border,";",""),title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;",""),subtitle:g("font-size:",q.sm,";color:",s.textSecondary,";margin:4px 0 0 0;",""),body:{name:"1a7zdz",styles:"padding:24px;display:flex;flex-direction:column;gap:12px"},loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},spinner:g("width:24px;height:24px;border-radius:50%;border:2px solid ",s.border,";border-top-color:",s.primary,";animation:",K1," 0.8s linear infinite;",""),urlButton:g("display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:16px 20px;background:",s.background,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;text-align:left;&:hover:not(:disabled){background:",s.surfaceHover,";border-color:",s.primary,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),urlLabel:g("font-size:",q.xs,";font-weight:600;color:",s.textSecondary,";text-transform:uppercase;letter-spacing:0.05em;",""),urlValue:g("font-size:",q.base,";font-weight:500;color:",s.text,";word-break:break-all;",""),noOptions:g("padding:20px;text-align:center;color:",s.textSecondary,";font-size:",q.sm,";",""),footer:g("padding:16px 24px;border-top:1px solid ",s.border,";display:flex;justify-content:flex-end;",""),cancelBtn:g("padding:10px 20px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}","")};function $p({isOpen:i,onClose:c,onSelect:f}){const[d,h]=x.useState(!0),[p,v]=x.useState(null),[D,w]=x.useState(null);if(x.useEffect(()=>{if(!i)return;async function L(){h(!0);try{const M=await xi.getFeaturedImageOptions();v(M.devUrl),w(M.productionUrl)}catch(M){console.error("Failed to load featured image options:",M)}h(!1)}L()},[i]),!i)return null;const b=p||D;return r("div",{css:un.overlay,onClick:c,children:y("div",{css:un.modal,onClick:L=>L.stopPropagation(),children:[y("div",{css:un.header,children:[r("h2",{css:un.title,children:"Generate Screenshot"}),r("p",{css:un.subtitle,children:"Choose which URL to screenshot"})]}),r("div",{css:un.body,children:d?r("div",{css:un.loading,children:r("div",{css:un.spinner})}):b?y(Pe,{children:[p&&y("button",{css:un.urlButton,onClick:()=>f(p),children:[r("span",{css:un.urlLabel,children:"Development"}),r("span",{css:un.urlValue,children:p})]}),D&&y("button",{css:un.urlButton,onClick:()=>f(D),children:[r("span",{css:un.urlLabel,children:"Production"}),r("span",{css:un.urlValue,children:D})]})]}):y("div",{css:un.noOptions,children:["No URLs configured. Set ",r("code",{children:"NEXT_PUBLIC_PRODUCTION_URL"})," in .env.local and/or .env.production."]})}),r("div",{css:un.footer,children:r("button",{css:un.cancelBtn,onClick:c,children:"Cancel"})})]})})}const Z1=Ut`
80
+ to { transform: rotate(360deg); }
81
+ `,ue={loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:g("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",Z1," 0.8s linear infinite;",""),empty:g("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyIcon:{name:"1o3cbsn",styles:"width:48px;height:48px;margin-bottom:16px;opacity:0.5"},emptyText:g("font-size:",q.base,";margin:0 0 4px 0;&:last-child{color:",s.textMuted,";font-size:",q.sm,";}",""),scanButton:g("margin-top:16px;padding:10px 24px;font-size:",q.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover:not(:disabled){background:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),grid:{name:"el23hk",styles:"display:grid;grid-template-columns:1fr;gap:12px;@media (min-width: 480px){grid-template-columns:repeat(2, 1fr);}@media (min-width: 768px){grid-template-columns:repeat(3, 1fr);}@media (min-width: 1024px){grid-template-columns:repeat(4, 1fr);}@media (min-width: 1280px){grid-template-columns:repeat(5, 1fr);}"},item:g("position:relative;border-radius:8px;border:1px solid ",s.border,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.surface,";user-select:none;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04);&:hover{border-color:#d0d5dd;box-shadow:0 2px 4px rgba(0, 0, 0, 0.06);}",""),itemSelected:g("border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";&:hover{border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";}",""),parentItem:g("cursor:pointer;&:hover{border-color:",s.primary,";}",""),checkboxWrapper:{name:"v3lnpt",styles:"position:absolute;top:0;left:0;z-index:10;padding:8px;cursor:pointer"},checkbox:g("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),content:g("position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:16px;background:",s.background,";",""),contentCloud:g("",""),contentRemote:g("",""),folderIcon:{name:"k1w47f",styles:"width:56px;height:56px;color:#f9935e"},imagesFolderIcon:g("width:56px;height:56px;color:",s.imagesFolder,";",""),imagesFolderWrapper:{name:"bjn8wh",styles:"position:relative"},lockIcon:g("position:absolute;bottom:4px;right:4px;width:16px;height:16px;color:",s.imagesFolder,";background:white;border-radius:50%;padding:2px;",""),parentIcon:g("width:56px;height:56px;color:",s.textMuted,";",""),fileIcon:g("width:40px;height:40px;color:",s.textMuted,";",""),image:{name:"rm1wug",styles:"max-width:100%;max-height:100%;object-fit:contain;border-radius:4px"},label:g("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),labelRow:{name:"1gkgtms",styles:"display:flex;flex-direction:column;gap:2px"},labelText:{name:"fxp7t8",styles:"flex:1;min-width:0"},copyBtn:g("position:absolute;top:4px;right:4px;z-index:10;height:28px;width:28px;color:",s.textMuted,";background:transparent;border:none;padding:0;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";}",""),copyIcon:{name:"1eg0rk6",styles:"width:18px;height:18px"},folderStats:{name:"905wvx",styles:"display:flex;align-items:center;gap:8px;margin:2px 0 0 0"},folderStat:g("display:flex;align-items:center;gap:3px;font-size:",q.xs,";",""),folderStatLocal:g("color:",s.textMuted,";",""),folderStatCloud:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatRemote:{name:"1lukubv",styles:"color:#ef4444"},folderStatUpdate:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatIconCloud:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},folderStatIconLocal:g("width:14px;height:14px;color:",s.textSecondary,";",""),folderStatIconRemote:{name:"efr29r",styles:"width:14px;height:14px;color:#ef4444"},folderStatIconUpdate:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateLabel:g("color:#f59e0b;font-size:",q.xs,";",""),updateCloudIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateSyncIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},statusRow:{name:"1b1nq65",styles:"display:flex;align-items:center;justify-content:space-between;margin:2px 0 0 0;gap:4px"},statusLeft:{name:"1j5vobt",styles:"display:flex;align-items:center;gap:4px"},thumbChips:{name:"x2l7ss",styles:"display:flex;align-items:center;gap:3px;margin-left:auto"},thumbChip:g("display:inline-flex;align-items:center;justify-content:center;padding:1px 4px;font-size:9px;font-weight:600;border-radius:3px;background:rgba(0, 0, 0, 0.08);color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.02em;",""),storedIconCloud:{name:"1e09qmx",styles:"width:16px;height:16px;color:#f59e0b"},storedIconRemote:{name:"1mrh6ju",styles:"width:16px;height:16px;color:#ef4444"},tooltip:{name:"qoyfdh",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;z-index:100;&::before{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},openBtn:g("position:absolute;bottom:8px;right:8px;z-index:10;height:28px;font-size:",q.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 8px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;box-shadow:0 1px 2px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),featuredPlaceholder:g("position:relative;border-radius:8px;border:2px dashed ",s.success,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.background,";&:hover{border-color:",s.success,";background-color:",s.successLight,";}",""),featuredContent:{name:"y8o17o",styles:"position:relative;aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;gap:8px"},featuredIcon:g("width:40px;height:40px;color:",s.success,";",""),featuredText:g("font-size:",q.sm,";color:",s.success,";text-align:center;font-weight:500;",""),featuredLabel:g("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),name:g("font-size:",q.sm,";font-weight:500;color:",s.text,";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;letter-spacing:-0.01em;direction:rtl;text-align:left;",""),size:g("font-size:",q.xs,";color:",s.textMuted,";margin:2px 0 0 0;",""),selectAllRow:g("display:flex;align-items:center;margin-bottom:16px;padding:12px 16px;background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";",""),selectAllLabel:g("display:flex;align-items:center;gap:10px;font-size:",q.base,";font-weight:500;color:",s.textSecondary,";cursor:pointer;&:hover{color:",s.text,";}",""),selectAllCheckbox:g("width:16px;height:16px;accent-color:",s.primary,";","")};function $1(){const{loading:i,sortedItems:c,metaEmpty:f,missingFeaturedImage:d,isAtRoot:h,isSearching:p,allItemsSelected:v,someItemsSelected:D,selectedItems:w,navigateUp:b,handleItemClick:L,handleOpen:M,handleGenerateThumbnail:E,handleSelectAll:Y,triggerScan:B,triggerRefresh:k,editedImageKey:Q}=Zp(),[j,ee]=x.useState(!1),[te,ce]=x.useState(!1),[V,P]=x.useState({current:0,total:3,percent:0,status:"processing",message:"Generating screenshot..."}),I=()=>{ee(!0)},ae=async H=>{ee(!1),ce(!0),P({current:0,total:4,percent:0,status:"processing",message:"Starting..."});try{const G=await fetch("/api/studio/generate-featured-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:H})});if(!G.ok){const de=await G.json();P({current:0,total:4,percent:0,status:"error",message:de.error||"Failed to generate screenshot"});return}const oe=G.body?.getReader(),fe=new TextDecoder;if(oe){let de="";for(;;){const{done:le,value:Me}=await oe.read();if(le)break;de+=fe.decode(Me,{stream:!0});const T=de.split(`
82
+ `);de=T.pop()||"";for(const $ of T)if($.startsWith("data: "))try{const J=JSON.parse($.slice(6));J.type==="start"?P(De=>({...De,total:J.total,message:`Screenshotting ${J.url}...`})):J.type==="progress"?P({current:J.current,total:J.total,percent:J.percent,status:"processing",message:J.message}):J.type==="complete"?(P({current:J.processed,total:J.processed,percent:100,status:J.errors>0?"error":"complete",message:J.message}),k()):J.type==="error"&&P(De=>({...De,status:"error",message:J.message}))}catch{}}}}catch(G){console.error("Featured image generation error:",G),P({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating the screenshot"})}};return i?y(Pe,{children:[te&&r(ul,{title:"Generating Screenshot",progress:V,onClose:()=>ce(!1)}),r("div",{css:ue.loading,children:r("div",{css:ue.spinner})})]}):f&&h?y("div",{css:ue.empty,children:[r("svg",{css:ue.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),r("p",{css:ue.emptyText,children:"No files tracked yet"}),r("p",{css:ue.emptyText,children:"Click Scan to discover files in your public folder"}),r("button",{css:ue.scanButton,onClick:B,children:"Scan for Files"})]}):c.length===0&&h?y("div",{css:ue.empty,children:[r("svg",{css:ue.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),r("p",{css:ue.emptyText,children:"No files in this folder"}),r("p",{css:ue.emptyText,children:"Upload images or click Scan in the toolbar"})]}):y(Pe,{children:[r($p,{isOpen:j,onClose:()=>ee(!1),onSelect:ae}),te&&r(ul,{title:"Generating Screenshot",progress:V,onClose:()=>ce(!1)}),y("div",{children:[c.length>0&&r("div",{css:ue.selectAllRow,children:y("label",{css:ue.selectAllLabel,children:[r("input",{type:"checkbox",css:ue.selectAllCheckbox,checked:v,ref:H=>{H&&(H.indeterminate=D&&!v)},onChange:Y}),"Select all (",c.length,")"]})}),y("div",{css:ue.grid,children:[!h&&!p&&y("div",{css:[ue.item,ue.parentItem,"",""],onClick:b,children:[r("div",{css:ue.content,children:r("svg",{css:ue.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),y("div",{css:ue.label,children:[r("p",{css:ue.name,children:".."}),r("p",{css:ue.size,children:"Parent folder"})]})]}),c.map(H=>r(J1,{item:H,isSelected:w.has(H.path),onClick:G=>L(H,G),onOpen:()=>M(H),onGenerateThumbnail:()=>E(H),editedImageKey:Q},H.path)),h&&d&&!p&&y("div",{css:ue.featuredPlaceholder,onClick:I,title:`Generate ${d.filename}`,children:[y("div",{css:ue.featuredContent,children:[r("svg",{css:ue.featuredIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),r("span",{css:ue.featuredText,children:"Generate Screenshot"})]}),y("div",{css:ue.featuredLabel,children:[r("p",{css:ue.name,children:d.filename}),r("p",{css:ue.size,children:"Click to screenshot homepage"})]})]})]})]})]})}function W1(i){return i.includes("/images/sm/")?"SM":i.includes("/images/md/")?"MD":i.includes("/images/lg/")?"LG":i.includes("/images/full/")?"FULL":null}function J1({item:i,isSelected:c,onClick:f,onOpen:d,onGenerateThumbnail:h,editedImageKey:p}){const[v,D]=x.useState(!1),w=i.type==="folder",b=!w&&i.thumbnail!==void 0,L=i.thumbnail&&p&&p.path===i.path?`${i.thumbnail}?v=${p.key}`:i.thumbnail,M=i.isProtected||w&&i.name==="images"&&i.path==="public/images",E=W1(i.path),Y=!w&&(i.hasSm||i.hasMd||i.hasLg||i.hasFull||E),B=Q=>{Q.stopPropagation();const j="/"+i.path.replace(/^public\//,"");navigator.clipboard.writeText(j),D(!0),setTimeout(()=>D(!1),1500)},k=Q=>{if(M){Q.stopPropagation(),d();return}f(Q)};return y("div",{css:[ue.item,c&&!M&&ue.itemSelected,"",""],onClick:k,children:[!M&&r("div",{css:ue.checkboxWrapper,onClick:Q=>Q.stopPropagation(),children:r("input",{type:"checkbox",css:ue.checkbox,checked:c,onChange:()=>f({})})}),y("div",{css:[ue.content,i.isCloud&&ue.contentCloud,i.isRemote&&ue.contentRemote,"",""],children:[y("button",{css:ue.copyBtn,onClick:B,title:"Copy file path",children:[v&&r("span",{css:ue.tooltip,children:"Copied!"}),r("svg",{css:ue.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:ue.openBtn,onClick:Q=>{Q.stopPropagation(),d()},children:"Open"}),w?M?y("div",{css:ue.imagesFolderWrapper,children:[r("svg",{css:ue.imagesFolderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),r("svg",{css:ue.lockIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})]}):r("svg",{css:ue.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}):b&&L?r("img",{css:ue.image,src:L,alt:i.name,loading:"lazy"}):r("svg",{css:ue.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})]}),r("div",{css:ue.label,children:r("div",{css:ue.labelRow,children:y("div",{css:ue.labelText,children:[r("p",{css:ue.name,title:i.name,children:i.name}),w?y("div",{css:ue.folderStats,children:[i.localCount!==void 0&&i.localCount>0&&y("span",{css:[ue.folderStat,ue.folderStatLocal,"",""],title:`${i.localCount} local`,children:[r("svg",{css:ue.folderStatIconLocal,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),i.localCount]}),i.cloudCount!==void 0&&i.cloudCount>0&&y("span",{css:[ue.folderStat,ue.folderStatCloud,"",""],title:`${i.cloudCount} in cloud`,children:[r("svg",{css:ue.folderStatIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),i.cloudCount]}),i.remoteCount!==void 0&&i.remoteCount>0&&y("span",{css:[ue.folderStat,ue.folderStatRemote,"",""],title:`${i.remoteCount} remote`,children:[r("svg",{css:ue.folderStatIconRemote,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),i.remoteCount]}),i.updateCount!==void 0&&i.updateCount>0&&y("span",{css:[ue.folderStat,ue.folderStatUpdate,"",""],title:`${i.updateCount} pending update${i.updateCount!==1?"s":""}`,children:[r("svg",{css:ue.folderStatIconUpdate,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),i.updateCount]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount!==void 0&&y("span",{css:ue.size,children:[i.fileCount," files"]})]}):y("div",{css:ue.statusRow,children:[r("div",{css:ue.statusLeft,children:i.hasUpdate?y(Pe,{children:[r("svg",{css:ue.updateCloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("svg",{css:ue.updateSyncIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),r("span",{css:ue.updateLabel,children:"update"})]}):i.cdnPushed?r("svg",{css:i.isRemote?ue.storedIconRemote:ue.storedIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.isRemote?r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}):r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}):i.size!==void 0?r("span",{css:ue.size,children:I1(i.size)}):null}),Y&&r("span",{css:ue.thumbChips,children:E?r("span",{css:ue.thumbChip,children:E}):y(Pe,{children:[i.hasSm&&r("span",{css:ue.thumbChip,children:"SM"}),i.hasMd&&r("span",{css:ue.thumbChip,children:"MD"}),i.hasLg&&r("span",{css:ue.thumbChip,children:"LG"}),i.hasFull&&r("span",{css:ue.thumbChip,children:"FULL"})]})})]})]})})})]})}function I1(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}const P1=Ut`
83
+ to { transform: rotate(360deg); }
84
+ `,W={loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:g("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",P1," 0.8s linear infinite;",""),empty:g("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyHint:g("font-size:",q.sm,";color:",s.textMuted,";margin-top:4px;",""),scanButton:g("margin-top:16px;padding:10px 24px;font-size:",q.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover:not(:disabled){background:",s.primaryHover,";}&:disabled{opacity:0.6;cursor:not-allowed;}",""),tableWrapper:g("background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";overflow-x:auto;",""),table:{name:"nufjao",styles:"width:100%;min-width:600px;border-collapse:collapse;white-space:nowrap"},th:g("text-align:left;font-size:11px;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.05em;padding:12px 16px;font-weight:600;background:",s.background,";border-bottom:1px solid ",s.border,";",""),thCheckbox:{name:"5iz1wr",styles:"width:48px"},thSize:{name:"yct5co",styles:"width:96px"},thDimensions:{name:"gu2s0e",styles:"width:128px"},thCdn:{name:"yct5co",styles:"width:96px"},tbody:g("",""),row:g("cursor:pointer;transition:background-color 0.15s ease;user-select:none;&:hover{background-color:",s.surfaceHover,";}&:not(:last-child) td{border-bottom:1px solid ",s.borderLight,";}",""),rowSelected:g("background-color:",s.primaryLight,";&:hover{background-color:",s.primaryLight,";}",""),parentRow:g("cursor:pointer;border-bottom:1px solid ",s.border,";&:hover{background-color:",s.surfaceHover,";}",""),td:{name:"i563hg",styles:"padding:12px 16px"},checkboxCell:{name:"sahq4q",styles:"padding:12px 16px;cursor:pointer;vertical-align:middle"},checkbox:g("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;display:block;",""),actionsCell:{name:"1w56d5c",styles:"display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-shrink:0"},copyBtn:g("position:relative;flex-shrink:0;height:32px;width:32px;font-size:",q.xs,";color:",s.textSecondary,";background:",s.surface,";border:1px solid ",s.border,";padding:0;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;justify-content:center;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";color:",s.text,";}",""),copyIcon:{name:"157xhr7",styles:"width:16px;height:16px"},folderStats:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},folderStat:g("display:flex;align-items:center;gap:3px;font-size:",q.xs,";",""),folderStatLocal:g("color:",s.textMuted,";",""),folderStatCloud:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatRemote:{name:"1lukubv",styles:"color:#ef4444"},folderStatUpdate:{name:"1t8qh25",styles:"color:#f59e0b"},folderStatIconCloud:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},folderStatIconLocal:g("width:14px;height:14px;color:",s.textSecondary,";",""),folderStatIconRemote:{name:"efr29r",styles:"width:14px;height:14px;color:#ef4444"},folderStatIconUpdate:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateLabel:g("display:flex;align-items:center;gap:4px;color:#f59e0b;font-size:",q.xs,";",""),updateCloudIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},updateSyncIcon:{name:"1pgx8p4",styles:"width:14px;height:14px;color:#f59e0b"},storedLabel:{name:"s5xdrg",styles:"display:flex;align-items:center"},storedIconCloud:{name:"1e09qmx",styles:"width:16px;height:16px;color:#f59e0b"},storedIconRemote:{name:"1mrh6ju",styles:"width:16px;height:16px;color:#ef4444"},tooltip:{name:"1bu1odp",styles:"position:absolute;top:50%;right:100%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:6px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},nameCell:{name:"9s3nhy",styles:"display:flex;align-items:center;gap:12px;flex:1"},thumbnailWrapper:{name:"f01c4l",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:4px"},thumbnailCloud:g("",""),thumbnailRemote:g("",""),folderIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},folderIcon:{name:"a45yt2",styles:"width:24px;height:24px;color:#f9935e"},imagesFolderWrapper:{name:"iqqile",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;align-items:center"},imagesFolderIcon:g("width:24px;height:24px;color:",s.imagesFolder,";",""),lockIcon:g("width:10px;height:10px;color:",s.imagesFolder,";margin-left:-6px;margin-top:8px;",""),parentIcon:g("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),fileIcon:g("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),thumbnail:g("max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:4px;border:1px solid ",s.borderLight,";",""),name:g("font-size:",q.base,";font-weight:500;color:",s.text,";letter-spacing:-0.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px;",""),meta:g("font-size:",q.sm,";color:",s.textSecondary,";",""),cdnBadge:g("display:inline-flex;align-items:center;gap:4px;font-size:",q.xs,";font-weight:500;color:",s.success,";",""),cdnBadgeRemote:g("display:inline-flex;align-items:center;font-size:",q.xs,";font-weight:500;color:#ef4444;",""),cdnIcon:{name:"1suksrg",styles:"width:12px;height:12px"},cdnEmpty:g("font-size:",q.sm,";color:",s.textMuted,";",""),featuredRow:g("cursor:pointer;transition:background-color 0.15s ease;border:2px dashed ",s.success,";&:hover{background-color:",s.successLight,";}td{border-bottom:none!important;}",""),featuredIcon:g("width:24px;height:24px;color:",s.success,";",""),featuredText:g("color:",s.success,";font-weight:500;",""),openBtn:g("height:32px;font-size:",q.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 14px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}","")};function e2(){const{loading:i,sortedItems:c,metaEmpty:f,missingFeaturedImage:d,isAtRoot:h,isSearching:p,allItemsSelected:v,someItemsSelected:D,selectedItems:w,navigateUp:b,handleItemClick:L,handleOpen:M,handleGenerateThumbnail:E,handleSelectAll:Y,triggerScan:B,triggerRefresh:k,editedImageKey:Q}=Zp(),[j,ee]=x.useState(!1),[te,ce]=x.useState(!1),[V,P]=x.useState({current:0,total:3,percent:0,status:"processing",message:"Generating screenshot..."}),I=()=>{ee(!0)},ae=async H=>{ee(!1),ce(!0),P({current:0,total:4,percent:0,status:"processing",message:"Starting..."});try{const G=await fetch("/api/studio/generate-featured-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:H})});if(!G.ok){const de=await G.json();P({current:0,total:4,percent:0,status:"error",message:de.error||"Failed to generate screenshot"});return}const oe=G.body?.getReader(),fe=new TextDecoder;if(oe){let de="";for(;;){const{done:le,value:Me}=await oe.read();if(le)break;de+=fe.decode(Me,{stream:!0});const T=de.split(`
85
+ `);de=T.pop()||"";for(const $ of T)if($.startsWith("data: "))try{const J=JSON.parse($.slice(6));J.type==="start"?P(De=>({...De,total:J.total,message:`Screenshotting ${J.url}...`})):J.type==="progress"?P({current:J.current,total:J.total,percent:J.percent,status:"processing",message:J.message}):J.type==="complete"?(P({current:J.processed,total:J.processed,percent:100,status:J.errors>0?"error":"complete",message:J.message}),k()):J.type==="error"&&P(De=>({...De,status:"error",message:J.message}))}catch{}}}}catch(G){console.error("Featured image generation error:",G),P({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating the screenshot"})}};return i?r("div",{css:W.loading,children:r("div",{css:W.spinner})}):f&&h?y("div",{css:W.empty,children:[r("p",{children:"No files tracked yet"}),r("p",{css:W.emptyHint,children:"Click Scan to discover files in your public folder"}),r("button",{css:W.scanButton,onClick:B,children:"Scan for Files"})]}):c.length===0&&h?y("div",{css:W.empty,children:[r("p",{children:"No files in this folder"}),r("p",{css:W.emptyHint,children:"Upload images or click Scan in the toolbar"})]}):y(Pe,{children:[r($p,{isOpen:j,onClose:()=>ee(!1),onSelect:ae}),te&&r(ul,{title:"Generating Screenshot",progress:V,onClose:()=>ce(!1)}),r("div",{css:W.tableWrapper,children:y("table",{css:W.table,children:[r("thead",{children:y("tr",{children:[r("th",{css:[W.th,W.thCheckbox,"",""],children:c.length>0&&r("input",{type:"checkbox",css:W.checkbox,checked:v,ref:H=>{H&&(H.indeterminate=D&&!v)},onChange:Y})}),r("th",{css:W.th,children:"Name"}),r("th",{css:[W.th,W.thSize,"",""],children:"Size"}),r("th",{css:[W.th,W.thDimensions,"",""],children:"Dimensions"}),r("th",{css:[W.th,W.thCdn,"",""],children:"CDN"})]})}),y("tbody",{css:W.tbody,children:[!h&&!p&&y("tr",{css:W.parentRow,onClick:b,children:[r("td",{css:W.td}),r("td",{css:W.td,children:y("div",{css:W.nameCell,children:[r("svg",{css:W.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),r("span",{css:W.name,children:".."})]})}),r("td",{css:[W.td,W.meta,"",""],children:"--"}),r("td",{css:[W.td,W.meta,"",""],children:"Parent folder"}),r("td",{css:W.td,children:"--"})]}),c.map(H=>r(t2,{item:H,isSelected:w.has(H.path),onClick:G=>L(H,G),onOpen:()=>M(H),onGenerateThumbnail:()=>E(H),editedImageKey:Q},H.path)),h&&d&&!p&&y("tr",{css:W.featuredRow,onClick:I,title:`Generate ${d.filename}`,children:[r("td",{css:W.td}),r("td",{css:W.td,children:y("div",{css:W.nameCell,children:[r("div",{css:W.folderIconWrapper,children:r("svg",{css:W.featuredIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),r("span",{css:[W.name,W.featuredText,"",""],children:d.filename})]})}),r("td",{css:[W.td,W.meta,W.featuredText,"",""],children:"--"}),r("td",{css:[W.td,W.meta,W.featuredText,"",""],children:"Click to generate"}),r("td",{css:[W.td,W.featuredText,"",""],children:"--"})]})]})]})})]})}function t2({item:i,isSelected:c,onClick:f,onOpen:d,onGenerateThumbnail:h,editedImageKey:p}){const[v,D]=x.useState(!1),w=i.type==="folder",b=!w&&i.thumbnail!==void 0,L=i.thumbnail&&p&&p.path===i.path?`${i.thumbnail}?v=${p.key}`:i.thumbnail,M=i.isProtected||w&&i.name==="images"&&i.path==="public/images",E=B=>{B.stopPropagation();const k="/"+i.path.replace(/^public\//,"");navigator.clipboard.writeText(k),D(!0),setTimeout(()=>D(!1),1500)},Y=B=>{if(M){B.stopPropagation(),d();return}f(B)};return y("tr",{css:[W.row,c&&!M&&W.rowSelected,"",""],onClick:Y,children:[r("td",{css:[W.td,W.checkboxCell,"",""],onClick:B=>B.stopPropagation(),children:!M&&r("input",{type:"checkbox",css:W.checkbox,checked:c,onChange:()=>f({})})}),r("td",{css:W.td,children:y("div",{css:W.nameCell,children:[w?M?y("div",{css:W.imagesFolderWrapper,children:[r("svg",{css:W.imagesFolderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),r("svg",{css:W.lockIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})]}):r("div",{css:W.folderIconWrapper,children:r("svg",{css:W.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}):b&&L?r("div",{css:[W.thumbnailWrapper,i.isCloud&&W.thumbnailCloud,i.isRemote&&W.thumbnailRemote,"",""],children:r("img",{css:W.thumbnail,src:L,alt:i.name,loading:"lazy"})}):r("div",{css:[W.thumbnailWrapper,i.isCloud&&W.thumbnailCloud,i.isRemote&&W.thumbnailRemote,"",""],children:r("svg",{css:W.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),r("span",{css:W.name,title:i.name,children:n2(i.name)}),y("div",{css:W.actionsCell,children:[y("button",{css:W.copyBtn,onClick:E,title:"Copy file path",children:[v&&r("span",{css:W.tooltip,children:"Copied!"}),r("svg",{css:W.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:W.openBtn,onClick:B=>{B.stopPropagation(),d()},children:"Open"})]})]})}),r("td",{css:[W.td,W.meta,"",""],children:w?y("div",{css:W.folderStats,children:[i.localCount!==void 0&&i.localCount>0&&y("span",{css:[W.folderStat,W.folderStatLocal,"",""],title:`${i.localCount} local`,children:[r("svg",{css:W.folderStatIconLocal,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),i.localCount]}),i.cloudCount!==void 0&&i.cloudCount>0&&y("span",{css:[W.folderStat,W.folderStatCloud,"",""],title:`${i.cloudCount} in cloud`,children:[r("svg",{css:W.folderStatIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),i.cloudCount]}),i.remoteCount!==void 0&&i.remoteCount>0&&y("span",{css:[W.folderStat,W.folderStatRemote,"",""],title:`${i.remoteCount} remote`,children:[r("svg",{css:W.folderStatIconRemote,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),i.remoteCount]}),i.updateCount!==void 0&&i.updateCount>0&&y("span",{css:[W.folderStat,W.folderStatUpdate,"",""],title:`${i.updateCount} pending update${i.updateCount!==1?"s":""}`,children:[r("svg",{css:W.folderStatIconUpdate,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),i.updateCount]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount!==void 0&&y("span",{children:[i.fileCount," files"]}),!i.localCount&&!i.cloudCount&&!i.remoteCount&&!i.updateCount&&i.fileCount===void 0&&"--"]}):i.hasUpdate?y("span",{css:W.updateLabel,children:[r("svg",{css:W.updateCloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})}),r("svg",{css:W.updateSyncIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"update"]}):i.cdnPushed?r("span",{css:W.storedLabel,children:r("svg",{css:i.isRemote?W.storedIconRemote:W.storedIconCloud,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.isRemote?r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}):r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})})}):i.size!==void 0?Lp(i.size):"--"}),r("td",{css:[W.td,W.meta,"",""],children:w?i.totalSize!==void 0?Lp(i.totalSize):"--":i.dimensions?`${i.dimensions.width}x${i.dimensions.height}`:"--"}),r("td",{css:W.td,children:i.cdnPushed?i.isRemote?r("span",{css:W.cdnBadgeRemote,children:"Remote"}):y("span",{css:W.cdnBadge,children:[r("svg",{css:W.cdnIcon,fill:"currentColor",viewBox:"0 0 20 20",children:r("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Pushed"]}):r("span",{css:W.cdnEmpty,children:"--"})})]})}function Lp(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function n2(i,c=32){if(i.length<=c)return i;const f=i.lastIndexOf("."),d=f>0?i.substring(f):"",h=f>0?i.substring(0,f):i,p=c-d.length-3;if(p<6)return i.substring(0,c-3)+"...";const v=Math.ceil(p/2),D=Math.floor(p/2);return h.substring(0,v)+"..."+h.substring(h.length-D)+d}var a2=Object.defineProperty,l2=(i,c,f)=>c in i?a2(i,c,{enumerable:!0,configurable:!0,writable:!0,value:f}):i[c]=f,Ht=(i,c,f)=>l2(i,typeof c!="symbol"?c+"":c,f);const Xr={x:0,y:0,width:0,height:0,unit:"px"},mo=(i,c,f)=>Math.min(Math.max(i,c),f),o2=(...i)=>i.filter(c=>c&&typeof c=="string").join(" "),Ep=(i,c)=>i===c||i.width===c.width&&i.height===c.height&&i.x===c.x&&i.y===c.y&&i.unit===c.unit;function bo(i,c,f){return i.unit==="%"?{...Xr,...i,unit:"%"}:{unit:"%",x:i.x?i.x/c*100:0,y:i.y?i.y/f*100:0,width:i.width?i.width/c*100:0,height:i.height?i.height/f*100:0}}function sl(i,c,f){return i.unit?i.unit==="px"?{...Xr,...i,unit:"px"}:{unit:"px",x:i.x?i.x*c/100:0,y:i.y?i.y*f/100:0,width:i.width?i.width*c/100:0,height:i.height?i.height*f/100:0}:{...Xr,...i,unit:"px"}}function Rp(i,c,f,d,h,p=0,v=0,D=d,w=h){const b={...i};let L=Math.min(p,d),M=Math.min(v,h),E=Math.min(D,d),Y=Math.min(w,h);c&&(c>1?(L=v?v*c:L,M=L/c,E=D*c):(M=p?p/c:M,L=M*c,Y=w/c)),b.y<0&&(b.height=Math.max(b.height+b.y,M),b.y=0),b.x<0&&(b.width=Math.max(b.width+b.x,L),b.x=0);const B=d-(b.x+b.width);B<0&&(b.x=Math.min(b.x,d-L),b.width+=B);const k=h-(b.y+b.height);if(k<0&&(b.y=Math.min(b.y,h-M),b.height+=k),b.width<L&&((f==="sw"||f=="nw")&&(b.x-=L-b.width),b.width=L),b.height<M&&((f==="nw"||f=="ne")&&(b.y-=M-b.height),b.height=M),b.width>E&&((f==="sw"||f=="nw")&&(b.x-=E-b.width),b.width=E),b.height>Y&&((f==="nw"||f=="ne")&&(b.y-=Y-b.height),b.height=Y),c){const Q=b.width/b.height;if(Q<c){const j=Math.max(b.width/c,M);(f==="nw"||f=="ne")&&(b.y-=j-b.height),b.height=j}else if(Q>c){const j=Math.max(b.height*c,L);(f==="sw"||f=="nw")&&(b.x-=j-b.width),b.width=j}}return b}function i2(i,c,f,d){const h={...i};return c==="ArrowLeft"?d==="nw"?(h.x-=f,h.y-=f,h.width+=f,h.height+=f):d==="w"?(h.x-=f,h.width+=f):d==="sw"?(h.x-=f,h.width+=f,h.height+=f):d==="ne"?(h.y+=f,h.width-=f,h.height-=f):d==="e"?h.width-=f:d==="se"&&(h.width-=f,h.height-=f):c==="ArrowRight"&&(d==="nw"?(h.x+=f,h.y+=f,h.width-=f,h.height-=f):d==="w"?(h.x+=f,h.width-=f):d==="sw"?(h.x+=f,h.width-=f,h.height-=f):d==="ne"?(h.y-=f,h.width+=f,h.height+=f):d==="e"?h.width+=f:d==="se"&&(h.width+=f,h.height+=f)),c==="ArrowUp"?d==="nw"?(h.x-=f,h.y-=f,h.width+=f,h.height+=f):d==="n"?(h.y-=f,h.height+=f):d==="ne"?(h.y-=f,h.width+=f,h.height+=f):d==="sw"?(h.x+=f,h.width-=f,h.height-=f):d==="s"?h.height-=f:d==="se"&&(h.width-=f,h.height-=f):c==="ArrowDown"&&(d==="nw"?(h.x+=f,h.y+=f,h.width-=f,h.height-=f):d==="n"?(h.y+=f,h.height-=f):d==="ne"?(h.y+=f,h.width-=f,h.height-=f):d==="sw"?(h.x-=f,h.width+=f,h.height+=f):d==="s"?h.height+=f:d==="se"&&(h.width+=f,h.height+=f)),h}const yo={capture:!0,passive:!1};let r2=0;const cl=class ta extends x.PureComponent{constructor(){super(...arguments),Ht(this,"docMoveBound",!1),Ht(this,"mouseDownOnCrop",!1),Ht(this,"dragStarted",!1),Ht(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),Ht(this,"componentRef",x.createRef()),Ht(this,"mediaRef",x.createRef()),Ht(this,"resizeObserver"),Ht(this,"initChangeCalled",!1),Ht(this,"instanceId",`rc-${r2++}`),Ht(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),Ht(this,"onCropPointerDown",c=>{const{crop:f,disabled:d}=this.props,h=this.getBox();if(!f)return;const p=sl(f,h.width,h.height);if(d)return;c.cancelable&&c.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const v=c.target.dataset.ord,D=!!v;let w=c.clientX,b=c.clientY,L=p.x,M=p.y;if(v){const E=c.clientX-h.x,Y=c.clientY-h.y;let B=0,k=0;v==="ne"||v=="e"?(B=E-(p.x+p.width),k=Y-p.y,L=p.x,M=p.y+p.height):v==="se"||v==="s"?(B=E-(p.x+p.width),k=Y-(p.y+p.height),L=p.x,M=p.y):v==="sw"||v=="w"?(B=E-p.x,k=Y-(p.y+p.height),L=p.x+p.width,M=p.y):(v==="nw"||v=="n")&&(B=E-p.x,k=Y-p.y,L=p.x+p.width,M=p.y+p.height),w=L+h.x+B,b=M+h.y+k}this.evData={startClientX:w,startClientY:b,startCropX:L,startCropY:M,clientX:c.clientX,clientY:c.clientY,isResize:D,ord:v},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),Ht(this,"onComponentPointerDown",c=>{const{crop:f,disabled:d,locked:h,keepSelection:p,onChange:v}=this.props,D=this.getBox();if(d||h||p&&f)return;c.cancelable&&c.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const w=c.clientX-D.x,b=c.clientY-D.y,L={unit:"px",x:w,y:b,width:0,height:0};this.evData={startClientX:c.clientX,startClientY:c.clientY,startCropX:w,startCropY:b,clientX:c.clientX,clientY:c.clientY,isResize:!0},this.mouseDownOnCrop=!0,v(sl(L,D.width,D.height),bo(L,D.width,D.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),Ht(this,"onDocPointerMove",c=>{const{crop:f,disabled:d,onChange:h,onDragStart:p}=this.props,v=this.getBox();if(d||!f||!this.mouseDownOnCrop)return;c.cancelable&&c.preventDefault(),this.dragStarted||(this.dragStarted=!0,p&&p(c));const{evData:D}=this;D.clientX=c.clientX,D.clientY=c.clientY;let w;D.isResize?w=this.resizeCrop():w=this.dragCrop(),Ep(f,w)||h(sl(w,v.width,v.height),bo(w,v.width,v.height))}),Ht(this,"onComponentKeyDown",c=>{const{crop:f,disabled:d,onChange:h,onComplete:p}=this.props;if(d)return;const v=c.key;let D=!1;if(!f)return;const w=this.getBox(),b=this.makePixelCrop(w),L=(navigator.platform.match("Mac")?c.metaKey:c.ctrlKey)?ta.nudgeStepLarge:c.shiftKey?ta.nudgeStepMedium:ta.nudgeStep;if(v==="ArrowLeft"?(b.x-=L,D=!0):v==="ArrowRight"?(b.x+=L,D=!0):v==="ArrowUp"?(b.y-=L,D=!0):v==="ArrowDown"&&(b.y+=L,D=!0),D){c.cancelable&&c.preventDefault(),b.x=mo(b.x,0,w.width-b.width),b.y=mo(b.y,0,w.height-b.height);const M=sl(b,w.width,w.height),E=bo(b,w.width,w.height);h(M,E),p&&p(M,E)}}),Ht(this,"onHandlerKeyDown",(c,f)=>{const{aspect:d=0,crop:h,disabled:p,minWidth:v=0,minHeight:D=0,maxWidth:w,maxHeight:b,onChange:L,onComplete:M}=this.props,E=this.getBox();if(p||!h)return;if(c.key==="ArrowUp"||c.key==="ArrowDown"||c.key==="ArrowLeft"||c.key==="ArrowRight")c.stopPropagation(),c.preventDefault();else return;const Y=(navigator.platform.match("Mac")?c.metaKey:c.ctrlKey)?ta.nudgeStepLarge:c.shiftKey?ta.nudgeStepMedium:ta.nudgeStep,B=sl(h,E.width,E.height),k=i2(B,c.key,Y,f),Q=Rp(k,d,f,E.width,E.height,v,D,w,b);if(!Ep(h,Q)){const j=bo(Q,E.width,E.height);L(Q,j),M&&M(Q,j)}}),Ht(this,"onDocPointerDone",c=>{const{crop:f,disabled:d,onComplete:h,onDragEnd:p}=this.props,v=this.getBox();this.unbindDocMove(),!(d||!f)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,p&&p(c),h&&h(sl(f,v.width,v.height),bo(f,v.width,v.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),Ht(this,"onDragFocus",()=>{var c;(c=this.componentRef.current)==null||c.scrollTo(0,0)})}get document(){return document}getBox(){const c=this.mediaRef.current;if(!c)return{x:0,y:0,width:0,height:0};const{x:f,y:d,width:h,height:p}=c.getBoundingClientRect();return{x:f,y:d,width:h,height:p}}componentDidUpdate(c){const{crop:f,onComplete:d}=this.props;if(d&&!c.crop&&f){const{width:h,height:p}=this.getBox();h&&p&&d(sl(f,h,p),bo(f,h,p))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,yo),this.document.addEventListener("pointerup",this.onDocPointerDone,yo),this.document.addEventListener("pointercancel",this.onDocPointerDone,yo),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,yo),this.document.removeEventListener("pointerup",this.onDocPointerDone,yo),this.document.removeEventListener("pointercancel",this.onDocPointerDone,yo),this.docMoveBound=!1)}getCropStyle(){const{crop:c}=this.props;if(c)return{top:`${c.y}${c.unit}`,left:`${c.x}${c.unit}`,width:`${c.width}${c.unit}`,height:`${c.height}${c.unit}`}}dragCrop(){const{evData:c}=this,f=this.getBox(),d=this.makePixelCrop(f),h=c.clientX-c.startClientX,p=c.clientY-c.startClientY;return d.x=mo(c.startCropX+h,0,f.width-d.width),d.y=mo(c.startCropY+p,0,f.height-d.height),d}getPointRegion(c,f,d,h){const{evData:p}=this,v=p.clientX-c.x,D=p.clientY-c.y;let w;h&&f?w=f==="nw"||f==="n"||f==="ne":w=D<p.startCropY;let b;return d&&f?b=f==="nw"||f==="w"||f==="sw":b=v<p.startCropX,b?w?"nw":"sw":w?"ne":"se"}resolveMinDimensions(c,f,d=0,h=0){const p=Math.min(d,c.width),v=Math.min(h,c.height);return!f||!p&&!v?[p,v]:f>1?p?[p,p/f]:[v*f,v]:v?[v*f,v]:[p,p/f]}resizeCrop(){const{evData:c}=this,{aspect:f=0,maxWidth:d,maxHeight:h}=this.props,p=this.getBox(),[v,D]=this.resolveMinDimensions(p,f,this.props.minWidth,this.props.minHeight);let w=this.makePixelCrop(p);const b=this.getPointRegion(p,c.ord,v,D),L=c.ord||b;let M=c.clientX-c.startClientX,E=c.clientY-c.startClientY;(v&&L==="nw"||L==="w"||L==="sw")&&(M=Math.min(M,-v)),(D&&L==="nw"||L==="n"||L==="ne")&&(E=Math.min(E,-D));const Y={unit:"px",x:0,y:0,width:0,height:0};b==="ne"?(Y.x=c.startCropX,Y.width=M,f?(Y.height=Y.width/f,Y.y=c.startCropY-Y.height):(Y.height=Math.abs(E),Y.y=c.startCropY-Y.height)):b==="se"?(Y.x=c.startCropX,Y.y=c.startCropY,Y.width=M,f?Y.height=Y.width/f:Y.height=E):b==="sw"?(Y.x=c.startCropX+M,Y.y=c.startCropY,Y.width=Math.abs(M),f?Y.height=Y.width/f:Y.height=E):b==="nw"&&(Y.x=c.startCropX+M,Y.width=Math.abs(M),f?(Y.height=Y.width/f,Y.y=c.startCropY-Y.height):(Y.height=Math.abs(E),Y.y=c.startCropY+E));const B=Rp(Y,f,b,p.width,p.height,v,D,d,h);return f||ta.xyOrds.indexOf(L)>-1?w=B:ta.xOrds.indexOf(L)>-1?(w.x=B.x,w.width=B.width):ta.yOrds.indexOf(L)>-1&&(w.y=B.y,w.height=B.height),w.x=mo(w.x,0,p.width-w.width),w.y=mo(w.y,0,p.height-w.height),w}renderCropSelection(){const{ariaLabels:c=ta.defaultProps.ariaLabels,disabled:f,locked:d,renderSelectionAddon:h,ruleOfThirds:p,crop:v}=this.props,D=this.getCropStyle();if(v)return yt.createElement("div",{style:D,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":c.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!f&&!d&&yt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},yt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),yt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),yt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),yt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":c.nwDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"nw"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":c.nDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"n"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":c.neDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"ne"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":c.eDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"e"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":c.seDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"se"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":c.sDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"s"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":c.swDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"sw"),role:"button"}),yt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":c.wDragHandle,onKeyDown:w=>this.onHandlerKeyDown(w,"w"),role:"button"})),h&&yt.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:w=>w.stopPropagation()},h(this.state)),p&&yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),yt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(c){const f={...Xr,...this.props.crop||{}};return sl(f,c.width,c.height)}render(){const{aspect:c,children:f,circularCrop:d,className:h,crop:p,disabled:v,locked:D,style:w,ruleOfThirds:b}=this.props,{cropIsActive:L,newCropIsBeingDrawn:M}=this.state,E=p?this.renderCropSelection():null,Y=o2("ReactCrop",h,L&&"ReactCrop--active",v&&"ReactCrop--disabled",D&&"ReactCrop--locked",M&&"ReactCrop--new-crop",p&&c&&"ReactCrop--fixed-aspect",p&&d&&"ReactCrop--circular-crop",p&&b&&"ReactCrop--rule-of-thirds",!this.dragStarted&&p&&!p.width&&!p.height&&"ReactCrop--invisible-crop",d&&"ReactCrop--no-animate");return yt.createElement("div",{ref:this.componentRef,className:Y,style:w},yt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},f),p?yt.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},yt.createElement("defs",null,yt.createElement("mask",{id:`hole-${this.instanceId}`},yt.createElement("rect",{width:"100%",height:"100%",fill:"white"}),d?yt.createElement("ellipse",{cx:`${p.x+p.width/2}${p.unit}`,cy:`${p.y+p.height/2}${p.unit}`,rx:`${p.width/2}${p.unit}`,ry:`${p.height/2}${p.unit}`,fill:"black"}):yt.createElement("rect",{x:`${p.x}${p.unit}`,y:`${p.y}${p.unit}`,width:`${p.width}${p.unit}`,height:`${p.height}${p.unit}`,fill:"black"}))),yt.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,E)}};Ht(cl,"xOrds",["e","w"]),Ht(cl,"yOrds",["n","s"]),Ht(cl,"xyOrds",["nw","ne","se","sw"]),Ht(cl,"nudgeStep",1),Ht(cl,"nudgeStepMedium",10),Ht(cl,"nudgeStepLarge",100),Ht(cl,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let s2=cl;const c2=Ut`
86
+ from { opacity: 0; }
87
+ to { opacity: 1; }
88
+ `,we={overlay:g("position:fixed;inset:0;z-index:10001;display:flex;background:transparent;animation:",c2," 0.15s ease-out;font-family:",dl,";",""),container:g(Ra," display:flex;flex:1;margin:24px;background:",s.surface,";border:1px solid ",s.border,";border-radius:12px;overflow:hidden;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),main:g("position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:",s.background,";overflow:hidden;.ReactCrop__crop-selection{border:2px solid ",s.primary,";}",""),headerButtons:{name:"8wfhwn",styles:"position:absolute;top:16px;right:16px;display:flex;gap:8px;z-index:10"},closeBtn:g("padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),closeIcon:g("width:20px;height:20px;color:",s.textSecondary,";",""),rotationWrapper:{name:"1xwnw1d",styles:"transition:transform 0.3s ease;position:relative;cursor:pointer"},cropHint:g("position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background:rgba(0, 0, 0, 0.7);color:white;padding:12px 20px;border-radius:8px;font-size:",q.sm,";pointer-events:none;white-space:nowrap;",""),successBanner:g("position:absolute;top:24px;left:50%;transform:translateX(-50%);background:#22c55e;color:#fff;padding:12px 24px;border-radius:8px;font-size:",q.sm,";font-weight:600;pointer-events:none;z-index:10;animation:fadeInOut 3s ease-in-out forwards;@keyframes fadeInOut{0%{opacity:0;transform:translateX(-50%) scale(0.9);}10%{opacity:1;transform:translateX(-50%) scale(1);}90%{opacity:1;transform:translateX(-50%) scale(1);}100%{opacity:0;transform:translateX(-50%) scale(0.9);}}",""),cropWrapper:{name:"12wysvm",styles:"max-width:100%;max-height:calc(100vh - 150px);img{max-width:100%;max-height:calc(100vh - 150px);display:block;}"},sidebar:g("width:280px;background:",s.surface,";border-left:1px solid ",s.border,";display:flex;flex-direction:column;overflow:hidden;",""),sidebarHeader:g("padding:16px 20px;border-bottom:1px solid ",s.border,";",""),sidebarTitle:g("font-size:",q.base,";font-weight:600;color:",s.text,";margin:0;",""),sidebarContent:{name:"1uv1qvv",styles:"flex:1;padding:20px;overflow:auto;display:flex;flex-direction:column;gap:20px"},section:{name:"1c3pogw",styles:"display:flex;flex-direction:column;gap:10px"},sectionLabel:g("font-size:",q.sm,";font-weight:600;color:",s.text,";",""),subSectionLabel:g("font-size:",q.xs,";font-weight:500;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.5px;",""),aspectButtons:{name:"13l5m7f",styles:"display:flex;gap:6px;flex-wrap:wrap"},aspectBtn:g("padding:6px 10px;font-size:",q.sm,";border:1px solid ",s.border,";background:",s.surface,";color:",s.text,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),aspectBtnActive:g("background-color:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primary,";border-color:",s.primary,";}",""),rotateButtons:{name:"11jf4ye",styles:"display:flex;gap:8px"},rotateBtn:g("flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;font-size:",q.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),rotateIcon:{name:"157xhr7",styles:"width:16px;height:16px"},rotatePreview:g("width:80px;height:80px;border:1px solid ",s.border,";border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:",s.background,";margin:8px auto;img{max-width:100%;max-height:100%;object-fit:contain;transition:transform 0.3s ease;}",""),resizeRow:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},resizeInput:g("width:80px;min-width:0;padding:8px 6px;font-size:",q.sm,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";text-align:center;&:focus{outline:none;border-color:",s.primary,";}&:disabled{opacity:0.5;cursor:not-allowed;background:",s.surfaceHover,";}&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}-moz-appearance:textfield;",""),resizeX:g("font-size:",q.sm,";color:",s.textMuted,";",""),qualitySlider:g("width:100%;height:6px;border-radius:3px;background:",s.border,";outline:none;cursor:pointer;&::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:",s.primary,";cursor:pointer;}&::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:",s.primary,";cursor:pointer;border:none;}",""),qualityRow:{name:"uh5xjc",styles:"display:flex;align-items:center;gap:12px"},qualityValue:g("min-width:40px;font-size:",q.sm,";color:",s.text,";text-align:right;",""),fileSize:g("font-size:",q.sm,";color:",s.textMuted,";padding:8px 0;",""),sidebarFooter:g("padding:16px 20px;border-top:1px solid ",s.border,";display:flex;flex-direction:column;gap:8px;",""),actionBtn:g("display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 14px;font-size:",q.base,";font-weight:500;background:",s.primary,";border:1px solid ",s.primary,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),cancelBtn:g("display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 14px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),spinner:{name:"1b4712p",styles:"width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin 0.75s linear infinite;@keyframes spin{to{transform:rotate(360deg);}}"},hint:g("font-size:",q.xs,";color:",s.textMuted,";font-style:italic;",""),clearBtn:g("margin-top:8px;padding:6px 12px;font-size:",q.xs,";color:",s.textSecondary,";background:transparent;border:1px solid ",s.border,";border-radius:4px;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";color:",s.text,";}","")},u2=[{label:"Free",value:void 0},{label:"1:1",value:1},{label:"4:3",value:4/3},{label:"3:2",value:3/2},{label:"16:9",value:16/9},{label:"2:3",value:2/3},{label:"9:16",value:9/16}];function d2(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(2)} MB`}function f2({imagePath:i,imageSrc:c,dimensions:f,fileSize:d,onClose:h,onSaveComplete:p,triggerRefresh:v}){const D=x.useRef(null),[w,b]=x.useState(),[L,M]=x.useState(),[E,Y]=x.useState(void 0),[B,k]=x.useState(f.width),[Q,j]=x.useState(f.height),[ee,te]=x.useState(!1),[ce,V]=x.useState(!1),[P,I]=x.useState({width:f.width,height:f.height}),[ae,H]=x.useState(1),[G,oe]=x.useState(!1),[fe,de]=x.useState(0),[le,Me]=x.useState(!1),T=B!==P.width||Q!==P.height,[$,J]=x.useState(0),[De,Xe]=x.useState(0),[S,U]=x.useState(!1),[ne,re]=x.useState(0),[ke,Te]=x.useState(null),[Ye,gt]=x.useState(d),[Be,nn]=x.useState(95),[Ze,et]=x.useState(0),xt=Ze!==0,_t=Z=>{const ie=Z.currentTarget,{naturalWidth:Re,naturalHeight:ut,width:Ne,height:Ce}=ie;I({width:Re,height:ut}),H(Re/Ne),V(!0),k(Re),j(ut)},jt=()=>{if(!ce||!D.current||G||T||xt)return;const Z=D.current.width,ie=D.current.height;if(oe(!0),E){const Re=Z/ie;let ut,Ne;E>Re?(ut=100,Ne=Re/E*100):(Ne=100,ut=E/Re*100);const Ce={unit:"%",x:(100-ut)/2,y:(100-Ne)/2,width:ut,height:Ne};b(Ce);const Ct={unit:"px",x:Math.round(Ce.x/100*Z),y:Math.round(Ce.y/100*ie),width:Math.round(Ce.width/100*Z),height:Math.round(Ce.height/100*ie)};M(Ct)}else b({unit:"%",x:0,y:0,width:100,height:100}),M({unit:"px",x:0,y:0,width:Z,height:ie})},Ft=()=>{oe(!1),b(void 0),M(void 0)};x.useEffect(()=>{if(L&&ce&&ae>0){const Z=Math.round(L.width*ae),ie=Math.round(L.height*ae);J(Z),Xe(ie)}else G||(J(0),Xe(0))},[L,ce,ae,G]);const Pt=()=>{et(Z=>(Z+90)%360)},fn=()=>{et(Z=>(Z-90+360)%360)},en=()=>{et(0)},rt=()=>{le&&p({name:i.split("/").pop()||"",path:i,type:"file",dimensions:P}),h()},Nt=Z=>{if(Y(Z),!ce||!D.current)return;const ie=D.current.width,Re=D.current.height;if(Z){const ut=ie/Re;let Ne,Ce;Z>ut?(Ne=100,Ce=ut/Z*100):(Ce=100,Ne=Z/ut*100);const Ct={unit:"%",x:(100-Ne)/2,y:(100-Ce)/2,width:Ne,height:Ce};b(Ct);const lt={unit:"px",x:Math.round(Ct.x/100*ie),y:Math.round(Ct.y/100*Re),width:Math.round(Ct.width/100*ie),height:Math.round(Ct.height/100*Re)};M(lt)}else b({unit:"%",x:0,y:0,width:100,height:100}),M({unit:"px",x:0,y:0,width:ie,height:Re})},pe=P.width/P.height,Wn=Z=>{if(G)return;const ie=parseInt(Z.target.value)||0;k(ie),ie>0&&j(Math.round(ie/pe))},Ot=Z=>{if(G)return;const ie=parseInt(Z.target.value)||0;j(ie),ie>0&&k(Math.round(ie*pe))},mn=()=>{k(P.width),j(P.height)},Tn=Z=>{if(!L||!D.current)return;const ie=parseInt(Z.target.value)||0;if(ie<=0)return;let Re=De;E&&(Re=Math.round(ie/E));const ut=ie/ae,Ne=Re/ae,Ce={unit:"px",x:L.x,y:L.y,width:ut,height:Ne},Ct=D.current.width-Ce.x,lt=D.current.height-Ce.y;Ce.width=Math.min(ut,Ct),Ce.height=Math.min(Ne,lt),M(Ce),b({unit:"px",x:Ce.x,y:Ce.y,width:Ce.width,height:Ce.height})},xn=Z=>{if(!L||!D.current)return;const ie=parseInt(Z.target.value)||0;if(ie<=0)return;let Re=$;E&&(Re=Math.round(ie*E));const ut=Re/ae,Ne=ie/ae,Ce={unit:"px",x:L.x,y:L.y,width:ut,height:Ne},Ct=D.current.width-Ce.x,lt=D.current.height-Ce.y;Ce.width=Math.min(ut,Ct),Ce.height=Math.min(Ne,lt),M(Ce),b({unit:"px",x:Ce.x,y:Ce.y,width:Ce.width,height:Ce.height})},vn=async()=>{if(ce){te(!0);try{const Z=L?{x:Math.round(L.x*ae),y:Math.round(L.y*ae),width:Math.round(L.width*ae),height:Math.round(L.height*ae)}:{x:0,y:0,width:P.width,height:P.height};let ie=G?$:T?B:P.width,Re=G?De:T?Q:P.height;if(Ze===90||Ze===270){const Ce=ie;ie=Re,Re=Ce}const Ne=await(await fetch("/api/studio/edit-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imagePath:i,crop:Z,rotation:Ze,resize:{width:ie,height:Re},quality:Be})})).json();Ne.success?(v(),p(Ne.updatedItem),I({width:Ne.dimensions.width,height:Ne.dimensions.height}),k(Ne.dimensions.width),j(Ne.dimensions.height),Ne.updatedItem?.size&&gt(Ne.updatedItem.size),oe(!1),b(void 0),M(void 0),et(0),Me(!0),de(Date.now()),re(Ce=>Ce+1),U(!0),setTimeout(()=>U(!1),3e3)):(console.error("Edit failed:",Ne.error),Te(Ne.error||"Failed to save image"))}catch(Z){console.error("Edit error:",Z),Te("An error occurred while saving the image")}finally{te(!1)}}};return y("div",{css:we.overlay,children:[y("div",{css:we.container,children:[y("div",{css:we.main,children:[r("div",{css:we.headerButtons,children:r("button",{css:we.closeBtn,onClick:rt,children:r("svg",{css:we.closeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),y("div",{css:we.rotationWrapper,onClick:jt,children:[r(s2,{crop:G?w:void 0,onChange:Z=>b(Z),onComplete:Z=>M(Z),aspect:E,css:we.cropWrapper,disabled:!G,children:r("img",{ref:D,src:fe?`${c}?v=${fe}`:c,alt:"Edit",onLoad:_t,style:{cursor:G?"crosshair":"pointer"}})}),!G&&ce&&r("div",{css:we.cropHint,children:xt?"Save rotation first to enable crop":T?"Save resize first to enable crop":"Click to enable crop selection"}),S&&r("div",{css:we.successBanner,children:"Image updated"},ne)]})]}),y("div",{css:we.sidebar,children:[r("div",{css:we.sidebarHeader,children:r("h2",{css:we.sidebarTitle,children:"Edit Image"})}),y("div",{css:we.sidebarContent,children:[y("div",{css:we.section,children:[r("span",{css:we.sectionLabel,children:"Crop Selection"}),r("span",{css:we.subSectionLabel,children:"Aspect Ratio"}),r("div",{css:we.aspectButtons,children:u2.map(Z=>r("button",{css:[we.aspectBtn,E===Z.value&&we.aspectBtnActive,"",""],onClick:()=>Nt(Z.value),disabled:T||xt,children:Z.label},Z.label))}),G&&y(Pe,{children:[r("span",{css:we.subSectionLabel,children:"Selection Size"}),y("div",{css:we.resizeRow,children:[r("input",{type:"number",css:we.resizeInput,value:$,onChange:Tn,min:1}),r("span",{css:we.resizeX,children:"×"}),r("input",{type:"number",css:we.resizeInput,value:De,onChange:xn,min:1}),r("span",{css:we.resizeX,children:"px"})]})]}),r("p",{css:we.hint,children:xt?"Save rotation first to enable crop":T?"Save resize first to enable crop":G?"Drag corners to resize crop area":"Click image to enable crop"}),G&&r("button",{css:we.clearBtn,onClick:Ft,children:"Clear Selection"})]}),y("div",{css:we.section,children:[r("span",{css:we.sectionLabel,children:"Rotation"}),r("div",{css:we.rotatePreview,children:r("img",{src:fe?`${c}?v=${fe}`:c,alt:"Rotation preview",style:{transform:`rotate(${Ze}deg)`}})}),y("div",{css:we.rotateButtons,children:[y("button",{css:we.rotateBtn,onClick:fn,disabled:ee||G||T,children:[r("svg",{css:we.rotateIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),"CCW"]}),y("button",{css:we.rotateBtn,onClick:Pt,disabled:ee||G||T,children:[r("svg",{css:we.rotateIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10h-10a8 8 0 00-8 8v2M21 10l-6 6m6-6l-6-6"})}),"CW"]})]}),xt&&r("button",{css:we.clearBtn,onClick:en,children:"Reset Rotation"}),r("p",{css:we.hint,children:G||T?"Save other changes first to rotate":xt?"Click Save Changes to apply rotation":"Preview rotation before saving"})]}),y("div",{css:we.section,children:[r("span",{css:we.sectionLabel,children:"Resize Image"}),y("div",{css:we.resizeRow,children:[r("input",{type:"number",css:we.resizeInput,value:B,onChange:Wn,min:1,disabled:G||xt}),r("span",{css:we.resizeX,children:"×"}),r("input",{type:"number",css:we.resizeInput,value:Q,onChange:Ot,min:1,disabled:G||xt}),r("span",{css:we.resizeX,children:"px"})]}),T&&!G&&!xt&&r("button",{css:we.clearBtn,onClick:mn,children:"Reset to Original"}),xt?r("p",{css:we.hint,children:"Save rotation first to resize"}):G?r("p",{css:we.hint,children:"Clear crop selection to resize"}):T?r("p",{css:we.hint,children:"Save to apply resize, then crop"}):r("p",{css:we.hint,children:"Maintains aspect ratio"})]}),y("div",{css:we.section,children:[r("span",{css:we.sectionLabel,children:"Quality"}),y("div",{css:we.qualityRow,children:[r("input",{type:"range",css:we.qualitySlider,min:1,max:100,value:Be,onChange:Z=>nn(parseInt(Z.target.value))}),y("span",{css:we.qualityValue,children:[Be,"%"]})]}),r("p",{css:we.hint,children:"Lower quality = smaller file size"})]}),y("div",{css:we.section,children:[r("span",{css:we.sectionLabel,children:"File Size"}),r("p",{css:we.fileSize,children:d2(Ye)})]})]}),y("div",{css:we.sidebarFooter,children:[r("button",{css:we.actionBtn,onClick:vn,disabled:ee||!ce,children:ee?y(Pe,{children:[r("span",{css:we.spinner}),"Saving..."]}):"Save Changes"}),r("button",{css:we.cancelBtn,onClick:rt,disabled:ee,children:"Close"})]})]})]}),ke&&r(Kr,{title:"Error",message:ke,onClose:()=>Te(null)})]})}const h2=[".jpg",".jpeg",".png",".gif",".webp",".svg",".ico",".bmp",".tiff",".tif"],p2=[".mp4",".webm",".mov",".avi",".mkv",".m4v"];function g2(i){const c=i.toLowerCase().substring(i.lastIndexOf("."));return h2.includes(c)}function m2(i){const c=i.toLowerCase().substring(i.lastIndexOf("."));return p2.includes(c)}const he={overlay:{name:"1crgpqk",styles:"position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;display:flex;background:transparent"},container:g("display:flex;flex:1;margin:24px;background:",s.surface,";border:1px solid ",s.border,";border-radius:12px;overflow:hidden;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),main:g("position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:",s.background,";overflow:auto;",""),headerButtons:{name:"8wfhwn",styles:"position:absolute;top:16px;right:16px;display:flex;gap:8px;z-index:10"},copyBtn:g("position:relative;padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),copyIcon:g("width:20px;height:20px;color:",s.textSecondary,";",""),statusIcon:g("display:flex;align-items:center;justify-content:center;padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);",""),cloudIcon:{name:"1byef48",styles:"width:22px;height:22px;color:#f59e0b;transform:translateY(1px)"},globeIcon:{name:"jso3j5",styles:"width:20px;height:20px;color:#ef4444"},tooltip:{name:"1w9prgf",styles:"position:absolute;right:100%;top:50%;transform:translateY(-50%);background:#1a1f36;color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;margin-right:8px;pointer-events:none;z-index:100;&::after{content:'';position:absolute;left:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-left-color:#1a1f36;}"},mainCloseBtn:g("padding:8px;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),mainCloseIcon:g("width:20px;height:20px;color:",s.textSecondary,";",""),mediaWrapper:{name:"zr0bjt",styles:"max-width:100%;max-height:100%;display:flex;align-items:center;justify-content:center"},image:{name:"4gte4n",styles:"max-width:100%;max-height:calc(100vh - 200px);object-fit:contain;border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1)"},video:{name:"1talud7",styles:"max-width:100%;max-height:calc(100vh - 200px);border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1)"},filePlaceholder:g("display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;background:",s.surface,";border-radius:12px;border:1px solid ",s.border,";",""),fileIcon:g("width:80px;height:80px;color:",s.textMuted,";margin-bottom:16px;",""),fileName:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;",""),sidebar:g("width:280px;background:",s.surface,";border-left:1px solid ",s.border,";display:flex;flex-direction:column;overflow:hidden;",""),sidebarHeader:g("padding:16px 20px;border-bottom:1px solid ",s.border,";",""),sidebarTitle:g("font-size:",q.base,";font-weight:600;color:",s.text,";margin:0;",""),sidebarContent:{name:"esl95u",styles:"flex:1;padding:20px;overflow:auto"},info:{name:"bh1r16",styles:"display:flex;flex-direction:column;gap:12px;margin-bottom:24px"},infoRow:g("display:flex;justify-content:space-between;font-size:",q.sm,";",""),infoLabel:g("color:",s.textSecondary,";",""),infoValue:g("color:",s.text,";font-weight:500;text-align:right;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",""),infoValueWrap:g("color:",s.text,";font-weight:500;text-align:right;max-width:160px;word-break:break-all;white-space:normal;",""),infoLink:g("color:",s.primary,";font-weight:500;text-align:right;max-width:160px;word-break:break-all;white-space:normal;text-decoration:none;&:hover{text-decoration:underline;}",""),thumbChips:{name:"1w7hks3",styles:"display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end"},thumbChip:g("font-size:10px;font-weight:600;padding:2px 6px;border-radius:4px;background:",s.primary,";color:white;",""),actions:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},actionBtn:g("display:flex;align-items:center;gap:10px;width:100%;padding:12px 14px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;color:",s.text,";text-align:left;&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),actionBtnDanger:g("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),actionBtnCloud:{name:"1lzbs29",styles:"color:#f59e0b;&:hover:not(:disabled){background-color:rgba(245, 158, 11, 0.1);border-color:#f59e0b;}"},actionIcon:{name:"a4lfw4",styles:"width:16px;height:16px;flex-shrink:0"}};function b2(){const{focusedItem:i,setFocusedItem:c,triggerRefresh:f,fileItems:d,setEditedImageKey:h,requestDelete:p,requestMove:v,requestSync:D,requestDownload:w,requestProcess:b,setProcessMode:L,actionState:M}=So(),[E,Y]=x.useState(!1),[B,k]=x.useState(!1),[Q,j]=x.useState({current:0,total:1,percent:0,status:"processing",message:"Renaming..."}),[ee,te]=x.useState(!1),[ce,V]=x.useState(null),[P,I]=x.useState(!1),[ae,H]=x.useState(!1),[G,oe]=x.useState({current:0,total:3,percent:0,status:"processing",message:"Generating favicons..."}),[fe,de]=x.useState(!1),[le,Me]=x.useState(0),T=M.showProgress,$=i?i.name.toLowerCase()==="favicon.png"||i.name.toLowerCase()==="favicon.jpg":!1,J=i&&!i.isProtected&&/\.(jpg|jpeg|png|webp|gif)$/i.test(i.name)&&(!i.isCloud||i.hasUpdate),De=et=>{c(et),Me(Date.now()),h(et.path)};if(!i)return null;const Xe=g2(i.name),S=m2(i.name),U="/"+i.path.replace(/^public\//,""),ne=i.cdnPushed&&i.cdnBaseUrl?`${i.cdnBaseUrl}${U}`:U,re=le?`${ne}?v=${le}`:ne,ke=typeof window<"u"?window.location.origin:"",Te=i.cdnPushed&&i.cdnBaseUrl?`${i.cdnBaseUrl}${U}`:`${ke}${U}`,Ye=()=>{c(null)},gt=()=>{navigator.clipboard.writeText(Te),I(!0),setTimeout(()=>I(!1),1500)},Be=async et=>{if(et&&et!==i.name){Y(!1),k(!0),j({current:0,total:1,percent:0,status:"processing",message:"Renaming file..."});try{const xt=await fetch("/api/studio/rename-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:i.path,newName:et})});if(!xt.body)throw new Error("No response body");const _t=xt.body.getReader(),jt=new TextDecoder;let Ft="",Pt="";for(;;){const{done:fn,value:en}=await _t.read();if(fn)break;Ft+=jt.decode(en,{stream:!0});const rt=Ft.split(`
89
+ `);Ft=rt.pop()||"";for(const Nt of rt){if(!Nt.startsWith("data: "))continue;const pe=JSON.parse(Nt.slice(6));pe.type==="start"?j({current:0,total:pe.total,percent:0,status:"processing",message:pe.message}):pe.type==="progress"?j({current:pe.current,total:pe.total,percent:Math.round(pe.current/pe.total*100),status:"processing",message:pe.message}):pe.type==="complete"?(Pt=pe.newPath,j({current:pe.renamed,total:pe.renamed,percent:100,status:"complete",message:"Renamed successfully"})):pe.type==="error"&&(j(Wn=>({...Wn,status:"error",message:pe.message})),V({title:"Rename Failed",message:pe.message}))}}Pt&&(c({...i,path:Pt,name:Pt.split("/").pop()||et}),f())}catch(xt){console.error("Rename error:",xt),j(_t=>({..._t,status:"error",message:"Failed to rename"})),V({title:"Rename Failed",message:"An error occurred while renaming the file"})}}},nn=async()=>{if(i){H(!0),oe({current:0,total:3,percent:0,status:"processing",message:"Generating favicons..."});try{const et=await fetch("/api/studio/generate-favicon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imagePath:"/"+i.path.replace(/^public\//,"")})});if(!et.ok){const jt=await et.json();oe({current:0,total:3,percent:0,status:"error",message:jt.error||"Failed to generate favicons"});return}const xt=et.body?.getReader(),_t=new TextDecoder;if(xt){let jt="";for(;;){const{done:Ft,value:Pt}=await xt.read();if(Ft)break;jt+=_t.decode(Pt,{stream:!0});const fn=jt.split(`
90
+ `);jt=fn.pop()||"";for(const en of fn)if(en.startsWith("data: "))try{const rt=JSON.parse(en.slice(6));rt.type==="start"?oe(Nt=>({...Nt,total:rt.total})):rt.type==="progress"?oe({current:rt.current,total:rt.total,percent:rt.percent,status:"processing",message:rt.message}):rt.type==="complete"?oe({current:rt.processed,total:rt.processed,percent:100,status:rt.errors>0?"error":"complete",message:rt.message}):rt.type==="error"&&oe(Nt=>({...Nt,status:"error",message:rt.message}))}catch{}}}}catch(et){console.error("Favicon generation error:",et),oe({current:0,total:3,percent:0,status:"error",message:"An error occurred while generating favicons"})}}},Ze=()=>Xe?r("img",{css:he.image,src:re,alt:i.name}):S?r("video",{css:he.video,src:re,controls:!0}):y("div",{css:he.filePlaceholder,children:[r("svg",{css:he.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("p",{css:he.fileName,children:i.name})]});return y(Pe,{children:[ce&&r(Kr,{title:ce.title,message:ce.message,onClose:()=>V(null)}),r(Kp,{isOpen:ee,onClose:()=>te(!1)}),E&&r(El,{title:"Rename File",message:"Enter a new name for the file:",defaultValue:i.name,placeholder:"Enter new filename",confirmLabel:"Rename",onConfirm:Be,onCancel:()=>Y(!1)}),B&&r(ul,{title:"Renaming",progress:Q,onClose:()=>{k(!1),f()}}),ae&&r(ul,{title:"Generating Favicons",progress:G,onClose:()=>H(!1)}),r("div",{css:he.overlay,onClick:Ye,children:y("div",{css:he.container,onClick:et=>et.stopPropagation(),children:[y("div",{css:he.main,children:[y("div",{css:he.headerButtons,children:[i.cdnPushed&&!i.isRemote&&r("span",{css:he.statusIcon,title:"Pushed to CDN",children:r("svg",{css:he.cloudIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"})})}),i.isRemote&&r("span",{css:he.statusIcon,title:"Remote image",children:r("svg",{css:he.globeIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})})}),y("button",{css:he.copyBtn,onClick:gt,title:"Copy file path",children:[P&&r("span",{css:he.tooltip,children:"Copied!"}),r("svg",{css:he.copyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})]}),r("button",{css:he.mainCloseBtn,onClick:Ye,"aria-label":"Close",children:r("svg",{css:he.mainCloseIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r("div",{css:he.mediaWrapper,children:Ze()})]}),y("div",{css:he.sidebar,children:[r("div",{css:he.sidebarHeader,children:r("h3",{css:he.sidebarTitle,children:"Details"})}),y("div",{css:he.sidebarContent,children:[y("div",{css:he.info,children:[y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Name"}),r("span",{css:he.infoValueWrap,children:i.name})]}),y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Path"}),r("span",{css:he.infoValueWrap,children:i.path.replace(/^public\//,"")})]}),i.size!==void 0&&y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Size"}),r("span",{css:he.infoValue,children:y2(i.size)})]}),i.dimensions&&y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Dimensions"}),y("span",{css:he.infoValue,children:[i.dimensions.width," × ",i.dimensions.height]})]}),(i.hasSm||i.hasMd||i.hasLg||i.hasFull)&&y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"Thumbnails"}),r("span",{css:he.infoValue,children:y("span",{css:he.thumbChips,children:[i.hasSm&&r("span",{css:he.thumbChip,children:"SM"}),i.hasMd&&r("span",{css:he.thumbChip,children:"MD"}),i.hasLg&&r("span",{css:he.thumbChip,children:"LG"}),i.hasFull&&r("span",{css:he.thumbChip,children:"FULL"})]})})]}),y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"CDN Status"}),r("span",{css:he.infoValue,children:i.cdnPushed?i.isRemote?"Remote":"Pushed":"Local"})]}),y("div",{css:he.infoRow,children:[r("span",{css:he.infoLabel,children:"URL"}),r("a",{href:Te,target:"_blank",rel:"noopener noreferrer",css:he.infoLink,title:Te,children:Te})]})]}),y("div",{css:he.actions,children:[y("button",{css:he.actionBtn,onClick:()=>Y(!0),disabled:i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),"Rename"]}),Xe&&y("button",{css:he.actionBtn,onClick:()=>de(!0),disabled:T||!J,title:J?void 0:"Download image first to edit",children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14M14 8l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})}),J?"Edit Image":"Download to Edit"]}),y("button",{css:he.actionBtn,onClick:()=>v([i.path]),disabled:T||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})}),"Move"]}),y("button",{css:[he.actionBtn,he.actionBtnCloud,"",""],onClick:()=>D([i.path],d),disabled:T||i.isProtected||i.cdnPushed&&!i.isRemote,title:i.cdnPushed&&!i.isRemote?"Already in R2":void 0,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),"Push to CDN"]}),y("button",{css:[he.actionBtn,he.actionBtnCloud,"",""],onClick:()=>w([i.path],d),disabled:T||!i.cdnPushed||i.isRemote,title:i.cdnPushed?i.isRemote?"Remote image":"Download from CDN to local":"Not on CDN",children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})}),"Download from CDN"]}),y("button",{css:he.actionBtn,onClick:()=>{L("generate"),b([i.path])},disabled:T||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Generate Thumbnails"]}),(i.hasSm||i.hasMd||i.hasLg||i.hasFull)&&y("button",{css:he.actionBtn,onClick:()=>{L("remove"),b([i.path])},disabled:T||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Remove Thumbnails"]}),$&&y("button",{css:he.actionBtn,onClick:nn,disabled:ae||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),"Generate Favicons"]}),y("button",{css:[he.actionBtn,he.actionBtnDanger,"",""],onClick:()=>p([i.path]),disabled:T||i.isProtected,children:[r("svg",{css:he.actionIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete"]})]})]})]})]})}),fe&&i.dimensions&&r(f2,{imagePath:i.path,imageSrc:re,dimensions:i.dimensions,fileSize:i.size||0,onClose:()=>de(!1),onSaveComplete:De,triggerRefresh:f})]})}function y2(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}const Ll={overlay:{name:"1u8n9cx",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1100"},modal:g("background:",s.surface,";border-radius:12px;padding:24px;max-width:400px;width:90%;box-shadow:0 20px 40px rgba(0, 0, 0, 0.2);",""),header:{name:"c6eghz",styles:"display:flex;align-items:center;gap:12px;margin-bottom:12px"},icon:g("width:24px;height:24px;color:",s.danger,";flex-shrink:0;",""),title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;",""),message:g("font-size:",q.base,";color:",s.textSecondary,";margin:0 0 20px 0;line-height:1.5;",""),button:g("width:100%;padding:10px 16px;border-radius:6px;font-size:",q.base,";font-weight:500;border:none;background:",s.primary,";color:white;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}","")};function x2(){const{error:i,clearError:c}=So();return i?r("div",{css:Ll.overlay,onClick:c,children:y("div",{css:Ll.modal,onClick:f=>f.stopPropagation(),children:[y("div",{css:Ll.header,children:[r("svg",{css:Ll.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),r("h3",{css:Ll.title,children:i.title})]}),r("p",{css:Ll.message,children:i.message}),r("button",{css:Ll.button,onClick:c,children:"OK"})]})}):null}const _p={showProgress:!1,progressTitle:"",progressState:{current:0,total:0,percent:0,status:"processing"},showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1,actionPaths:[],syncImageCount:0,syncHasRemote:!1,syncHasLocal:!1,processMode:"generate",downloadImageCount:0,downloadTotalSelected:0};function v2({triggerRefresh:i,clearSelection:c,setFocusedItem:f,showError:d}){const[h,p]=x.useState(_p),v=x.useCallback(H=>{p(G=>({...G,progressState:typeof H=="function"?H(G.progressState):{...G.progressState,...H}}))},[]),D=x.useCallback(H=>{p(G=>({...G,showProgress:H}))},[]),w=x.useCallback(H=>{p(G=>({...G,progressTitle:H}))},[]),b=wu({setShowProgress:D,setProgressTitle:w,setProgressState:v,triggerRefresh:i}),L=x.useCallback(H=>{p(G=>({...G,actionPaths:H,showDeleteConfirm:!0}))},[]),M=x.useCallback(H=>{p(G=>({...G,actionPaths:H,showMoveModal:!0}))},[]),E=x.useCallback((H,G)=>{const oe=H.map(le=>"/"+le.replace(/^public\//,""));let fe=!1,de=!1;for(const le of H){const Me=G.find(T=>T.path===le);Me&&(Me.isRemote?fe=!0:Me.cdnPushed||(de=!0))}p(le=>({...le,actionPaths:H,syncImageCount:oe.length,syncHasRemote:fe,syncHasLocal:de,showSyncConfirm:!0}))},[]),Y=x.useCallback((H,G)=>{const oe=[];for(const fe of H){const de=G.find(le=>le.path===fe);de&&de.cdnPushed&&!de.isRemote&&oe.push(fe)}p(fe=>({...fe,actionPaths:oe,downloadImageCount:oe.length,downloadTotalSelected:H.length,showDownloadConfirm:!0}))},[]),B=x.useCallback(H=>{p(G=>({...G,actionPaths:H,showProcessConfirm:!0}))},[]),k=x.useCallback(H=>{p(G=>({...G,processMode:H}))},[]),Q=x.useCallback(()=>{p(H=>({...H,showDeleteConfirm:!1,showMoveModal:!1,showSyncConfirm:!1,showProcessConfirm:!1,showDownloadConfirm:!1}))},[]),j=x.useCallback(()=>{p(_p)},[]),ee=x.useCallback(()=>{b.stop()},[b]),te=x.useCallback(async()=>{const H=h.actionPaths;p(G=>({...G,showDeleteConfirm:!1}));try{const G=await fetch("/api/studio/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:H})});if(G.ok)c(),f(null),i();else{const oe=await G.json();d("Delete Failed",oe.error||"Unknown error")}}catch(G){console.error("Delete error:",G),d("Delete Failed","Delete failed. Check console for details.")}},[h.actionPaths,c,f,i,d]),ce=x.useCallback(async H=>{const G=h.actionPaths;p(oe=>({...oe,showMoveModal:!1})),await b.execute({endpoint:"/api/studio/move",body:{paths:G,destination:H},title:"Moving Files",onComplete:oe=>{oe.errors&&oe.errors>0&&oe.errorMessages?.length&&d("Move Failed",oe.errorMessages.join(`
91
+ `)),c(),f(null)}})},[h.actionPaths,c,f,d,b]),V=x.useCallback(async()=>{const G=h.actionPaths.map(de=>"/"+de.replace(/^public\//,""));p(de=>({...de,showSyncConfirm:!1,showProgress:!0,progressTitle:"Pushing to CDN",progressState:{current:0,total:G.length,percent:0,status:"processing",message:"Pushing to CDN..."}}));let oe=0;const fe=[];for(let de=0;de<G.length;de++){const le=G[de];try{const Me=await fetch("/api/studio/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageKeys:[le]})});if(Me.ok)oe++;else{const T=await Me.json();fe.push(`${le}: ${T.error||"Unknown error"}`)}}catch(Me){fe.push(`${le}: ${Me instanceof Error?Me.message:"Unknown error"}`)}v({current:de+1,total:G.length,percent:Math.round((de+1)/G.length*100),status:"processing",message:`Pushed ${le}`})}v({current:G.length,total:G.length,percent:100,status:fe.length>0?"error":"complete",message:`Pushed ${oe} file${oe!==1?"s":""}${fe.length>0?`, ${fe.length} error${fe.length!==1?"s":""}`:""}`}),fe.length>0&&d("Push Errors",fe.join(`
92
+ `)),c(),i()},[h.actionPaths,c,i,d,v]),P=x.useCallback(async()=>{const H=h.actionPaths,G=h.processMode,oe=H.map(Me=>{const T=Me.replace(/^public\//,"");return T.startsWith("/")?T:`/${T}`}),fe=G==="remove",de=fe?"/api/studio/unprocess-stream":"/api/studio/reprocess-stream",le=fe?"Removing Thumbnails":"Generating Thumbnails";p(Me=>({...Me,showProcessConfirm:!1})),await b.execute({endpoint:de,body:{imageKeys:oe},title:le})},[h.actionPaths,h.processMode,b]),I=x.useCallback(async()=>{const H=h.progressState.orphanedFiles;if(!(!H||H.length===0))try{const G=await fetch("/api/studio/delete-orphans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:H})});if(G.ok)v(oe=>({...oe,orphanedFiles:void 0,message:oe.message?.replace(/Found \d+ orphaned thumbnail\(s\).*/,"Orphaned thumbnails deleted.")})),i();else{const oe=await G.json();d("Delete Failed",oe.error||"Failed to delete orphaned files")}}catch(G){console.error("Delete orphans error:",G),d("Delete Failed","Failed to delete orphaned files. Check console for details.")}},[h.progressState.orphanedFiles,i,d,v]),ae=x.useCallback(async(H,G)=>{if(H.length===0)return;w("Uploading Files"),D(!0),v({current:0,total:H.length,percent:0,status:"processing",message:"Uploading..."});let oe=0;const fe=[];for(let de=0;de<H.length;de++){const le=H[de],Me=new FormData;Me.append("file",le),Me.append("path",G);try{(await fetch("/api/studio/upload",{method:"POST",body:Me})).ok?oe++:fe.push(le.name)}catch(T){console.error("Upload error:",T),fe.push(le.name)}v({current:de+1,total:H.length,percent:Math.round((de+1)/H.length*100),status:"processing",message:`Uploaded ${le.name}`})}v({current:H.length,total:H.length,percent:100,status:fe.length>0?"error":"complete",message:`Uploaded ${oe} file${oe!==1?"s":""}${fe.length>0?`, ${fe.length} failed`:""}`}),i()},[D,w,v,i]);return{actionState:h,setActionState:p,requestDelete:L,requestMove:M,requestSync:E,requestDownload:Y,requestProcess:B,setProcessMode:k,cancelAction:Q,closeProgress:j,stopProcessing:ee,confirmDelete:te,confirmMove:ce,confirmSync:V,confirmProcess:P,deleteOrphans:I,uploadFiles:ae}}const w2=Ut`
93
+ from { opacity: 0; }
94
+ to { opacity: 1; }
95
+ `,S2=Ut`
96
+ from {
97
+ opacity: 0;
98
+ transform: translateY(-8px) scale(0.98);
99
+ }
100
+ to {
101
+ opacity: 1;
102
+ transform: translateY(0) scale(1);
103
+ }
104
+ `,C2=Ut`
105
+ from { transform: rotate(0deg); }
106
+ to { transform: rotate(360deg); }
107
+ `,Le={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",w2," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:90vh;overflow:hidden;animation:",S2," 0.2s ease-out;display:flex;flex-direction:column;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"amghpa",styles:"padding:16px 24px 24px;overflow-y:auto;flex:1"},section:{name:"za8dp",styles:"margin-bottom:20px;&:last-child{margin-bottom:0;}"},sectionLabel:g("font-size:",q.sm,";font-weight:600;color:",s.textSecondary,";margin:0 0 8px 0;text-transform:uppercase;letter-spacing:0.05em;",""),folderName:g("display:inline-flex;align-items:center;gap:8px;padding:8px 12px;background:",s.background,";border-radius:6px;font-size:",q.base,";font-weight:500;color:",s.text,";",""),folderIcon:{name:"8pinfb",styles:"width:18px;height:18px;color:#f9935e"},statusBadge:g("display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:6px;font-size:",q.sm,";margin-top:8px;",""),statusNeedsGen:{name:"1ozqf4e",styles:"background:#fef3c7;color:#92400e"},statusReady:{name:"6zd3sa",styles:"background:#d1fae5;color:#065f46"},fontList:{name:"dj9uva",styles:"display:flex;flex-wrap:wrap;gap:6px;margin-top:8px"},fontChip:g("display:inline-flex;align-items:center;padding:4px 10px;background:",s.background,";border-radius:4px;font-size:",q.sm,";color:",s.text,";",""),checkboxList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},checkboxLabel:g("display:flex;align-items:center;gap:10px;padding:10px 12px;background:",s.background,";border-radius:6px;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.surfaceHover,";}",""),checkbox:g("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),checkboxText:g("font-size:",q.base,";color:",s.text,";flex:1;",""),addNewRow:{name:"ap5vte",styles:"display:flex;gap:8px;margin-top:12px"},addNewInput:g("flex:1;padding:10px 12px;font-size:",q.base,";border:1px solid ",s.border,";border-radius:6px;background:",s.surface,";color:",s.text,";&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),addNewBtn:g("padding:10px 16px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;color:",s.text,";transition:all 0.15s ease;&:hover:not(:disabled){background:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),emptyText:g("font-size:",q.sm,";color:",s.textMuted,";padding:8px 0;",""),errorText:g("font-size:",q.sm,";color:",s.danger,";margin-top:4px;",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnCancel:g("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),btnConfirm:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";border-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}",""),loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},loadingSpinner:g("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",C2," 0.8s linear infinite;","")};function k2({folderPath:i,selectedFiles:c,onConfirm:f,onCancel:d}){const[h,p]=x.useState(!0),[v,D]=x.useState(null),[w,b]=x.useState([]),[L,M]=x.useState(new Set),[E,Y]=x.useState(""),[B,k]=x.useState(""),[Q,j]=x.useState(!1),ee=!!(c&&c.length>0);x.useEffect(()=>{async function ae(){try{if(ee){const H=await fetch("/api/studio/fonts/assignments");if(H.ok){const G=await H.json();b(G.assignments||[])}}else if(i){const[H,G]=await Promise.all([fetch("/api/studio/fonts/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:i})}),fetch("/api/studio/fonts/assignments")]);if(H.ok){const oe=await H.json();D(oe),M(new Set(oe.assignments||[]))}if(G.ok){const oe=await G.json();b(oe.assignments||[])}}}catch(H){console.error("Failed to load data:",H)}finally{p(!1)}}ae()},[i,ee]);const te=ae=>{j(!0),M(H=>{const G=new Set(H);return G.has(ae)?G.delete(ae):G.add(ae),G})},ce=()=>{const ae=E.trim().toLowerCase();if(ae){if(!/^[a-z][a-z0-9]*$/.test(ae)){k("Name must start with a letter and contain only letters and numbers");return}j(!0),M(H=>new Set([...H,ae])),Y(""),k("")}},V=()=>{Q&&!window.confirm("You have unsaved changes. Discard them?")||d()},P=()=>{const ae=Array.from(L);ae.length!==0&&f(ae)};if(h)return r("div",{css:Le.overlay,children:r("div",{css:Le.modal,children:r("div",{css:Le.loading,children:r("div",{css:Le.loadingSpinner})})})});const I=!ee&&v!==null&&v.ttfFiles.length===0&&v.woff2Files.length===0;return r("div",{css:Le.overlay,onClick:V,children:y("div",{css:Le.modal,onClick:ae=>ae.stopPropagation(),children:[r("div",{css:Le.header,children:r("h3",{css:Le.title,children:"Assign Web Font"})}),y("div",{css:Le.body,children:[ee?y("div",{css:Le.section,children:[y("p",{css:Le.sectionLabel,children:["Selected Files (",c.length,")"]}),y("div",{css:[Le.statusBadge,Le.statusReady,"",""],children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),c.length," woff2 file",c.length>1?"s":""," selected"]}),y("div",{css:Le.fontList,children:[c.slice(0,10).map((ae,H)=>r("span",{css:Le.fontChip,children:ae.split("/").pop()},H)),c.length>10&&y("span",{css:Le.fontChip,children:["+",c.length-10," more"]})]})]}):y(Pe,{children:[y("div",{css:Le.section,children:[r("p",{css:Le.sectionLabel,children:"Font Folder"}),y("div",{css:Le.folderName,children:[r("svg",{css:Le.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})}),v?.folderName||i?.split("/").pop()]}),v&&r("div",{css:[Le.statusBadge,v.needsGeneration?Le.statusNeedsGen:Le.statusReady,"",""],children:v.needsGeneration?y(Pe,{children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"woff2 files will be generated (",v.ttfFiles.length," TTF files)"]}):y(Pe,{children:[r("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"woff2 files ready (",v.woff2Files.length," files)"]})})]}),v&&v.detectedFonts.length>0&&y("div",{css:Le.section,children:[r("p",{css:Le.sectionLabel,children:"Detected Fonts"}),r("div",{css:Le.fontList,children:v.detectedFonts.map((ae,H)=>y("span",{css:Le.fontChip,children:[ae.weightName,ae.style==="italic"?" Italic":""]},H))})]}),v&&v.needsGeneration&&y("div",{css:Le.section,children:[r("p",{css:Le.sectionLabel,children:"TTF Files to Convert"}),y("div",{css:Le.fontList,children:[v.ttfFiles.slice(0,8).map((ae,H)=>r("span",{css:Le.fontChip,children:ae},H)),v.ttfFiles.length>8&&y("span",{css:Le.fontChip,children:["+",v.ttfFiles.length-8," more"]})]})]})]}),!I&&y("div",{css:Le.section,children:[r("p",{css:Le.sectionLabel,children:"Assign To"}),w.length>0?r("div",{css:Le.checkboxList,children:w.map(ae=>y("label",{css:Le.checkboxLabel,children:[r("input",{type:"checkbox",css:Le.checkbox,checked:L.has(ae.name),onChange:()=>te(ae.name)}),r("span",{css:Le.checkboxText,children:ae.name})]},ae.name))}):r("p",{css:Le.emptyText,children:"No existing font assignments"}),Array.from(L).filter(ae=>!w.find(H=>H.name===ae)).map(ae=>y("label",{css:[Le.checkboxLabel,"margin-top:8px;",""],children:[r("input",{type:"checkbox",css:Le.checkbox,checked:!0,onChange:()=>te(ae)}),y("span",{css:Le.checkboxText,children:[ae," (new)"]})]},ae)),y("div",{css:Le.addNewRow,children:[r("input",{type:"text",css:Le.addNewInput,placeholder:"Add new assignment...",value:E,onChange:ae=>{Y(ae.target.value),k("")},onKeyDown:ae=>{ae.key==="Enter"&&(ae.preventDefault(),ce())}}),r("button",{css:Le.addNewBtn,onClick:ce,disabled:!E.trim(),children:"Add"})]}),B&&r("p",{css:Le.errorText,children:B})]}),I&&r("div",{css:Le.section,children:r("p",{css:Le.emptyText,children:"This folder does not contain any TTF or woff2 font files."})})]}),y("div",{css:Le.footer,children:[r("button",{css:[Le.btn,Le.btnCancel,"",""],onClick:V,children:"Cancel"}),y("button",{css:[Le.btn,Le.btnConfirm,"",""],onClick:P,disabled:L.size===0||I,children:["Assign Font",L.size>1?"s":""]})]})]})})}const z2=Ut`
108
+ from { opacity: 0; }
109
+ to { opacity: 1; }
110
+ `,M2=Ut`
111
+ from {
112
+ opacity: 0;
113
+ transform: translateY(-8px) scale(0.98);
114
+ }
115
+ to {
116
+ opacity: 1;
117
+ transform: translateY(0) scale(1);
118
+ }
119
+ `,D2=Ut`
120
+ from { transform: rotate(0deg); }
121
+ to { transform: rotate(360deg); }
122
+ `,Wt={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",z2," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:480px;width:90%;max-height:80vh;overflow:hidden;animation:",M2," 0.2s ease-out;display:flex;flex-direction:column;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),body:{name:"amghpa",styles:"padding:16px 24px 24px;overflow-y:auto;flex:1"},assignmentList:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"},assignmentRow:g("display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:",s.background,";border-radius:8px;border:1px solid ",s.border,";",""),assignmentInfo:{name:"nj7tus",styles:"display:flex;align-items:center;gap:8px;flex:1;min-width:0"},assignmentName:g("font-size:",q.base,";font-weight:500;color:",s.text,";",""),assignmentFolder:g("font-size:",q.sm,";color:",s.textMuted,";&::before{content:'→';margin-right:6px;color:",s.textMuted,";}",""),deleteBtn:g("padding:6px 12px;font-size:",q.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;&:hover{background:",s.dangerLight,";border-color:",s.danger,";color:",s.danger,";}",""),confirmRow:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},confirmBtn:g("padding:6px 12px;font-size:",q.sm,";font-weight:500;background:",s.danger,";border:1px solid ",s.danger,";border-radius:4px;cursor:pointer;color:white;transition:all 0.15s ease;&:hover{background:",s.dangerHover,";border-color:",s.dangerHover,";}",""),cancelBtn:g("padding:6px 12px;font-size:",q.sm,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}",""),emptyText:g("font-size:",q.base,";color:",s.textMuted,";text-align:center;padding:32px 0;",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid ",s.border,";background-color:",s.background,";",""),btn:g("padding:10px 18px;font-size:",q.base,";font-weight:500;border-radius:6px;cursor:pointer;transition:all 0.15s ease;letter-spacing:-0.01em;",""),btnPrimary:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover{background-color:",s.primaryHover,";border-color:",s.primaryHover,";}",""),loading:{name:"uphaut",styles:"display:flex;align-items:center;justify-content:center;padding:40px"},loadingSpinner:g("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",D2," 0.8s linear infinite;","")};function A2({onClose:i,onRefresh:c}){const[f,d]=x.useState(!0),[h,p]=x.useState([]),[v,D]=x.useState(null),w=x.useCallback(async()=>{try{const E=await fetch("/api/studio/fonts/assignments");if(E.ok){const Y=await E.json();p(Y.assignments||[])}}catch(E){console.error("Failed to load assignments:",E)}finally{d(!1)}},[]);x.useEffect(()=>{w()},[w]);const b=E=>{D(E)},L=()=>{D(null)},M=async E=>{try{(await fetch("/api/studio/fonts/delete-assignment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})})).ok&&(p(B=>B.filter(k=>k.name!==E)),D(null),c?.())}catch(Y){console.error("Failed to delete assignment:",Y)}};return r("div",{css:Wt.overlay,onClick:i,children:y("div",{css:Wt.modal,onClick:E=>E.stopPropagation(),children:[r("div",{css:Wt.header,children:r("h3",{css:Wt.title,children:"Font Assignments"})}),r("div",{css:Wt.body,children:f?r("div",{css:Wt.loading,children:r("div",{css:Wt.loadingSpinner})}):h.length===0?y("p",{css:Wt.emptyText,children:["No font assignments yet.",r("br",{}),'Select a folder and click "Assign Web Font" to create one.']}):r("div",{css:Wt.assignmentList,children:h.map(E=>y("div",{css:Wt.assignmentRow,children:[y("div",{css:Wt.assignmentInfo,children:[r("span",{css:Wt.assignmentName,children:E.name}),r("span",{css:Wt.assignmentFolder,children:E.folder})]}),v===E.name?y("div",{css:Wt.confirmRow,children:[r("button",{css:Wt.confirmBtn,onClick:()=>M(E.name),children:"Delete?"}),r("button",{css:Wt.cancelBtn,onClick:L,children:"Cancel"})]}):r("button",{css:Wt.deleteBtn,onClick:()=>b(E.name),children:"Delete"})]},E.name))})}),r("div",{css:Wt.footer,children:r("button",{css:[Wt.btn,Wt.btnPrimary,"",""],onClick:i,children:"Done"})})]})})}const T2=Ut`
123
+ from { opacity: 0; }
124
+ to { opacity: 1; }
125
+ `,L2=Ut`
126
+ from {
127
+ opacity: 0;
128
+ transform: translateY(-8px) scale(0.98);
129
+ }
130
+ to {
131
+ opacity: 1;
132
+ transform: translateY(0) scale(1);
133
+ }
134
+ `,Jt={overlay:g("position:fixed;inset:0;background-color:rgba(26, 31, 54, 0.4);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;animation:",T2," 0.15s ease-out;font-family:",dl,";",""),modal:g(Ra," background-color:",s.surface,";border-radius:12px;box-shadow:0 30px 60px -12px rgba(50, 50, 93, 0.25),0 18px 36px -18px rgba(0, 0, 0, 0.3);max-width:520px;width:90%;animation:",L2," 0.2s ease-out;overflow:hidden;",""),header:{name:"nsgk6m",styles:"padding:24px 24px 0"},title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0;letter-spacing:-0.02em;",""),content:{name:"vxuddk",styles:"padding:24px"},dropzone:g("border:2px dashed ",s.border,";border-radius:8px;padding:40px 24px;text-align:center;cursor:pointer;transition:all 0.15s ease;background-color:",s.background,";&:hover{border-color:",s.primary,";background-color:",s.primaryLight,";}",""),dropzoneActive:g("border-color:",s.primary,";background-color:",s.primaryLight,";",""),dropzoneIcon:g("width:48px;height:48px;color:",s.textMuted,";margin:0 auto 16px;",""),dropzoneText:g("font-size:",q.base,";color:",s.text,";margin:0 0 8px;",""),dropzoneHint:g("font-size:",q.sm,";color:",s.textMuted,";margin:0;",""),fileList:{name:"1kqpffn",styles:"margin-top:16px;max-height:200px;overflow-y:auto"},fileItem:g("display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:",s.background,";border-radius:6px;margin-bottom:4px;font-size:",q.sm,";&:last-child{margin-bottom:0;}",""),fileName:g("color:",s.text,";overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;margin-right:8px;",""),fileSize:g("color:",s.textMuted,";flex-shrink:0;",""),removeBtn:g("background:none;border:none;color:",s.textMuted,";cursor:pointer;padding:4px;margin-left:8px;&:hover{color:",s.danger,";}",""),footer:g("display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;background-color:",s.background,";border-top:1px solid ",s.border,";",""),btn:g("padding:10px 20px;border-radius:6px;font-size:",q.base,";font-weight:500;cursor:pointer;transition:all 0.15s ease;",""),btnSecondary:g("background-color:",s.surface,";border:1px solid ",s.border,";color:",s.text,";&:hover{background-color:",s.background,";}",""),btnPrimary:g("background-color:",s.primary,";border:1px solid ",s.primary,";color:white;&:hover:not(:disabled){background-color:",s.primaryHover,";}&:disabled{opacity:0.5;cursor:not-allowed;}","")};function E2(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function R2({currentPath:i,onClose:c,onUploadComplete:f,setShowProgress:d,setProgressTitle:h,setProgress:p}){const[v,D]=x.useState([]),[w,b]=x.useState(!1),L=x.useRef(null),M=x.useRef(!1),E=x.useCallback(Q=>{if(Q){const j=Array.from(Q).filter(ee=>ee.name.toLowerCase().endsWith(".ttf"));D(ee=>[...ee,...j])}},[]),Y=x.useCallback(Q=>{Q.preventDefault(),b(!1),E(Q.dataTransfer.files)},[E]),B=x.useCallback(Q=>{D(j=>j.filter((ee,te)=>te!==Q))},[]),k=x.useCallback(async()=>{if(v.length===0)return;c(),M.current=!1,h("Uploading Font Files"),d(!0),p({current:0,total:v.length,percent:0,status:"processing",message:"Uploading..."});let Q=0;const j=[];for(let ee=0;ee<v.length;ee++){if(M.current){p(V=>({...V,status:"complete",message:`Stopped. Uploaded ${Q} file${Q!==1?"s":""}.`})),f();return}const te=v[ee];p({current:ee,total:v.length,percent:Math.round(ee/v.length*100),status:"processing",message:`Uploading ${te.name}...`}),await new Promise(V=>setTimeout(V,500));const ce=new FormData;ce.append("file",te),ce.append("path",i);try{(await fetch("/api/studio/fonts/upload",{method:"POST",body:ce})).ok?Q++:j.push(te.name)}catch{j.push(te.name)}}p({current:Q,total:v.length,percent:100,status:"complete",message:j.length>0?`Uploaded ${Q} file${Q!==1?"s":""}. ${j.length} failed.`:`Uploaded ${Q} file${Q!==1?"s":""} successfully.`}),f()},[v,i,c,f,d,h,p]);return r("div",{css:Jt.overlay,onClick:c,children:y("div",{css:Jt.modal,onClick:Q=>Q.stopPropagation(),children:[r("div",{css:Jt.header,children:r("h2",{css:Jt.title,children:"Add Font Files"})}),y("div",{css:Jt.content,children:[r("input",{ref:L,type:"file",multiple:!0,accept:".ttf",style:{display:"none"},onChange:Q=>E(Q.target.files)}),y("div",{css:[Jt.dropzone,w&&Jt.dropzoneActive,"",""],onClick:()=>L.current?.click(),onDragOver:Q=>{Q.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:Y,children:[r("svg",{css:Jt.dropzoneIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),r("p",{css:Jt.dropzoneText,children:w?"Drop files here":"Click to select or drag and drop"}),r("p",{css:Jt.dropzoneHint,children:"TTF font files only"})]}),v.length>0&&r("div",{css:Jt.fileList,children:v.map((Q,j)=>y("div",{css:Jt.fileItem,children:[r("span",{css:Jt.fileName,children:Q.name}),r("span",{css:Jt.fileSize,children:E2(Q.size)}),r("button",{css:Jt.removeBtn,onClick:()=>B(j),children:r("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},`${Q.name}-${j}`))})]}),y("div",{css:Jt.footer,children:[r("button",{css:[Jt.btn,Jt.btnSecondary,"",""],onClick:c,children:"Cancel"}),y("button",{css:[Jt.btn,Jt.btnPrimary,"",""],onClick:k,disabled:v.length===0,children:["Upload ",v.length>0&&`(${v.length})`]})]})]})})}const du="36px",_2=Ut`
135
+ to { transform: rotate(360deg); }
136
+ `,St={toolbar:g("display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background-color:",s.surface,";border-bottom:1px solid ",s.border,";@media (min-width: 768px){padding:12px 24px;}",""),toolbarLeft:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},toolbarRight:{name:"17nohj2",styles:"display:flex;flex-wrap:nowrap;flex-shrink:0;align-items:center;gap:8px"},btn:g("display:inline-flex;align-items:center;justify-content:center;gap:6px;height:",du,";padding:0 14px;border-radius:6px;font-size:",q.base,";font-weight:500;background:",s.surface,";border:1px solid ",s.border,";cursor:pointer;transition:all 0.15s ease;color:",s.text,";&:hover:not(:disabled){background-color:",s.surfaceHover,";border-color:",s.borderHover,";}&:disabled{cursor:not-allowed;opacity:0.5;}",""),btnPrimary:g("background:",s.primary,";border-color:",s.primary,";color:white;&:hover:not(:disabled){background:",s.primaryHover,";border-color:",s.primaryHover,";}",""),btnDanger:g("color:",s.danger,";&:hover:not(:disabled){background-color:",s.dangerLight,";border-color:",s.danger,";}",""),btnIcon:{name:"157xhr7",styles:"width:16px;height:16px"},selectionCount:g("font-size:",q.base,";color:",s.textSecondary,";display:flex;align-items:center;gap:8px;margin-right:8px;",""),clearBtn:g("color:",s.primary,";background:none;border:none;cursor:pointer;font-size:",q.base,";font-weight:500;padding:0;&:hover{text-decoration:underline;}",""),searchInput:g("height:",du,";padding:0 10px;border-radius:6px;font-size:",q.base,";background:",s.surface,";border:1px solid ",s.border,";color:",s.text,";width:160px;transition:all 0.15s ease;&:focus{outline:none;border-color:",s.primary,";box-shadow:0 0 0 2px ",s.primaryLight,";}&::placeholder{color:",s.textMuted,";}",""),viewToggle:g("display:flex;align-items:center;height:",du,";background-color:",s.surface,";border:1px solid ",s.border,";border-radius:6px;overflow:hidden;",""),viewBtn:g("height:100%;padding:0 10px;background:transparent;border:none;cursor:pointer;color:",s.textSecondary,";transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{color:",s.text,";background-color:",s.surfaceHover,";}",""),viewBtnActive:g("background-color:",s.primaryLight,";color:",s.primary,";&:hover{background-color:",s.primaryLight,";color:",s.primary,";}",""),iconSpin:g("animation:",_2," 1s linear infinite;","")};function O2({showUploadButton:i,selectedItems:c,someItemsSelected:f,singleFileSelected:d,singleFolderSelected:h,canAssign:p,hasSelectedWoff2Files:v,selectedWoff2Files:D,refreshing:w,viewMode:b,searchQuery:L,onAddNew:M,onRenameFile:E,onRenameFolder:Y,onNewFolder:B,onDelete:k,onAssign:Q,onClearSelection:j,onSearchChange:ee,onRefresh:te,onViewModeChange:ce,onShowSettings:V}){return y("div",{css:St.toolbar,children:[y("div",{css:St.toolbarLeft,children:[i&&y("button",{css:[St.btn,St.btnPrimary,"",""],onClick:M,children:[r(B2,{}),"Add New"]}),y("button",{css:St.btn,onClick:()=>{d?E():h?Y():B()},children:[d||h?r(j2,{}):r(H2,{}),d?"Rename File":h?"Rename Folder":"New Folder"]}),y("button",{css:[St.btn,St.btnDanger,"",""],onClick:k,disabled:c.size===0,children:[r(U2,{}),"Delete"]}),y("button",{css:St.btn,onClick:Q,disabled:!p,title:p?v?`Assign ${D.length} woff2 file${D.length>1?"s":""}`:"Assign web font":"Select a folder or woff2 files to assign",children:[r(N2,{}),"Assign Web Font"]})]}),y("div",{css:St.toolbarRight,children:[f&&y("span",{css:St.selectionCount,children:[c.size," selected",r("button",{css:St.clearBtn,onClick:j,children:"Clear"})]}),r("input",{type:"text",css:St.searchInput,placeholder:"Search fonts...",value:L,onChange:ee}),r("button",{css:St.btn,onClick:te,title:"Refresh view",disabled:w,children:r(q2,{spinning:w})}),y("div",{css:St.viewToggle,children:[r("button",{css:[St.viewBtn,b==="grid"&&St.viewBtnActive,"",""],onClick:()=>ce("grid"),"aria-label":"Grid view",children:r(Y2,{})}),r("button",{css:[St.viewBtn,b==="list"&&St.viewBtnActive,"",""],onClick:()=>ce("list"),"aria-label":"List view",children:r(G2,{})})]}),r("button",{css:St.btn,onClick:V,title:"Font assignments settings",children:r(X2,{})})]})]})}function B2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}function H2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})})}function U2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})}function j2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}function N2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})})}function q2({spinning:i}){return r("svg",{css:[St.btnIcon,i&&St.iconSpin,"",""],fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function Y2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function G2(){return r("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}function X2(){return y("svg",{css:St.btnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function V2(i){return i<1024?i+" B":i<1024*1024?(i/1024).toFixed(1)+" KB":(i/(1024*1024)).toFixed(1)+" MB"}const at={selectAllRow:g("display:flex;align-items:center;gap:24px;margin-bottom:16px;padding:12px 16px;background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";",""),selectAllLabel:g("display:flex;align-items:center;gap:10px;font-size:",q.base,";font-weight:500;color:",s.textSecondary,";cursor:pointer;&:hover{color:",s.text,";}",""),selectAllCheckbox:g("width:16px;height:16px;accent-color:",s.primary,";",""),grid:{name:"el23hk",styles:"display:grid;grid-template-columns:1fr;gap:12px;@media (min-width: 480px){grid-template-columns:repeat(2, 1fr);}@media (min-width: 768px){grid-template-columns:repeat(3, 1fr);}@media (min-width: 1024px){grid-template-columns:repeat(4, 1fr);}@media (min-width: 1280px){grid-template-columns:repeat(5, 1fr);}"},item:g("position:relative;border-radius:8px;border:1px solid ",s.border,";overflow:hidden;cursor:pointer;transition:all 0.15s ease;background-color:",s.surface,";user-select:none;box-shadow:0 1px 2px rgba(0, 0, 0, 0.04);&:hover{border-color:#d0d5dd;box-shadow:0 2px 4px rgba(0, 0, 0, 0.06);}",""),itemSelected:g("border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";&:hover{border-color:",s.primary,";box-shadow:0 0 0 1px ",s.primary,";}",""),checkboxWrapper:{name:"v3lnpt",styles:"position:absolute;top:0;left:0;z-index:10;padding:8px;cursor:pointer"},checkbox:g("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),itemContent:g("position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:16px;background:",s.background,";",""),folderIcon:{name:"k1w47f",styles:"width:56px;height:56px;color:#f9935e"},parentIcon:g("width:56px;height:56px;color:",s.textMuted,";",""),fileIcon:g("width:40px;height:40px;color:",s.textMuted,";",""),openBtn:g("position:absolute;bottom:8px;right:8px;z-index:10;height:28px;font-size:",q.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 8px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:flex;align-items:center;box-shadow:0 1px 2px rgba(0, 0, 0, 0.08);&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),label:g("padding:10px 12px;background-color:",s.surface,";border-top:1px solid ",s.borderLight,";",""),labelName:g("font-size:",q.sm,";font-weight:500;color:",s.text,";margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",""),labelMeta:g("font-size:",q.xs,";color:",s.textMuted,";margin:2px 0 0 0;",""),copyBtn:g("position:absolute;top:8px;right:8px;z-index:10;width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:",s.surface,";border:1px solid ",s.border,";border-radius:4px;cursor:pointer;opacity:0;transition:opacity 0.15s ease;box-shadow:0 1px 2px rgba(0, 0, 0, 0.08);color:",s.textSecondary,";&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";color:",s.primary,";}.studio-item:hover &{opacity:1;}",""),copyBtnVisible:g("opacity:1;color:",s.primary,";",""),copyBtnIcon:{name:"1djxupe",styles:"width:14px;height:14px"},badge:{name:"1ue8xbs",styles:"width:8px;height:8px;border-radius:50%;flex-shrink:0"},badgeGray:{name:"a0o945",styles:"background-color:#9ca3af"},badgeYellow:{name:"yqs32k",styles:"background-color:#eab308"},badgeGreen:{name:"b752gh",styles:"background-color:#10b981"},badgeWrapper:{name:"1pi78hi",styles:"display:flex;align-items:center;gap:6px"}};function F2({items:i,filteredItems:c,selectedItems:f,allItemsSelected:d,someItemsSelected:h,copiedPath:p,folderStatuses:v,isAtRoot:D,onItemClick:w,onOpen:b,onNavigateUp:L,onSelectAll:M,onSelectAllWoff:E,onSelectAllTtf:Y,onCopyPath:B}){return y(Pe,{children:[i.length>0&&y("div",{css:at.selectAllRow,children:[y("label",{css:at.selectAllLabel,children:[r("input",{type:"checkbox",css:at.selectAllCheckbox,checked:d,ref:k=>{k&&(k.indeterminate=h&&!d)},onChange:M}),"Select all (",i.length,")"]}),i.some(k=>k.name.toLowerCase().endsWith(".woff2"))&&y("label",{css:at.selectAllLabel,children:[r("input",{type:"checkbox",css:at.selectAllCheckbox,checked:i.filter(k=>k.name.toLowerCase().endsWith(".woff2")).every(k=>f.has(k.path)),onChange:E}),"WOFF2"]}),i.some(k=>k.name.toLowerCase().endsWith(".ttf"))&&y("label",{css:at.selectAllLabel,children:[r("input",{type:"checkbox",css:at.selectAllCheckbox,checked:i.filter(k=>k.name.toLowerCase().endsWith(".ttf")).every(k=>f.has(k.path)),onChange:Y}),"TTF"]})]}),y("div",{css:at.grid,children:[!D&&y("div",{css:at.item,onClick:L,onDoubleClick:L,children:[r("div",{css:at.itemContent,children:r(K2,{})}),y("div",{css:at.label,children:[r("p",{css:at.labelName,children:".."}),r("p",{css:at.labelMeta,children:"Parent folder"})]})]}),c.map(k=>{const Q=f.has(k.path);return y("div",{className:"studio-item",css:[at.item,Q&&at.itemSelected,"",""],onClick:j=>w(k,j),onDoubleClick:()=>b(k),children:[r("div",{css:at.checkboxWrapper,onClick:j=>{j.stopPropagation(),w(k,j)},children:r("input",{type:"checkbox",css:at.checkbox,checked:Q,onChange:()=>{}})}),y("div",{css:at.itemContent,children:[k.type==="file"&&r("button",{css:[at.copyBtn,p===k.path&&at.copyBtnVisible,"",""],onClick:j=>B(k.path,j),title:p===k.path?"Copied!":"Copy path",children:p===k.path?r(W2,{}):r($2,{})}),r("button",{css:at.openBtn,onClick:j=>{j.stopPropagation(),b(k)},children:"Open"}),k.type==="folder"?r(Q2,{}):r(Z2,{})]}),y("div",{css:at.label,children:[r("p",{css:at.labelName,children:y("span",{css:at.badgeWrapper,children:[k.type==="folder"&&v[k.path]&&r("span",{css:[at.badge,v[k.path].assignments.length>0?at.badgeGreen:v[k.path].hasWoff2?at.badgeYellow:at.badgeGray,"",""],title:v[k.path].assignments.length>0?`Assigned to: ${v[k.path].assignments.join(", ")}`:v[k.path].hasWoff2?"woff2 ready":"TTF only"}),k.name]})}),r("p",{css:at.labelMeta,children:k.type==="folder"?`${k.fileCount||0} files`:k.size?V2(k.size):""})]})]},k.path)})]})]})}function Q2(){return r("svg",{css:at.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}function K2(){return r("svg",{css:at.parentIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}function Z2(){return r("svg",{css:at.fileIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}function $2(){return r("svg",{css:at.copyBtnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function W2(){return r("svg",{css:at.copyBtnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function J2(i){return i<1024?i+" B":i<1024*1024?(i/1024).toFixed(1)+" KB":(i/(1024*1024)).toFixed(1)+" MB"}const je={selectAllRow:g("display:flex;align-items:center;gap:24px;margin-bottom:16px;padding:12px 16px;background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";",""),selectAllLabel:g("display:flex;align-items:center;gap:10px;font-size:",q.base,";font-weight:500;color:",s.textSecondary,";cursor:pointer;&:hover{color:",s.text,";}",""),selectAllCheckbox:g("width:16px;height:16px;accent-color:",s.primary,";",""),tableWrapper:g("background:",s.surface,";border-radius:8px;border:1px solid ",s.border,";overflow-x:auto;",""),table:{name:"1ceqwkv",styles:"width:100%;min-width:400px;border-collapse:collapse;white-space:nowrap"},th:g("text-align:left;font-size:11px;color:",s.textMuted,";text-transform:uppercase;letter-spacing:0.05em;padding:12px 16px;font-weight:600;background:",s.background,";border-bottom:1px solid ",s.border,";",""),thCheckbox:{name:"5iz1wr",styles:"width:48px"},thSize:{name:"yct5co",styles:"width:96px"},row:g("cursor:pointer;transition:background-color 0.15s ease;user-select:none;&:hover{background-color:",s.surfaceHover,";}&:not(:last-child) td{border-bottom:1px solid ",s.borderLight,";}",""),rowSelected:g("background-color:",s.primaryLight,";&:hover{background-color:",s.primaryLight,";}",""),parentRow:g("cursor:pointer;border-bottom:1px solid ",s.border,";&:hover{background-color:",s.surfaceHover,";}",""),td:{name:"i563hg",styles:"padding:12px 16px"},checkboxCell:{name:"sahq4q",styles:"padding:12px 16px;cursor:pointer;vertical-align:middle"},checkbox:g("width:18px;height:18px;accent-color:",s.primary,";cursor:pointer;",""),nameCell:{name:"9s3nhy",styles:"display:flex;align-items:center;gap:12px;flex:1"},folderIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},folderIconSmall:{name:"a45yt2",styles:"width:24px;height:24px;color:#f9935e"},fileIconWrapper:{name:"xfecxx",styles:"width:48px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0"},fileIconSmall:g("width:20px;height:20px;color:",s.textMuted,";",""),parentIconSmall:g("width:20px;height:20px;color:",s.textMuted,";flex-shrink:0;",""),name:g("font-size:",q.base,";font-weight:500;color:",s.text,";letter-spacing:-0.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px;",""),meta:g("font-size:",q.sm,";color:",s.textSecondary,";",""),actionsCell:{name:"1w56d5c",styles:"display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-shrink:0"},listOpenBtn:g("height:32px;font-size:",q.sm,";font-weight:500;color:",s.primary,";background:",s.surface,";border:1px solid ",s.border,";padding:0 14px;cursor:pointer;border-radius:4px;transition:all 0.15s ease;display:inline-flex;align-items:center;&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";}",""),listCopyBtn:g("height:28px;width:28px;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;color:",s.textMuted,";transition:all 0.15s ease;flex-shrink:0;&:hover{background-color:",s.primaryLight,";border-color:",s.primary,";color:",s.primary,";}",""),copyBtnIcon:{name:"1djxupe",styles:"width:14px;height:14px"},badge:{name:"1ue8xbs",styles:"width:8px;height:8px;border-radius:50%;flex-shrink:0"},badgeGray:{name:"a0o945",styles:"background-color:#9ca3af"},badgeYellow:{name:"yqs32k",styles:"background-color:#eab308"},badgeGreen:{name:"b752gh",styles:"background-color:#10b981"},badgeWrapper:{name:"1pi78hi",styles:"display:flex;align-items:center;gap:6px"}};function I2({items:i,filteredItems:c,selectedItems:f,allItemsSelected:d,someItemsSelected:h,copiedPath:p,folderStatuses:v,isAtRoot:D,onItemClick:w,onOpen:b,onNavigateUp:L,onSelectAll:M,onSelectAllWoff:E,onSelectAllTtf:Y,onCopyPath:B}){return y(Pe,{children:[i.length>0&&y("div",{css:je.selectAllRow,children:[y("label",{css:je.selectAllLabel,children:[r("input",{type:"checkbox",css:je.selectAllCheckbox,checked:d,ref:k=>{k&&(k.indeterminate=h&&!d)},onChange:M}),"Select all (",i.length,")"]}),i.some(k=>k.name.toLowerCase().endsWith(".woff2"))&&y("label",{css:je.selectAllLabel,children:[r("input",{type:"checkbox",css:je.selectAllCheckbox,checked:i.filter(k=>k.name.toLowerCase().endsWith(".woff2")).every(k=>f.has(k.path)),onChange:E}),"WOFF2"]}),i.some(k=>k.name.toLowerCase().endsWith(".ttf"))&&y("label",{css:je.selectAllLabel,children:[r("input",{type:"checkbox",css:je.selectAllCheckbox,checked:i.filter(k=>k.name.toLowerCase().endsWith(".ttf")).every(k=>f.has(k.path)),onChange:Y}),"TTF"]})]}),r("div",{css:je.tableWrapper,children:y("table",{css:je.table,children:[r("thead",{children:y("tr",{children:[r("th",{css:[je.th,je.thCheckbox,"",""],children:i.length>0&&r("input",{type:"checkbox",css:je.checkbox,checked:d,ref:k=>{k&&(k.indeterminate=h&&!d)},onChange:M})}),r("th",{css:je.th,children:"Name"}),r("th",{css:[je.th,je.thSize,"",""],children:"Size"})]})}),y("tbody",{children:[!D&&y("tr",{css:je.parentRow,onClick:L,children:[r("td",{css:je.td}),r("td",{css:je.td,children:y("div",{css:je.nameCell,children:[r("svg",{css:je.parentIconSmall,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})}),r("span",{css:je.name,children:".."})]})}),r("td",{css:[je.td,je.meta,"",""],children:"Parent folder"})]}),c.map(k=>{const Q=f.has(k.path);return y("tr",{css:[je.row,Q&&je.rowSelected,"",""],onClick:j=>w(k,j),children:[r("td",{css:[je.td,je.checkboxCell,"",""],onClick:j=>j.stopPropagation(),children:r("input",{type:"checkbox",css:je.checkbox,checked:Q,onChange:()=>w(k,{})})}),r("td",{css:je.td,children:y("div",{css:je.nameCell,children:[k.type==="folder"?r("div",{css:je.folderIconWrapper,children:r("svg",{css:je.folderIconSmall,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}):r("div",{css:je.fileIconWrapper,children:r("svg",{css:je.fileIconSmall,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),y("span",{css:je.badgeWrapper,children:[k.type==="folder"&&v[k.path]&&r("span",{css:[je.badge,v[k.path].assignments.length>0?je.badgeGreen:v[k.path].hasWoff2?je.badgeYellow:je.badgeGray,"",""],title:v[k.path].assignments.length>0?`Assigned to: ${v[k.path].assignments.join(", ")}`:v[k.path].hasWoff2?"woff2 ready":"TTF only"}),r("span",{css:je.name,title:k.name,children:k.name})]}),y("div",{css:je.actionsCell,children:[k.type==="file"&&r("button",{css:je.listCopyBtn,onClick:j=>B(k.path,j),title:p===k.path?"Copied!":"Copy path",children:p===k.path?r(eb,{}):r(P2,{})}),r("button",{css:je.listOpenBtn,onClick:j=>{j.stopPropagation(),b(k)},children:"Open"})]})]})}),r("td",{css:[je.td,je.meta,"",""],children:k.type==="folder"?`${k.fileCount||0} files`:k.size?J2(k.size):"--"})]},k.path)})]})]})})]})}function P2(){return r("svg",{css:je.copyBtnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function eb(){return r("svg",{css:je.copyBtnIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}const tb=Ut`
137
+ to { transform: rotate(360deg); }
138
+ `,Dn={container:{name:"xt6tct",styles:"flex:1;display:flex;flex-direction:column;overflow:hidden"},toolbar:g("display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background-color:",s.surface,";border-bottom:1px solid ",s.border,";@media (min-width: 768px){padding:12px 24px;}",""),content:{name:"1tznmxd",styles:"flex:1;overflow:auto;padding:20px 24px"},loading:{name:"1d2ui9i",styles:"display:flex;align-items:center;justify-content:center;flex:1;min-height:300px"},spinner:g("width:32px;height:32px;border-radius:50%;border:3px solid ",s.border,";border-top-color:",s.primary,";animation:",tb," 0.8s linear infinite;",""),empty:g("display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:300px;color:",s.textSecondary,";",""),emptyIcon:{name:"1o3cbsn",styles:"width:48px;height:48px;margin-bottom:16px;opacity:0.5"},emptyText:g("font-size:",q.base,";margin:0 0 4px 0;&:last-child{color:",s.textMuted,";font-size:",q.sm,";}",""),dropOverlay:g("position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(99, 91, 255, 0.1);border:3px dashed ",s.primary,";border-radius:8px;display:flex;align-items:center;justify-content:center;z-index:50;pointer-events:none;",""),dropMessage:g("display:flex;flex-direction:column;align-items:center;gap:12px;color:",s.primary,";font-size:",q.lg,";font-weight:600;",""),dropIcon:{name:"18jhpep",styles:"width:48px;height:48px"},createBtn:g("margin-top:16px;padding:10px 24px;font-size:",q.base,";font-weight:500;background:",s.primary,";color:white;border:none;border-radius:8px;cursor:pointer;transition:background 0.15s ease;&:hover{background:",s.primaryHover,";}",""),folderIcon:{name:"k1w47f",styles:"width:56px;height:56px;color:#f9935e"}};function nb({currentPath:i,setCurrentPath:c,refreshKey:f,triggerRefresh:d}){const[h,p]=x.useState([]),[v,D]=x.useState(!0),[w,b]=x.useState(new Set),[L,M]=x.useState(!1),[E,Y]=x.useState(!1),[B,k]=x.useState(!1),[Q,j]=x.useState(!1),[ee,te]=x.useState(!1),[ce,V]=x.useState(!1),[P,I]=x.useState("grid"),[ae,H]=x.useState(!1),[G,oe]=x.useState(!1),[fe,de]=x.useState(!1),[le,Me]=x.useState(!1),[T,$]=x.useState(!1),[J,De]=x.useState({status:"idle",current:0,total:0,percent:0}),[Xe,S]=x.useState("Processing"),[U,ne]=x.useState(null),[re,ke]=x.useState({}),[Te,Ye]=x.useState(null),[gt,Be]=x.useState(""),[nn,Ze]=x.useState(null),{execute:et,stop:xt}=wu({setShowProgress:$,setProgressTitle:S,setProgressState:De,triggerRefresh:d}),_t=x.useCallback(async()=>{try{D(!0);const me=await fetch(`/api/studio/fonts/list?path=${encodeURIComponent(i)}`);if(me.ok){const Ve=await me.json();p(Ve.items||[]),M(Ve.canCreate===!0)}}catch(me){console.error("Failed to fetch fonts:",me),p([])}finally{D(!1)}},[i]);x.useEffect(()=>{_t(),b(new Set)},[_t,f]);const jt=x.useCallback(async me=>{const Ve={};for(const Fe of me)if(Fe.type==="folder")try{const tt=await fetch("/api/studio/fonts/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:Fe.path})});if(tt.ok){const dt=await tt.json();Ve[Fe.path]={needsGeneration:dt.needsGeneration,hasWoff2:dt.woff2Files?.length>0,assignments:dt.assignments||[]}}}catch{}ke(Ve)},[]);x.useEffect(()=>{const me=h.filter(Ve=>Ve.type==="folder");me.length>0&&i.startsWith("_fonts")&&jt(me)},[h,i,jt]);const Ft=gt?h.filter(me=>me.name.toLowerCase().includes(gt.toLowerCase())):h,Pt=i==="_fonts",fn=x.useCallback((me,Ve)=>{if(Ve.stopPropagation(),Ve.shiftKey&&Te){const Fe=h.findIndex(dt=>dt.path===Te),tt=h.findIndex(dt=>dt.path===me.path);if(Fe!==-1&&tt!==-1){const dt=Math.min(Fe,tt),an=Math.max(Fe,tt);b(hn=>{const mt=new Set(hn);for(let Lt=dt;Lt<=an;Lt++)mt.add(h[Lt].path);return mt})}}else b(Fe=>{const tt=new Set(Fe);return tt.has(me.path)?tt.delete(me.path):tt.add(me.path),tt});Ye(me.path)},[h,Te]),en=x.useCallback(me=>{me.type==="folder"&&(c(me.path),b(new Set))},[c]),rt=x.useCallback(()=>{const me=i.split("/");me.pop();const Ve=me.join("/")||"_fonts";c(Ve),b(new Set)},[i,c]),Nt=h.length>0&&w.size===h.length,pe=w.size>0,Wn=x.useCallback(()=>{b(Nt?new Set:new Set(h.map(me=>me.path)))},[Nt,h]),Ot=x.useCallback(()=>{b(new Set),Ye(null)},[]),mn=x.useCallback(()=>{const me=h.filter(Fe=>Fe.type==="file"&&Fe.name.toLowerCase().endsWith(".woff2")),Ve=me.every(Fe=>w.has(Fe.path));b(Ve?Fe=>{const tt=new Set(Fe);return me.forEach(dt=>tt.delete(dt.path)),tt}:Fe=>{const tt=new Set(Fe);return me.forEach(dt=>tt.add(dt.path)),tt})},[h,w]),Tn=x.useCallback(()=>{const me=h.filter(Fe=>Fe.type==="file"&&Fe.name.toLowerCase().endsWith(".ttf")),Ve=me.every(Fe=>w.has(Fe.path));b(Ve?Fe=>{const tt=new Set(Fe);return me.forEach(dt=>tt.delete(dt.path)),tt}:Fe=>{const tt=new Set(Fe);return me.forEach(dt=>tt.add(dt.path)),tt})},[h,w]),xn=x.useCallback((me,Ve)=>{Ve.stopPropagation(),navigator.clipboard.writeText(me).then(()=>{Ze(me),setTimeout(()=>Ze(null),1500)})},[]),vn=x.useCallback(async()=>{H(!0),await _t(),H(!1)},[_t]),Z=Array.from(w),ie=Z.length===1&&h.find(me=>me.path===Z[0])?.type==="folder",Re=ie?Z[0]:null,ut=Re&&Re.split("/").pop()||"",Ne=Z.length===1&&h.find(me=>me.path===Z[0])?.type==="file",Ce=Ne?Z[0]:null,Ct=Ce&&Ce.split("/").pop()||"",lt=Z.filter(me=>{const Ve=h.find(Fe=>Fe.path===me);return Ve?.type==="file"&&Ve.name.toLowerCase().endsWith(".woff2")}),na=lt.length>0,Nn=ie||na,ko=x.useCallback(()=>{Nn&&de(!0)},[Nn]),_a=x.useCallback(async me=>{de(!1),await et({endpoint:"/api/studio/fonts/assign-stream",body:ie?{folder:Re,assignments:me}:{files:lt,assignments:me},title:"Assigning Web Font",operationType:"process"})},[Re,ie,lt,et]),Oa=x.useCallback(()=>{$(!1),De({status:"idle",current:0,total:0,percent:0})},[]),ua=x.useCallback(async me=>{Re&&(k(!1),await et({endpoint:"/api/studio/fonts/rename-stream",body:{oldPath:Re,newName:me},title:"Renaming Folder",onComplete:()=>b(new Set)}))},[Re,et]),Jn=x.useCallback(async me=>{if(Ce){j(!1);try{(await fetch("/api/studio/fonts/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:Ce,newName:me})})).ok&&(b(new Set),d())}catch(Ve){console.error("Rename file failed:",Ve)}}},[Ce,d]),Ba=x.useCallback(()=>{w.size!==0&&V(!0)},[w.size]),da=x.useCallback(async()=>{V(!1),await et({endpoint:"/api/studio/fonts/delete-stream",body:{paths:Array.from(w)},title:"Deleting Files",operationType:"delete",onComplete:()=>b(new Set)})},[w,et]),Rl=x.useCallback(()=>{te(!0)},[]),_l=x.useCallback(async me=>{te(!1);try{(await fetch("/api/studio/fonts/create-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,name:me})})).ok&&d()}catch(Ve){console.error("Create folder failed:",Ve)}},[i,d]),fl=x.useCallback(me=>{me.preventDefault(),me.stopPropagation(),i.startsWith("_fonts")&&Y(!0)},[i]),fa=x.useCallback(me=>{me.preventDefault(),me.stopPropagation(),Y(!1)},[]),zo=x.useCallback(async me=>{if(me.preventDefault(),me.stopPropagation(),Y(!1),!i.startsWith("_fonts"))return;const Ve=Array.from(me.dataTransfer.files).filter(dt=>dt.name.toLowerCase().endsWith(".ttf")||dt.name.toLowerCase().endsWith(".otf"));if(Ve.length===0)return;S("Uploading Files"),$(!0),De({status:"processing",current:0,total:Ve.length,percent:0,message:"Uploading..."});let Fe=0;const tt=[];for(let dt=0;dt<Ve.length;dt++){const an=Ve[dt],hn=new FormData;hn.append("file",an),hn.append("path",i);try{(await fetch("/api/studio/fonts/upload",{method:"POST",body:hn})).ok?Fe++:tt.push(an.name)}catch(mt){console.error("Upload failed:",mt),tt.push(an.name)}De({status:"processing",current:dt+1,total:Ve.length,percent:Math.round((dt+1)/Ve.length*100),message:`Uploaded ${an.name}`})}De({status:tt.length>0?"error":"complete",current:Ve.length,total:Ve.length,percent:100,message:`Uploaded ${Fe} file${Fe!==1?"s":""}${tt.length>0?`, ${tt.length} failed`:""}`}),d()},[i,d]);if(v)return y("div",{css:Dn.container,children:[r("div",{css:Dn.toolbar}),r("div",{css:Dn.loading,children:r("div",{css:Dn.spinner})})]});const Ol=i.startsWith("_fonts");return y("div",{css:Dn.container,children:[r(O2,{showUploadButton:Ol,selectedItems:w,someItemsSelected:pe,singleFileSelected:Ne,singleFolderSelected:ie,canAssign:Nn,hasSelectedWoff2Files:na,selectedWoff2Files:lt,refreshing:ae,viewMode:P,searchQuery:gt,onAddNew:()=>oe(!0),onRenameFile:()=>j(!0),onRenameFolder:()=>k(!0),onNewFolder:Rl,onDelete:Ba,onAssign:ko,onClearSelection:Ot,onSearchChange:me=>Be(me.target.value),onRefresh:vn,onViewModeChange:I,onShowSettings:()=>Me(!0)}),y("div",{css:Dn.content,onDragOver:fl,onDragLeave:fa,onDrop:zo,style:{position:"relative"},children:[E&&r("div",{css:Dn.dropOverlay,children:y("div",{css:Dn.dropMessage,children:[r(ab,{}),r("span",{children:"Drop TTF/OTF files to upload"})]})}),Ft.length===0&&L&&!gt?y("div",{css:Dn.empty,children:[r("span",{css:Dn.emptyIcon,children:r(lb,{})}),r("p",{css:Dn.emptyText,children:"Folder doesn't exist"}),r("button",{css:Dn.createBtn,onClick:Rl,children:"Create Folder"})]}):P==="grid"?r(F2,{items:h,filteredItems:Ft,selectedItems:w,allItemsSelected:Nt,someItemsSelected:pe,copiedPath:nn,folderStatuses:re,isAtRoot:Pt,onItemClick:fn,onOpen:en,onNavigateUp:rt,onSelectAll:Wn,onSelectAllWoff:mn,onSelectAllTtf:Tn,onCopyPath:xn}):r(I2,{items:h,filteredItems:Ft,selectedItems:w,allItemsSelected:Nt,someItemsSelected:pe,copiedPath:nn,folderStatuses:re,isAtRoot:Pt,onItemClick:fn,onOpen:en,onNavigateUp:rt,onSelectAll:Wn,onSelectAllWoff:mn,onSelectAllTtf:Tn,onCopyPath:xn})]}),ee&&r(El,{title:"New Folder",message:"Enter a name for the new folder:",placeholder:"Folder name",confirmLabel:"Create",onConfirm:_l,onCancel:()=>te(!1)}),B&&Re&&r(El,{title:"Rename Folder",message:"Enter a new name for the folder:",placeholder:ut,defaultValue:ut,confirmLabel:"Rename",onConfirm:ua,onCancel:()=>k(!1)}),Q&&Ce&&r(El,{title:"Rename File",message:"Enter a new name for the file:",placeholder:Ct,defaultValue:Ct,confirmLabel:"Rename",onConfirm:Jn,onCancel:()=>j(!1)}),ce&&r(vo,{title:"Delete Items",message:`Are you sure you want to delete ${w.size} item${w.size!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:da,onCancel:()=>V(!1)}),G&&r(R2,{currentPath:i,onClose:()=>oe(!1),onUploadComplete:()=>{oe(!1),d()},setShowProgress:$,setProgressTitle:S,setProgress:De}),fe&&Nn&&r(k2,{folderPath:ie?Re:void 0,selectedFiles:na?lt:void 0,onConfirm:_a,onCancel:()=>de(!1)}),T&&r(ul,{title:Xe,progress:J,onClose:Oa,onStop:xt}),le&&r(A2,{onClose:()=>Me(!1),onRefresh:d}),U&&r(Kr,{title:U.title,message:U.message,onClose:()=>ne(null)})]})}function ab(){return r("svg",{css:Dn.dropIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}function lb(){return r("svg",{css:Dn.folderIcon,fill:"currentColor",viewBox:"0 0 24 24",children:r("path",{d:"M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z"})})}const ob="36px",Tt={container:g(Ra," display:flex;flex-direction:column;height:100%;background:",s.background,";",""),header:g("display:flex;align-items:center;justify-content:space-between;padding:12px 24px;background:",s.surface,";border-bottom:1px solid ",s.border,";position:relative;",""),titleDropdown:{name:"bjn8wh",styles:"position:relative"},titleButton:g("display:flex;align-items:center;gap:6px;font-size:19px!important;font-weight:600;color:",s.text,";background:transparent;border:none;padding:4px 8px;margin:-4px -8px;border-radius:6px;cursor:pointer;letter-spacing:-0.02em;transition:background 0.15s ease;&:hover{background:",s.surfaceHover,";}",""),titleChevron:g("width:18px;height:18px;color:",s.textSecondary,";transition:transform 0.15s ease;margin-top:2px;stroke-width:2.5;",""),titleChevronOpen:{name:"21xn5r",styles:"transform:rotate(180deg)"},dropdownMenu:g("position:absolute;top:calc(100% + 8px);left:0;background:",s.surface,";border:1px solid ",s.border,";border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);padding:4px;z-index:100;",""),dropdownItem:g("display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;background:transparent;border:none;border-radius:6px;white-space:nowrap;position:relative;top:1px;font-size:19px!important;font-weight:600;letter-spacing:-0.02em;color:",s.text,";cursor:pointer;transition:all 0.15s ease;text-align:left;&:hover{background:",s.surfaceHover,";}",""),dropdownItemActive:g("&::after{content:'';display:inline-block;width:8px;height:8px;background:",s.primary,";border-radius:50%;position:relative;top:1px;}",""),headerLeft:{name:"16ur2v6",styles:"display:flex;align-items:center;gap:12px;flex:1;min-width:0"},headerCenter:{name:"1fsejhz",styles:"position:absolute;left:50%;transform:translateX(-50%);display:flex;align-items:center;max-width:50%"},breadcrumbs:g("display:flex;align-items:center;gap:6px;font-size:",q.base,";color:",s.textSecondary,";overflow:hidden;",""),breadcrumbSeparator:g("color:",s.border,";flex-shrink:0;",""),breadcrumbItem:g("color:",s.textSecondary,";text-decoration:none;cursor:pointer;transition:color 0.15s ease;white-space:nowrap;font-weight:500;&:hover{color:",s.primary,";}",""),breadcrumbCurrent:g("color:",s.text,";font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""),headerIconBtn:g("display:flex;align-items:center;justify-content:center;width:32px;height:32px;color:",s.textMuted,";background:transparent;border:none;border-radius:6px;cursor:pointer;transition:all 0.15s ease;&:hover{color:",s.text,";background:",s.surface,";}",""),headerActions:{name:"1yydxi7",styles:"display:flex;align-items:center;gap:8px"},headerBtn:g("height:",ob,";padding:0 12px;background:",s.surface,";border:1px solid ",s.border,";border-radius:6px;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;&:hover{background-color:",s.surfaceHover,";border-color:",s.borderHover,";}",""),headerIcon:g("width:16px;height:16px;color:",s.textSecondary,";",""),content:{name:"1rtaly3",styles:"flex:1;display:flex;overflow:hidden"},fileBrowser:{name:"upomw9",styles:"flex:1;min-width:0;overflow:auto;padding:20px 24px;display:flex;flex-direction:column"},dropOverlay:g("position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(99, 91, 255, 0.1);border:3px dashed ",s.primary,";border-radius:8px;display:flex;align-items:center;justify-content:center;z-index:50;pointer-events:none;",""),dropMessage:g("display:flex;flex-direction:column;align-items:center;gap:12px;color:",s.primary,";font-size:",q.lg,";font-weight:600;",""),dropIcon:{name:"18jhpep",styles:"width:48px;height:48px"}};function ib({onClose:i,isVisible:c=!0,standaloneMode:f=!1,workspacePath:d,siteUrl:h}){const p=i||(()=>{}),[v,D]=x.useState("public"),[w,b]=x.useState(new Set),[L,M]=x.useState(null),[E,Y]=x.useState("grid"),[B,k]=x.useState(null),[Q,j]=x.useState(null),[ee,te]=x.useState(!1),[ce,V]=x.useState(0),[P,I]=x.useState(!1),[ae,H]=x.useState(""),[G,oe]=x.useState(null),[fe,de]=x.useState([]),[le,Me]=x.useState(!1),[T,$]=x.useState(()=>{if(typeof window<"u"){const Z=window.location.hash.slice(1);if(Z==="fonts")return"fonts";if(Z==="media")return"media"}return"media"}),[J,De]=x.useState(!1),Xe=x.useRef(null);x.useEffect(()=>{const Z=()=>{const ie=window.location.hash.slice(1);ie==="fonts"?$("fonts"):ie==="media"&&$("media")};return window.addEventListener("hashchange",Z),()=>window.removeEventListener("hashchange",Z)},[]);const[S,U]=x.useState("_fonts"),[ne,re]=x.useState(0),ke=x.useCallback(()=>{V(Z=>Z+1)},[]),[Te,Ye]=x.useState(null),gt=x.useCallback(Z=>{Ye({path:Z,key:Date.now()})},[]);x.useEffect(()=>{if(B&&fe.length>0){const Z=fe.find(ie=>ie.path===B.path);Z&&JSON.stringify(Z)!==JSON.stringify(B)&&k(Z)}},[fe,B]);const Be=x.useCallback(()=>{I(!0)},[]),nn=x.useCallback(()=>{I(!1)},[]),Ze=x.useCallback((Z,ie)=>{oe({title:Z,message:ie})},[]),et=x.useCallback(()=>{oe(null)},[]),xt=x.useCallback(Z=>{Z.preventDefault(),Z.stopPropagation(),Me(!0)},[]),_t=x.useCallback(Z=>{Z.preventDefault(),Z.stopPropagation(),Me(!1)},[]),jt=x.useCallback(()=>{if(v==="public")return;const Z=v.split("/");Z.pop(),D(Z.join("/")||"public"),b(new Set)},[v]),Ft=x.useCallback(Z=>{D(Z),b(new Set),k(null)},[]),Pt=x.useCallback(Z=>{b(ie=>{const Re=new Set(ie);return Re.has(Z)?Re.delete(Z):Re.add(Z),Re}),M(Z)},[]),fn=x.useCallback((Z,ie,Re)=>{const ut=Re.findIndex(lt=>lt.path===Z),Ne=Re.findIndex(lt=>lt.path===ie);if(ut===-1||Ne===-1)return;const Ce=Math.min(ut,Ne),Ct=Math.max(ut,Ne);b(lt=>{const na=new Set(lt);for(let Nn=Ce;Nn<=Ct;Nn++)na.add(Re[Nn].path);return na}),M(ie)},[]),en=x.useCallback(Z=>{b(new Set(Z.map(ie=>ie.path)))},[]),rt=x.useCallback(()=>{b(new Set)},[]),Nt=x.useCallback(Z=>{k(Z)},[]),pe=v2({triggerRefresh:ke,clearSelection:rt,setFocusedItem:Nt,showError:Ze}),Wn=x.useCallback(async Z=>{Z.preventDefault(),Z.stopPropagation(),Me(!1);const ie=Array.from(Z.dataTransfer.files);ie.length!==0&&(v==="public/images"||v.startsWith("public/images/")||pe.uploadFiles(ie,v))},[v,pe]),Ot=x.useCallback(Z=>{if(Z.key==="Escape"){const ie=Z.target;if(ie.tagName==="INPUT"||ie.tagName==="TEXTAREA")return;B?k(null):f||p()}},[p,B,f]);x.useEffect(()=>(c&&(document.addEventListener("keydown",Ot),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",Ot),document.body.style.overflow=""}),[Ot,c]),x.useEffect(()=>{const Z=ie=>{Xe.current&&!Xe.current.contains(ie.target)&&De(!1)};return J&&document.addEventListener("mousedown",Z),()=>{document.removeEventListener("mousedown",Z)}},[J]);const mn=x.useCallback(()=>{De(Z=>!Z)},[]),Tn=x.useCallback(Z=>{$(Z),De(!1),window.location.hash=Z},[]),xn=x.useCallback(()=>{re(Z=>Z+1)},[]),vn={isOpen:!0,openStudio:()=>{},closeStudio:p,toggleStudio:p,currentPath:v,setCurrentPath:Ft,navigateUp:jt,selectedItems:w,toggleSelection:Pt,selectRange:fn,selectAll:en,clearSelection:rt,lastSelectedPath:L,viewMode:E,setViewMode:Y,focusedItem:B,setFocusedItem:k,meta:Q,setMeta:j,isLoading:ee,setIsLoading:te,refreshKey:ce,triggerRefresh:ke,editedImageKey:Te,setEditedImageKey:gt,scanRequested:P,triggerScan:Be,clearScanRequest:nn,searchQuery:ae,setSearchQuery:H,error:G,showError:Ze,clearError:et,fileItems:fe,setFileItems:de,actionState:pe.actionState,requestDelete:pe.requestDelete,requestMove:pe.requestMove,requestSync:pe.requestSync,requestDownload:pe.requestDownload,requestProcess:pe.requestProcess,setProcessMode:pe.setProcessMode,confirmDelete:pe.confirmDelete,confirmMove:pe.confirmMove,confirmSync:pe.confirmSync,confirmProcess:pe.confirmProcess,cancelAction:pe.cancelAction,closeProgress:pe.closeProgress,stopProcessing:pe.stopProcessing,deleteOrphans:pe.deleteOrphans};return r(Fp.Provider,{value:vn,children:y("div",{css:Tt.container,children:[y("div",{css:Tt.header,children:[r("div",{css:Tt.headerLeft,children:y("div",{css:Tt.titleDropdown,ref:Xe,children:[y("button",{css:Tt.titleButton,onClick:mn,children:[r("span",{children:"gallop.studio"}),r(hb,{isOpen:J})]}),J&&y("div",{css:Tt.dropdownMenu,children:[r("button",{css:[Tt.dropdownItem,T==="media"&&Tt.dropdownItemActive,"",""],onClick:()=>Tn("media"),children:"media & files"}),r("button",{css:[Tt.dropdownItem,T==="fonts"&&Tt.dropdownItemActive,"",""],onClick:()=>Tn("fonts"),children:"fonts"})]})]})}),r("div",{css:Tt.headerCenter,children:r(ub,{currentPath:T==="fonts"?S:v,onNavigate:T==="fonts"?U:Ft,projectName:d?d.split("/").pop():void 0})}),y("div",{css:Tt.headerActions,children:[h&&r("a",{href:h,target:"_blank",rel:"noopener noreferrer",css:Tt.headerIconBtn,title:`Open ${h}`,children:r(db,{})}),!f&&r("button",{css:Tt.headerBtn,onClick:p,"aria-label":"Close Studio",children:r(fb,{})})]})]}),T==="media"?y(Pe,{children:[r(A1,{}),y("div",{css:Tt.content,onDragOver:xt,onDragLeave:_t,onDrop:Wn,children:[le&&r("div",{css:Tt.dropOverlay,children:y("div",{css:Tt.dropMessage,children:[r("svg",{css:Tt.dropIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),r("span",{children:"Drop files to upload"})]})}),r("div",{css:Tt.fileBrowser,children:E==="grid"?r($1,{}):r(e2,{})})]}),B&&r(b2,{}),r(x2,{}),pe.actionState.showDeleteConfirm&&r(vo,{title:"Delete Files",message:`Are you sure you want to delete ${pe.actionState.actionPaths.length} item${pe.actionState.actionPaths.length!==1?"s":""}? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger",onConfirm:pe.confirmDelete,onCancel:pe.cancelAction}),pe.actionState.showSyncConfirm&&r(vo,{title:"Push to CDN",message:`Push ${pe.actionState.syncImageCount} image${pe.actionState.syncImageCount!==1?"s":""} to Cloudflare R2?${pe.actionState.syncHasRemote?" Remote images will be downloaded first.":""}${pe.actionState.syncHasLocal?" After pushing, local files will be deleted.":""}`,confirmLabel:"Push",onConfirm:pe.confirmSync,onCancel:pe.cancelAction}),pe.actionState.showProcessConfirm&&r(cb,{imageCount:pe.actionState.actionPaths.length,mode:pe.actionState.processMode,onConfirm:pe.confirmProcess,onCancel:pe.cancelAction}),pe.actionState.showMoveModal&&r(Qp,{selectedItems:new Set(pe.actionState.actionPaths),currentPath:v,onMove:Z=>pe.confirmMove(Z),onCancel:pe.cancelAction}),pe.actionState.showProgress&&r(ul,{title:pe.actionState.progressTitle,progress:pe.actionState.progressState,onStop:pe.stopProcessing,onDeleteOrphans:pe.deleteOrphans,onClose:pe.closeProgress})]}):r(nb,{currentPath:S,setCurrentPath:U,refreshKey:ne,triggerRefresh:xn})]})})}var rb={name:"1cm5yut",styles:"display:flex;gap:12px;justify-content:flex-end"},sb={name:"1ca3l8d",styles:"position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:10000"};function cb({imageCount:i,mode:c,onConfirm:f,onCancel:d}){const h={overlay:sb,container:g("background:",s.surface,";border-radius:12px;padding:24px;max-width:420px;width:90%;box-shadow:0 20px 25px -5px rgba(0, 0, 0, 0.1),0 10px 10px -5px rgba(0, 0, 0, 0.04);",""),title:g("font-size:",q.lg,";font-weight:600;color:",s.text,";margin:0 0 16px;",""),message:g("font-size:",q.base,";color:",s.textSecondary,";margin:0 0 20px;line-height:1.5;",""),actions:rb,cancelBtn:g("padding:10px 20px;border:1px solid ",s.border,";border-radius:8px;background:",s.background,";color:",s.text,";font-size:",q.base,";font-weight:500;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.surfaceHover,";border-color:",s.borderHover,";}",""),confirmBtn:g("padding:10px 20px;border:none;border-radius:8px;background:",s.primary,";color:white;font-size:",q.base,";font-weight:500;cursor:pointer;transition:all 0.15s ease;&:hover{background:",s.primaryHover,";}",""),confirmBtnDanger:g("background:",s.danger,";&:hover{background:#dc2626;}","")},p=c==="remove",v=p?"Remove Thumbnails":"Generate Thumbnails",D=p?`Remove generated thumbnails for ${i} image${i!==1?"s":""}? Original images will be kept.`:`Generate thumbnails for ${i} image${i!==1?"s":""}?`,w=p?"Remove":"Generate";return r("div",{css:h.overlay,onClick:d,children:y("div",{css:h.container,onClick:b=>b.stopPropagation(),children:[r("h2",{css:h.title,children:v}),r("p",{css:h.message,children:D}),y("div",{css:h.actions,children:[r("button",{css:h.cancelBtn,onClick:d,children:"Cancel"}),r("button",{css:[h.confirmBtn,p&&h.confirmBtnDanger,"",""],onClick:f,children:w})]})]})})}function ub({currentPath:i,onNavigate:c,projectName:f}){const d=i.split("/").filter(Boolean),h=d.map((p,v)=>{let D=p;return v===0&&(p==="public"&&f?D=f:p==="_fonts"&&(D="fonts")),{name:D,path:d.slice(0,v+1).join("/")}});return r("div",{css:Tt.breadcrumbs,children:h.map((p,v)=>y("span",{style:{display:"flex",alignItems:"center",gap:6},children:[v>0&&r("span",{css:Tt.breadcrumbSeparator,children:"/"}),v===h.length-1?r("span",{css:Tt.breadcrumbCurrent,children:p.name}):r("span",{css:Tt.breadcrumbItem,onClick:()=>c(p.path),children:p.name})]},p.path))})}function db(){return y("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}function fb(){return y("svg",{css:Tt.headerIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function hb({isOpen:i}){return r("svg",{css:[Tt.titleChevron,i&&Tt.titleChevronOpen,"",""],viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r("polyline",{points:"6 9 12 15 18 9"})})}const Wp=document.getElementById("root");if(!Wp)throw new Error("Root element not found");const pb=window.__STUDIO_WORKSPACE__||"Unknown",gb=window.__STUDIO_SITE_URL__||"";u1.createRoot(Wp).render(r(x.StrictMode,{children:r("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"#0a0a0a"},children:r(ib,{isVisible:!0,standaloneMode:!0,workspacePath:pb,siteUrl:gb})})}));