figranium 0.9.1 → 0.9.2

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.
@@ -1,15 +0,0 @@
1
- (function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))c(h);new MutationObserver(h=>{for(const d of h)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&c(f)}).observe(document,{childList:!0,subtree:!0});function o(h){const d={};return h.integrity&&(d.integrity=h.integrity),h.referrerPolicy&&(d.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?d.credentials="include":h.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(h){if(h.ep)return;h.ep=!0;const d=o(h);fetch(h.href,d)}})();var ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var kc={exports:{}},Ui={};var Vh;function r0(){if(Vh)return Ui;Vh=1;var l=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(c,h,d){var f=null;if(d!==void 0&&(f=""+d),h.key!==void 0&&(f=""+h.key),"key"in h){d={};for(var p in h)p!=="key"&&(d[p]=h[p])}else d=h;return h=d.ref,{$$typeof:l,type:c,key:f,ref:h!==void 0?h:null,props:d}}return Ui.Fragment=u,Ui.jsx=o,Ui.jsxs=o,Ui}var Gh;function s0(){return Gh||(Gh=1,kc.exports=r0()),kc.exports}var r=s0(),Ac={exports:{}},Ve={};var Zh;function o0(){if(Zh)return Ve;Zh=1;var l=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),T=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=T&&A[T]||A["@@iterator"],typeof A=="function"?A:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function y(A,O,P){this.props=A,this.context=O,this.refs=v,this.updater=P||j}y.prototype.isReactComponent={},y.prototype.setState=function(A,O){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,O,"setState")},y.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=y.prototype;function E(A,O,P){this.props=A,this.context=O,this.refs=v,this.updater=P||j}var U=E.prototype=new C;U.constructor=E,x(U,y.prototype),U.isPureReactComponent=!0;var B=Array.isArray;function Z(){}var Y={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function F(A,O,P){var le=P.ref;return{$$typeof:l,type:A,key:O,ref:le!==void 0?le:null,props:P}}function ge(A,O){return F(A.type,O,A.props)}function ce(A){return typeof A=="object"&&A!==null&&A.$$typeof===l}function M(A){var O={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(P){return O[P]})}var H=/\/+/g;function _(A,O){return typeof A=="object"&&A!==null&&A.key!=null?M(""+A.key):O.toString(36)}function W(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(Z,Z):(A.status="pending",A.then(function(O){A.status==="pending"&&(A.status="fulfilled",A.value=O)},function(O){A.status==="pending"&&(A.status="rejected",A.reason=O)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function X(A,O,P,le,de){var Ne=typeof A;(Ne==="undefined"||Ne==="boolean")&&(A=null);var Te=!1;if(A===null)Te=!0;else switch(Ne){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(A.$$typeof){case l:case u:Te=!0;break;case k:return Te=A._init,X(Te(A._payload),O,P,le,de)}}if(Te)return de=de(A),Te=le===""?"."+_(A,0):le,B(de)?(P="",Te!=null&&(P=Te.replace(H,"$&/")+"/"),X(de,O,P,"",function(Ke){return Ke})):de!=null&&(ce(de)&&(de=ge(de,P+(de.key==null||A&&A.key===de.key?"":(""+de.key).replace(H,"$&/")+"/")+Te)),O.push(de)),1;Te=0;var Ae=le===""?".":le+":";if(B(A))for(var De=0;De<A.length;De++)le=A[De],Ne=Ae+_(le,De),Te+=X(le,O,P,Ne,de);else if(De=S(A),typeof De=="function")for(A=De.call(A),De=0;!(le=A.next()).done;)le=le.value,Ne=Ae+_(le,De++),Te+=X(le,O,P,Ne,de);else if(Ne==="object"){if(typeof A.then=="function")return X(W(A),O,P,le,de);throw O=String(A),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return Te}function I(A,O,P){if(A==null)return A;var le=[],de=0;return X(A,le,"","",function(Ne){return O.call(P,Ne,de++)}),le}function xe(A){if(A._status===-1){var O=A._result;O=O(),O.then(function(P){(A._status===0||A._status===-1)&&(A._status=1,A._result=P)},function(P){(A._status===0||A._status===-1)&&(A._status=2,A._result=P)}),A._status===-1&&(A._status=0,A._result=O)}if(A._status===1)return A._result.default;throw A._result}var V=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},oe={map:I,forEach:function(A,O,P){I(A,function(){O.apply(this,arguments)},P)},count:function(A){var O=0;return I(A,function(){O++}),O},toArray:function(A){return I(A,function(O){return O})||[]},only:function(A){if(!ce(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ve.Activity=N,Ve.Children=oe,Ve.Component=y,Ve.Fragment=o,Ve.Profiler=h,Ve.PureComponent=E,Ve.StrictMode=c,Ve.Suspense=m,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Y.H.useMemoCache(A)}},Ve.cache=function(A){return function(){return A.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(A,O,P){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var le=x({},A.props),de=A.key;if(O!=null)for(Ne in O.key!==void 0&&(de=""+O.key),O)!ne.call(O,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&O.ref===void 0||(le[Ne]=O[Ne]);var Ne=arguments.length-2;if(Ne===1)le.children=P;else if(1<Ne){for(var Te=Array(Ne),Ae=0;Ae<Ne;Ae++)Te[Ae]=arguments[Ae+2];le.children=Te}return F(A.type,de,le)},Ve.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:d,_context:A},A},Ve.createElement=function(A,O,P){var le,de={},Ne=null;if(O!=null)for(le in O.key!==void 0&&(Ne=""+O.key),O)ne.call(O,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=O[le]);var Te=arguments.length-2;if(Te===1)de.children=P;else if(1<Te){for(var Ae=Array(Te),De=0;De<Te;De++)Ae[De]=arguments[De+2];de.children=Ae}if(A&&A.defaultProps)for(le in Te=A.defaultProps,Te)de[le]===void 0&&(de[le]=Te[le]);return F(A,Ne,de)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(A){return{$$typeof:p,render:A}},Ve.isValidElement=ce,Ve.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:xe}},Ve.memo=function(A,O){return{$$typeof:b,type:A,compare:O===void 0?null:O}},Ve.startTransition=function(A){var O=Y.T,P={};Y.T=P;try{var le=A(),de=Y.S;de!==null&&de(P,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(Z,V)}catch(Ne){V(Ne)}finally{O!==null&&P.types!==null&&(O.types=P.types),Y.T=O}},Ve.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},Ve.use=function(A){return Y.H.use(A)},Ve.useActionState=function(A,O,P){return Y.H.useActionState(A,O,P)},Ve.useCallback=function(A,O){return Y.H.useCallback(A,O)},Ve.useContext=function(A){return Y.H.useContext(A)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(A,O){return Y.H.useDeferredValue(A,O)},Ve.useEffect=function(A,O){return Y.H.useEffect(A,O)},Ve.useEffectEvent=function(A){return Y.H.useEffectEvent(A)},Ve.useId=function(){return Y.H.useId()},Ve.useImperativeHandle=function(A,O,P){return Y.H.useImperativeHandle(A,O,P)},Ve.useInsertionEffect=function(A,O){return Y.H.useInsertionEffect(A,O)},Ve.useLayoutEffect=function(A,O){return Y.H.useLayoutEffect(A,O)},Ve.useMemo=function(A,O){return Y.H.useMemo(A,O)},Ve.useOptimistic=function(A,O){return Y.H.useOptimistic(A,O)},Ve.useReducer=function(A,O,P){return Y.H.useReducer(A,O,P)},Ve.useRef=function(A){return Y.H.useRef(A)},Ve.useState=function(A){return Y.H.useState(A)},Ve.useSyncExternalStore=function(A,O,P){return Y.H.useSyncExternalStore(A,O,P)},Ve.useTransition=function(){return Y.H.useTransition()},Ve.version="19.2.3",Ve}var Xh;function Wc(){return Xh||(Xh=1,Ac.exports=o0()),Ac.exports}var z=Wc();const Dn=Fc(z);var zc={exports:{}},Bi={},Tc={exports:{}},Rc={};var Kh;function c0(){return Kh||(Kh=1,(function(l){function u(X,I){var xe=X.length;X.push(I);e:for(;0<xe;){var V=xe-1>>>1,oe=X[V];if(0<h(oe,I))X[V]=I,X[xe]=oe,xe=V;else break e}}function o(X){return X.length===0?null:X[0]}function c(X){if(X.length===0)return null;var I=X[0],xe=X.pop();if(xe!==I){X[0]=xe;e:for(var V=0,oe=X.length,A=oe>>>1;V<A;){var O=2*(V+1)-1,P=X[O],le=O+1,de=X[le];if(0>h(P,xe))le<oe&&0>h(de,P)?(X[V]=de,X[le]=xe,V=le):(X[V]=P,X[O]=xe,V=O);else if(le<oe&&0>h(de,xe))X[V]=de,X[le]=xe,V=le;else break e}}return I}function h(X,I){var xe=X.sortIndex-I.sortIndex;return xe!==0?xe:X.id-I.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();l.unstable_now=function(){return f.now()-p}}var m=[],b=[],k=1,N=null,T=3,S=!1,j=!1,x=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function U(X){for(var I=o(b);I!==null;){if(I.callback===null)c(b);else if(I.startTime<=X)c(b),I.sortIndex=I.expirationTime,u(m,I);else break;I=o(b)}}function B(X){if(x=!1,U(X),!j)if(o(m)!==null)j=!0,Z||(Z=!0,M());else{var I=o(b);I!==null&&W(B,I.startTime-X)}}var Z=!1,Y=-1,ne=5,F=-1;function ge(){return v?!0:!(l.unstable_now()-F<ne)}function ce(){if(v=!1,Z){var X=l.unstable_now();F=X;var I=!0;try{e:{j=!1,x&&(x=!1,C(Y),Y=-1),S=!0;var xe=T;try{t:{for(U(X),N=o(m);N!==null&&!(N.expirationTime>X&&ge());){var V=N.callback;if(typeof V=="function"){N.callback=null,T=N.priorityLevel;var oe=V(N.expirationTime<=X);if(X=l.unstable_now(),typeof oe=="function"){N.callback=oe,U(X),I=!0;break t}N===o(m)&&c(m),U(X)}else c(m);N=o(m)}if(N!==null)I=!0;else{var A=o(b);A!==null&&W(B,A.startTime-X),I=!1}}break e}finally{N=null,T=xe,S=!1}I=void 0}}finally{I?M():Z=!1}}}var M;if(typeof E=="function")M=function(){E(ce)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,_=H.port2;H.port1.onmessage=ce,M=function(){_.postMessage(null)}}else M=function(){y(ce,0)};function W(X,I){Y=y(function(){X(l.unstable_now())},I)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(X){X.callback=null},l.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<X?Math.floor(1e3/X):5},l.unstable_getCurrentPriorityLevel=function(){return T},l.unstable_next=function(X){switch(T){case 1:case 2:case 3:var I=3;break;default:I=T}var xe=T;T=I;try{return X()}finally{T=xe}},l.unstable_requestPaint=function(){v=!0},l.unstable_runWithPriority=function(X,I){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var xe=T;T=X;try{return I()}finally{T=xe}},l.unstable_scheduleCallback=function(X,I,xe){var V=l.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?V+xe:V):xe=V,X){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=xe+oe,X={id:k++,callback:I,priorityLevel:X,startTime:xe,expirationTime:oe,sortIndex:-1},xe>V?(X.sortIndex=xe,u(b,X),o(m)===null&&X===o(b)&&(x?(C(Y),Y=-1):x=!0,W(B,xe-V))):(X.sortIndex=oe,u(m,X),j||S||(j=!0,Z||(Z=!0,M()))),X},l.unstable_shouldYield=ge,l.unstable_wrapCallback=function(X){var I=T;return function(){var xe=T;T=I;try{return X.apply(this,arguments)}finally{T=xe}}}})(Rc)),Rc}var Qh;function u0(){return Qh||(Qh=1,Tc.exports=c0()),Tc.exports}var Oc={exports:{}},Xt={};var Ih;function d0(){if(Ih)return Xt;Ih=1;var l=Wc();function u(m){var b="https://react.dev/errors/"+m;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)b+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+m+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(u(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},h=Symbol.for("react.portal");function d(m,b,k){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:N==null?null:""+N,children:m,containerInfo:b,implementation:k}}var f=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,b){if(m==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Xt.createPortal=function(m,b){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(u(299));return d(m,b,null,k)},Xt.flushSync=function(m){var b=f.T,k=c.p;try{if(f.T=null,c.p=2,m)return m()}finally{f.T=b,c.p=k,c.d.f()}},Xt.preconnect=function(m,b){typeof m=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(m,b))},Xt.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},Xt.preinit=function(m,b){if(typeof m=="string"&&b&&typeof b.as=="string"){var k=b.as,N=p(k,b.crossOrigin),T=typeof b.integrity=="string"?b.integrity:void 0,S=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;k==="style"?c.d.S(m,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:N,integrity:T,fetchPriority:S}):k==="script"&&c.d.X(m,{crossOrigin:N,integrity:T,fetchPriority:S,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Xt.preinitModule=function(m,b){if(typeof m=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var k=p(b.as,b.crossOrigin);c.d.M(m,{crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(m)},Xt.preload=function(m,b){if(typeof m=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var k=b.as,N=p(k,b.crossOrigin);c.d.L(m,k,{crossOrigin:N,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})}},Xt.preloadModule=function(m,b){if(typeof m=="string")if(b){var k=p(b.as,b.crossOrigin);c.d.m(m,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(m)},Xt.requestFormReset=function(m){c.d.r(m)},Xt.unstable_batchedUpdates=function(m,b){return m(b)},Xt.useFormState=function(m,b,k){return f.H.useFormState(m,b,k)},Xt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Xt.version="19.2.3",Xt}var Jh;function wp(){if(Jh)return Oc.exports;Jh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(u){console.error(u)}}return l(),Oc.exports=d0(),Oc.exports}var $h;function f0(){if($h)return Bi;$h=1;var l=u0(),u=Wc(),o=wp();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function f(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 p(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 m(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===a)return m(i),e;if(s===n)return m(i),t;s=s.sibling}throw Error(c(188))}if(a.return!==n.return)a=i,n=s;else{for(var g=!1,R=i.child;R;){if(R===a){g=!0,a=i,n=s;break}if(R===n){g=!0,n=i,a=s;break}R=R.sibling}if(!g){for(R=s.child;R;){if(R===a){g=!0,a=s,n=i;break}if(R===n){g=!0,n=s,a=i;break}R=R.sibling}if(!g)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,T=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=ce&&e[ce]||e["@@iterator"],typeof e=="function"?e:null)}var H=Symbol.for("react.client.reference");function _(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===H?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case y:return"Profiler";case v:return"StrictMode";case B:return"Suspense";case Z:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case E:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:_(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return _(e(t))}catch{}}return null}var W=Array.isArray,X=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},V=[],oe=-1;function A(e){return{current:e}}function O(e){0>oe||(e.current=V[oe],V[oe]=null,oe--)}function P(e,t){oe++,V[oe]=e.current,e.current=t}var le=A(null),de=A(null),Ne=A(null),Te=A(null);function Ae(e,t){switch(P(Ne,t),P(de,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dh(t),e=fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(le),P(le,e)}function De(){O(le),O(de),O(Ne)}function Ke(e){e.memoizedState!==null&&P(Te,e);var t=le.current,a=fh(t,e.type);t!==a&&(P(de,e),P(le,a))}function Je(e){de.current===e&&(O(le),O(de)),Te.current===e&&(O(Te),Ri._currentValue=xe)}var ut,xt;function w(e){if(ut===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ut=t&&t[1]||"",xt=-1<a.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ut+e+xt}var fe=!1;function re(e,t){if(!e||fe)return"";fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ue){var ie=ue}Reflect.construct(e,[],ve)}else{try{ve.call()}catch(ue){ie=ue}e.call(ve.prototype)}}else{try{throw Error()}catch(ue){ie=ue}(ve=e())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ue){if(ue&&ie&&typeof ue.stack=="string")return[ue.stack,ie.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),g=s[0],R=s[1];if(g&&R){var q=g.split(`
4
- `),ae=R.split(`
5
- `);for(i=n=0;n<q.length&&!q[n].includes("DetermineComponentFrameRoot");)n++;for(;i<ae.length&&!ae[i].includes("DetermineComponentFrameRoot");)i++;if(n===q.length||i===ae.length)for(n=q.length-1,i=ae.length-1;1<=n&&0<=i&&q[n]!==ae[i];)i--;for(;1<=n&&0<=i;n--,i--)if(q[n]!==ae[i]){if(n!==1||i!==1)do if(n--,i--,0>i||q[n]!==ae[i]){var pe=`
6
- `+q[n].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=n&&0<=i);break}}}finally{fe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?w(a):""}function L(e,t){switch(e.tag){case 26:case 27:case 5:return w(e.type);case 16:return w("Lazy");case 13:return e.child!==t&&t!==null?w("Suspense Fallback"):w("Suspense");case 19:return w("SuspenseList");case 0:case 15:return re(e.type,!1);case 11:return re(e.type.render,!1);case 1:return re(e.type,!0);case 31:return w("Activity");default:return""}}function D(e){try{var t="",a=null;do t+=L(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
7
- Error generating stack: `+n.message+`
8
- `+n.stack}}var J=Object.prototype.hasOwnProperty,te=l.unstable_scheduleCallback,me=l.unstable_cancelCallback,G=l.unstable_shouldYield,we=l.unstable_requestPaint,Se=l.unstable_now,ye=l.unstable_getCurrentPriorityLevel,ze=l.unstable_ImmediatePriority,Ge=l.unstable_UserBlockingPriority,Be=l.unstable_NormalPriority,_e=l.unstable_LowPriority,Ce=l.unstable_IdlePriority,Ee=l.log,Re=l.unstable_setDisableYieldValue,qe=null,dt=null;function Mt(e){if(typeof Ee=="function"&&Re(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(qe,e)}catch{}}var ft=Math.clz32?Math.clz32:el,nn=Math.log,Yl=Math.LN2;function el(e){return e>>>=0,e===0?32:31-(nn(e)/Yl|0)|0}var Ma=256,Ot=262144,wt=4194304;function Ut(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 Ua(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var R=n&134217727;return R!==0?(n=R&~s,n!==0?i=Ut(n):(g&=R,g!==0?i=Ut(g):a||(a=R&~e,a!==0&&(i=Ut(a))))):(R=n&~s,R!==0?i=Ut(R):g!==0?i=Ut(g):a||(a=n&~e,a!==0&&(i=Ut(a)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,a=t&-t,s>=a||s===32&&(a&4194048)!==0)?t:i}function Ca(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xi(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 Nt(){var e=wt;return wt<<=1,(wt&62914560)===0&&(wt=4194304),e}function tl(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ba(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vs(e,t,a,n,i,s){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var R=e.entanglements,q=e.expirationTimes,ae=e.hiddenUpdates;for(a=g&~a;0<a;){var pe=31-ft(a),ve=1<<pe;R[pe]=0,q[pe]=-1;var ie=ae[pe];if(ie!==null)for(ae[pe]=null,pe=0;pe<ie.length;pe++){var ue=ie[pe];ue!==null&&(ue.lane&=-536870913)}a&=~ve}n!==0&&Vl(e,n,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(g&~t))}function Vl(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-ft(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Gl(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-ft(a),i=1<<n;i&t|e[n]&t&&(e[n]|=t),a&=~i}}function Zl(e,t){var a=t&-t;return a=(a&42)!==0?1:al(a),(a&(e.suspendedLanes|t))!==0?0:a}function al(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 Xl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ta(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Mh(e.type))}function Kl(e,t){var a=I.p;try{return I.p=e,t()}finally{I.p=a}}var Vt=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Vt,Bt="__reactProps$"+Vt,ln="__reactContainer$"+Vt,Ql="__reactEvents$"+Vt,Il="__reactListeners$"+Vt,Ki="__reactHandles$"+Vt,rn="__reactResources$"+Vt,sn="__reactMarker$"+Vt;function Un(e){delete e[Tt],delete e[Bt],delete e[Ql],delete e[Il],delete e[Ki]}function on(e){var t=e[Tt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ln]||a[Tt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=yh(e);e!==null;){if(a=e[Tt])return a;e=yh(e)}return t}e=a,a=e.parentNode}return null}function cn(e){if(e=e[Tt]||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 Q(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function se(e){var t=e[rn];return t||(t=e[rn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function he(e){e[sn]=!0}var ke=new Set,Ye={};function Le(e,t){tt(e,t),tt(e+"Capture",t)}function tt(e,t){for(Ye[e]=t,e=0;e<t.length;e++)ke.add(t[e])}var at=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]*$"),gt={},Et={};function It(e){return J.call(Et,e)?!0:J.call(gt,e)?!1:at.test(e)?Et[e]=!0:(gt[e]=!0,!1)}function Gt(e,t,a){if(It(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function wa(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Sa(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qi(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(g){a=""+g,s.call(this,g)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zt(e){if(!e._valueTracker){var t=nl(e)?"checked":"value";e._valueTracker=Qi(e,t,""+e[t])}}function ca(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=nl(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function _a(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 ll=/[\n"\\]/g;function ua(e){return e.replace(ll,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ws(e,t,a,n,i,s,g,R){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Ss(e,g,Kt(t)):a!=null?Ss(e,g,Kt(a)):n!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Kt(R):e.removeAttribute("name")}function lu(e,t,a,n,i,s,g,R){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Zt(e);return}a=a!=null?""+Kt(a):"",t=t!=null?""+Kt(t):a,R||t===e.value||(e.value=t),e.defaultValue=t}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=R?e.checked:!!n,e.defaultChecked=!!n,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),Zt(e)}function Ss(e,t,a){t==="number"&&_a(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function il(e,t,a,n){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Kt(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function iu(e,t,a){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Kt(a):""}function ru(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(W(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Kt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Zt(e)}function rl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var tm=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 su(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||tm.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ou(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&a[i]!==n&&su(e,i,n)}else for(var s in t)t.hasOwnProperty(s)&&su(e,s,t[s])}function _s(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 am=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"]]),nm=/^[\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 Ii(e){return nm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function La(){}var js=null;function Ns(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sl=null,ol=null;function cu(e){var t=cn(e);if(t&&(e=t.stateNode)){var a=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ws(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ua(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var i=n[Bt]||null;if(!i)throw Error(c(90));ws(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&ca(n)}break e;case"textarea":iu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&il(e,!!a.multiple,t,!1)}}}var Es=!1;function uu(e,t,a){if(Es)return e(t,a);Es=!0;try{var n=e(t);return n}finally{if(Es=!1,(sl!==null||ol!==null)&&(Mr(),sl&&(t=sl,e=ol,ol=sl=null,cu(t),e)))for(t=0;t<e.length;t++)cu(e[t])}}function Jl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Bt]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var Ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(Ha)try{var $l={};Object.defineProperty($l,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",$l,$l),window.removeEventListener("test",$l,$l)}catch{Cs=!1}var un=null,ks=null,Ji=null;function du(){if(Ji)return Ji;var e,t=ks,a=t.length,n,i="value"in un?un.value:un.textContent,s=i.length;for(e=0;e<a&&t[e]===i[e];e++);var g=a-e;for(n=1;n<=g&&t[a-n]===i[s-n];n++);return Ji=i.slice(e,1<n?1-n:void 0)}function $i(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 Fi(){return!0}function fu(){return!1}function Jt(e){function t(a,n,i,s,g){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=g,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(a=e[R],this[R]=a?a(s):s[R]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Fi:fu,this.isPropagationStopped=fu,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Fi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fi)},persist:function(){},isPersistent:Fi}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wi=Jt(Bn),Fl=N({},Bn,{view:0,detail:0}),lm=Jt(Fl),As,zs,Wl,Pi=N({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rs,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!==Wl&&(Wl&&e.type==="mousemove"?(As=e.screenX-Wl.screenX,zs=e.screenY-Wl.screenY):zs=As=0,Wl=e),As)},movementY:function(e){return"movementY"in e?e.movementY:zs}}),hu=Jt(Pi),im=N({},Pi,{dataTransfer:0}),rm=Jt(im),sm=N({},Fl,{relatedTarget:0}),Ts=Jt(sm),om=N({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0}),cm=Jt(om),um=N({},Bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dm=Jt(um),fm=N({},Bn,{data:0}),pu=Jt(fm),hm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pm={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"},mm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mm[e])?!!t[e]:!1}function Rs(){return xm}var gm=N({},Fl,{key:function(e){if(e.key){var t=hm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rs,charCode:function(e){return e.type==="keypress"?$i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bm=Jt(gm),ym=N({},Pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mu=Jt(ym),vm=N({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rs}),wm=Jt(vm),Sm=N({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),_m=Jt(Sm),jm=N({},Pi,{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}),Nm=Jt(jm),Em=N({},Bn,{newState:0,oldState:0}),Cm=Jt(Em),km=[9,13,27,32],Os=Ha&&"CompositionEvent"in window,Pl=null;Ha&&"documentMode"in document&&(Pl=document.documentMode);var Am=Ha&&"TextEvent"in window&&!Pl,xu=Ha&&(!Os||Pl&&8<Pl&&11>=Pl),gu=" ",bu=!1;function yu(e,t){switch(e){case"keyup":return km.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function zm(e,t){switch(e){case"compositionend":return vu(t);case"keypress":return t.which!==32?null:(bu=!0,gu);case"textInput":return e=t.data,e===gu&&bu?null:e;default:return null}}function Tm(e,t){if(cl)return e==="compositionend"||!Os&&yu(e,t)?(e=du(),Ji=ks=un=null,cl=!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 xu&&t.locale!=="ko"?null:t.data;default:return null}}var Rm={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 wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rm[e.type]:t==="textarea"}function Su(e,t,a,n){sl?ol?ol.push(n):ol=[n]:sl=n,t=Vr(t,"onChange"),0<t.length&&(a=new Wi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var ei=null,ti=null;function Om(e){ih(e,0)}function er(e){var t=Q(e);if(ca(t))return e}function _u(e,t){if(e==="change")return t}var ju=!1;if(Ha){var Ds;if(Ha){var Ms="oninput"in document;if(!Ms){var Nu=document.createElement("div");Nu.setAttribute("oninput","return;"),Ms=typeof Nu.oninput=="function"}Ds=Ms}else Ds=!1;ju=Ds&&(!document.documentMode||9<document.documentMode)}function Eu(){ei&&(ei.detachEvent("onpropertychange",Cu),ti=ei=null)}function Cu(e){if(e.propertyName==="value"&&er(ti)){var t=[];Su(t,ti,e,Ns(e)),uu(Om,t)}}function Dm(e,t,a){e==="focusin"?(Eu(),ei=t,ti=a,ei.attachEvent("onpropertychange",Cu)):e==="focusout"&&Eu()}function Mm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return er(ti)}function Um(e,t){if(e==="click")return er(t)}function Bm(e,t){if(e==="input"||e==="change")return er(t)}function Lm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aa=typeof Object.is=="function"?Object.is:Lm;function ai(e,t){if(aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!J.call(t,i)||!aa(e[i],t[i]))return!1}return!0}function ku(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Au(e,t){var a=ku(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ku(a)}}function zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_a(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=_a(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 Hm=Ha&&"documentMode"in document&&11>=document.documentMode,ul=null,Bs=null,ni=null,Ls=!1;function Ru(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ls||ul==null||ul!==_a(n)||(n=ul,"selectionStart"in n&&Us(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ni&&ai(ni,n)||(ni=n,n=Vr(Bs,"onSelect"),0<n.length&&(t=new Wi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=ul)))}function Ln(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var dl={animationend:Ln("Animation","AnimationEnd"),animationiteration:Ln("Animation","AnimationIteration"),animationstart:Ln("Animation","AnimationStart"),transitionrun:Ln("Transition","TransitionRun"),transitionstart:Ln("Transition","TransitionStart"),transitioncancel:Ln("Transition","TransitionCancel"),transitionend:Ln("Transition","TransitionEnd")},Hs={},Ou={};Ha&&(Ou=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function Hn(e){if(Hs[e])return Hs[e];if(!dl[e])return e;var t=dl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ou)return Hs[e]=t[a];return e}var Du=Hn("animationend"),Mu=Hn("animationiteration"),Uu=Hn("animationstart"),qm=Hn("transitionrun"),Ym=Hn("transitionstart"),Vm=Hn("transitioncancel"),Bu=Hn("transitionend"),Lu=new Map,qs="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(" ");qs.push("scrollEnd");function ja(e,t){Lu.set(e,t),Le(t,[e])}var tr=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)},da=[],fl=0,Ys=0;function ar(){for(var e=fl,t=Ys=fl=0;t<e;){var a=da[t];da[t++]=null;var n=da[t];da[t++]=null;var i=da[t];da[t++]=null;var s=da[t];if(da[t++]=null,n!==null&&i!==null){var g=n.pending;g===null?i.next=i:(i.next=g.next,g.next=i),n.pending=i}s!==0&&Hu(a,i,s)}}function nr(e,t,a,n){da[fl++]=e,da[fl++]=t,da[fl++]=a,da[fl++]=n,Ys|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Vs(e,t,a,n){return nr(e,t,a,n),lr(e)}function qn(e,t){return nr(e,null,null,t),lr(e)}function Hu(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var i=!1,s=e.return;s!==null;)s.childLanes|=a,n=s.alternate,n!==null&&(n.childLanes|=a),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-ft(a),e=s.hiddenUpdates,n=e[i],n===null?e[i]=[t]:n.push(t),t.lane=a|536870912),s):null}function lr(e){if(50<Ni)throw Ni=0,Wo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hl={};function Gm(e,t,a,n){this.tag=e,this.key=a,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(e,t,a,n){return new Gm(e,t,a,n)}function Gs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qa(e,t){var a=e.alternate;return a===null?(a=na(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function qu(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ir(e,t,a,n,i,s){var g=0;if(n=e,typeof e=="function")Gs(e)&&(g=1);else if(typeof e=="string")g=Ix(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=na(31,a,t,i),e.elementType=F,e.lanes=s,e;case x:return Yn(a.children,i,s,t);case v:g=8,i|=24;break;case y:return e=na(12,a,t,i|2),e.elementType=y,e.lanes=s,e;case B:return e=na(13,a,t,i),e.elementType=B,e.lanes=s,e;case Z:return e=na(19,a,t,i),e.elementType=Z,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:g=10;break e;case C:g=9;break e;case U:g=11;break e;case Y:g=14;break e;case ne:g=16,n=null;break e}g=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=na(g,a,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Yn(e,t,a,n){return e=na(7,e,n,t),e.lanes=a,e}function Zs(e,t,a){return e=na(6,e,null,t),e.lanes=a,e}function Yu(e){var t=na(18,null,null,0);return t.stateNode=e,t}function Xs(e,t,a){return t=na(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vu=new WeakMap;function fa(e,t){if(typeof e=="object"&&e!==null){var a=Vu.get(e);return a!==void 0?a:(t={value:e,source:t,stack:D(t)},Vu.set(e,t),t)}return{value:e,source:t,stack:D(t)}}var pl=[],ml=0,rr=null,li=0,ha=[],pa=0,dn=null,ka=1,Aa="";function Ya(e,t){pl[ml++]=li,pl[ml++]=rr,rr=e,li=t}function Gu(e,t,a){ha[pa++]=ka,ha[pa++]=Aa,ha[pa++]=dn,dn=e;var n=ka;e=Aa;var i=32-ft(n)-1;n&=~(1<<i),a+=1;var s=32-ft(t)+i;if(30<s){var g=i-i%5;s=(n&(1<<g)-1).toString(32),n>>=g,i-=g,ka=1<<32-ft(t)+i|a<<i|n,Aa=s+e}else ka=1<<s|a<<i|n,Aa=e}function Ks(e){e.return!==null&&(Ya(e,1),Gu(e,1,0))}function Qs(e){for(;e===rr;)rr=pl[--ml],pl[ml]=null,li=pl[--ml],pl[ml]=null;for(;e===dn;)dn=ha[--pa],ha[pa]=null,Aa=ha[--pa],ha[pa]=null,ka=ha[--pa],ha[pa]=null}function Zu(e,t){ha[pa++]=ka,ha[pa++]=Aa,ha[pa++]=dn,ka=t.id,Aa=t.overflow,dn=e}var Lt=null,ht=null,We=!1,fn=null,ma=!1,Is=Error(c(519));function hn(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ii(fa(t,e)),Is}function Xu(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Tt]=e,t[Bt]=n,a){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(a=0;a<Ci.length;a++)Ie(Ci[a],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),lu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),ru(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||ch(t.textContent,a)?(n.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),n.onScroll!=null&&Ie("scroll",t),n.onScrollEnd!=null&&Ie("scrollend",t),n.onClick!=null&&(t.onclick=La),t=!0):t=!1,t||hn(e,!0)}function Ku(e){for(Lt=e.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:ma=!1;return;case 27:case 3:ma=!0;return;default:Lt=Lt.return}}function xl(e){if(e!==Lt)return!1;if(!We)return Ku(e),We=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hc(e.type,e.memoizedProps)),a=!a),a&&ht&&hn(e),Ku(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=bh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ht=bh(e)}else t===27?(t=ht,Cn(e.type)?(e=bc,bc=null,ht=e):ht=t):ht=Lt?ga(e.stateNode.nextSibling):null;return!0}function Vn(){ht=Lt=null,We=!1}function Js(){var e=fn;return e!==null&&(Pt===null?Pt=e:Pt.push.apply(Pt,e),fn=null),e}function ii(e){fn===null?fn=[e]:fn.push(e)}var $s=A(null),Gn=null,Va=null;function pn(e,t,a){P($s,t._currentValue),t._currentValue=a}function Ga(e){e._currentValue=$s.current,O($s)}function Fs(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Ws(e,t,a,n){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var g=i.child;s=s.firstContext;e:for(;s!==null;){var R=s;s=i;for(var q=0;q<t.length;q++)if(R.context===t[q]){s.lanes|=a,R=s.alternate,R!==null&&(R.lanes|=a),Fs(s.return,a,e),n||(g=null);break e}s=R.next}}else if(i.tag===18){if(g=i.return,g===null)throw Error(c(341));g.lanes|=a,s=g.alternate,s!==null&&(s.lanes|=a),Fs(g,a,e),g=null}else g=i.child;if(g!==null)g.return=i;else for(g=i;g!==null;){if(g===e){g=null;break}if(i=g.sibling,i!==null){i.return=g.return,g=i;break}g=g.return}i=g}}function gl(e,t,a,n){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var g=i.alternate;if(g===null)throw Error(c(387));if(g=g.memoizedProps,g!==null){var R=i.type;aa(i.pendingProps.value,g.value)||(e!==null?e.push(R):e=[R])}}else if(i===Te.current){if(g=i.alternate,g===null)throw Error(c(387));g.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ri):e=[Ri])}i=i.return}e!==null&&Ws(t,e,a,n),t.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!aa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zn(e){Gn=e,Va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return Qu(Gn,e)}function or(e,t){return Gn===null&&Zn(e),Qu(e,t)}function Qu(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Va===null){if(e===null)throw Error(c(308));Va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Va=Va.next=t;return a}var Zm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Xm=l.unstable_scheduleCallback,Km=l.unstable_NormalPriority,Ct={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ps(){return{controller:new Zm,data:new Map,refCount:0}}function ri(e){e.refCount--,e.refCount===0&&Xm(Km,function(){e.controller.abort()})}var si=null,eo=0,bl=0,yl=null;function Qm(e,t){if(si===null){var a=si=[];eo=0,bl=lc(),yl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return eo++,t.then(Iu,Iu),t}function Iu(){if(--eo===0&&si!==null){yl!==null&&(yl.status="fulfilled");var e=si;si=null,bl=0,yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Im(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(n.status="rejected",n.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var Ju=X.S;X.S=function(e,t){Of=Se(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qm(e,t),Ju!==null&&Ju(e,t)};var Xn=A(null);function to(){var e=Xn.current;return e!==null?e:ct.pooledCache}function cr(e,t){t===null?P(Xn,Xn.current):P(Xn,t.pool)}function $u(){var e=to();return e===null?null:{parent:Ct._currentValue,pool:e}}var vl=Error(c(460)),ao=Error(c(474)),ur=Error(c(542)),dr={then:function(){}};function Fu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Wu(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(La,La),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e;default:if(typeof t.status=="string")t.then(La,La);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=n}},function(n){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e}throw Qn=t,vl}}function Kn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Qn=a,vl):a}}var Qn=null;function Pu(){if(Qn===null)throw Error(c(459));var e=Qn;return Qn=null,e}function ed(e){if(e===vl||e===ur)throw Error(c(483))}var wl=null,oi=0;function fr(e){var t=oi;return oi+=1,wl===null&&(wl=[]),Wu(wl,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hr(e,t){throw t.$$typeof===T?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function td(e){function t($,K){if(e){var ee=$.deletions;ee===null?($.deletions=[K],$.flags|=16):ee.push(K)}}function a($,K){if(!e)return null;for(;K!==null;)t($,K),K=K.sibling;return null}function n($){for(var K=new Map;$!==null;)$.key!==null?K.set($.key,$):K.set($.index,$),$=$.sibling;return K}function i($,K){return $=qa($,K),$.index=0,$.sibling=null,$}function s($,K,ee){return $.index=ee,e?(ee=$.alternate,ee!==null?(ee=ee.index,ee<K?($.flags|=67108866,K):ee):($.flags|=67108866,K)):($.flags|=1048576,K)}function g($){return e&&$.alternate===null&&($.flags|=67108866),$}function R($,K,ee,be){return K===null||K.tag!==6?(K=Zs(ee,$.mode,be),K.return=$,K):(K=i(K,ee),K.return=$,K)}function q($,K,ee,be){var Ue=ee.type;return Ue===x?pe($,K,ee.props.children,be,ee.key):K!==null&&(K.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&Kn(Ue)===K.type)?(K=i(K,ee.props),ci(K,ee),K.return=$,K):(K=ir(ee.type,ee.key,ee.props,null,$.mode,be),ci(K,ee),K.return=$,K)}function ae($,K,ee,be){return K===null||K.tag!==4||K.stateNode.containerInfo!==ee.containerInfo||K.stateNode.implementation!==ee.implementation?(K=Xs(ee,$.mode,be),K.return=$,K):(K=i(K,ee.children||[]),K.return=$,K)}function pe($,K,ee,be,Ue){return K===null||K.tag!==7?(K=Yn(ee,$.mode,be,Ue),K.return=$,K):(K=i(K,ee),K.return=$,K)}function ve($,K,ee){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Zs(""+K,$.mode,ee),K.return=$,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return ee=ir(K.type,K.key,K.props,null,$.mode,ee),ci(ee,K),ee.return=$,ee;case j:return K=Xs(K,$.mode,ee),K.return=$,K;case ne:return K=Kn(K),ve($,K,ee)}if(W(K)||M(K))return K=Yn(K,$.mode,ee,null),K.return=$,K;if(typeof K.then=="function")return ve($,fr(K),ee);if(K.$$typeof===E)return ve($,or($,K),ee);hr($,K)}return null}function ie($,K,ee,be){var Ue=K!==null?K.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ue!==null?null:R($,K,""+ee,be);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:return ee.key===Ue?q($,K,ee,be):null;case j:return ee.key===Ue?ae($,K,ee,be):null;case ne:return ee=Kn(ee),ie($,K,ee,be)}if(W(ee)||M(ee))return Ue!==null?null:pe($,K,ee,be,null);if(typeof ee.then=="function")return ie($,K,fr(ee),be);if(ee.$$typeof===E)return ie($,K,or($,ee),be);hr($,ee)}return null}function ue($,K,ee,be,Ue){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return $=$.get(ee)||null,R(K,$,""+be,Ue);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case S:return $=$.get(be.key===null?ee:be.key)||null,q(K,$,be,Ue);case j:return $=$.get(be.key===null?ee:be.key)||null,ae(K,$,be,Ue);case ne:return be=Kn(be),ue($,K,ee,be,Ue)}if(W(be)||M(be))return $=$.get(ee)||null,pe(K,$,be,Ue,null);if(typeof be.then=="function")return ue($,K,ee,fr(be),Ue);if(be.$$typeof===E)return ue($,K,ee,or(K,be),Ue);hr(K,be)}return null}function Oe($,K,ee,be){for(var Ue=null,Pe=null,Me=K,Xe=K=0,Fe=null;Me!==null&&Xe<ee.length;Xe++){Me.index>Xe?(Fe=Me,Me=null):Fe=Me.sibling;var et=ie($,Me,ee[Xe],be);if(et===null){Me===null&&(Me=Fe);break}e&&Me&&et.alternate===null&&t($,Me),K=s(et,K,Xe),Pe===null?Ue=et:Pe.sibling=et,Pe=et,Me=Fe}if(Xe===ee.length)return a($,Me),We&&Ya($,Xe),Ue;if(Me===null){for(;Xe<ee.length;Xe++)Me=ve($,ee[Xe],be),Me!==null&&(K=s(Me,K,Xe),Pe===null?Ue=Me:Pe.sibling=Me,Pe=Me);return We&&Ya($,Xe),Ue}for(Me=n(Me);Xe<ee.length;Xe++)Fe=ue(Me,$,Xe,ee[Xe],be),Fe!==null&&(e&&Fe.alternate!==null&&Me.delete(Fe.key===null?Xe:Fe.key),K=s(Fe,K,Xe),Pe===null?Ue=Fe:Pe.sibling=Fe,Pe=Fe);return e&&Me.forEach(function(Rn){return t($,Rn)}),We&&Ya($,Xe),Ue}function He($,K,ee,be){if(ee==null)throw Error(c(151));for(var Ue=null,Pe=null,Me=K,Xe=K=0,Fe=null,et=ee.next();Me!==null&&!et.done;Xe++,et=ee.next()){Me.index>Xe?(Fe=Me,Me=null):Fe=Me.sibling;var Rn=ie($,Me,et.value,be);if(Rn===null){Me===null&&(Me=Fe);break}e&&Me&&Rn.alternate===null&&t($,Me),K=s(Rn,K,Xe),Pe===null?Ue=Rn:Pe.sibling=Rn,Pe=Rn,Me=Fe}if(et.done)return a($,Me),We&&Ya($,Xe),Ue;if(Me===null){for(;!et.done;Xe++,et=ee.next())et=ve($,et.value,be),et!==null&&(K=s(et,K,Xe),Pe===null?Ue=et:Pe.sibling=et,Pe=et);return We&&Ya($,Xe),Ue}for(Me=n(Me);!et.done;Xe++,et=ee.next())et=ue(Me,$,Xe,et.value,be),et!==null&&(e&&et.alternate!==null&&Me.delete(et.key===null?Xe:et.key),K=s(et,K,Xe),Pe===null?Ue=et:Pe.sibling=et,Pe=et);return e&&Me.forEach(function(i0){return t($,i0)}),We&&Ya($,Xe),Ue}function ot($,K,ee,be){if(typeof ee=="object"&&ee!==null&&ee.type===x&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:e:{for(var Ue=ee.key;K!==null;){if(K.key===Ue){if(Ue=ee.type,Ue===x){if(K.tag===7){a($,K.sibling),be=i(K,ee.props.children),be.return=$,$=be;break e}}else if(K.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&Kn(Ue)===K.type){a($,K.sibling),be=i(K,ee.props),ci(be,ee),be.return=$,$=be;break e}a($,K);break}else t($,K);K=K.sibling}ee.type===x?(be=Yn(ee.props.children,$.mode,be,ee.key),be.return=$,$=be):(be=ir(ee.type,ee.key,ee.props,null,$.mode,be),ci(be,ee),be.return=$,$=be)}return g($);case j:e:{for(Ue=ee.key;K!==null;){if(K.key===Ue)if(K.tag===4&&K.stateNode.containerInfo===ee.containerInfo&&K.stateNode.implementation===ee.implementation){a($,K.sibling),be=i(K,ee.children||[]),be.return=$,$=be;break e}else{a($,K);break}else t($,K);K=K.sibling}be=Xs(ee,$.mode,be),be.return=$,$=be}return g($);case ne:return ee=Kn(ee),ot($,K,ee,be)}if(W(ee))return Oe($,K,ee,be);if(M(ee)){if(Ue=M(ee),typeof Ue!="function")throw Error(c(150));return ee=Ue.call(ee),He($,K,ee,be)}if(typeof ee.then=="function")return ot($,K,fr(ee),be);if(ee.$$typeof===E)return ot($,K,or($,ee),be);hr($,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,K!==null&&K.tag===6?(a($,K.sibling),be=i(K,ee),be.return=$,$=be):(a($,K),be=Zs(ee,$.mode,be),be.return=$,$=be),g($)):a($,K)}return function($,K,ee,be){try{oi=0;var Ue=ot($,K,ee,be);return wl=null,Ue}catch(Me){if(Me===vl||Me===ur)throw Me;var Pe=na(29,Me,null,$.mode);return Pe.lanes=be,Pe.return=$,Pe}}}var In=td(!0),ad=td(!1),mn=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(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 xn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gn(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(nt&2)!==0){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=lr(e),Hu(e,null,a),t}return nr(e,n,t,a),lr(e)}function ui(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Gl(e,a)}}function io(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var i=null,s=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};s===null?i=s=g:s=s.next=g,a=a.next}while(a!==null);s===null?i=s=t:s=s.next=t}else i=s=t;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ro=!1;function di(){if(ro){var e=yl;if(e!==null)throw e}}function fi(e,t,a,n){ro=!1;var i=e.updateQueue;mn=!1;var s=i.firstBaseUpdate,g=i.lastBaseUpdate,R=i.shared.pending;if(R!==null){i.shared.pending=null;var q=R,ae=q.next;q.next=null,g===null?s=ae:g.next=ae,g=q;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,R=pe.lastBaseUpdate,R!==g&&(R===null?pe.firstBaseUpdate=ae:R.next=ae,pe.lastBaseUpdate=q))}if(s!==null){var ve=i.baseState;g=0,pe=ae=q=null,R=s;do{var ie=R.lane&-536870913,ue=ie!==R.lane;if(ue?($e&ie)===ie:(n&ie)===ie){ie!==0&&ie===bl&&(ro=!0),pe!==null&&(pe=pe.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Oe=e,He=R;ie=t;var ot=a;switch(He.tag){case 1:if(Oe=He.payload,typeof Oe=="function"){ve=Oe.call(ot,ve,ie);break e}ve=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=He.payload,ie=typeof Oe=="function"?Oe.call(ot,ve,ie):Oe,ie==null)break e;ve=N({},ve,ie);break e;case 2:mn=!0}}ie=R.callback,ie!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=i.callbacks,ue===null?i.callbacks=[ie]:ue.push(ie))}else ue={lane:ie,tag:R.tag,payload:R.payload,callback:R.callback,next:null},pe===null?(ae=pe=ue,q=ve):pe=pe.next=ue,g|=ie;if(R=R.next,R===null){if(R=i.shared.pending,R===null)break;ue=R,R=ue.next,ue.next=null,i.lastBaseUpdate=ue,i.shared.pending=null}}while(!0);pe===null&&(q=ve),i.baseState=q,i.firstBaseUpdate=ae,i.lastBaseUpdate=pe,s===null&&(i.shared.lanes=0),Sn|=g,e.lanes=g,e.memoizedState=ve}}function nd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ld(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nd(a[e],t)}var Sl=A(null),pr=A(0);function id(e,t){e=Wa,P(pr,e),P(Sl,t),Wa=e|t.baseLanes}function so(){P(pr,Wa),P(Sl,Sl.current)}function oo(){Wa=pr.current,O(Sl),O(pr)}var la=A(null),xa=null;function bn(e){var t=e.alternate;P(St,St.current&1),P(la,e),xa===null&&(t===null||Sl.current!==null||t.memoizedState!==null)&&(xa=e)}function co(e){P(St,St.current),P(la,e),xa===null&&(xa=e)}function rd(e){e.tag===22?(P(St,St.current),P(la,e),xa===null&&(xa=e)):yn()}function yn(){P(St,St.current),P(la,la.current)}function ia(e){O(la),xa===e&&(xa=null),O(St)}var St=A(0);function mr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xc(a)||gc(a)))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 Za=0,Ze=null,rt=null,kt=null,xr=!1,_l=!1,Jn=!1,gr=0,hi=0,jl=null,Jm=0;function yt(){throw Error(c(321))}function uo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!aa(e[a],t[a]))return!1;return!0}function fo(e,t,a,n,i,s){return Za=s,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?Gd:Co,Jn=!1,s=a(n,i),Jn=!1,_l&&(s=od(t,a,n,i)),sd(e),s}function sd(e){X.H=xi;var t=rt!==null&&rt.next!==null;if(Za=0,kt=rt=Ze=null,xr=!1,hi=0,jl=null,t)throw Error(c(300));e===null||At||(e=e.dependencies,e!==null&&sr(e)&&(At=!0))}function od(e,t,a,n){Ze=e;var i=0;do{if(_l&&(jl=null),hi=0,_l=!1,25<=i)throw Error(c(301));if(i+=1,kt=rt=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}X.H=Zd,s=t(a,n)}while(_l);return s}function $m(){var e=X.H,t=e.useState()[0];return t=typeof t.then=="function"?pi(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Ze.flags|=1024),t}function ho(){var e=gr!==0;return gr=0,e}function po(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function mo(e){if(xr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xr=!1}Za=0,kt=rt=Ze=null,_l=!1,hi=gr=0,jl=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?Ze.memoizedState=kt=e:kt=kt.next=e,kt}function _t(){if(rt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=kt===null?Ze.memoizedState:kt.next;if(t!==null)kt=t,rt=e;else{if(e===null)throw Ze.alternate===null?Error(c(467)):Error(c(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},kt===null?Ze.memoizedState=kt=e:kt=kt.next=e}return kt}function br(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pi(e){var t=hi;return hi+=1,jl===null&&(jl=[]),e=Wu(jl,e,t),t=Ze,(kt===null?t.memoizedState:kt.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?Gd:Co),e}function yr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pi(e);if(e.$$typeof===E)return Ht(e)}throw Error(c(438,String(e)))}function xo(e){var t=null,a=Ze.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ze.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=br(),Ze.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=ge;return t.index++,a}function Xa(e,t){return typeof t=="function"?t(e):t}function vr(e){var t=_t();return go(t,rt,e)}function go(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var i=e.baseQueue,s=n.pending;if(s!==null){if(i!==null){var g=i.next;i.next=s.next,s.next=g}t.baseQueue=i=s,n.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var R=g=null,q=null,ae=t,pe=!1;do{var ve=ae.lane&-536870913;if(ve!==ae.lane?($e&ve)===ve:(Za&ve)===ve){var ie=ae.revertLane;if(ie===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ve===bl&&(pe=!0);else if((Za&ie)===ie){ae=ae.next,ie===bl&&(pe=!0);continue}else ve={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},q===null?(R=q=ve,g=s):q=q.next=ve,Ze.lanes|=ie,Sn|=ie;ve=ae.action,Jn&&a(s,ve),s=ae.hasEagerState?ae.eagerState:a(s,ve)}else ie={lane:ve,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},q===null?(R=q=ie,g=s):q=q.next=ie,Ze.lanes|=ve,Sn|=ve;ae=ae.next}while(ae!==null&&ae!==t);if(q===null?g=s:q.next=R,!aa(s,e.memoizedState)&&(At=!0,pe&&(a=yl,a!==null)))throw a;e.memoizedState=s,e.baseState=g,e.baseQueue=q,n.lastRenderedState=s}return i===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function bo(e){var t=_t(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,i=a.pending,s=t.memoizedState;if(i!==null){a.pending=null;var g=i=i.next;do s=e(s,g.action),g=g.next;while(g!==i);aa(s,t.memoizedState)||(At=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),a.lastRenderedState=s}return[s,n]}function cd(e,t,a){var n=Ze,i=_t(),s=We;if(s){if(a===void 0)throw Error(c(407));a=a()}else a=t();var g=!aa((rt||i).memoizedState,a);if(g&&(i.memoizedState=a,At=!0),i=i.queue,wo(fd.bind(null,n,i,e),[e]),i.getSnapshot!==t||g||kt!==null&&kt.memoizedState.tag&1){if(n.flags|=2048,Nl(9,{destroy:void 0},dd.bind(null,n,i,a,t),null),ct===null)throw Error(c(349));s||(Za&127)!==0||ud(n,t,a)}return a}function ud(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ze.updateQueue,t===null?(t=br(),Ze.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function dd(e,t,a,n){t.value=a,t.getSnapshot=n,hd(t)&&pd(e)}function fd(e,t,a){return a(function(){hd(t)&&pd(e)})}function hd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!aa(e,a)}catch{return!0}}function pd(e){var t=qn(e,2);t!==null&&ea(t,e,2)}function yo(e){var t=Qt();if(typeof e=="function"){var a=e;if(e=a(),Jn){Mt(!0);try{a()}finally{Mt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:e},t}function md(e,t,a,n){return e.baseState=a,go(e,rt,typeof n=="function"?n:Xa)}function Fm(e,t,a,n,i){if(_r(e))throw Error(c(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){s.listeners.push(g)}};X.T!==null?a(!0):s.isTransition=!1,n(s),a=t.pending,a===null?(s.next=t.pending=s,xd(t,s)):(s.next=a.next,t.pending=a.next=s)}}function xd(e,t){var a=t.action,n=t.payload,i=e.state;if(t.isTransition){var s=X.T,g={};X.T=g;try{var R=a(i,n),q=X.S;q!==null&&q(g,R),gd(e,t,R)}catch(ae){vo(e,t,ae)}finally{s!==null&&g.types!==null&&(s.types=g.types),X.T=s}}else try{s=a(i,n),gd(e,t,s)}catch(ae){vo(e,t,ae)}}function gd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){bd(e,t,n)},function(n){return vo(e,t,n)}):bd(e,t,a)}function bd(e,t,a){t.status="fulfilled",t.value=a,yd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,xd(e,a)))}function vo(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,yd(t),t=t.next;while(t!==n)}e.action=null}function yd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vd(e,t){return t}function wd(e,t){if(We){var a=ct.formState;if(a!==null){e:{var n=Ze;if(We){if(ht){t:{for(var i=ht,s=ma;i.nodeType!==8;){if(!s){i=null;break t}if(i=ga(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){ht=ga(i.nextSibling),n=i.data==="F!";break e}}hn(n)}n=!1}n&&(t=a[0])}}return a=Qt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:t},a.queue=n,a=qd.bind(null,Ze,n),n.dispatch=a,n=yo(!1),s=Eo.bind(null,Ze,!1,n.queue),n=Qt(),i={state:t,dispatch:null,action:e,pending:null},n.queue=i,a=Fm.bind(null,Ze,i,s,a),i.dispatch=a,n.memoizedState=e,[t,a,!1]}function Sd(e){var t=_t();return _d(t,rt,e)}function _d(e,t,a){if(t=go(e,t,vd)[0],e=vr(Xa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=pi(t)}catch(g){throw g===vl?ur:g}else n=t;t=_t();var i=t.queue,s=i.dispatch;return a!==t.memoizedState&&(Ze.flags|=2048,Nl(9,{destroy:void 0},Wm.bind(null,i,a),null)),[n,s,e]}function Wm(e,t){e.action=t}function jd(e){var t=_t(),a=rt;if(a!==null)return _d(t,a,e);_t(),t=t.memoizedState,a=_t();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Nl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=br(),Ze.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Nd(){return _t().memoizedState}function wr(e,t,a,n){var i=Qt();Ze.flags|=e,i.memoizedState=Nl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Sr(e,t,a,n){var i=_t();n=n===void 0?null:n;var s=i.memoizedState.inst;rt!==null&&n!==null&&uo(n,rt.memoizedState.deps)?i.memoizedState=Nl(t,s,a,n):(Ze.flags|=e,i.memoizedState=Nl(1|t,s,a,n))}function Ed(e,t){wr(8390656,8,e,t)}function wo(e,t){Sr(2048,8,e,t)}function Pm(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=br(),Ze.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Cd(e){var t=_t().memoizedState;return Pm({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function kd(e,t){return Sr(4,2,e,t)}function Ad(e,t){return Sr(4,4,e,t)}function zd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Td(e,t,a){a=a!=null?a.concat([e]):null,Sr(4,4,zd.bind(null,t,e),a)}function So(){}function Rd(e,t){var a=_t();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&uo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Od(e,t){var a=_t();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&uo(t,n[1]))return n[0];if(n=e(),Jn){Mt(!0);try{e()}finally{Mt(!1)}}return a.memoizedState=[n,t],n}function _o(e,t,a){return a===void 0||(Za&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Mf(),Ze.lanes|=e,Sn|=e,a)}function Dd(e,t,a,n){return aa(a,t)?a:Sl.current!==null?(e=_o(e,a,n),aa(e,t)||(At=!0),e):(Za&42)===0||(Za&1073741824)!==0&&($e&261930)===0?(At=!0,e.memoizedState=a):(e=Mf(),Ze.lanes|=e,Sn|=e,t)}function Md(e,t,a,n,i){var s=I.p;I.p=s!==0&&8>s?s:8;var g=X.T,R={};X.T=R,Eo(e,!1,t,a);try{var q=i(),ae=X.S;if(ae!==null&&ae(R,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var pe=Im(q,n);mi(e,t,pe,oa(e))}else mi(e,t,n,oa(e))}catch(ve){mi(e,t,{then:function(){},status:"rejected",reason:ve},oa())}finally{I.p=s,g!==null&&R.types!==null&&(g.types=R.types),X.T=g}}function ex(){}function jo(e,t,a,n){if(e.tag!==5)throw Error(c(476));var i=Ud(e).queue;Md(e,i,t,xe,a===null?ex:function(){return Bd(e),a(n)})}function Ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:xe},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bd(e){var t=Ud(e);t.next===null&&(t=e.alternate.memoizedState),mi(e,t.next.queue,{},oa())}function No(){return Ht(Ri)}function Ld(){return _t().memoizedState}function Hd(){return _t().memoizedState}function tx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=xn(a);var n=gn(t,e,a);n!==null&&(ea(n,t,a),ui(n,t,a)),t={cache:Ps()},e.payload=t;return}t=t.return}}function ax(e,t,a){var n=oa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},_r(e)?Yd(t,a):(a=Vs(e,t,a,n),a!==null&&(ea(a,e,n),Vd(a,t,n)))}function qd(e,t,a){var n=oa();mi(e,t,a,n)}function mi(e,t,a,n){var i={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(_r(e))Yd(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var g=t.lastRenderedState,R=s(g,a);if(i.hasEagerState=!0,i.eagerState=R,aa(R,g))return nr(e,t,i,0),ct===null&&ar(),!1}catch{}if(a=Vs(e,t,i,n),a!==null)return ea(a,e,n),Vd(a,t,n),!0}return!1}function Eo(e,t,a,n){if(n={lane:2,revertLane:lc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_r(e)){if(t)throw Error(c(479))}else t=Vs(e,a,n,2),t!==null&&ea(t,e,2)}function _r(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function Yd(e,t){_l=xr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Vd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Gl(e,a)}}var xi={readContext:Ht,use:yr,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};xi.useEffectEvent=yt;var Gd={readContext:Ht,use:yr,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Ed,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,wr(4194308,4,zd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return wr(4194308,4,e,t)},useInsertionEffect:function(e,t){wr(4,2,e,t)},useMemo:function(e,t){var a=Qt();t=t===void 0?null:t;var n=e();if(Jn){Mt(!0);try{e()}finally{Mt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Qt();if(a!==void 0){var i=a(t);if(Jn){Mt(!0);try{a(t)}finally{Mt(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=ax.bind(null,Ze,e),[n.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yo(e);var t=e.queue,a=qd.bind(null,Ze,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:So,useDeferredValue:function(e,t){var a=Qt();return _o(a,e,t)},useTransition:function(){var e=yo(!1);return e=Md.bind(null,Ze,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ze,i=Qt();if(We){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),ct===null)throw Error(c(349));($e&127)!==0||ud(n,t,a)}i.memoizedState=a;var s={value:a,getSnapshot:t};return i.queue=s,Ed(fd.bind(null,n,s,e),[e]),n.flags|=2048,Nl(9,{destroy:void 0},dd.bind(null,n,s,a,t),null),a},useId:function(){var e=Qt(),t=ct.identifierPrefix;if(We){var a=Aa,n=ka;a=(n&~(1<<32-ft(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Jm++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:No,useFormState:wd,useActionState:wd,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Eo.bind(null,Ze,!0,a),a.dispatch=t,[e,t]},useMemoCache:xo,useCacheRefresh:function(){return Qt().memoizedState=tx.bind(null,Ze)},useEffectEvent:function(e){var t=Qt(),a={impl:e};return t.memoizedState=a,function(){if((nt&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Co={readContext:Ht,use:yr,useCallback:Rd,useContext:Ht,useEffect:wo,useImperativeHandle:Td,useInsertionEffect:kd,useLayoutEffect:Ad,useMemo:Od,useReducer:vr,useRef:Nd,useState:function(){return vr(Xa)},useDebugValue:So,useDeferredValue:function(e,t){var a=_t();return Dd(a,rt.memoizedState,e,t)},useTransition:function(){var e=vr(Xa)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pi(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:No,useFormState:Sd,useActionState:Sd,useOptimistic:function(e,t){var a=_t();return md(a,rt,e,t)},useMemoCache:xo,useCacheRefresh:Hd};Co.useEffectEvent=Cd;var Zd={readContext:Ht,use:yr,useCallback:Rd,useContext:Ht,useEffect:wo,useImperativeHandle:Td,useInsertionEffect:kd,useLayoutEffect:Ad,useMemo:Od,useReducer:bo,useRef:Nd,useState:function(){return bo(Xa)},useDebugValue:So,useDeferredValue:function(e,t){var a=_t();return rt===null?_o(a,e,t):Dd(a,rt.memoizedState,e,t)},useTransition:function(){var e=bo(Xa)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pi(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:No,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var a=_t();return rt!==null?md(a,rt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:xo,useCacheRefresh:Hd};Zd.useEffectEvent=Cd;function ko(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:N({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ao={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=oa(),i=xn(n);i.payload=t,a!=null&&(i.callback=a),t=gn(e,i,n),t!==null&&(ea(t,e,n),ui(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=oa(),i=xn(n);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=gn(e,i,n),t!==null&&(ea(t,e,n),ui(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),n=xn(a);n.tag=2,t!=null&&(n.callback=t),t=gn(e,n,a),t!==null&&(ea(t,e,a),ui(t,e,a))}};function Xd(e,t,a,n,i,s,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,g):t.prototype&&t.prototype.isPureReactComponent?!ai(a,n)||!ai(i,s):!0}function Kd(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Ao.enqueueReplaceState(t,t.state,null)}function $n(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=N({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Qd(e){tr(e)}function Id(e){console.error(e)}function Jd(e){tr(e)}function jr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function $d(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function zo(e,t,a){return a=xn(a),a.tag=3,a.payload={element:null},a.callback=function(){jr(e,t)},a}function Fd(e){return e=xn(e),e.tag=3,e}function Wd(e,t,a,n){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var s=n.value;e.payload=function(){return i(s)},e.callback=function(){$d(t,a,n)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){$d(t,a,n),typeof i!="function"&&(_n===null?_n=new Set([this]):_n.add(this));var R=n.stack;this.componentDidCatch(n.value,{componentStack:R!==null?R:""})})}function nx(e,t,a,n,i){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&gl(t,a,i,!0),a=la.current,a!==null){switch(a.tag){case 31:case 13:return xa===null?Ur():a.alternate===null&&vt===0&&(vt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===dr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),tc(e,n,i)),!1;case 22:return a.flags|=65536,n===dr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),tc(e,n,i)),!1}throw Error(c(435,a.tag))}return tc(e,n,i),Ur(),!1}if(We)return t=la.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==Is&&(e=Error(c(422),{cause:n}),ii(fa(e,a)))):(n!==Is&&(t=Error(c(423),{cause:n}),ii(fa(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,n=fa(n,a),i=zo(e.stateNode,n,i),io(e,i),vt!==4&&(vt=2)),!1;var s=Error(c(520),{cause:n});if(s=fa(s,a),ji===null?ji=[s]:ji.push(s),vt!==4&&(vt=2),t===null)return!0;n=fa(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=zo(a.stateNode,n,e),io(a,e),!1;case 1:if(t=a.type,s=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(_n===null||!_n.has(s))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Fd(i),Wd(i,e,a,n),io(a,i),!1}a=a.return}while(a!==null);return!1}var To=Error(c(461)),At=!1;function qt(e,t,a,n){t.child=e===null?ad(t,null,a,n):In(t,e.child,a,n)}function Pd(e,t,a,n,i){a=a.render;var s=t.ref;if("ref"in n){var g={};for(var R in n)R!=="ref"&&(g[R]=n[R])}else g=n;return Zn(t),n=fo(e,t,a,g,s,i),R=ho(),e!==null&&!At?(po(e,t,i),Ka(e,t,i)):(We&&R&&Ks(t),t.flags|=1,qt(e,t,n,i),t.child)}function ef(e,t,a,n,i){if(e===null){var s=a.type;return typeof s=="function"&&!Gs(s)&&s.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=s,tf(e,t,s,n,i)):(e=ir(a.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Ho(e,i)){var g=s.memoizedProps;if(a=a.compare,a=a!==null?a:ai,a(g,n)&&e.ref===t.ref)return Ka(e,t,i)}return t.flags|=1,e=qa(s,n),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,a,n,i){if(e!==null){var s=e.memoizedProps;if(ai(s,n)&&e.ref===t.ref)if(At=!1,t.pendingProps=n=s,Ho(e,i))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,Ka(e,t,i)}return Ro(e,t,a,n,i)}function af(e,t,a,n){var i=n.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|a:a,e!==null){for(n=t.child=e.child,i=0;n!==null;)i=i|n.lanes|n.childLanes,n=n.sibling;n=i&~s}else n=0,t.child=null;return nf(e,t,s,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cr(t,s!==null?s.cachePool:null),s!==null?id(t,s):so(),rd(t);else return n=t.lanes=536870912,nf(e,t,s!==null?s.baseLanes|a:a,a,n)}else s!==null?(cr(t,s.cachePool),id(t,s),yn(),t.memoizedState=null):(e!==null&&cr(t,null),so(),yn());return qt(e,t,i,a),t.child}function gi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,a,n,i){var s=to();return s=s===null?null:{parent:Ct._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&cr(t,null),so(),rd(t),e!==null&&gl(e,t,n,!0),t.childLanes=i,null}function Nr(e,t){return t=Cr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lf(e,t,a){return In(t,e.child,null,a),e=Nr(t,t.pendingProps),e.flags|=2,ia(t),t.memoizedState=null,e}function lx(e,t,a){var n=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(n.mode==="hidden")return e=Nr(t,n),t.lanes=536870912,gi(null,e);if(co(t),(e=ht)?(e=gh(e,ma),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dn!==null?{id:ka,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},a=Yu(e),a.return=t,t.child=a,Lt=t,ht=null)):e=null,e===null)throw hn(t);return t.lanes=536870912,null}return Nr(t,n)}var s=e.memoizedState;if(s!==null){var g=s.dehydrated;if(co(t),i)if(t.flags&256)t.flags&=-257,t=lf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(At||gl(e,t,a,!1),i=(a&e.childLanes)!==0,At||i){if(n=ct,n!==null&&(g=Zl(n,a),g!==0&&g!==s.retryLane))throw s.retryLane=g,qn(e,g),ea(n,e,g),To;Ur(),t=lf(e,t,a)}else e=s.treeContext,ht=ga(g.nextSibling),Lt=t,We=!0,fn=null,ma=!1,e!==null&&Zu(t,e),t=Nr(t,n),t.flags|=4096;return t}return e=qa(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Er(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ro(e,t,a,n,i){return Zn(t),a=fo(e,t,a,n,void 0,i),n=ho(),e!==null&&!At?(po(e,t,i),Ka(e,t,i)):(We&&n&&Ks(t),t.flags|=1,qt(e,t,a,i),t.child)}function rf(e,t,a,n,i,s){return Zn(t),t.updateQueue=null,a=od(t,n,a,i),sd(e),n=ho(),e!==null&&!At?(po(e,t,s),Ka(e,t,s)):(We&&n&&Ks(t),t.flags|=1,qt(e,t,a,s),t.child)}function sf(e,t,a,n,i){if(Zn(t),t.stateNode===null){var s=hl,g=a.contextType;typeof g=="object"&&g!==null&&(s=Ht(g)),s=new a(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ao,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},no(t),g=a.contextType,s.context=typeof g=="object"&&g!==null?Ht(g):hl,s.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(ko(t,a,g,n),s.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(g=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),g!==s.state&&Ao.enqueueReplaceState(s,s.state,null),fi(t,n,s,i),di(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var R=t.memoizedProps,q=$n(a,R);s.props=q;var ae=s.context,pe=a.contextType;g=hl,typeof pe=="object"&&pe!==null&&(g=Ht(pe));var ve=a.getDerivedStateFromProps;pe=typeof ve=="function"||typeof s.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,pe||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(R||ae!==g)&&Kd(t,s,n,g),mn=!1;var ie=t.memoizedState;s.state=ie,fi(t,n,s,i),di(),ae=t.memoizedState,R||ie!==ae||mn?(typeof ve=="function"&&(ko(t,a,ve,n),ae=t.memoizedState),(q=mn||Xd(t,a,q,n,ie,ae,g))?(pe||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=ae),s.props=n,s.state=ae,s.context=g,n=q):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,lo(e,t),g=t.memoizedProps,pe=$n(a,g),s.props=pe,ve=t.pendingProps,ie=s.context,ae=a.contextType,q=hl,typeof ae=="object"&&ae!==null&&(q=Ht(ae)),R=a.getDerivedStateFromProps,(ae=typeof R=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g!==ve||ie!==q)&&Kd(t,s,n,q),mn=!1,ie=t.memoizedState,s.state=ie,fi(t,n,s,i),di();var ue=t.memoizedState;g!==ve||ie!==ue||mn||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof R=="function"&&(ko(t,a,R,n),ue=t.memoizedState),(pe=mn||Xd(t,a,pe,n,ie,ue,q)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(ae||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,ue,q),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,ue,q)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ue),s.props=n,s.state=ue,s.context=q,n=pe):(typeof s.componentDidUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,Er(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=In(t,e.child,null,i),t.child=In(t,null,a,i)):qt(e,t,a,i),t.memoizedState=s.state,e=t.child):e=Ka(e,t,i),e}function of(e,t,a,n){return Vn(),t.flags|=256,qt(e,t,a,n),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Do(e){return{baseLanes:e,cachePool:$u()}}function Mo(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=sa),e}function cf(e,t,a){var n=t.pendingProps,i=!1,s=(t.flags&128)!==0,g;if((g=s)||(g=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),g&&(i=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(i?bn(t):yn(),(e=ht)?(e=gh(e,ma),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dn!==null?{id:ka,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},a=Yu(e),a.return=t,t.child=a,Lt=t,ht=null)):e=null,e===null)throw hn(t);return gc(e)?t.lanes=32:t.lanes=536870912,null}var R=n.children;return n=n.fallback,i?(yn(),i=t.mode,R=Cr({mode:"hidden",children:R},i),n=Yn(n,i,a,null),R.return=t,n.return=t,R.sibling=n,t.child=R,n=t.child,n.memoizedState=Do(a),n.childLanes=Mo(e,g,a),t.memoizedState=Oo,gi(null,n)):(bn(t),Uo(t,R))}var q=e.memoizedState;if(q!==null&&(R=q.dehydrated,R!==null)){if(s)t.flags&256?(bn(t),t.flags&=-257,t=Bo(e,t,a)):t.memoizedState!==null?(yn(),t.child=e.child,t.flags|=128,t=null):(yn(),R=n.fallback,i=t.mode,n=Cr({mode:"visible",children:n.children},i),R=Yn(R,i,a,null),R.flags|=2,n.return=t,R.return=t,n.sibling=R,t.child=n,In(t,e.child,null,a),n=t.child,n.memoizedState=Do(a),n.childLanes=Mo(e,g,a),t.memoizedState=Oo,t=gi(null,n));else if(bn(t),gc(R)){if(g=R.nextSibling&&R.nextSibling.dataset,g)var ae=g.dgst;g=ae,n=Error(c(419)),n.stack="",n.digest=g,ii({value:n,source:null,stack:null}),t=Bo(e,t,a)}else if(At||gl(e,t,a,!1),g=(a&e.childLanes)!==0,At||g){if(g=ct,g!==null&&(n=Zl(g,a),n!==0&&n!==q.retryLane))throw q.retryLane=n,qn(e,n),ea(g,e,n),To;xc(R)||Ur(),t=Bo(e,t,a)}else xc(R)?(t.flags|=192,t.child=e.child,t=null):(e=q.treeContext,ht=ga(R.nextSibling),Lt=t,We=!0,fn=null,ma=!1,e!==null&&Zu(t,e),t=Uo(t,n.children),t.flags|=4096);return t}return i?(yn(),R=n.fallback,i=t.mode,q=e.child,ae=q.sibling,n=qa(q,{mode:"hidden",children:n.children}),n.subtreeFlags=q.subtreeFlags&65011712,ae!==null?R=qa(ae,R):(R=Yn(R,i,a,null),R.flags|=2),R.return=t,n.return=t,n.sibling=R,t.child=n,gi(null,n),n=t.child,R=e.child.memoizedState,R===null?R=Do(a):(i=R.cachePool,i!==null?(q=Ct._currentValue,i=i.parent!==q?{parent:q,pool:q}:i):i=$u(),R={baseLanes:R.baseLanes|a,cachePool:i}),n.memoizedState=R,n.childLanes=Mo(e,g,a),t.memoizedState=Oo,gi(e.child,n)):(bn(t),a=e.child,e=a.sibling,a=qa(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function Uo(e,t){return t=Cr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cr(e,t){return e=na(22,e,null,t),e.lanes=0,e}function Bo(e,t,a){return In(t,e.child,null,a),e=Uo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Fs(e.return,t,a)}function Lo(e,t,a,n,i,s){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i,treeForkCount:s}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=n,g.tail=a,g.tailMode=i,g.treeForkCount=s)}function df(e,t,a){var n=t.pendingProps,i=n.revealOrder,s=n.tail;n=n.children;var g=St.current,R=(g&2)!==0;if(R?(g=g&1|2,t.flags|=128):g&=1,P(St,g),qt(e,t,n,a),n=We?li:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uf(e,a,t);else if(e.tag===19)uf(e,a,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(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&mr(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Lo(t,!1,i,a,s,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mr(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Lo(t,!0,a,null,s,n);break;case"together":Lo(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ka(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Sn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(gl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=qa(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=qa(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Ho(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&sr(e)))}function ix(e,t,a){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),pn(t,Ct,e.memoizedState.cache),Vn();break;case 27:case 5:Ke(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:pn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(bn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?cf(e,t,a):(bn(t),e=Ka(e,t,a),e!==null?e.sibling:null);bn(t);break;case 19:var i=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(gl(e,t,a,!1),n=(a&t.childLanes)!==0),i){if(n)return df(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),P(St,St.current),n)break;return null;case 22:return t.lanes=0,af(e,t,a,t.pendingProps);case 24:pn(t,Ct,e.memoizedState.cache)}return Ka(e,t,a)}function ff(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!Ho(e,a)&&(t.flags&128)===0)return At=!1,ix(e,t,a);At=(e.flags&131072)!==0}else At=!1,We&&(t.flags&1048576)!==0&&Gu(t,li,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Kn(t.elementType),t.type=e,typeof e=="function")Gs(e)?(n=$n(e,n),t.tag=1,t=sf(null,t,e,n,a)):(t.tag=0,t=Ro(null,t,e,n,a));else{if(e!=null){var i=e.$$typeof;if(i===U){t.tag=11,t=Pd(null,t,e,n,a);break e}else if(i===Y){t.tag=14,t=ef(null,t,e,n,a);break e}}throw t=_(e)||e,Error(c(306,t,""))}}return t;case 0:return Ro(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,i=$n(n,t.pendingProps),sf(e,t,n,i,a);case 3:e:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var s=t.memoizedState;i=s.element,lo(e,t),fi(t,n,null,a);var g=t.memoizedState;if(n=g.cache,pn(t,Ct,n),n!==s.cache&&Ws(t,[Ct],a,!0),di(),n=g.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=of(e,t,n,a);break e}else if(n!==i){i=fa(Error(c(424)),t),ii(i),t=of(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ht=ga(e.firstChild),Lt=t,We=!0,fn=null,ma=!0,a=ad(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Vn(),n===i){t=Ka(e,t,a);break e}qt(e,t,n,a)}t=t.child}return t;case 26:return Er(e,t),e===null?(a=_h(t.type,null,t.pendingProps,null))?t.memoizedState=a:We||(a=t.type,e=t.pendingProps,n=Gr(Ne.current).createElement(a),n[Tt]=t,n[Bt]=e,Yt(n,a,e),he(n),t.stateNode=n):t.memoizedState=_h(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ke(t),e===null&&We&&(n=t.stateNode=vh(t.type,t.pendingProps,Ne.current),Lt=t,ma=!0,i=ht,Cn(t.type)?(bc=i,ht=ga(n.firstChild)):ht=i),qt(e,t,t.pendingProps.children,a),Er(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((i=n=ht)&&(n=Mx(n,t.type,t.pendingProps,ma),n!==null?(t.stateNode=n,Lt=t,ht=ga(n.firstChild),ma=!1,i=!0):i=!1),i||hn(t)),Ke(t),i=t.type,s=t.pendingProps,g=e!==null?e.memoizedProps:null,n=s.children,hc(i,s)?n=null:g!==null&&hc(i,g)&&(t.flags|=32),t.memoizedState!==null&&(i=fo(e,t,$m,null,null,a),Ri._currentValue=i),Er(e,t),qt(e,t,n,a),t.child;case 6:return e===null&&We&&((e=a=ht)&&(a=Ux(a,t.pendingProps,ma),a!==null?(t.stateNode=a,Lt=t,ht=null,e=!0):e=!1),e||hn(t)),null;case 13:return cf(e,t,a);case 4:return Ae(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=In(t,null,n,a):qt(e,t,n,a),t.child;case 11:return Pd(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pn(t,t.type,n.value),qt(e,t,n.children,a),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,Zn(t),i=Ht(i),n=n(i),t.flags|=1,qt(e,t,n,a),t.child;case 14:return ef(e,t,t.type,t.pendingProps,a);case 15:return tf(e,t,t.type,t.pendingProps,a);case 19:return df(e,t,a);case 31:return lx(e,t,a);case 22:return af(e,t,a,t.pendingProps);case 24:return Zn(t),n=Ht(Ct),e===null?(i=to(),i===null&&(i=ct,s=Ps(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=a),i=s),t.memoizedState={parent:n,cache:i},no(t),pn(t,Ct,i)):((e.lanes&a)!==0&&(lo(e,t),fi(t,null,null,a),di()),i=e.memoizedState,s=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),pn(t,Ct,n)):(n=s.cache,pn(t,Ct,n),n!==i.cache&&Ws(t,[Ct],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Qa(e){e.flags|=4}function qo(e,t,a,n,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Hf())e.flags|=8192;else throw Qn=dr,ao}else e.flags&=-16777217}function hf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kh(t))if(Hf())e.flags|=8192;else throw Qn=dr,ao}function kr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,Al|=t)}function bi(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function rx(e,t,a){var n=t.pendingProps;switch(Qs(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return pt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ga(Ct),De(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xl(t)?Qa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Js())),pt(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(Qa(t),s!==null?(pt(t),hf(t,s)):(pt(t),qo(t,i,null,n,a))):s?s!==e.memoizedState?(Qa(t),pt(t),hf(t,s)):(pt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Qa(t),pt(t),qo(t,i,e,n,a)),null;case 27:if(Je(t),a=Ne.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Qa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return pt(t),null}e=le.current,xl(t)?Xu(t):(e=vh(i,n,a),t.stateNode=e,Qa(t))}return pt(t),null;case 5:if(Je(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Qa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return pt(t),null}if(s=le.current,xl(t))Xu(t);else{var g=Gr(Ne.current);switch(s){case 1:s=g.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=g.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=g.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=g.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=g.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?g.createElement("select",{is:n.is}):g.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?g.createElement(i,{is:n.is}):g.createElement(i)}}s[Tt]=t,s[Bt]=n;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)s.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=s;e:switch(Yt(s,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Qa(t)}}return pt(t),qo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Qa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ne.current,xl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,i=Lt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||ch(e.nodeValue,a)),e||hn(t,!0)}else e=Gr(e).createTextNode(n),e[Tt]=t,t.stateNode=e}return pt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=xl(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Tt]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),e=!1}else a=Js(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ia(t),t):(ia(t),null);if((t.flags&128)!==0)throw Error(c(558))}return pt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=xl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[Tt]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else i=Js(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ia(t),t):(ia(t),null)}return ia(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==i&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),kr(t,t.updateQueue),pt(t),null);case 4:return De(),e===null&&oc(t.stateNode.containerInfo),pt(t),null;case 10:return Ga(t.type),pt(t),null;case 19:if(O(St),n=t.memoizedState,n===null)return pt(t),null;if(i=(t.flags&128)!==0,s=n.rendering,s===null)if(i)bi(n,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=mr(e),s!==null){for(t.flags|=128,bi(n,!1),e=s.updateQueue,t.updateQueue=e,kr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)qu(a,e),a=a.sibling;return P(St,St.current&1|2),We&&Ya(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Se()>Or&&(t.flags|=128,i=!0,bi(n,!1),t.lanes=4194304)}else{if(!i)if(e=mr(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,kr(t,e),bi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!We)return pt(t),null}else 2*Se()-n.renderingStartTime>Or&&a!==536870912&&(t.flags|=128,i=!0,bi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Se(),e.sibling=null,a=St.current,P(St,i?a&1|2:a&1),We&&Ya(t,n.treeForkCount),e):(pt(t),null);case 22:case 23:return ia(t),oo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),a=t.updateQueue,a!==null&&kr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&O(Xn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ga(Ct),pt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function sx(e,t){switch(Qs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(Ct),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(ia(t),t.alternate===null)throw Error(c(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ia(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(St),null;case 4:return De(),null;case 10:return Ga(t.type),null;case 22:case 23:return ia(t),oo(),e!==null&&O(Xn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ga(Ct),null;case 25:return null;default:return null}}function pf(e,t){switch(Qs(t),t.tag){case 3:Ga(Ct),De();break;case 26:case 27:case 5:Je(t);break;case 4:De();break;case 31:t.memoizedState!==null&&ia(t);break;case 13:ia(t);break;case 19:O(St);break;case 10:Ga(t.type);break;case 22:case 23:ia(t),oo(),e!==null&&O(Xn);break;case 24:Ga(Ct)}}function yi(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){n=void 0;var s=a.create,g=a.inst;n=s(),g.destroy=n}a=a.next}while(a!==i)}}catch(R){it(t,t.return,R)}}function vn(e,t,a){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var s=i.next;n=s;do{if((n.tag&e)===e){var g=n.inst,R=g.destroy;if(R!==void 0){g.destroy=void 0,i=t;var q=a,ae=R;try{ae()}catch(pe){it(i,q,pe)}}}n=n.next}while(n!==s)}}catch(pe){it(t,t.return,pe)}}function mf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ld(t,a)}catch(n){it(e,e.return,n)}}}function xf(e,t,a){a.props=$n(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){it(e,t,n)}}function vi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(i){it(e,t,i)}}function za(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(i){it(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){it(e,t,i)}else a.current=null}function gf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){it(e,e.return,i)}}function Yo(e,t,a){try{var n=e.stateNode;Ax(n,e.type,a,t),n[Bt]=t}catch(i){it(e,e.return,i)}}function bf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cn(e.type)||e.tag===4}function Vo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bf(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&&Cn(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 Go(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=La));else if(n!==4&&(n===27&&Cn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Go(e,t,a),e=e.sibling;e!==null;)Go(e,t,a),e=e.sibling}function Ar(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Cn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ar(e,t,a),e=e.sibling;e!==null;)Ar(e,t,a),e=e.sibling}function yf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Yt(t,n,a),t[Tt]=e,t[Bt]=a}catch(s){it(e,e.return,s)}}var Ia=!1,zt=!1,Zo=!1,vf=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function ox(e,t){if(e=e.containerInfo,dc=$r,e=Tu(e),Us(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{a.nodeType,s.nodeType}catch{a=null;break e}var g=0,R=-1,q=-1,ae=0,pe=0,ve=e,ie=null;t:for(;;){for(var ue;ve!==a||i!==0&&ve.nodeType!==3||(R=g+i),ve!==s||n!==0&&ve.nodeType!==3||(q=g+n),ve.nodeType===3&&(g+=ve.nodeValue.length),(ue=ve.firstChild)!==null;)ie=ve,ve=ue;for(;;){if(ve===e)break t;if(ie===a&&++ae===i&&(R=g),ie===s&&++pe===n&&(q=g),(ue=ve.nextSibling)!==null)break;ve=ie,ie=ve.parentNode}ve=ue}a=R===-1||q===-1?null:{start:R,end:q}}else a=null}a=a||{start:0,end:0}}else a=null;for(fc={focusedElem:e,selectionRange:a},$r=!1,Dt=t;Dt!==null;)if(t=Dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Dt=e;else for(;Dt!==null;){switch(t=Dt,s=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(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,a=t,i=s.memoizedProps,s=s.memoizedState,n=a.stateNode;try{var Oe=$n(a.type,i);e=n.getSnapshotBeforeUpdate(Oe,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(He){it(a,a.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)mc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Dt=e;break}Dt=t.return}}function wf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:$a(e,a),n&4&&yi(5,a);break;case 1:if($a(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){it(a,a.return,g)}else{var i=$n(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){it(a,a.return,g)}}n&64&&mf(a),n&512&&vi(a,a.return);break;case 3:if($a(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{ld(e,t)}catch(g){it(a,a.return,g)}}break;case 27:t===null&&n&4&&yf(a);case 26:case 5:$a(e,a),t===null&&n&4&&gf(a),n&512&&vi(a,a.return);break;case 12:$a(e,a);break;case 31:$a(e,a),n&4&&jf(e,a);break;case 13:$a(e,a),n&4&&Nf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=gx.bind(null,a),Bx(e,a))));break;case 22:if(n=a.memoizedState!==null||Ia,!n){t=t!==null&&t.memoizedState!==null||zt,i=Ia;var s=zt;Ia=n,(zt=t)&&!s?Fa(e,a,(a.subtreeFlags&8772)!==0):$a(e,a),Ia=i,zt=s}break;case 30:break;default:$a(e,a)}}function Sf(e){var t=e.alternate;t!==null&&(e.alternate=null,Sf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Un(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 mt=null,$t=!1;function Ja(e,t,a){for(a=a.child;a!==null;)_f(e,t,a),a=a.sibling}function _f(e,t,a){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(qe,a)}catch{}switch(a.tag){case 26:zt||za(a,t),Ja(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:zt||za(a,t);var n=mt,i=$t;Cn(a.type)&&(mt=a.stateNode,$t=!1),Ja(e,t,a),Ai(a.stateNode),mt=n,$t=i;break;case 5:zt||za(a,t);case 6:if(n=mt,i=$t,mt=null,Ja(e,t,a),mt=n,$t=i,mt!==null)if($t)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(s){it(a,t,s)}else try{mt.removeChild(a.stateNode)}catch(s){it(a,t,s)}break;case 18:mt!==null&&($t?(e=mt,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Bl(e)):mh(mt,a.stateNode));break;case 4:n=mt,i=$t,mt=a.stateNode.containerInfo,$t=!0,Ja(e,t,a),mt=n,$t=i;break;case 0:case 11:case 14:case 15:vn(2,a,t),zt||vn(4,a,t),Ja(e,t,a);break;case 1:zt||(za(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&xf(a,t,n)),Ja(e,t,a);break;case 21:Ja(e,t,a);break;case 22:zt=(n=zt)||a.memoizedState!==null,Ja(e,t,a),zt=n;break;default:Ja(e,t,a)}}function jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bl(e)}catch(a){it(t,t.return,a)}}}function Nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bl(e)}catch(a){it(t,t.return,a)}}function cx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(c(435,e.tag))}}function zr(e,t){var a=cx(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var i=bx.bind(null,e,n);n.then(i,i)}})}function Ft(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],s=e,g=t,R=g;e:for(;R!==null;){switch(R.tag){case 27:if(Cn(R.type)){mt=R.stateNode,$t=!1;break e}break;case 5:mt=R.stateNode,$t=!1;break e;case 3:case 4:mt=R.stateNode.containerInfo,$t=!0;break e}R=R.return}if(mt===null)throw Error(c(160));_f(s,g,i),mt=null,$t=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ef(t,e),t=t.sibling}var Na=null;function Ef(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),Wt(e),n&4&&(vn(3,e,e.return),yi(3,e),vn(5,e,e.return));break;case 1:Ft(t,e),Wt(e),n&512&&(zt||a===null||za(a,a.return)),n&64&&Ia&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=Na;if(Ft(t,e),Wt(e),n&512&&(zt||a===null||za(a,a.return)),n&4){var s=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":s=i.getElementsByTagName("title")[0],(!s||s[sn]||s[Tt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(n),i.head.insertBefore(s,i.querySelector("head > title"))),Yt(s,n,a),s[Tt]=e,he(s),n=s;break e;case"link":var g=Eh("link","href",i).get(n+(a.href||""));if(g){for(var R=0;R<g.length;R++)if(s=g[R],s.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&s.getAttribute("rel")===(a.rel==null?null:a.rel)&&s.getAttribute("title")===(a.title==null?null:a.title)&&s.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(R,1);break t}}s=i.createElement(n),Yt(s,n,a),i.head.appendChild(s);break;case"meta":if(g=Eh("meta","content",i).get(n+(a.content||""))){for(R=0;R<g.length;R++)if(s=g[R],s.getAttribute("content")===(a.content==null?null:""+a.content)&&s.getAttribute("name")===(a.name==null?null:a.name)&&s.getAttribute("property")===(a.property==null?null:a.property)&&s.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&s.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(R,1);break t}}s=i.createElement(n),Yt(s,n,a),i.head.appendChild(s);break;default:throw Error(c(468,n))}s[Tt]=e,he(s),n=s}e.stateNode=n}else Ch(i,e.type,e.stateNode);else e.stateNode=Nh(i,n,e.memoizedProps);else s!==n?(s===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):s.count--,n===null?Ch(i,e.type,e.stateNode):Nh(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Yo(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ft(t,e),Wt(e),n&512&&(zt||a===null||za(a,a.return)),a!==null&&n&4&&Yo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ft(t,e),Wt(e),n&512&&(zt||a===null||za(a,a.return)),e.flags&32){i=e.stateNode;try{rl(i,"")}catch(Oe){it(e,e.return,Oe)}}n&4&&e.stateNode!=null&&(i=e.memoizedProps,Yo(e,i,a!==null?a.memoizedProps:i)),n&1024&&(Zo=!0);break;case 6:if(Ft(t,e),Wt(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Oe){it(e,e.return,Oe)}}break;case 3:if(Kr=null,i=Na,Na=Zr(t.containerInfo),Ft(t,e),Na=i,Wt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Bl(t.containerInfo)}catch(Oe){it(e,e.return,Oe)}Zo&&(Zo=!1,Cf(e));break;case 4:n=Na,Na=Zr(e.stateNode.containerInfo),Ft(t,e),Wt(e),Na=n;break;case 12:Ft(t,e),Wt(e);break;case 31:Ft(t,e),Wt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zr(e,n)));break;case 13:Ft(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Rr=Se()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zr(e,n)));break;case 22:i=e.memoizedState!==null;var q=a!==null&&a.memoizedState!==null,ae=Ia,pe=zt;if(Ia=ae||i,zt=pe||q,Ft(t,e),zt=pe,Ia=ae,Wt(e),n&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||q||Ia||zt||Fn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){q=a=t;try{if(s=q.stateNode,i)g=s.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{R=q.stateNode;var ve=q.memoizedProps.style,ie=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;R.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Oe){it(q,q.return,Oe)}}}else if(t.tag===6){if(a===null){q=t;try{q.stateNode.nodeValue=i?"":q.memoizedProps}catch(Oe){it(q,q.return,Oe)}}}else if(t.tag===18){if(a===null){q=t;try{var ue=q.stateNode;i?xh(ue,!0):xh(q.stateNode,!1)}catch(Oe){it(q,q.return,Oe)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,zr(e,a))));break;case 19:Ft(t,e),Wt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zr(e,n)));break;case 30:break;case 21:break;default:Ft(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(bf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var i=a.stateNode,s=Vo(e);Ar(e,s,i);break;case 5:var g=a.stateNode;a.flags&32&&(rl(g,""),a.flags&=-33);var R=Vo(e);Ar(e,R,g);break;case 3:case 4:var q=a.stateNode.containerInfo,ae=Vo(e);Go(e,ae,q);break;default:throw Error(c(161))}}catch(pe){it(e,e.return,pe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $a(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wf(e,t.alternate,t),t=t.sibling}function Fn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vn(4,t,t.return),Fn(t);break;case 1:za(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&xf(t,t.return,a),Fn(t);break;case 27:Ai(t.stateNode);case 26:case 5:za(t,t.return),Fn(t);break;case 22:t.memoizedState===null&&Fn(t);break;case 30:Fn(t);break;default:Fn(t)}e=e.sibling}}function Fa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,i=e,s=t,g=s.flags;switch(s.tag){case 0:case 11:case 15:Fa(i,s,a),yi(4,s);break;case 1:if(Fa(i,s,a),n=s,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(ae){it(n,n.return,ae)}if(n=s,i=n.updateQueue,i!==null){var R=n.stateNode;try{var q=i.shared.hiddenCallbacks;if(q!==null)for(i.shared.hiddenCallbacks=null,i=0;i<q.length;i++)nd(q[i],R)}catch(ae){it(n,n.return,ae)}}a&&g&64&&mf(s),vi(s,s.return);break;case 27:yf(s);case 26:case 5:Fa(i,s,a),a&&n===null&&g&4&&gf(s),vi(s,s.return);break;case 12:Fa(i,s,a);break;case 31:Fa(i,s,a),a&&g&4&&jf(i,s);break;case 13:Fa(i,s,a),a&&g&4&&Nf(i,s);break;case 22:s.memoizedState===null&&Fa(i,s,a),vi(s,s.return);break;case 30:break;default:Fa(i,s,a)}t=t.sibling}}function Xo(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ri(a))}function Ko(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ri(e))}function Ea(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kf(e,t,a,n),t=t.sibling}function kf(e,t,a,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,n),i&2048&&yi(9,t);break;case 1:Ea(e,t,a,n);break;case 3:Ea(e,t,a,n),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ri(e)));break;case 12:if(i&2048){Ea(e,t,a,n),e=t.stateNode;try{var s=t.memoizedProps,g=s.id,R=s.onPostCommit;typeof R=="function"&&R(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){it(t,t.return,q)}}else Ea(e,t,a,n);break;case 31:Ea(e,t,a,n);break;case 13:Ea(e,t,a,n);break;case 23:break;case 22:s=t.stateNode,g=t.alternate,t.memoizedState!==null?s._visibility&2?Ea(e,t,a,n):wi(e,t):s._visibility&2?Ea(e,t,a,n):(s._visibility|=2,El(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Xo(g,t);break;case 24:Ea(e,t,a,n),i&2048&&Ko(t.alternate,t);break;default:Ea(e,t,a,n)}}function El(e,t,a,n,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,g=t,R=a,q=n,ae=g.flags;switch(g.tag){case 0:case 11:case 15:El(s,g,R,q,i),yi(8,g);break;case 23:break;case 22:var pe=g.stateNode;g.memoizedState!==null?pe._visibility&2?El(s,g,R,q,i):wi(s,g):(pe._visibility|=2,El(s,g,R,q,i)),i&&ae&2048&&Xo(g.alternate,g);break;case 24:El(s,g,R,q,i),i&&ae&2048&&Ko(g.alternate,g);break;default:El(s,g,R,q,i)}t=t.sibling}}function wi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,i=n.flags;switch(n.tag){case 22:wi(a,n),i&2048&&Xo(n.alternate,n);break;case 24:wi(a,n),i&2048&&Ko(n.alternate,n);break;default:wi(a,n)}t=t.sibling}}var Si=8192;function Cl(e,t,a){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)Af(e,t,a),e=e.sibling}function Af(e,t,a){switch(e.tag){case 26:Cl(e,t,a),e.flags&Si&&e.memoizedState!==null&&Jx(a,Na,e.memoizedState,e.memoizedProps);break;case 5:Cl(e,t,a);break;case 3:case 4:var n=Na;Na=Zr(e.stateNode.containerInfo),Cl(e,t,a),Na=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Si,Si=16777216,Cl(e,t,a),Si=n):Cl(e,t,a));break;default:Cl(e,t,a)}}function zf(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 _i(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Dt=n,Rf(n,e)}zf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tf(e),e=e.sibling}function Tf(e){switch(e.tag){case 0:case 11:case 15:_i(e),e.flags&2048&&vn(9,e,e.return);break;case 3:_i(e);break;case 12:_i(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Tr(e)):_i(e);break;default:_i(e)}}function Tr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Dt=n,Rf(n,e)}zf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vn(8,t,t.return),Tr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Tr(t));break;default:Tr(t)}e=e.sibling}}function Rf(e,t){for(;Dt!==null;){var a=Dt;switch(a.tag){case 0:case 11:case 15:vn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ri(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Dt=n;else e:for(a=e;Dt!==null;){n=Dt;var i=n.sibling,s=n.return;if(Sf(n),n===a){Dt=null;break e}if(i!==null){i.return=s,Dt=i;break e}Dt=s}}}var ux={getCacheForType:function(e){var t=Ht(Ct),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ht(Ct).controller.signal}},dx=typeof WeakMap=="function"?WeakMap:Map,nt=0,ct=null,Qe=null,$e=0,lt=0,ra=null,wn=!1,kl=!1,Qo=!1,Wa=0,vt=0,Sn=0,Wn=0,Io=0,sa=0,Al=0,ji=null,Pt=null,Jo=!1,Rr=0,Of=0,Or=1/0,Dr=null,_n=null,Rt=0,jn=null,zl=null,Pa=0,$o=0,Fo=null,Df=null,Ni=0,Wo=null;function oa(){return(nt&2)!==0&&$e!==0?$e&-$e:X.T!==null?lc():ta()}function Mf(){if(sa===0)if(($e&536870912)===0||We){var e=Ot;Ot<<=1,(Ot&3932160)===0&&(Ot=262144),sa=e}else sa=536870912;return e=la.current,e!==null&&(e.flags|=32),sa}function ea(e,t,a){(e===ct&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(Tl(e,0),Nn(e,$e,sa,!1)),Ba(e,a),((nt&2)===0||e!==ct)&&(e===ct&&((nt&2)===0&&(Wn|=a),vt===4&&Nn(e,$e,sa,!1)),Ta(e))}function Uf(e,t,a){if((nt&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ca(e,t),i=n?px(e,t):ec(e,t,!0),s=n;do{if(i===0){kl&&!n&&Nn(e,t,0,!1);break}else{if(a=e.current.alternate,s&&!fx(a)){i=ec(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var R=e;i=ji;var q=R.current.memoizedState.isDehydrated;if(q&&(Tl(R,g).flags|=256),g=ec(R,g,!1),g!==2){if(Qo&&!q){R.errorRecoveryDisabledLanes|=s,Wn|=s,i=4;break e}s=Pt,Pt=i,s!==null&&(Pt===null?Pt=s:Pt.push.apply(Pt,s))}i=g}if(s=!1,i!==2)continue}}if(i===1){Tl(e,0),Nn(e,t,0,!0);break}e:{switch(n=e,s=i,s){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Nn(n,t,sa,!wn);break e;case 2:Pt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=Rr+300-Se(),10<i)){if(Nn(n,t,sa,!wn),Ua(n,0,!0)!==0)break e;Pa=t,n.timeoutHandle=hh(Bf.bind(null,n,a,Pt,Dr,Jo,t,sa,Wn,Al,wn,s,"Throttled",-0,0),i);break e}Bf(n,a,Pt,Dr,Jo,t,sa,Wn,Al,wn,s,null,-0,0)}}break}while(!0);Ta(e)}function Bf(e,t,a,n,i,s,g,R,q,ae,pe,ve,ie,ue){if(e.timeoutHandle=-1,ve=t.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:La},Af(t,s,ve);var Oe=(s&62914560)===s?Rr-Se():(s&4194048)===s?Of-Se():0;if(Oe=$x(ve,Oe),Oe!==null){Pa=s,e.cancelPendingCommit=Oe(Xf.bind(null,e,t,s,a,n,i,g,R,q,pe,ve,null,ie,ue)),Nn(e,s,g,!ae);return}}Xf(e,t,s,a,n,i,g,R,q)}function fx(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],s=i.getSnapshot;i=i.value;try{if(!aa(s(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Nn(e,t,a,n){t&=~Io,t&=~Wn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var s=31-ft(i),g=1<<s;n[s]=-1,i&=~g}a!==0&&Vl(e,a,t)}function Mr(){return(nt&6)===0?(Ei(0),!1):!0}function Po(){if(Qe!==null){if(lt===0)var e=Qe.return;else e=Qe,Va=Gn=null,mo(e),wl=null,oi=0,e=Qe;for(;e!==null;)pf(e.alternate,e),e=e.return;Qe=null}}function Tl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Rx(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Pa=0,Po(),ct=e,Qe=a=qa(e.current,null),$e=t,lt=0,ra=null,wn=!1,kl=Ca(e,t),Qo=!1,Al=sa=Io=Wn=Sn=vt=0,Pt=ji=null,Jo=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-ft(n),s=1<<i;t|=e[i],n&=~s}return Wa=t,ar(),a}function Lf(e,t){Ze=null,X.H=xi,t===vl||t===ur?(t=Pu(),lt=3):t===ao?(t=Pu(),lt=4):lt=t===To?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ra=t,Qe===null&&(vt=1,jr(e,fa(t,e.current)))}function Hf(){var e=la.current;return e===null?!0:($e&4194048)===$e?xa===null:($e&62914560)===$e||($e&536870912)!==0?e===xa:!1}function qf(){var e=X.H;return X.H=xi,e===null?xi:e}function Yf(){var e=X.A;return X.A=ux,e}function Ur(){vt=4,wn||($e&4194048)!==$e&&la.current!==null||(kl=!0),(Sn&134217727)===0&&(Wn&134217727)===0||ct===null||Nn(ct,$e,sa,!1)}function ec(e,t,a){var n=nt;nt|=2;var i=qf(),s=Yf();(ct!==e||$e!==t)&&(Dr=null,Tl(e,t)),t=!1;var g=vt;e:do try{if(lt!==0&&Qe!==null){var R=Qe,q=ra;switch(lt){case 8:Po(),g=6;break e;case 3:case 2:case 9:case 6:la.current===null&&(t=!0);var ae=lt;if(lt=0,ra=null,Rl(e,R,q,ae),a&&kl){g=0;break e}break;default:ae=lt,lt=0,ra=null,Rl(e,R,q,ae)}}hx(),g=vt;break}catch(pe){Lf(e,pe)}while(!0);return t&&e.shellSuspendCounter++,Va=Gn=null,nt=n,X.H=i,X.A=s,Qe===null&&(ct=null,$e=0,ar()),g}function hx(){for(;Qe!==null;)Vf(Qe)}function px(e,t){var a=nt;nt|=2;var n=qf(),i=Yf();ct!==e||$e!==t?(Dr=null,Or=Se()+500,Tl(e,t)):kl=Ca(e,t);e:do try{if(lt!==0&&Qe!==null){t=Qe;var s=ra;t:switch(lt){case 1:lt=0,ra=null,Rl(e,t,s,1);break;case 2:case 9:if(Fu(s)){lt=0,ra=null,Gf(t);break}t=function(){lt!==2&&lt!==9||ct!==e||(lt=7),Ta(e)},s.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Fu(s)?(lt=0,ra=null,Gf(t)):(lt=0,ra=null,Rl(e,t,s,7));break;case 5:var g=null;switch(Qe.tag){case 26:g=Qe.memoizedState;case 5:case 27:var R=Qe;if(g?kh(g):R.stateNode.complete){lt=0,ra=null;var q=R.sibling;if(q!==null)Qe=q;else{var ae=R.return;ae!==null?(Qe=ae,Br(ae)):Qe=null}break t}}lt=0,ra=null,Rl(e,t,s,5);break;case 6:lt=0,ra=null,Rl(e,t,s,6);break;case 8:Po(),vt=6;break e;default:throw Error(c(462))}}mx();break}catch(pe){Lf(e,pe)}while(!0);return Va=Gn=null,X.H=n,X.A=i,nt=a,Qe!==null?0:(ct=null,$e=0,ar(),vt)}function mx(){for(;Qe!==null&&!G();)Vf(Qe)}function Vf(e){var t=ff(e.alternate,e,Wa);e.memoizedProps=e.pendingProps,t===null?Br(e):Qe=t}function Gf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=rf(a,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=rf(a,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:mo(t);default:pf(a,t),t=Qe=qu(t,Wa),t=ff(a,t,Wa)}e.memoizedProps=e.pendingProps,t===null?Br(e):Qe=t}function Rl(e,t,a,n){Va=Gn=null,mo(t),wl=null,oi=0;var i=t.return;try{if(nx(e,i,t,a,$e)){vt=1,jr(e,fa(a,e.current)),Qe=null;return}}catch(s){if(i!==null)throw Qe=i,s;vt=1,jr(e,fa(a,e.current)),Qe=null;return}t.flags&32768?(We||n===1?e=!0:kl||($e&536870912)!==0?e=!1:(wn=e=!0,(n===2||n===9||n===3||n===6)&&(n=la.current,n!==null&&n.tag===13&&(n.flags|=16384))),Zf(t,e)):Br(t)}function Br(e){var t=e;do{if((t.flags&32768)!==0){Zf(t,wn);return}e=t.return;var a=rx(t.alternate,t,Wa);if(a!==null){Qe=a;return}if(t=t.sibling,t!==null){Qe=t;return}Qe=t=e}while(t!==null);vt===0&&(vt=5)}function Zf(e,t){do{var a=sx(e.alternate,e);if(a!==null){a.flags&=32767,Qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Qe=e;return}Qe=e=a}while(e!==null);vt=6,Qe=null}function Xf(e,t,a,n,i,s,g,R,q){e.cancelPendingCommit=null;do Lr();while(Rt!==0);if((nt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(s=t.lanes|t.childLanes,s|=Ys,vs(e,a,s,g,R,q),e===ct&&(Qe=ct=null,$e=0),zl=t,jn=e,Pa=a,$o=s,Fo=i,Df=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yx(Be,function(){return $f(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=X.T,X.T=null,i=I.p,I.p=2,g=nt,nt|=4;try{ox(e,t,a)}finally{nt=g,I.p=i,X.T=n}}Rt=1,Kf(),Qf(),If()}}function Kf(){if(Rt===1){Rt=0;var e=jn,t=zl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=X.T,X.T=null;var n=I.p;I.p=2;var i=nt;nt|=4;try{Ef(t,e);var s=fc,g=Tu(e.containerInfo),R=s.focusedElem,q=s.selectionRange;if(g!==R&&R&&R.ownerDocument&&zu(R.ownerDocument.documentElement,R)){if(q!==null&&Us(R)){var ae=q.start,pe=q.end;if(pe===void 0&&(pe=ae),"selectionStart"in R)R.selectionStart=ae,R.selectionEnd=Math.min(pe,R.value.length);else{var ve=R.ownerDocument||document,ie=ve&&ve.defaultView||window;if(ie.getSelection){var ue=ie.getSelection(),Oe=R.textContent.length,He=Math.min(q.start,Oe),ot=q.end===void 0?He:Math.min(q.end,Oe);!ue.extend&&He>ot&&(g=ot,ot=He,He=g);var $=Au(R,He),K=Au(R,ot);if($&&K&&(ue.rangeCount!==1||ue.anchorNode!==$.node||ue.anchorOffset!==$.offset||ue.focusNode!==K.node||ue.focusOffset!==K.offset)){var ee=ve.createRange();ee.setStart($.node,$.offset),ue.removeAllRanges(),He>ot?(ue.addRange(ee),ue.extend(K.node,K.offset)):(ee.setEnd(K.node,K.offset),ue.addRange(ee))}}}}for(ve=[],ue=R;ue=ue.parentNode;)ue.nodeType===1&&ve.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ve.length;R++){var be=ve[R];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}$r=!!dc,fc=dc=null}finally{nt=i,I.p=n,X.T=a}}e.current=t,Rt=2}}function Qf(){if(Rt===2){Rt=0;var e=jn,t=zl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=X.T,X.T=null;var n=I.p;I.p=2;var i=nt;nt|=4;try{wf(e,t.alternate,t)}finally{nt=i,I.p=n,X.T=a}}Rt=3}}function If(){if(Rt===4||Rt===3){Rt=0,we();var e=jn,t=zl,a=Pa,n=Df;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,zl=jn=null,Jf(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(_n=null),Xl(a),t=t.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(qe,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=X.T,i=I.p,I.p=2,X.T=null;try{for(var s=e.onRecoverableError,g=0;g<n.length;g++){var R=n[g];s(R.value,{componentStack:R.stack})}}finally{X.T=t,I.p=i}}(Pa&3)!==0&&Lr(),Ta(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Wo?Ni++:(Ni=0,Wo=e):Ni=0,Ei(0)}}function Jf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ri(t)))}function Lr(){return Kf(),Qf(),If(),$f()}function $f(){if(Rt!==5)return!1;var e=jn,t=$o;$o=0;var a=Xl(Pa),n=X.T,i=I.p;try{I.p=32>a?32:a,X.T=null,a=Fo,Fo=null;var s=jn,g=Pa;if(Rt=0,zl=jn=null,Pa=0,(nt&6)!==0)throw Error(c(331));var R=nt;if(nt|=4,Tf(s.current),kf(s,s.current,g,a),nt=R,Ei(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(qe,s)}catch{}return!0}finally{I.p=i,X.T=n,Jf(e,t)}}function Ff(e,t,a){t=fa(a,t),t=zo(e.stateNode,t,2),e=gn(e,t,2),e!==null&&(Ba(e,2),Ta(e))}function it(e,t,a){if(e.tag===3)Ff(e,e,a);else for(;t!==null;){if(t.tag===3){Ff(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(_n===null||!_n.has(n))){e=fa(a,e),a=Fd(2),n=gn(t,a,2),n!==null&&(Wd(a,n,t,e),Ba(n,2),Ta(n));break}}t=t.return}}function tc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new dx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(a)||(Qo=!0,i.add(a),e=xx.bind(null,e,t,a),t.then(e,e))}function xx(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ct===e&&($e&a)===a&&(vt===4||vt===3&&($e&62914560)===$e&&300>Se()-Rr?(nt&2)===0&&Tl(e,0):Io|=a,Al===$e&&(Al=0)),Ta(e)}function Wf(e,t){t===0&&(t=Nt()),e=qn(e,t),e!==null&&(Ba(e,t),Ta(e))}function gx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Wf(e,a)}function bx(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),Wf(e,a)}function yx(e,t){return te(e,t)}var Hr=null,Ol=null,ac=!1,qr=!1,nc=!1,En=0;function Ta(e){e!==Ol&&e.next===null&&(Ol===null?Hr=Ol=e:Ol=Ol.next=e),qr=!0,ac||(ac=!0,wx())}function Ei(e,t){if(!nc&&qr){nc=!0;do for(var a=!1,n=Hr;n!==null;){if(e!==0){var i=n.pendingLanes;if(i===0)var s=0;else{var g=n.suspendedLanes,R=n.pingedLanes;s=(1<<31-ft(42|e)+1)-1,s&=i&~(g&~R),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(a=!0,ah(n,s))}else s=$e,s=Ua(n,n===ct?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||Ca(n,s)||(a=!0,ah(n,s));n=n.next}while(a);nc=!1}}function vx(){Pf()}function Pf(){qr=ac=!1;var e=0;En!==0&&Tx()&&(e=En);for(var t=Se(),a=null,n=Hr;n!==null;){var i=n.next,s=eh(n,t);s===0?(n.next=null,a===null?Hr=i:a.next=i,i===null&&(Ol=a)):(a=n,(e!==0||(s&3)!==0)&&(qr=!0)),n=i}Rt!==0&&Rt!==5||Ei(e),En!==0&&(En=0)}function eh(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var g=31-ft(s),R=1<<g,q=i[g];q===-1?((R&a)===0||(R&n)!==0)&&(i[g]=Xi(R,t)):q<=t&&(e.expiredLanes|=R),s&=~R}if(t=ct,a=$e,a=Ua(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&me(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ca(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&me(n),Xl(a)){case 2:case 8:a=Ge;break;case 32:a=Be;break;case 268435456:a=Ce;break;default:a=Be}return n=th.bind(null,e),a=te(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&me(n),e.callbackPriority=2,e.callbackNode=null,2}function th(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Lr()&&e.callbackNode!==a)return null;var n=$e;return n=Ua(e,e===ct?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Uf(e,n,t),eh(e,Se()),e.callbackNode!=null&&e.callbackNode===a?th.bind(null,e):null)}function ah(e,t){if(Lr())return null;Uf(e,t,!0)}function wx(){Ox(function(){(nt&6)!==0?te(ze,vx):Pf()})}function lc(){if(En===0){var e=bl;e===0&&(e=Ma,Ma<<=1,(Ma&261888)===0&&(Ma=256)),En=e}return En}function nh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ii(""+e)}function lh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Sx(e,t,a,n,i){if(t==="submit"&&a&&a.stateNode===i){var s=nh((i[Bt]||null).action),g=n.submitter;g&&(t=(t=g[Bt]||null)?nh(t.formAction):g.getAttribute("formAction"),t!==null&&(s=t,g=null));var R=new Wi("action","action",null,n,i);e.push({event:R,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(En!==0){var q=g?lh(i,g):new FormData(i);jo(a,{pending:!0,data:q,method:i.method,action:s},null,q)}}else typeof s=="function"&&(R.preventDefault(),q=g?lh(i,g):new FormData(i),jo(a,{pending:!0,data:q,method:i.method,action:s},s,q))},currentTarget:i}]})}}for(var ic=0;ic<qs.length;ic++){var rc=qs[ic],_x=rc.toLowerCase(),jx=rc[0].toUpperCase()+rc.slice(1);ja(_x,"on"+jx)}ja(Du,"onAnimationEnd"),ja(Mu,"onAnimationIteration"),ja(Uu,"onAnimationStart"),ja("dblclick","onDoubleClick"),ja("focusin","onFocus"),ja("focusout","onBlur"),ja(qm,"onTransitionRun"),ja(Ym,"onTransitionStart"),ja(Vm,"onTransitionCancel"),ja(Bu,"onTransitionEnd"),tt("onMouseEnter",["mouseout","mouseover"]),tt("onMouseLeave",["mouseout","mouseover"]),tt("onPointerEnter",["pointerout","pointerover"]),tt("onPointerLeave",["pointerout","pointerover"]),Le("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Le("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Le("onBeforeInput",["compositionend","keypress","textInput","paste"]),Le("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Le("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Le("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="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(" "),Nx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ci));function ih(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var g=n.length-1;0<=g;g--){var R=n[g],q=R.instance,ae=R.currentTarget;if(R=R.listener,q!==s&&i.isPropagationStopped())break e;s=R,i.currentTarget=ae;try{s(i)}catch(pe){tr(pe)}i.currentTarget=null,s=q}else for(g=0;g<n.length;g++){if(R=n[g],q=R.instance,ae=R.currentTarget,R=R.listener,q!==s&&i.isPropagationStopped())break e;s=R,i.currentTarget=ae;try{s(i)}catch(pe){tr(pe)}i.currentTarget=null,s=q}}}}function Ie(e,t){var a=t[Ql];a===void 0&&(a=t[Ql]=new Set);var n=e+"__bubble";a.has(n)||(rh(t,e,2,!1),a.add(n))}function sc(e,t,a){var n=0;t&&(n|=4),rh(a,e,n,t)}var Yr="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Yr]){e[Yr]=!0,ke.forEach(function(a){a!=="selectionchange"&&(Nx.has(a)||sc(a,!1,e),sc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yr]||(t[Yr]=!0,sc("selectionchange",!1,t))}}function rh(e,t,a,n){switch(Mh(t)){case 2:var i=Px;break;case 8:i=e0;break;default:i=_c}a=i.bind(null,t,a,e),i=void 0,!Cs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function cc(e,t,a,n,i){var s=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var g=n.tag;if(g===3||g===4){var R=n.stateNode.containerInfo;if(R===i)break;if(g===4)for(g=n.return;g!==null;){var q=g.tag;if((q===3||q===4)&&g.stateNode.containerInfo===i)return;g=g.return}for(;R!==null;){if(g=on(R),g===null)return;if(q=g.tag,q===5||q===6||q===26||q===27){n=s=g;continue e}R=R.parentNode}}n=n.return}uu(function(){var ae=s,pe=Ns(a),ve=[];e:{var ie=Lu.get(e);if(ie!==void 0){var ue=Wi,Oe=e;switch(e){case"keypress":if($i(a)===0)break e;case"keydown":case"keyup":ue=bm;break;case"focusin":Oe="focus",ue=Ts;break;case"focusout":Oe="blur",ue=Ts;break;case"beforeblur":case"afterblur":ue=Ts;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=hu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=rm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=wm;break;case Du:case Mu:case Uu:ue=cm;break;case Bu:ue=_m;break;case"scroll":case"scrollend":ue=lm;break;case"wheel":ue=Nm;break;case"copy":case"cut":case"paste":ue=dm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=mu;break;case"toggle":case"beforetoggle":ue=Cm}var He=(t&4)!==0,ot=!He&&(e==="scroll"||e==="scrollend"),$=He?ie!==null?ie+"Capture":null:ie;He=[];for(var K=ae,ee;K!==null;){var be=K;if(ee=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ee===null||$===null||(be=Jl(K,$),be!=null&&He.push(ki(K,be,ee))),ot)break;K=K.return}0<He.length&&(ie=new ue(ie,Oe,null,a,pe),ve.push({event:ie,listeners:He}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",ie&&a!==js&&(Oe=a.relatedTarget||a.fromElement)&&(on(Oe)||Oe[ln]))break e;if((ue||ie)&&(ie=pe.window===pe?pe:(ie=pe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ue?(Oe=a.relatedTarget||a.toElement,ue=ae,Oe=Oe?on(Oe):null,Oe!==null&&(ot=d(Oe),He=Oe.tag,Oe!==ot||He!==5&&He!==27&&He!==6)&&(Oe=null)):(ue=null,Oe=ae),ue!==Oe)){if(He=hu,be="onMouseLeave",$="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(He=mu,be="onPointerLeave",$="onPointerEnter",K="pointer"),ot=ue==null?ie:Q(ue),ee=Oe==null?ie:Q(Oe),ie=new He(be,K+"leave",ue,a,pe),ie.target=ot,ie.relatedTarget=ee,be=null,on(pe)===ae&&(He=new He($,K+"enter",Oe,a,pe),He.target=ee,He.relatedTarget=ot,be=He),ot=be,ue&&Oe)t:{for(He=Ex,$=ue,K=Oe,ee=0,be=$;be;be=He(be))ee++;be=0;for(var Ue=K;Ue;Ue=He(Ue))be++;for(;0<ee-be;)$=He($),ee--;for(;0<be-ee;)K=He(K),be--;for(;ee--;){if($===K||K!==null&&$===K.alternate){He=$;break t}$=He($),K=He(K)}He=null}else He=null;ue!==null&&sh(ve,ie,ue,He,!1),Oe!==null&&ot!==null&&sh(ve,ot,Oe,He,!0)}}e:{if(ie=ae?Q(ae):window,ue=ie.nodeName&&ie.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ie.type==="file")var Pe=_u;else if(wu(ie))if(ju)Pe=Bm;else{Pe=Mm;var Me=Dm}else ue=ie.nodeName,!ue||ue.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ae&&_s(ae.elementType)&&(Pe=_u):Pe=Um;if(Pe&&(Pe=Pe(e,ae))){Su(ve,Pe,a,pe);break e}Me&&Me(e,ie,ae),e==="focusout"&&ae&&ie.type==="number"&&ae.memoizedProps.value!=null&&Ss(ie,"number",ie.value)}switch(Me=ae?Q(ae):window,e){case"focusin":(wu(Me)||Me.contentEditable==="true")&&(ul=Me,Bs=ae,ni=null);break;case"focusout":ni=Bs=ul=null;break;case"mousedown":Ls=!0;break;case"contextmenu":case"mouseup":case"dragend":Ls=!1,Ru(ve,a,pe);break;case"selectionchange":if(Hm)break;case"keydown":case"keyup":Ru(ve,a,pe)}var Xe;if(Os)e:{switch(e){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else cl?yu(e,a)&&(Fe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Fe="onCompositionStart");Fe&&(xu&&a.locale!=="ko"&&(cl||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&cl&&(Xe=du()):(un=pe,ks="value"in un?un.value:un.textContent,cl=!0)),Me=Vr(ae,Fe),0<Me.length&&(Fe=new pu(Fe,e,null,a,pe),ve.push({event:Fe,listeners:Me}),Xe?Fe.data=Xe:(Xe=vu(a),Xe!==null&&(Fe.data=Xe)))),(Xe=Am?zm(e,a):Tm(e,a))&&(Fe=Vr(ae,"onBeforeInput"),0<Fe.length&&(Me=new pu("onBeforeInput","beforeinput",null,a,pe),ve.push({event:Me,listeners:Fe}),Me.data=Xe)),Sx(ve,e,ae,a,pe)}ih(ve,t)})}function ki(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Vr(e,t){for(var a=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=Jl(e,a),i!=null&&n.unshift(ki(e,i,s)),i=Jl(e,t),i!=null&&n.push(ki(e,i,s))),e.tag===3)return n;e=e.return}return[]}function Ex(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sh(e,t,a,n,i){for(var s=t._reactName,g=[];a!==null&&a!==n;){var R=a,q=R.alternate,ae=R.stateNode;if(R=R.tag,q!==null&&q===n)break;R!==5&&R!==26&&R!==27||ae===null||(q=ae,i?(ae=Jl(a,s),ae!=null&&g.unshift(ki(a,ae,q))):i||(ae=Jl(a,s),ae!=null&&g.push(ki(a,ae,q)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var Cx=/\r\n?/g,kx=/\u0000|\uFFFD/g;function oh(e){return(typeof e=="string"?e:""+e).replace(Cx,`
9
- `).replace(kx,"")}function ch(e,t){return t=oh(t),oh(e)===t}function st(e,t,a,n,i,s){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||rl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&rl(e,""+n);break;case"className":wa(e,"class",n);break;case"tabIndex":wa(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":wa(e,a,n);break;case"style":ou(e,n,s);break;case"data":if(t!=="object"){wa(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ii(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 s=="function"&&(a==="formAction"?(t!=="input"&&st(e,t,"name",i.name,i,null),st(e,t,"formEncType",i.formEncType,i,null),st(e,t,"formMethod",i.formMethod,i,null),st(e,t,"formTarget",i.formTarget,i,null)):(st(e,t,"encType",i.encType,i,null),st(e,t,"method",i.method,i,null),st(e,t,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ii(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=La);break;case"onScroll":n!=null&&Ie("scroll",e);break;case"onScrollEnd":n!=null&&Ie("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Ii(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Ie("beforetoggle",e),Ie("toggle",e),Gt(e,"popover",n);break;case"xlinkActuate":Sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Sa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Sa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Sa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Sa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Gt(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=am.get(a)||a,Gt(e,a,n))}}function uc(e,t,a,n,i,s){switch(a){case"style":ou(e,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?rl(e,n):(typeof n=="number"||typeof n=="bigint")&&rl(e,""+n);break;case"onScroll":n!=null&&Ie("scroll",e);break;case"onScrollEnd":n!=null&&Ie("scrollend",e);break;case"onClick":n!=null&&(e.onclick=La);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ye.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),s=e[Bt]||null,s=s!=null?s[a]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof n=="function")){typeof s!="function"&&s!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,i);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Gt(e,a,n)}}}function Yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("load",e);var n=!1,i=!1,s;for(s in a)if(a.hasOwnProperty(s)){var g=a[s];if(g!=null)switch(s){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:st(e,t,s,g,a,null)}}i&&st(e,t,"srcSet",a.srcSet,a,null),n&&st(e,t,"src",a.src,a,null);return;case"input":Ie("invalid",e);var R=s=g=i=null,q=null,ae=null;for(n in a)if(a.hasOwnProperty(n)){var pe=a[n];if(pe!=null)switch(n){case"name":i=pe;break;case"type":g=pe;break;case"checked":q=pe;break;case"defaultChecked":ae=pe;break;case"value":s=pe;break;case"defaultValue":R=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(c(137,t));break;default:st(e,t,n,pe,a,null)}}lu(e,s,R,q,ae,g,i,!1);return;case"select":Ie("invalid",e),n=g=s=null;for(i in a)if(a.hasOwnProperty(i)&&(R=a[i],R!=null))switch(i){case"value":s=R;break;case"defaultValue":g=R;break;case"multiple":n=R;default:st(e,t,i,R,a,null)}t=s,a=g,e.multiple=!!n,t!=null?il(e,!!n,t,!1):a!=null&&il(e,!!n,a,!0);return;case"textarea":Ie("invalid",e),s=i=n=null;for(g in a)if(a.hasOwnProperty(g)&&(R=a[g],R!=null))switch(g){case"value":n=R;break;case"defaultValue":i=R;break;case"children":s=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(c(91));break;default:st(e,t,g,R,a,null)}ru(e,n,i,s);return;case"option":for(q in a)a.hasOwnProperty(q)&&(n=a[q],n!=null)&&(q==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":st(e,t,q,n,a,null));return;case"dialog":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(n=0;n<Ci.length;n++)Ie(Ci[n],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("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(ae in a)if(a.hasOwnProperty(ae)&&(n=a[ae],n!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:st(e,t,ae,n,a,null)}return;default:if(_s(t)){for(pe in a)a.hasOwnProperty(pe)&&(n=a[pe],n!==void 0&&uc(e,t,pe,n,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(n=a[R],n!=null&&st(e,t,R,n,a,null))}function Ax(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,g=null,R=null,q=null,ae=null,pe=null;for(ue in a){var ve=a[ue];if(a.hasOwnProperty(ue)&&ve!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":q=ve;default:n.hasOwnProperty(ue)||st(e,t,ue,null,n,ve)}}for(var ie in n){var ue=n[ie];if(ve=a[ie],n.hasOwnProperty(ie)&&(ue!=null||ve!=null))switch(ie){case"type":s=ue;break;case"name":i=ue;break;case"checked":ae=ue;break;case"defaultChecked":pe=ue;break;case"value":g=ue;break;case"defaultValue":R=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(c(137,t));break;default:ue!==ve&&st(e,t,ie,ue,n,ve)}}ws(e,g,R,q,ae,pe,s,i);return;case"select":ue=g=R=ie=null;for(s in a)if(q=a[s],a.hasOwnProperty(s)&&q!=null)switch(s){case"value":break;case"multiple":ue=q;default:n.hasOwnProperty(s)||st(e,t,s,null,n,q)}for(i in n)if(s=n[i],q=a[i],n.hasOwnProperty(i)&&(s!=null||q!=null))switch(i){case"value":ie=s;break;case"defaultValue":R=s;break;case"multiple":g=s;default:s!==q&&st(e,t,i,s,n,q)}t=R,a=g,n=ue,ie!=null?il(e,!!a,ie,!1):!!n!=!!a&&(t!=null?il(e,!!a,t,!0):il(e,!!a,a?[]:"",!1));return;case"textarea":ue=ie=null;for(R in a)if(i=a[R],a.hasOwnProperty(R)&&i!=null&&!n.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:st(e,t,R,null,n,i)}for(g in n)if(i=n[g],s=a[g],n.hasOwnProperty(g)&&(i!=null||s!=null))switch(g){case"value":ie=i;break;case"defaultValue":ue=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==s&&st(e,t,g,i,n,s)}iu(e,ie,ue);return;case"option":for(var Oe in a)ie=a[Oe],a.hasOwnProperty(Oe)&&ie!=null&&!n.hasOwnProperty(Oe)&&(Oe==="selected"?e.selected=!1:st(e,t,Oe,null,n,ie));for(q in n)ie=n[q],ue=a[q],n.hasOwnProperty(q)&&ie!==ue&&(ie!=null||ue!=null)&&(q==="selected"?e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":st(e,t,q,ie,n,ue));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 He in a)ie=a[He],a.hasOwnProperty(He)&&ie!=null&&!n.hasOwnProperty(He)&&st(e,t,He,null,n,ie);for(ae in n)if(ie=n[ae],ue=a[ae],n.hasOwnProperty(ae)&&ie!==ue&&(ie!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:st(e,t,ae,ie,n,ue)}return;default:if(_s(t)){for(var ot in a)ie=a[ot],a.hasOwnProperty(ot)&&ie!==void 0&&!n.hasOwnProperty(ot)&&uc(e,t,ot,void 0,n,ie);for(pe in n)ie=n[pe],ue=a[pe],!n.hasOwnProperty(pe)||ie===ue||ie===void 0&&ue===void 0||uc(e,t,pe,ie,n,ue);return}}for(var $ in a)ie=a[$],a.hasOwnProperty($)&&ie!=null&&!n.hasOwnProperty($)&&st(e,t,$,null,n,ie);for(ve in n)ie=n[ve],ue=a[ve],!n.hasOwnProperty(ve)||ie===ue||ie==null&&ue==null||st(e,t,ve,ie,n,ue)}function uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var i=a[n],s=i.transferSize,g=i.initiatorType,R=i.duration;if(s&&R&&uh(g)){for(g=0,R=i.responseEnd,n+=1;n<a.length;n++){var q=a[n],ae=q.startTime;if(ae>R)break;var pe=q.transferSize,ve=q.initiatorType;pe&&uh(ve)&&(q=q.responseEnd,g+=pe*(q<R?1:(R-ae)/(q-ae)))}if(--n,t+=8*(s+g)/(i.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 dc=null,fc=null;function Gr(e){return e.nodeType===9?e:e.ownerDocument}function dh(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 fh(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 hc(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 pc=null;function Tx(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var hh=typeof setTimeout=="function"?setTimeout:void 0,Rx=typeof clearTimeout=="function"?clearTimeout:void 0,ph=typeof Promise=="function"?Promise:void 0,Ox=typeof queueMicrotask=="function"?queueMicrotask:typeof ph<"u"?function(e){return ph.resolve(null).then(e).catch(Dx)}:hh;function Dx(e){setTimeout(function(){throw e})}function Cn(e){return e==="head"}function mh(e,t){var a=t,n=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(i),Bl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Ai(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ai(a);for(var s=a.firstChild;s;){var g=s.nextSibling,R=s.nodeName;s[sn]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&s.rel.toLowerCase()==="stylesheet"||a.removeChild(s),s=g}}else a==="body"&&Ai(e.ownerDocument.body);a=i}while(a);Bl(t)}function xh(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function mc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":mc(a),Un(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Mx(e,t,a,n){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[sn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=ga(e.nextSibling),e===null)break}return null}function Ux(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ga(e.nextSibling),e===null))return null;return e}function gh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ga(e.nextSibling),e===null))return null;return e}function xc(e){return e.data==="$?"||e.data==="$~"}function gc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bx(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ga(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 bc=null;function bh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ga(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function yh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function vh(e,t,a){switch(t=Gr(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Ai(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Un(e)}var ba=new Map,wh=new Set;function Zr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var en=I.d;I.d={f:Lx,r:Hx,D:qx,C:Yx,L:Vx,m:Gx,X:Xx,S:Zx,M:Kx};function Lx(){var e=en.f(),t=Mr();return e||t}function Hx(e){var t=cn(e);t!==null&&t.tag===5&&t.type==="form"?Bd(t):en.r(e)}var Dl=typeof document>"u"?null:document;function Sh(e,t,a){var n=Dl;if(n&&typeof t=="string"&&t){var i=ua(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),wh.has(i)||(wh.add(i),e={rel:e,crossOrigin:a,href:t},n.querySelector(i)===null&&(t=n.createElement("link"),Yt(t,"link",e),he(t),n.head.appendChild(t)))}}function qx(e){en.D(e),Sh("dns-prefetch",e,null)}function Yx(e,t){en.C(e,t),Sh("preconnect",e,t)}function Vx(e,t,a){en.L(e,t,a);var n=Dl;if(n&&e&&t){var i='link[rel="preload"][as="'+ua(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ua(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ua(a.imageSizes)+'"]')):i+='[href="'+ua(e)+'"]';var s=i;switch(t){case"style":s=Ml(e);break;case"script":s=Ul(e)}ba.has(s)||(e=N({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ba.set(s,e),n.querySelector(i)!==null||t==="style"&&n.querySelector(zi(s))||t==="script"&&n.querySelector(Ti(s))||(t=n.createElement("link"),Yt(t,"link",e),he(t),n.head.appendChild(t)))}}function Gx(e,t){en.m(e,t);var a=Dl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ua(n)+'"][href="'+ua(e)+'"]',s=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ul(e)}if(!ba.has(s)&&(e=N({rel:"modulepreload",href:e},t),ba.set(s,e),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ti(s)))return}n=a.createElement("link"),Yt(n,"link",e),he(n),a.head.appendChild(n)}}}function Zx(e,t,a){en.S(e,t,a);var n=Dl;if(n&&e){var i=se(n).hoistableStyles,s=Ml(e);t=t||"default";var g=i.get(s);if(!g){var R={loading:0,preload:null};if(g=n.querySelector(zi(s)))R.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ba.get(s))&&yc(e,a);var q=g=n.createElement("link");he(q),Yt(q,"link",e),q._p=new Promise(function(ae,pe){q.onload=ae,q.onerror=pe}),q.addEventListener("load",function(){R.loading|=1}),q.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Xr(g,t,n)}g={type:"stylesheet",instance:g,count:1,state:R},i.set(s,g)}}}function Xx(e,t){en.X(e,t);var a=Dl;if(a&&e){var n=se(a).hoistableScripts,i=Ul(e),s=n.get(i);s||(s=a.querySelector(Ti(i)),s||(e=N({src:e,async:!0},t),(t=ba.get(i))&&vc(e,t),s=a.createElement("script"),he(s),Yt(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(i,s))}}function Kx(e,t){en.M(e,t);var a=Dl;if(a&&e){var n=se(a).hoistableScripts,i=Ul(e),s=n.get(i);s||(s=a.querySelector(Ti(i)),s||(e=N({src:e,async:!0,type:"module"},t),(t=ba.get(i))&&vc(e,t),s=a.createElement("script"),he(s),Yt(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(i,s))}}function _h(e,t,a,n){var i=(i=Ne.current)?Zr(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ml(a.href),a=se(i).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ml(a.href);var s=se(i).hoistableStyles,g=s.get(e);if(g||(i=i.ownerDocument||i,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,g),(s=i.querySelector(zi(e)))&&!s._p&&(g.instance=s,g.state.loading=5),ba.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ba.set(e,a),s||Qx(i,e,a,g.state))),t&&n===null)throw Error(c(528,""));return g}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ul(a),a=se(i).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Ml(e){return'href="'+ua(e)+'"'}function zi(e){return'link[rel="stylesheet"]['+e+"]"}function jh(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function Qx(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Yt(t,"link",a),he(t),e.head.appendChild(t))}function Ul(e){return'[src="'+ua(e)+'"]'}function Ti(e){return"script[async]"+e}function Nh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ua(a.href)+'"]');if(n)return t.instance=n,he(n),n;var i=N({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),he(n),Yt(n,"style",i),Xr(n,a.precedence,e),t.instance=n;case"stylesheet":i=Ml(a.href);var s=e.querySelector(zi(i));if(s)return t.state.loading|=4,t.instance=s,he(s),s;n=jh(a),(i=ba.get(i))&&yc(n,i),s=(e.ownerDocument||e).createElement("link"),he(s);var g=s;return g._p=new Promise(function(R,q){g.onload=R,g.onerror=q}),Yt(s,"link",n),t.state.loading|=4,Xr(s,a.precedence,e),t.instance=s;case"script":return s=Ul(a.src),(i=e.querySelector(Ti(s)))?(t.instance=i,he(i),i):(n=a,(i=ba.get(s))&&(n=N({},a),vc(n,i)),e=e.ownerDocument||e,i=e.createElement("script"),he(i),Yt(i,"link",n),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Xr(n,a.precedence,e));return t.instance}function Xr(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,s=i,g=0;g<n.length;g++){var R=n[g];if(R.dataset.precedence===t)s=R;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kr=null;function Eh(e,t,a){if(Kr===null){var n=new Map,i=Kr=new Map;i.set(a,n)}else i=Kr,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var s=a[i];if(!(s[sn]||s[Tt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var g=s.getAttribute(t)||"";g=e+g;var R=n.get(g);R?R.push(s):n.set(g,[s])}}return n}function Ch(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Ix(e,t,a){if(a===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 kh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jx(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=Ml(n.href),s=t.querySelector(zi(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=s,he(s);return}s=t.ownerDocument||t,n=jh(n),(i=ba.get(i))&&yc(n,i),s=s.createElement("link"),he(s);var g=s;g._p=new Promise(function(R,q){g.onload=R,g.onerror=q}),Yt(s,"link",n),a.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Qr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var wc=0;function $x(e,t){return e.stylesheets&&e.count===0&&Jr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Jr(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&wc===0&&(wc=62500*zx());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Jr(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>wc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function Qr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ir=null;function Jr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ir=new Map,t.forEach(Fx,e),Ir=null,Qr.call(e))}function Fx(e,t){if(!(t.state.loading&4)){var a=Ir.get(e);if(a)var n=a.get(null);else{a=new Map,Ir.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var g=i[s];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),n=g)}n&&a.set(null,n)}i=t.instance,g=i.getAttribute("data-precedence"),s=a.get(g)||n,s===n&&a.set(null,i),a.set(g,i),this.count++,n=Qr.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ri={$$typeof:E,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Wx(e,t,a,n,i,s,g,R,q){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=tl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tl(0),this.hiddenUpdates=tl(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function Ah(e,t,a,n,i,s,g,R,q,ae,pe,ve){return e=new Wx(e,t,a,g,q,ae,pe,ve,R),t=1,s===!0&&(t|=24),s=na(3,null,null,t),e.current=s,s.stateNode=e,t=Ps(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:a,cache:t},no(s),e}function zh(e){return e?(e=hl,e):hl}function Th(e,t,a,n,i,s){i=zh(i),n.context===null?n.context=i:n.pendingContext=i,n=xn(t),n.payload={element:a},s=s===void 0?null:s,s!==null&&(n.callback=s),a=gn(e,n,t),a!==null&&(ea(a,e,t),ui(a,e,t))}function Rh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Sc(e,t){Rh(e,t),(e=e.alternate)&&Rh(e,t)}function Oh(e){if(e.tag===13||e.tag===31){var t=qn(e,67108864);t!==null&&ea(t,e,67108864),Sc(e,67108864)}}function Dh(e){if(e.tag===13||e.tag===31){var t=oa();t=al(t);var a=qn(e,t);a!==null&&ea(a,e,t),Sc(e,t)}}var $r=!0;function Px(e,t,a,n){var i=X.T;X.T=null;var s=I.p;try{I.p=2,_c(e,t,a,n)}finally{I.p=s,X.T=i}}function e0(e,t,a,n){var i=X.T;X.T=null;var s=I.p;try{I.p=8,_c(e,t,a,n)}finally{I.p=s,X.T=i}}function _c(e,t,a,n){if($r){var i=jc(n);if(i===null)cc(e,t,n,Fr,a),Uh(e,n);else if(a0(i,e,t,a,n))n.stopPropagation();else if(Uh(e,n),t&4&&-1<t0.indexOf(e)){for(;i!==null;){var s=cn(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var g=Ut(s.pendingLanes);if(g!==0){var R=s;for(R.pendingLanes|=2,R.entangledLanes|=2;g;){var q=1<<31-ft(g);R.entanglements[1]|=q,g&=~q}Ta(s),(nt&6)===0&&(Or=Se()+500,Ei(0))}}break;case 31:case 13:R=qn(s,2),R!==null&&ea(R,s,2),Mr(),Sc(s,2)}if(s=jc(n),s===null&&cc(e,t,n,Fr,a),s===i)break;i=s}i!==null&&n.stopPropagation()}else cc(e,t,n,null,a)}}function jc(e){return e=Ns(e),Nc(e)}var Fr=null;function Nc(e){if(Fr=null,e=on(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=f(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fr=e,null}function Mh(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(ye()){case ze:return 2;case Ge:return 8;case Be:case _e:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var Ec=!1,kn=null,An=null,zn=null,Oi=new Map,Di=new Map,Tn=[],t0="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 Uh(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":Oi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Di.delete(t.pointerId)}}function Mi(e,t,a,n,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},t!==null&&(t=cn(t),t!==null&&Oh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function a0(e,t,a,n,i){switch(t){case"focusin":return kn=Mi(kn,e,t,a,n,i),!0;case"dragenter":return An=Mi(An,e,t,a,n,i),!0;case"mouseover":return zn=Mi(zn,e,t,a,n,i),!0;case"pointerover":var s=i.pointerId;return Oi.set(s,Mi(Oi.get(s)||null,e,t,a,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Di.set(s,Mi(Di.get(s)||null,e,t,a,n,i)),!0}return!1}function Bh(e){var t=on(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=f(a),t!==null){e.blockedOn=t,Kl(e.priority,function(){Dh(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,Kl(e.priority,function(){Dh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=jc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);js=n,a.target.dispatchEvent(n),js=null}else return t=cn(a),t!==null&&Oh(t),e.blockedOn=a,!1;t.shift()}return!0}function Lh(e,t,a){Wr(e)&&a.delete(t)}function n0(){Ec=!1,kn!==null&&Wr(kn)&&(kn=null),An!==null&&Wr(An)&&(An=null),zn!==null&&Wr(zn)&&(zn=null),Oi.forEach(Lh),Di.forEach(Lh)}function Pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,n0)))}var es=null;function Hh(e){es!==e&&(es=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){es===e&&(es=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],i=e[t+2];if(typeof n!="function"){if(Nc(n||a)===null)continue;break}var s=cn(a);s!==null&&(e.splice(t,3),t-=3,jo(s,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function Bl(e){function t(q){return Pr(q,e)}kn!==null&&Pr(kn,e),An!==null&&Pr(An,e),zn!==null&&Pr(zn,e),Oi.forEach(t),Di.forEach(t);for(var a=0;a<Tn.length;a++){var n=Tn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Tn.length&&(a=Tn[0],a.blockedOn===null);)Bh(a),a.blockedOn===null&&Tn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],s=a[n+1],g=i[Bt]||null;if(typeof s=="function")g||Hh(a);else if(g){var R=null;if(s&&s.hasAttribute("formAction")){if(i=s,g=s[Bt]||null)R=g.formAction;else if(Nc(i)!==null)continue}else R=g.action;typeof R=="function"?a[n+1]=R:(a.splice(n,3),n-=3),Hh(a)}}}function qh(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(g){return i=g})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Cc(e){this._internalRoot=e}ts.prototype.render=Cc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=oa();Th(a,n,e,t,null,null)},ts.prototype.unmount=Cc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Th(e.current,2,null,e,null,null),Mr(),t[ln]=null}};function ts(e){this._internalRoot=e}ts.prototype.unstable_scheduleHydration=function(e){if(e){var t=ta();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Tn.length&&t!==0&&t<Tn[a].priority;a++);Tn.splice(a,0,e),a===0&&Bh(e)}};var Yh=u.version;if(Yh!=="19.2.3")throw Error(c(527,Yh,"19.2.3"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var l0={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var as=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!as.isDisabled&&as.supportsFiber)try{qe=as.inject(l0),dt=as}catch{}}return Bi.createRoot=function(e,t){if(!h(e))throw Error(c(299));var a=!1,n="",i=Qd,s=Id,g=Jd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Ah(e,1,!1,null,null,a,n,null,i,s,g,qh),e[ln]=t.current,oc(e),new Cc(t)},Bi.hydrateRoot=function(e,t,a){if(!h(e))throw Error(c(299));var n=!1,i="",s=Qd,g=Id,R=Jd,q=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(s=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(q=a.formState)),t=Ah(e,1,!0,t,a??null,n,i,q,s,g,R,qh),t.context=zh(null),a=t.current,n=oa(),n=al(n),i=xn(n),i.callback=null,gn(a,i,n),a=n,t.current.lanes=a,Ba(t,a),Ta(t),e[ln]=t.current,oc(e),new ts(t)},Bi.version="19.2.3",Bi}var Fh;function h0(){if(Fh)return zc.exports;Fh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(u){console.error(u)}}return l(),zc.exports=f0(),zc.exports}var p0=h0();const m0=Fc(p0);var Wh="popstate";function x0(l={}){function u(c,h){let{pathname:d,search:f,hash:p}=c.location;return Zc("",{pathname:d,search:f,hash:p},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function o(c,h){return typeof h=="string"?h:qi(h)}return b0(u,o,null,l)}function bt(l,u){if(l===!1||l===null||typeof l>"u")throw new Error(u)}function Oa(l,u){if(!l){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function g0(){return Math.random().toString(36).substring(2,10)}function Ph(l,u){return{usr:l.state,key:l.key,idx:u}}function Zc(l,u,o=null,c){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof u=="string"?Hl(u):u,state:o,key:u&&u.key||c||g0()}}function qi({pathname:l="/",search:u="",hash:o=""}){return u&&u!=="?"&&(l+=u.charAt(0)==="?"?u:"?"+u),o&&o!=="#"&&(l+=o.charAt(0)==="#"?o:"#"+o),l}function Hl(l){let u={};if(l){let o=l.indexOf("#");o>=0&&(u.hash=l.substring(o),l=l.substring(0,o));let c=l.indexOf("?");c>=0&&(u.search=l.substring(c),l=l.substring(0,c)),l&&(u.pathname=l)}return u}function b0(l,u,o,c={}){let{window:h=document.defaultView,v5Compat:d=!1}=c,f=h.history,p="POP",m=null,b=k();b==null&&(b=0,f.replaceState({...f.state,idx:b},""));function k(){return(f.state||{idx:null}).idx}function N(){p="POP";let v=k(),y=v==null?null:v-b;b=v,m&&m({action:p,location:x.location,delta:y})}function T(v,y){p="PUSH";let C=Zc(x.location,v,y);b=k()+1;let E=Ph(C,b),U=x.createHref(C);try{f.pushState(E,"",U)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;h.location.assign(U)}d&&m&&m({action:p,location:x.location,delta:1})}function S(v,y){p="REPLACE";let C=Zc(x.location,v,y);b=k();let E=Ph(C,b),U=x.createHref(C);f.replaceState(E,"",U),d&&m&&m({action:p,location:x.location,delta:0})}function j(v){return y0(v)}let x={get action(){return p},get location(){return l(h,f)},listen(v){if(m)throw new Error("A history only accepts one active listener");return h.addEventListener(Wh,N),m=v,()=>{h.removeEventListener(Wh,N),m=null}},createHref(v){return u(h,v)},createURL:j,encodeLocation(v){let y=j(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:T,replace:S,go(v){return f.go(v)}};return x}function y0(l,u=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),bt(o,"No window.location.(origin|href) available to create URL");let c=typeof l=="string"?l:qi(l);return c=c.replace(/ $/,"%20"),!u&&c.startsWith("//")&&(c=o+c),new URL(c,o)}function Sp(l,u,o="/"){return v0(l,u,o,!1)}function v0(l,u,o,c){let h=typeof u=="string"?Hl(u):u,d=an(h.pathname||"/",o);if(d==null)return null;let f=_p(l);w0(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let b=R0(d);p=z0(f[m],b,c)}return p}function _p(l,u=[],o=[],c="",h=!1){let d=(f,p,m=h,b)=>{let k={relativePath:b===void 0?f.path||"":b,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(k.relativePath.startsWith("/")){if(!k.relativePath.startsWith(c)&&m)return;bt(k.relativePath.startsWith(c),`Absolute route path "${k.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),k.relativePath=k.relativePath.slice(c.length)}let N=tn([c,k.relativePath]),T=o.concat(k);f.children&&f.children.length>0&&(bt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${N}".`),_p(f.children,u,T,N,m)),!(f.path==null&&!f.index)&&u.push({path:N,score:k0(N,f.index),routesMeta:T})};return l.forEach((f,p)=>{if(f.path===""||!f.path?.includes("?"))d(f,p);else for(let m of jp(f.path))d(f,p,!0,m)}),u}function jp(l){let u=l.split("/");if(u.length===0)return[];let[o,...c]=u,h=o.endsWith("?"),d=o.replace(/\?$/,"");if(c.length===0)return h?[d,""]:[d];let f=jp(c.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),h&&p.push(...f),p.map(m=>l.startsWith("/")&&m===""?"/":m)}function w0(l){l.sort((u,o)=>u.score!==o.score?o.score-u.score:A0(u.routesMeta.map(c=>c.childrenIndex),o.routesMeta.map(c=>c.childrenIndex)))}var S0=/^:[\w-]+$/,_0=3,j0=2,N0=1,E0=10,C0=-2,ep=l=>l==="*";function k0(l,u){let o=l.split("/"),c=o.length;return o.some(ep)&&(c+=C0),u&&(c+=j0),o.filter(h=>!ep(h)).reduce((h,d)=>h+(S0.test(d)?_0:d===""?N0:E0),c)}function A0(l,u){return l.length===u.length&&l.slice(0,-1).every((c,h)=>c===u[h])?l[l.length-1]-u[u.length-1]:0}function z0(l,u,o=!1){let{routesMeta:c}=l,h={},d="/",f=[];for(let p=0;p<c.length;++p){let m=c[p],b=p===c.length-1,k=d==="/"?u:u.slice(d.length)||"/",N=ms({path:m.relativePath,caseSensitive:m.caseSensitive,end:b},k),T=m.route;if(!N&&b&&o&&!c[c.length-1].route.index&&(N=ms({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},k)),!N)return null;Object.assign(h,N.params),f.push({params:h,pathname:tn([d,N.pathname]),pathnameBase:U0(tn([d,N.pathnameBase])),route:T}),N.pathnameBase!=="/"&&(d=tn([d,N.pathnameBase]))}return f}function ms(l,u){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[o,c]=T0(l.path,l.caseSensitive,l.end),h=u.match(o);if(!h)return null;let d=h[0],f=d.replace(/(.)\/+$/,"$1"),p=h.slice(1);return{params:c.reduce((b,{paramName:k,isOptional:N},T)=>{if(k==="*"){let j=p[T]||"";f=d.slice(0,d.length-j.length).replace(/(.)\/+$/,"$1")}const S=p[T];return N&&!S?b[k]=void 0:b[k]=(S||"").replace(/%2F/g,"/"),b},{}),pathname:d,pathnameBase:f,pattern:l}}function T0(l,u=!1,o=!0){Oa(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let c=[],h="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m)=>(c.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(c.push({paramName:"*"}),h+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?h+="\\/*$":l!==""&&l!=="/"&&(h+="(?:(?=\\/|$))"),[new RegExp(h,u?void 0:"i"),c]}function R0(l){try{return l.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Oa(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),l}}function an(l,u){if(u==="/")return l;if(!l.toLowerCase().startsWith(u.toLowerCase()))return null;let o=u.endsWith("/")?u.length-1:u.length,c=l.charAt(o);return c&&c!=="/"?null:l.slice(o)||"/"}var O0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D0(l,u="/"){let{pathname:o,search:c="",hash:h=""}=typeof l=="string"?Hl(l):l,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=tp(o.substring(1),"/"):d=tp(o,u)):d=u,{pathname:d,search:B0(c),hash:L0(h)}}function tp(l,u){let o=u.replace(/\/+$/,"").split("/");return l.split("/").forEach(h=>{h===".."?o.length>1&&o.pop():h!=="."&&o.push(h)}),o.length>1?o.join("/"):"/"}function Dc(l,u,o,c){return`Cannot include a '${l}' character in a manually specified \`to.${u}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function M0(l){return l.filter((u,o)=>o===0||u.route.path&&u.route.path.length>0)}function Np(l){let u=M0(l);return u.map((o,c)=>c===u.length-1?o.pathname:o.pathnameBase)}function Ep(l,u,o,c=!1){let h;typeof l=="string"?h=Hl(l):(h={...l},bt(!h.pathname||!h.pathname.includes("?"),Dc("?","pathname","search",h)),bt(!h.pathname||!h.pathname.includes("#"),Dc("#","pathname","hash",h)),bt(!h.search||!h.search.includes("#"),Dc("#","search","hash",h)));let d=l===""||h.pathname==="",f=d?"/":h.pathname,p;if(f==null)p=o;else{let N=u.length-1;if(!c&&f.startsWith("..")){let T=f.split("/");for(;T[0]==="..";)T.shift(),N-=1;h.pathname=T.join("/")}p=N>=0?u[N]:"/"}let m=D0(h,p),b=f&&f!=="/"&&f.endsWith("/"),k=(d||f===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(b||k)&&(m.pathname+="/"),m}var tn=l=>l.join("/").replace(/\/\/+/g,"/"),U0=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),B0=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,L0=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,H0=class{constructor(l,u,o,c=!1){this.status=l,this.statusText=u||"",this.internal=c,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function q0(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function Y0(l){return l.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Cp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kp(l,u){let o=l;if(typeof o!="string"||!O0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let c=o,h=!1;if(Cp)try{let d=new URL(window.location.href),f=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=an(f.pathname,u);f.origin===d.origin&&p!=null?o=p+f.search+f.hash:h=!0}catch{Oa(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:h,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ap=["POST","PUT","PATCH","DELETE"];new Set(Ap);var V0=["GET",...Ap];new Set(V0);var ql=z.createContext(null);ql.displayName="DataRouter";var gs=z.createContext(null);gs.displayName="DataRouterState";var G0=z.createContext(!1),zp=z.createContext({isTransitioning:!1});zp.displayName="ViewTransition";var Z0=z.createContext(new Map);Z0.displayName="Fetchers";var X0=z.createContext(null);X0.displayName="Await";var va=z.createContext(null);va.displayName="Navigation";var Vi=z.createContext(null);Vi.displayName="Location";var Da=z.createContext({outlet:null,matches:[],isDataRoute:!1});Da.displayName="Route";var Pc=z.createContext(null);Pc.displayName="RouteError";var Tp="REACT_ROUTER_ERROR",K0="REDIRECT",Q0="ROUTE_ERROR_RESPONSE";function I0(l){if(l.startsWith(`${Tp}:${K0}:{`))try{let u=JSON.parse(l.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function J0(l){if(l.startsWith(`${Tp}:${Q0}:{`))try{let u=JSON.parse(l.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new H0(u.status,u.statusText,u.data)}catch{}}function $0(l,{relative:u}={}){bt(Gi(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:c}=z.useContext(va),{hash:h,pathname:d,search:f}=Zi(l,{relative:u}),p=d;return o!=="/"&&(p=d==="/"?o:tn([o,d])),c.createHref({pathname:p,search:f,hash:h})}function Gi(){return z.useContext(Vi)!=null}function Mn(){return bt(Gi(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Vi).location}var Rp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Op(l){z.useContext(va).static||z.useLayoutEffect(l)}function Pn(){let{isDataRoute:l}=z.useContext(Da);return l?cg():F0()}function F0(){bt(Gi(),"useNavigate() may be used only in the context of a <Router> component.");let l=z.useContext(ql),{basename:u,navigator:o}=z.useContext(va),{matches:c}=z.useContext(Da),{pathname:h}=Mn(),d=JSON.stringify(Np(c)),f=z.useRef(!1);return Op(()=>{f.current=!0}),z.useCallback((m,b={})=>{if(Oa(f.current,Rp),!f.current)return;if(typeof m=="number"){o.go(m);return}let k=Ep(m,JSON.parse(d),h,b.relative==="path");l==null&&u!=="/"&&(k.pathname=k.pathname==="/"?u:tn([u,k.pathname])),(b.replace?o.replace:o.push)(k,b.state,b)},[u,o,d,h,l])}z.createContext(null);function Dp(){let{matches:l}=z.useContext(Da),u=l[l.length-1];return u?u.params:{}}function Zi(l,{relative:u}={}){let{matches:o}=z.useContext(Da),{pathname:c}=Mn(),h=JSON.stringify(Np(o));return z.useMemo(()=>Ep(l,JSON.parse(h),c,u==="path"),[l,h,c,u])}function W0(l,u){return Mp(l,u)}function Mp(l,u,o,c,h){bt(Gi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=z.useContext(va),{matches:f}=z.useContext(Da),p=f[f.length-1],m=p?p.params:{},b=p?p.pathname:"/",k=p?p.pathnameBase:"/",N=p&&p.route;{let C=N&&N.path||"";Bp(b,!N||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let T=Mn(),S;if(u){let C=typeof u=="string"?Hl(u):u;bt(k==="/"||C.pathname?.startsWith(k),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${k}" but pathname "${C.pathname}" was given in the \`location\` prop.`),S=C}else S=T;let j=S.pathname||"/",x=j;if(k!=="/"){let C=k.replace(/^\//,"").split("/");x="/"+j.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=Sp(l,{pathname:x});Oa(N||v!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),Oa(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=ng(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},m,C.params),pathname:tn([k,d.encodeLocation?d.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?k:tn([k,d.encodeLocation?d.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),f,o,c,h);return u&&y?z.createElement(Vi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},y):y}function P0(){let l=og(),u=q0(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),o=l instanceof Error?l.stack:null,c="rgba(200,200,200, 0.5)",h={padding:"0.5rem",backgroundColor:c},d={padding:"2px 4px",backgroundColor:c},f=null;return console.error("Error handled by React Router default ErrorBoundary:",l),f=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:d},"ErrorBoundary")," or"," ",z.createElement("code",{style:d},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},u),o?z.createElement("pre",{style:h},o):null,f)}var eg=z.createElement(P0,null),Up=class extends z.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,u){return u.location!==l.location||u.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:u.error,location:u.location,revalidation:l.revalidation||u.revalidation}}componentDidCatch(l,u){this.props.onError?this.props.onError(l,u):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const o=J0(l.digest);o&&(l=o)}let u=l!==void 0?z.createElement(Da.Provider,{value:this.props.routeContext},z.createElement(Pc.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?z.createElement(tg,{error:l},u):u}};Up.contextType=G0;var Mc=new WeakMap;function tg({children:l,error:u}){let{basename:o}=z.useContext(va);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let c=I0(u.digest);if(c){let h=Mc.get(u);if(h)throw h;let d=kp(c.location,o);if(Cp&&!Mc.get(u))if(d.isExternal||c.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:c.replace}));throw Mc.set(u,f),f}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return l}function ag({routeContext:l,match:u,children:o}){let c=z.useContext(ql);return c&&c.static&&c.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=u.route.id),z.createElement(Da.Provider,{value:l},o)}function ng(l,u=[],o=null,c=null,h=null){if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let d=l,f=o?.errors;if(f!=null){let k=d.findIndex(N=>N.route.id&&f?.[N.route.id]!==void 0);bt(k>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,k+1))}let p=!1,m=-1;if(o)for(let k=0;k<d.length;k++){let N=d[k];if((N.route.HydrateFallback||N.route.hydrateFallbackElement)&&(m=k),N.route.id){let{loaderData:T,errors:S}=o,j=N.route.loader&&!T.hasOwnProperty(N.route.id)&&(!S||S[N.route.id]===void 0);if(N.route.lazy||j){p=!0,m>=0?d=d.slice(0,m+1):d=[d[0]];break}}}let b=o&&c?(k,N)=>{c(k,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:Y0(o.matches),errorInfo:N})}:void 0;return d.reduceRight((k,N,T)=>{let S,j=!1,x=null,v=null;o&&(S=f&&N.route.id?f[N.route.id]:void 0,x=N.route.errorElement||eg,p&&(m<0&&T===0?(Bp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,v=null):m===T&&(j=!0,v=N.route.hydrateFallbackElement||null)));let y=u.concat(d.slice(0,T+1)),C=()=>{let E;return S?E=x:j?E=v:N.route.Component?E=z.createElement(N.route.Component,null):N.route.element?E=N.route.element:E=k,z.createElement(ag,{match:N,routeContext:{outlet:k,matches:y,isDataRoute:o!=null},children:E})};return o&&(N.route.ErrorBoundary||N.route.errorElement||T===0)?z.createElement(Up,{location:o.location,revalidation:o.revalidation,component:x,error:S,children:C(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:b}):C()},null)}function eu(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lg(l){let u=z.useContext(ql);return bt(u,eu(l)),u}function ig(l){let u=z.useContext(gs);return bt(u,eu(l)),u}function rg(l){let u=z.useContext(Da);return bt(u,eu(l)),u}function tu(l){let u=rg(l),o=u.matches[u.matches.length-1];return bt(o.route.id,`${l} can only be used on routes that contain a unique "id"`),o.route.id}function sg(){return tu("useRouteId")}function og(){let l=z.useContext(Pc),u=ig("useRouteError"),o=tu("useRouteError");return l!==void 0?l:u.errors?.[o]}function cg(){let{router:l}=lg("useNavigate"),u=tu("useNavigate"),o=z.useRef(!1);return Op(()=>{o.current=!0}),z.useCallback(async(h,d={})=>{Oa(o.current,Rp),o.current&&(typeof h=="number"?await l.navigate(h):await l.navigate(h,{fromRouteId:u,...d}))},[l,u])}var ap={};function Bp(l,u,o){!u&&!ap[l]&&(ap[l]=!0,Oa(!1,o))}z.memo(ug);function ug({routes:l,future:u,state:o,onError:c}){return Mp(l,void 0,o,c,u)}function Ra(l){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dg({basename:l="/",children:u=null,location:o,navigationType:c="POP",navigator:h,static:d=!1,unstable_useTransitions:f}){bt(!Gi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=l.replace(/^\/*/,"/"),m=z.useMemo(()=>({basename:p,navigator:h,static:d,unstable_useTransitions:f,future:{}}),[p,h,d,f]);typeof o=="string"&&(o=Hl(o));let{pathname:b="/",search:k="",hash:N="",state:T=null,key:S="default"}=o,j=z.useMemo(()=>{let x=an(b,p);return x==null?null:{location:{pathname:x,search:k,hash:N,state:T,key:S},navigationType:c}},[p,b,k,N,T,S,c]);return Oa(j!=null,`<Router basename="${p}"> is not able to match the URL "${b}${k}${N}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:z.createElement(va.Provider,{value:m},z.createElement(Vi.Provider,{children:u,value:j}))}function fg({children:l,location:u}){return W0(Xc(l),u)}function Xc(l,u=[]){let o=[];return z.Children.forEach(l,(c,h)=>{if(!z.isValidElement(c))return;let d=[...u,h];if(c.type===z.Fragment){o.push.apply(o,Xc(c.props.children,d));return}bt(c.type===Ra,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let f={id:c.props.id||d.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(f.children=Xc(c.props.children,d)),o.push(f)}),o}var hs="get",ps="application/x-www-form-urlencoded";function bs(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function hg(l){return bs(l)&&l.tagName.toLowerCase()==="button"}function pg(l){return bs(l)&&l.tagName.toLowerCase()==="form"}function mg(l){return bs(l)&&l.tagName.toLowerCase()==="input"}function xg(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function gg(l,u){return l.button===0&&(!u||u==="_self")&&!xg(l)}var ls=null;function bg(){if(ls===null)try{new FormData(document.createElement("form"),0),ls=!1}catch{ls=!0}return ls}var yg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Uc(l){return l!=null&&!yg.has(l)?(Oa(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ps}"`),null):l}function vg(l,u){let o,c,h,d,f;if(pg(l)){let p=l.getAttribute("action");c=p?an(p,u):null,o=l.getAttribute("method")||hs,h=Uc(l.getAttribute("enctype"))||ps,d=new FormData(l)}else if(hg(l)||mg(l)&&(l.type==="submit"||l.type==="image")){let p=l.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=l.getAttribute("formaction")||p.getAttribute("action");if(c=m?an(m,u):null,o=l.getAttribute("formmethod")||p.getAttribute("method")||hs,h=Uc(l.getAttribute("formenctype"))||Uc(p.getAttribute("enctype"))||ps,d=new FormData(p,l),!bg()){let{name:b,type:k,value:N}=l;if(k==="image"){let T=b?`${b}.`:"";d.append(`${T}x`,"0"),d.append(`${T}y`,"0")}else b&&d.append(b,N)}}else{if(bs(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=hs,c=null,h=ps,f=l}return d&&h==="text/plain"&&(f=d,d=void 0),{action:c,method:o.toLowerCase(),encType:h,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function au(l,u){if(l===!1||l===null||typeof l>"u")throw new Error(u)}function wg(l,u,o,c){let h=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return o?h.pathname.endsWith("/")?h.pathname=`${h.pathname}_.${c}`:h.pathname=`${h.pathname}.${c}`:h.pathname==="/"?h.pathname=`_root.${c}`:u&&an(h.pathname,u)==="/"?h.pathname=`${u.replace(/\/$/,"")}/_root.${c}`:h.pathname=`${h.pathname.replace(/\/$/,"")}.${c}`,h}async function Sg(l,u){if(l.id in u)return u[l.id];try{let o=await import(l.module);return u[l.id]=o,o}catch(o){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _g(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function jg(l,u,o){let c=await Promise.all(l.map(async h=>{let d=u.routes[h.route.id];if(d){let f=await Sg(d,o);return f.links?f.links():[]}return[]}));return kg(c.flat(1).filter(_g).filter(h=>h.rel==="stylesheet"||h.rel==="preload").map(h=>h.rel==="stylesheet"?{...h,rel:"prefetch",as:"style"}:{...h,rel:"prefetch"}))}function np(l,u,o,c,h,d){let f=(m,b)=>o[b]?m.route.id!==o[b].route.id:!0,p=(m,b)=>o[b].pathname!==m.pathname||o[b].route.path?.endsWith("*")&&o[b].params["*"]!==m.params["*"];return d==="assets"?u.filter((m,b)=>f(m,b)||p(m,b)):d==="data"?u.filter((m,b)=>{let k=c.routes[m.route.id];if(!k||!k.hasLoader)return!1;if(f(m,b)||p(m,b))return!0;if(m.route.shouldRevalidate){let N=m.route.shouldRevalidate({currentUrl:new URL(h.pathname+h.search+h.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(l,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function Ng(l,u,{includeHydrateFallback:o}={}){return Eg(l.map(c=>{let h=u.routes[c.route.id];if(!h)return[];let d=[h.module];return h.clientActionModule&&(d=d.concat(h.clientActionModule)),h.clientLoaderModule&&(d=d.concat(h.clientLoaderModule)),o&&h.hydrateFallbackModule&&(d=d.concat(h.hydrateFallbackModule)),h.imports&&(d=d.concat(h.imports)),d}).flat(1))}function Eg(l){return[...new Set(l)]}function Cg(l){let u={},o=Object.keys(l).sort();for(let c of o)u[c]=l[c];return u}function kg(l,u){let o=new Set;return new Set(u),l.reduce((c,h)=>{let d=JSON.stringify(Cg(h));return o.has(d)||(o.add(d),c.push({key:d,link:h})),c},[])}function Lp(){let l=z.useContext(ql);return au(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function Ag(){let l=z.useContext(gs);return au(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var nu=z.createContext(void 0);nu.displayName="FrameworkContext";function Hp(){let l=z.useContext(nu);return au(l,"You must render this element inside a <HydratedRouter> element"),l}function zg(l,u){let o=z.useContext(nu),[c,h]=z.useState(!1),[d,f]=z.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:b,onMouseLeave:k,onTouchStart:N}=u,T=z.useRef(null);z.useEffect(()=>{if(l==="render"&&f(!0),l==="viewport"){let x=y=>{y.forEach(C=>{f(C.isIntersecting)})},v=new IntersectionObserver(x,{threshold:.5});return T.current&&v.observe(T.current),()=>{v.disconnect()}}},[l]),z.useEffect(()=>{if(c){let x=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(x)}}},[c]);let S=()=>{h(!0)},j=()=>{h(!1),f(!1)};return o?l!=="intent"?[d,T,{}]:[d,T,{onFocus:Li(p,S),onBlur:Li(m,j),onMouseEnter:Li(b,S),onMouseLeave:Li(k,j),onTouchStart:Li(N,S)}]:[!1,T,{}]}function Li(l,u){return o=>{l&&l(o),o.defaultPrevented||u(o)}}function Tg({page:l,...u}){let{router:o}=Lp(),c=z.useMemo(()=>Sp(o.routes,l,o.basename),[o.routes,l,o.basename]);return c?z.createElement(Og,{page:l,matches:c,...u}):null}function Rg(l){let{manifest:u,routeModules:o}=Hp(),[c,h]=z.useState([]);return z.useEffect(()=>{let d=!1;return jg(l,u,o).then(f=>{d||h(f)}),()=>{d=!0}},[l,u,o]),c}function Og({page:l,matches:u,...o}){let c=Mn(),{future:h,manifest:d,routeModules:f}=Hp(),{basename:p}=Lp(),{loaderData:m,matches:b}=Ag(),k=z.useMemo(()=>np(l,u,b,d,c,"data"),[l,u,b,d,c]),N=z.useMemo(()=>np(l,u,b,d,c,"assets"),[l,u,b,d,c]),T=z.useMemo(()=>{if(l===c.pathname+c.search+c.hash)return[];let x=new Set,v=!1;if(u.forEach(C=>{let E=d.routes[C.route.id];!E||!E.hasLoader||(!k.some(U=>U.route.id===C.route.id)&&C.route.id in m&&f[C.route.id]?.shouldRevalidate||E.hasClientLoader?v=!0:x.add(C.route.id))}),x.size===0)return[];let y=wg(l,p,h.unstable_trailingSlashAwareDataRequests,"data");return v&&x.size>0&&y.searchParams.set("_routes",u.filter(C=>x.has(C.route.id)).map(C=>C.route.id).join(",")),[y.pathname+y.search]},[p,h.unstable_trailingSlashAwareDataRequests,m,c,d,k,u,l,f]),S=z.useMemo(()=>Ng(N,d),[N,d]),j=Rg(N);return z.createElement(z.Fragment,null,T.map(x=>z.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...o})),S.map(x=>z.createElement("link",{key:x,rel:"modulepreload",href:x,...o})),j.map(({key:x,link:v})=>z.createElement("link",{key:x,nonce:o.nonce,...v,crossOrigin:v.crossOrigin??o.crossOrigin})))}function Dg(...l){return u=>{l.forEach(o=>{typeof o=="function"?o(u):o!=null&&(o.current=u)})}}var Mg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Mg&&(window.__reactRouterVersion="7.13.0")}catch{}function Ug({basename:l,children:u,unstable_useTransitions:o,window:c}){let h=z.useRef();h.current==null&&(h.current=x0({window:c,v5Compat:!0}));let d=h.current,[f,p]=z.useState({action:d.action,location:d.location}),m=z.useCallback(b=>{o===!1?p(b):z.startTransition(()=>p(b))},[o]);return z.useLayoutEffect(()=>d.listen(m),[d,m]),z.createElement(dg,{basename:l,children:u,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:o})}var qp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yp=z.forwardRef(function({onClick:u,discover:o="render",prefetch:c="none",relative:h,reloadDocument:d,replace:f,state:p,target:m,to:b,preventScrollReset:k,viewTransition:N,unstable_defaultShouldRevalidate:T,...S},j){let{basename:x,unstable_useTransitions:v}=z.useContext(va),y=typeof b=="string"&&qp.test(b),C=kp(b,x);b=C.to;let E=$0(b,{relative:h}),[U,B,Z]=zg(c,S),Y=qg(b,{replace:f,state:p,target:m,preventScrollReset:k,relative:h,viewTransition:N,unstable_defaultShouldRevalidate:T,unstable_useTransitions:v});function ne(ge){u&&u(ge),ge.defaultPrevented||Y(ge)}let F=z.createElement("a",{...S,...Z,href:C.absoluteURL||E,onClick:C.isExternal||d?u:ne,ref:Dg(j,B),target:m,"data-discover":!y&&o==="render"?"true":void 0});return U&&!y?z.createElement(z.Fragment,null,F,z.createElement(Tg,{page:E})):F});Yp.displayName="Link";var Bg=z.forwardRef(function({"aria-current":u="page",caseSensitive:o=!1,className:c="",end:h=!1,style:d,to:f,viewTransition:p,children:m,...b},k){let N=Zi(f,{relative:b.relative}),T=Mn(),S=z.useContext(gs),{navigator:j,basename:x}=z.useContext(va),v=S!=null&&Xg(N)&&p===!0,y=j.encodeLocation?j.encodeLocation(N).pathname:N.pathname,C=T.pathname,E=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;o||(C=C.toLowerCase(),E=E?E.toLowerCase():null,y=y.toLowerCase()),E&&x&&(E=an(E,x)||E);const U=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let B=C===y||!h&&C.startsWith(y)&&C.charAt(U)==="/",Z=E!=null&&(E===y||!h&&E.startsWith(y)&&E.charAt(y.length)==="/"),Y={isActive:B,isPending:Z,isTransitioning:v},ne=B?u:void 0,F;typeof c=="function"?F=c(Y):F=[c,B?"active":null,Z?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let ge=typeof d=="function"?d(Y):d;return z.createElement(Yp,{...b,"aria-current":ne,className:F,ref:k,style:ge,to:f,viewTransition:p},typeof m=="function"?m(Y):m)});Bg.displayName="NavLink";var Lg=z.forwardRef(({discover:l="render",fetcherKey:u,navigate:o,reloadDocument:c,replace:h,state:d,method:f=hs,action:p,onSubmit:m,relative:b,preventScrollReset:k,viewTransition:N,unstable_defaultShouldRevalidate:T,...S},j)=>{let{unstable_useTransitions:x}=z.useContext(va),v=Gg(),y=Zg(p,{relative:b}),C=f.toLowerCase()==="get"?"get":"post",E=typeof p=="string"&&qp.test(p),U=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let Z=B.nativeEvent.submitter,Y=Z?.getAttribute("formmethod")||f,ne=()=>v(Z||B.currentTarget,{fetcherKey:u,method:Y,navigate:o,replace:h,state:d,relative:b,preventScrollReset:k,viewTransition:N,unstable_defaultShouldRevalidate:T});x&&o!==!1?z.startTransition(()=>ne()):ne()};return z.createElement("form",{ref:j,method:C,action:y,onSubmit:c?m:U,...S,"data-discover":!E&&l==="render"?"true":void 0})});Lg.displayName="Form";function Hg(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vp(l){let u=z.useContext(ql);return bt(u,Hg(l)),u}function qg(l,{target:u,replace:o,state:c,preventScrollReset:h,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let b=Pn(),k=Mn(),N=Zi(l,{relative:d});return z.useCallback(T=>{if(gg(T,u)){T.preventDefault();let S=o!==void 0?o:qi(k)===qi(N),j=()=>b(l,{replace:S,state:c,preventScrollReset:h,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p});m?z.startTransition(()=>j()):j()}},[k,b,N,o,c,u,l,h,d,f,p,m])}var Yg=0,Vg=()=>`__${String(++Yg)}__`;function Gg(){let{router:l}=Vp("useSubmit"),{basename:u}=z.useContext(va),o=sg(),c=l.fetch,h=l.navigate;return z.useCallback(async(d,f={})=>{let{action:p,method:m,encType:b,formData:k,body:N}=vg(d,u);if(f.navigate===!1){let T=f.fetcherKey||Vg();await c(T,o,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:k,body:N,formMethod:f.method||m,formEncType:f.encType||b,flushSync:f.flushSync})}else await h(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:k,body:N,formMethod:f.method||m,formEncType:f.encType||b,replace:f.replace,state:f.state,fromRouteId:o,flushSync:f.flushSync,viewTransition:f.viewTransition})},[c,h,u,o])}function Zg(l,{relative:u}={}){let{basename:o}=z.useContext(va),c=z.useContext(Da);bt(c,"useFormAction must be used inside a RouteContext");let[h]=c.matches.slice(-1),d={...Zi(l||".",{relative:u})},f=Mn();if(l==null){d.search=f.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(k=>k==="")){p.delete("index"),m.filter(N=>N).forEach(N=>p.append("index",N));let k=p.toString();d.search=k?`?${k}`:""}}return(!l||l===".")&&h.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:tn([o,d.pathname])),qi(d)}function Xg(l,{relative:u}={}){let o=z.useContext(zp);bt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Vp("useViewTransitionState"),h=Zi(l,{relative:u});if(!o.isTransitioning)return!1;let d=an(o.currentLocation.pathname,c)||o.currentLocation.pathname,f=an(o.nextLocation.pathname,c)||o.nextLocation.pathname;return ms(h.pathname,f)!=null||ms(h.pathname,d)!=null}var Kg=wp();const je=Dn.memo(({name:l,className:u="",fill:o=!1})=>r.jsx("span",{className:`material-symbols-outlined ${u}`,style:{fontVariationSettings:o?"'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24":"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},"aria-hidden":"true",children:l})),Qg=({onNavigate:l,onNewTask:u,onLogout:o,currentScreen:c})=>r.jsxs("aside",{className:"w-20 h-full border-r border-white/10 glass flex flex-col items-center py-8 shrink-0 z-50",children:[r.jsx("button",{onClick:()=>l("dashboard"),className:"mb-12 hover:opacity-80 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg","aria-label":"Go to Dashboard",children:r.jsx("img",{src:"/figranium_icon.svg",alt:"Figranium Logo",className:"w-10 h-10",onError:h=>{h.currentTarget.src="/figranium_icon.svg"}})}),r.jsxs("div",{className:"flex-1 flex flex-col gap-6",children:[r.jsx("button",{onClick:u,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-white bg-white/5 hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"New Task","aria-label":"New Task",children:r.jsx(je,{name:"add",className:"text-2xl"})}),r.jsx("button",{onClick:()=>l("dashboard"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="dashboard"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Dashboard","aria-label":"Dashboard",children:r.jsx(je,{name:"home",className:"text-2xl"})}),r.jsx("button",{onClick:()=>l("settings"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="settings"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Settings","aria-label":"Settings",children:r.jsx(je,{name:"settings",className:"text-2xl"})}),r.jsx("button",{onClick:()=>l("executions"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="executions"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Executions","aria-label":"Executions",children:r.jsx(je,{name:"history",className:"text-2xl"})}),r.jsx("button",{onClick:()=>l("captures"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="captures"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Captures","aria-label":"Captures",children:r.jsx(je,{name:"photo_camera",className:"text-2xl"})})]}),r.jsx("button",{onClick:o,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-gray-500 hover:bg-red-500/10 hover:text-red-500 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Logout","aria-label":"Logout",children:r.jsx(je,{name:"logout",className:"text-2xl"})})]}),Ig=Dn.memo(Qg),Jg=({status:l,onSubmit:u,error:o,busy:c=!1})=>{const[h,d]=z.useState(""),[f,p]=z.useState(""),[m,b]=z.useState(""),[k,N]=z.useState(""),T=j=>{j.preventDefault(),u(f,m,h,k)},S=l==="setup"?c?"Creating account...":"Create Account":c?"Authenticating...":"Authenticate";return r.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#020202] flex items-center justify-center",children:[r.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),r.jsxs("div",{className:"w-[400px] glass-card p-10 rounded-[48px] space-y-8 relative",children:[r.jsxs("div",{className:"text-center space-y-3",children:[r.jsx("img",{src:"/figranium_logo.svg",alt:"Figranium",className:"h-24 mx-auto object-contain"}),r.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] leading-relaxed max-w-[200px] mx-auto",children:"Deterministic Control for an Agentic World"}),l==="setup"&&r.jsx("p",{className:"text-[10px] font-bold text-accent uppercase tracking-[0.3em]",children:"Initializing System"})]}),r.jsxs("form",{onSubmit:T,className:"space-y-8",children:[r.jsxs("div",{className:"space-y-4",children:[l==="setup"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"auth-name",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Name"}),r.jsx("input",{id:"auth-name",type:"text",value:h,onChange:j=>d(j.target.value),placeholder:"Full Name",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",autoComplete:"name"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"auth-email",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Email"}),r.jsx("input",{id:"auth-email",type:"email",value:f,onChange:j=>p(j.target.value),placeholder:"user@example.com",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:"email"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"auth-pass",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Password"}),r.jsx("input",{id:"auth-pass",type:"password",value:m,onChange:j=>b(j.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:l==="setup"?"new-password":"current-password"})]}),l==="setup"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"auth-pass-confirm",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Confirm Password"}),r.jsx("input",{id:"auth-pass-confirm",type:"password",value:k,onChange:j=>N(j.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:"new-password"})]})]}),r.jsxs("button",{type:"submit",disabled:c,"aria-busy":c,className:"shine-effect w-full bg-white text-black py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-60 disabled:cursor-default flex items-center justify-center gap-3",children:[c&&r.jsx("div",{className:"w-4 h-4 border-2 border-black/10 border-t-black rounded-full animate-spin"}),S]}),o&&r.jsx("div",{role:"alert",className:"text-[9px] font-bold text-red-500 text-center uppercase tracking-widest",children:o})]})]})]})};function $g(l){return l>=1e6?`${(l/1e6).toFixed(1).replace(/\.0$/,"")}m`:l>=1e3?`${(l/1e3).toFixed(1).replace(/\.0$/,"")}k`:String(l)}const Fg=({className:l})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:l,"aria-hidden":"true",children:r.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.379.202 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.418 22 12c0-5.523-4.477-10-10-10z"})});function Gp({className:l=""}){const[u,o]=z.useState("—"),c=d=>{const f=d.currentTarget.getBoundingClientRect(),p=Math.min(1,Math.max(0,(d.clientX-f.left)/f.width)),m=Math.min(1,Math.max(0,(d.clientY-f.top)/f.height));d.currentTarget.style.setProperty("--beam-x",`${(p*100).toFixed(2)}%`),d.currentTarget.style.setProperty("--beam-y",`${(m*100).toFixed(2)}%`)},h=d=>{d.currentTarget.style.setProperty("--beam-x","50%"),d.currentTarget.style.setProperty("--beam-y","50%")};return z.useEffect(()=>{let d=!0;return fetch("https://api.github.com/repos/figranium/figranium").then(f=>f.ok?f.json():null).then(f=>{!d||!f?.stargazers_count||o($g(Number(f.stargazers_count)))}).catch(()=>{d&&o("—")}),()=>{d=!1}},[]),r.jsxs("a",{href:"https://github.com/figranium/figranium",target:"_blank",rel:"noreferrer",onPointerMove:c,onPointerLeave:h,className:`gh-pill beam-follow inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-4 py-2 text-[11px] uppercase tracking-[0.25em] text-white/70 transition hover:border-white/20 hover:bg-white/10 hover:text-white ${l}`,"aria-label":"Star Figranium on GitHub",children:[r.jsx(Fg,{className:"h-4 w-4"}),"GitHub",r.jsx("span",{className:"mx-1 h-3 w-px bg-white/20","aria-hidden":"true"}),r.jsx(je,{name:"star",className:"text-base",fill:!0}),u]})}const Wg=({tasks:l,onNewTask:u,onEditTask:o,onDeleteTask:c,onExportTasks:h,onImportTasks:d})=>{const f=z.useRef(null),[p,m]=Dn.useState(!1),[b,k]=Dn.useState([]),N=x=>{try{return x?`https://www.google.com/s2/favicons?domain=${new URL(x).hostname}&sz=64`:null}catch{return null}},T=()=>{f.current?.click()},S=x=>{const v=x.target.files?.[0];v&&d(v),x.target.value=""},j=x=>{k(v=>v.includes(x)?v.filter(y=>y!==x):[...v,x])};return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex-1 overflow-hidden animate-in fade-in duration-500",children:r.jsxs("div",{className:"h-full flex flex-col px-12 py-12 max-w-7xl mx-auto space-y-12 w-full",children:[r.jsxs("div",{className:"flex items-end justify-between",children:[r.jsx("div",{className:"space-y-2",children:r.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Dashboard"})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Gp,{}),r.jsxs("button",{onClick:()=>{k([]),m(!0)},className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[r.jsx(je,{name:"download",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Export"]}),r.jsxs("button",{onClick:T,className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[r.jsx(je,{name:"upload",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Import"]}),r.jsx("button",{onClick:u,className:"shine-effect bg-white text-black px-8 py-3 rounded-2xl font-bold text-[10px] tracking-[0.2em] uppercase transition-all hover:scale-105 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"+ New Task"}),r.jsx("input",{ref:f,type:"file",accept:"application/json",className:"hidden",onChange:S})]})]}),r.jsxs("div",{className:"relative flex-1 min-h-0",children:[r.jsx("div",{className:"pointer-events-none absolute top-0 left-0 right-0 h-10 bg-gradient-to-b from-[#050505] via-[#050505]/50 to-transparent z-10"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start gap-6 overflow-y-auto custom-scrollbar pb-12 pr-4 h-full",children:l.map(x=>{const v=N(x.url);return r.jsxs("div",{className:"glass-card p-8 rounded-[40px] flex flex-col gap-6 group hover:-translate-y-1",children:[r.jsxs("div",{className:"flex justify-between items-start",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden",children:v?r.jsx("img",{src:v,alt:"",className:"w-6 h-6 object-contain grayscale opacity-100 group-hover:grayscale-0 transition-all duration-300",onError:y=>{y.target.style.display="none"}}):r.jsx(je,{name:"public",className:"text-gray-500 text-xl"})}),r.jsx("div",{className:"px-3 py-1 rounded-full bg-white/5 text-[7px] font-bold uppercase tracking-widest text-gray-500",children:x.mode})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-bold text-white truncate",children:x.name||"Untitled"}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono truncate mt-1",children:x.url||"Target undefined"})]}),r.jsxs("div",{className:"flex gap-3 pt-4 border-t border-white/5",children:[r.jsx("button",{onClick:()=>o(x),className:"flex-1 py-2 rounded-xl bg-white text-black text-[9px] font-bold uppercase tracking-widest hover:scale-105 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Edit Task"}),r.jsx("button",{onClick:()=>c(x.id),className:"w-10 h-10 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center hover:bg-red-500/10 hover:text-red-500 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Delete task",title:"Delete task",children:r.jsx(je,{name:"close",className:"text-base"})})]})]},x.id)})})]}),l.length===0&&r.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center space-y-6",children:[r.jsx("div",{className:"w-24 h-24 border-2 border-dashed border-white/20 rounded-[40px] flex items-center justify-center text-3xl bg-white/5",children:r.jsx(je,{name:"rocket_launch",className:"text-white/50 text-4xl"})}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("p",{className:"text-sm font-bold uppercase tracking-widest text-white/70",children:"No Tasks Found"}),r.jsx("p",{className:"text-[10px] text-gray-500 max-w-[200px] mx-auto leading-relaxed",children:"Get started by creating your first automation task."})]}),r.jsx("button",{onClick:u,className:"px-6 py-3 bg-white text-black rounded-2xl font-bold text-[10px] tracking-[0.2em] uppercase hover:scale-105 transition-transform shadow-lg shadow-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Create First Task"})]})]})}),p&&r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 pb-20 sm:pb-6",children:[r.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm",onClick:()=>m(!1)}),r.jsxs("div",{className:"relative w-full max-w-lg bg-[#0a0a0a] border border-white/10 rounded-[32px] shadow-2xl overflow-hidden flex flex-col max-h-full slide-up",children:[r.jsxs("div",{className:"p-6 sm:p-8 shrink-0",children:[r.jsx("h3",{className:"text-xl font-bold text-white tracking-tight",children:"Export Tasks"}),r.jsx("p",{className:"text-[11px] text-white/50 mt-2 font-mono",children:"Select the tasks you want to export."})]}),r.jsxs("div",{className:"px-6 sm:px-8 pb-4 flex items-center gap-3 shrink-0 border-b border-white/5",children:[r.jsx("button",{onClick:()=>k(l.map(x=>x.id)),className:"text-[10px] font-bold uppercase tracking-widest text-blue-400 hover:text-blue-300 transition-colors",children:"Select All"}),r.jsx("span",{className:"text-white/20",children:"|"}),r.jsx("button",{onClick:()=>k([]),className:"text-[10px] font-bold uppercase tracking-widest text-white/40 hover:text-white/80 transition-colors",children:"Deselect All"}),r.jsx("div",{className:"flex-1"}),r.jsxs("span",{className:"text-[10px] font-mono text-white/30",children:[b.length," selected"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 sm:p-8 space-y-2",children:l.map(x=>r.jsxs("button",{onClick:()=>j(x.id),className:`w-full text-left p-4 rounded-2xl border transition-all flex items-center gap-4 ${b.includes(x.id)?"bg-blue-500/10 border-blue-500/30":"bg-white/5 border-white/5 hover:border-white/10"}`,children:[r.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center border transition-colors ${b.includes(x.id)?"bg-blue-500 border-blue-400 text-white":"border-white/20"}`,children:b.includes(x.id)&&r.jsx(je,{name:"check",className:"text-[14px]"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm font-bold text-white truncate",children:x.name||"Untitled"}),r.jsx("div",{className:"text-[10px] text-white/40 font-mono truncate",children:x.url||"No URL"})]})]},x.id))}),r.jsxs("div",{className:"p-6 sm:p-8 bg-black/40 border-t border-white/5 flex gap-3 shrink-0",children:[r.jsx("button",{onClick:()=>m(!1),className:"flex-1 px-4 py-3 rounded-xl border border-white/10 text-white text-[10px] font-bold uppercase tracking-widest hover:bg-white/5 transition-all",children:"Cancel"}),r.jsxs("button",{onClick:()=>{h(b),m(!1)},disabled:b.length===0,className:`flex-1 px-4 py-3 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all ${b.length>0?"bg-white text-black hover:scale-105":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:["Export (",b.length,")"]})]})]})]})]})},lp=z.memo(Wg),jt=l=>l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),Pg=new Set(["const","let","var","function","return","if","else","for","while","do","switch","case","break","continue","try","catch","finally","throw","new","class","extends","super","import","from","export","default","await","async","typeof","instanceof","in","of","this"]),Zp=(l,u)=>{const o=/\{\$(\w+)\}/g;let c="",h=0,d;const f=m=>!!u&&(m in u||m==="now"),p=m=>{if(m==="now")return!0;const b=u?u[m]:void 0;return b&&b.value!==""&&b.value!==void 0&&b.value!==null};for(;(d=o.exec(l))!==null;){d.index>h&&(c+=jt(l.substring(h,d.index)));const m=d[1],b=f(m),k=p(m);c+=`<span class="${b?k?"var-highlight-default":"var-highlight":"var-highlight-undefined"}">${jt(d[0])}</span>`,h=o.lastIndex}return c+=jt(l.substring(h)),c},eb=l=>{const u=/("(?:\\.|[^"\\])*")|(-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|\b(true|false|null)\b/g;let o="",c=0,h;for(;(h=u.exec(l))!==null;){h.index>c&&(o+=jt(l.substring(c,h.index)));const d=h[0];if(h[1]){let f=!1,p=h.index+d.length;for(;p<l.length&&/\s/.test(l[p]);)p+=1;l[p]===":"&&(f=!0),o+=`<span class="${f?"code-token-key":"code-token-string"}">${jt(d)}</span>`}else h[2]?o+=`<span class="code-token-number">${jt(d)}</span>`:o+=`<span class="code-token-boolean">${jt(d)}</span>`;c=u.lastIndex}return o+=jt(l.substring(c)),o},tb=(l,u)=>{const o=/(\{\$\w+\})|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`)|(\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|(\btrue\b|\bfalse\b|\bnull\b|\bundefined\b)|(\b[A-Za-z_]\w*\b)/g;let c="",h=0,d;for(;(d=o.exec(l))!==null;){d.index>h&&(c+=jt(l.substring(h,d.index)));const f=d[0];if(d[1])c+=Zp(f,u);else if(d[2])c+=`<span class="code-token-comment">${jt(f)}</span>`;else if(d[3])c+=`<span class="code-token-string">${jt(f)}</span>`;else if(d[4])c+=`<span class="code-token-number">${jt(f)}</span>`;else if(d[5])c+=`<span class="code-token-boolean">${jt(f)}</span>`;else if(d[6]){const p=Pg.has(f)?"code-token-keyword":"code-token-identifier";c+=`<span class="${p}">${jt(f)}</span>`}else c+=jt(f);h=o.lastIndex}return c+=jt(l.substring(h)),c},ab=l=>{const u=/<\/?[^>]+>/g;let o="",c=0,h;for(;(h=u.exec(l))!==null;){h.index>c&&(o+=jt(l.substring(c,h.index)));const d=h[0],f=d.match(/^<(\/?[A-Za-z0-9-]+)([\s\S]*?)>$/);if(f){const p=f[1],m=f[2];let b=jt(p);b.startsWith("/")?b=`/<span class="code-token-tag">${b.substring(1)}</span>`:b=`<span class="code-token-tag">${b}</span>`;let k=jt(m);k=k.replace(/(\s)([A-Za-z0-9-:]+)(=)/g,'$1<span class="code-token-attr">$2</span>$3'),k=k.replace(/(&quot;.*?&quot;|&#39;.*?&#39;)/g,'<span class="code-token-string">$1</span>'),o+=`<span class="code-token-punct">&lt;${b}${k}&gt;</span>`}else o+=`<span class="code-token-punct">${jt(d)}</span>`;c=u.lastIndex}return o+=jt(l.substring(c)),o},Xp=(l,u,o)=>u==="javascript"?tb(l,o):u==="json"?eb(l):u==="html"?ab(l):Zp(l,o),ya=({value:l,onChange:u,onBlur:o,placeholder:c,variables:h,className:d,syntax:f="plain"})=>{const p=z.useRef(null);return z.useEffect(()=>{if(p.current){const m=p.current.innerHTML,b=Xp(l,f,h);if(m!==b){const k=window.getSelection();let N=0;if(k&&k.rangeCount>0){const T=k.getRangeAt(0),S=T.cloneRange();S.selectNodeContents(p.current),S.setEnd(T.endContainer,T.endOffset),N=S.toString().length}if(p.current.innerHTML=b,N>0){const T=document.createTreeWalker(p.current,NodeFilter.SHOW_TEXT);let S=0,j=T.nextNode();for(;j;){const x=j.textContent?.length||0;if(S+x>=N){const v=document.createRange();v.setStart(j,N-S),v.collapse(!0),k?.removeAllRanges(),k?.addRange(v);break}S+=x,j=T.nextNode()}}}}},[l,h]),r.jsx("div",{ref:p,contentEditable:!0,className:`rich-input-content w-full bg-transparent focus:outline-none text-white min-h-[1.5rem] ${d}`,"data-placeholder":c,onInput:m=>u(m.currentTarget.textContent||""),onBlur:m=>{const b=m.currentTarget.textContent||"";u(b),o?.(b)}})},Yi=({value:l,onChange:u,onBlur:o,language:c,placeholder:h,className:d,readOnly:f,variables:p})=>{const m=z.useRef(null),b=z.useRef(null),k=l||h||"",N=!l&&!!h,T=z.useMemo(()=>Xp(k,c,p),[k,c,p]);return z.useEffect(()=>{const S=m.current,j=b.current;if(!S||!j)return;const x=()=>{j.scrollTop=S.scrollTop,j.scrollLeft=S.scrollLeft};return S.addEventListener("scroll",x),()=>{S.removeEventListener("scroll",x)}},[]),r.jsxs("div",{className:`code-editor ${d||""}`,onWheel:S=>{const j=m.current;j&&(j.scrollHeight<=j.clientHeight||(j.scrollTop+=S.deltaY,j.scrollLeft+=S.deltaX,j.focus(),S.preventDefault()))},children:[r.jsx("pre",{ref:b,className:`code-editor-pre ${N?"code-editor-placeholder":""}`,"aria-hidden":!0,dangerouslySetInnerHTML:{__html:T}}),r.jsx("textarea",{ref:m,value:l,onChange:S=>u?.(S.target.value),onBlur:S=>o?.(S.target.value),spellCheck:!1,wrap:"off",readOnly:f,className:`code-editor-textarea ${f?"code-editor-textarea-readonly":""}`,"aria-label":"Code editor",tabIndex:f?-1:0})]})},Kc=[{type:"click",label:"Click",description:"Click an element"},{type:"type",label:"Type",description:"Type text into a field"},{type:"hover",label:"Hover",description:"Hover an element"},{type:"press",label:"Press",description:"Press a key"},{type:"wait",label:"Wait",description:"Pause for seconds"},{type:"wait_selector",label:"Wait for Selector",description:"Wait until element appears"},{type:"wait_downloads",label:"Wait for Downloads",description:"Wait until downloads finish"},{type:"scroll",label:"Scroll",description:"Scroll the page or container"},{type:"javascript",label:"JavaScript",description:"Run custom JS"},{type:"csv",label:"CSV",description:"Parse CSV into rows"},{type:"merge",label:"Merge",description:"Merge inputs into a single output"},{type:"screenshot",label:"Screenshot",description:"Capture a screenshot"},{type:"navigate",label:"Navigate To",description:"Navigate to a URL"},{type:"if",label:"If",description:"Conditional block start"},{type:"else",label:"Else",description:"Conditional alternate path"},{type:"end",label:"End Block",description:"Close a block"},{type:"while",label:"While",description:"Loop while condition true"},{type:"repeat",label:"Repeat N",description:"Repeat block N times"},{type:"foreach",label:"For Each",description:"Loop through items"},{type:"set",label:"Set Variable",description:"Update variable value"},{type:"stop",label:"Stop Task",description:"Stop task with status"},{type:"on_error",label:"On Error",description:"Run on failure"},{type:"start",label:"Start Task",description:"Run another task"}],nb=({open:l,query:u,onQueryChange:o,onClose:c,onSelect:h})=>{const d=z.useRef(null),f=z.useMemo(()=>{const p=u.trim().toLowerCase();return p?Kc.filter(m=>m.label.toLowerCase().includes(p)||m.description.toLowerCase().includes(p)):Kc},[u]);return l?r.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:c,children:r.jsxs("div",{className:"glass-card w-full max-w-xl rounded-[28px] border border-white/10 p-6 shadow-2xl",onClick:p=>p.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"Add Block"}),r.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Search actions and control flow blocks."})]}),r.jsx("button",{onClick:c,className:"p-2 rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all","aria-label":"Close",children:r.jsx(je,{name:"close",className:"text-base"})})]}),r.jsx("input",{ref:p=>{d.current=p,p&&p.focus()},value:u,onChange:p=>o(p.target.value),placeholder:"Type to filter (e.g., if, click, loop)",className:"w-full rounded-xl bg-black/40 border border-white/10 px-4 py-3 text-sm text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30"}),r.jsxs("div",{className:"mt-4 max-h-[320px] overflow-y-auto custom-scrollbar space-y-2",children:[f.map(p=>r.jsxs("button",{onClick:()=>h(p.type),className:"w-full text-left px-4 py-3 rounded-xl border border-white/5 bg-white/[0.02] hover:bg-white/[0.06] transition-all",children:[r.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-white",children:p.label}),r.jsx("div",{className:"text-[9px] text-gray-500 mt-1",children:p.description})]},p.type)),f.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No matches."})]})]})}):null};function Qc(){return Qc=Object.assign?Object.assign.bind():function(l){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var c in o)({}).hasOwnProperty.call(o,c)&&(l[c]=o[c])}return l},Qc.apply(null,arguments)}function ip(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Ic(l,u){return Ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,c){return o.__proto__=c,o},Ic(l,u)}function lb(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,Ic(l,u)}var rp=Number.isNaN||function(u){return typeof u=="number"&&u!==u};function ib(l,u){return!!(l===u||rp(l)&&rp(u))}function rb(l,u){if(l.length!==u.length)return!1;for(var o=0;o<l.length;o++)if(!ib(l[o],u[o]))return!1;return!0}function Bc(l,u){u===void 0&&(u=rb);var o,c=[],h,d=!1;function f(){for(var p=[],m=0;m<arguments.length;m++)p[m]=arguments[m];return d&&o===this&&u(p,c)||(h=l.apply(this,p),d=!0,o=this,c=p),h}return f}var sb=typeof performance=="object"&&typeof performance.now=="function",sp=sb?function(){return performance.now()}:function(){return Date.now()};function op(l){cancelAnimationFrame(l.id)}function ob(l,u){var o=sp();function c(){sp()-o>=u?l.call(null):h.id=requestAnimationFrame(c)}var h={id:requestAnimationFrame(c)};return h}var Lc=-1;function cp(l){if(l===void 0&&(l=!1),Lc===-1||l){var u=document.createElement("div"),o=u.style;o.width="50px",o.height="50px",o.overflow="scroll",document.body.appendChild(u),Lc=u.offsetWidth-u.clientWidth,document.body.removeChild(u)}return Lc}var Ll=null;function up(l){if(l===void 0&&(l=!1),Ll===null||l){var u=document.createElement("div"),o=u.style;o.width="50px",o.height="50px",o.overflow="scroll",o.direction="rtl";var c=document.createElement("div"),h=c.style;return h.width="100px",h.height="100px",u.appendChild(c),document.body.appendChild(u),u.scrollLeft>0?Ll="positive-descending":(u.scrollLeft=1,u.scrollLeft===0?Ll="negative":Ll="positive-ascending"),document.body.removeChild(u),Ll}return Ll}var cb=150,ub=function(u,o){return u};function db(l){var u,o=l.getItemOffset,c=l.getEstimatedTotalSize,h=l.getItemSize,d=l.getOffsetForIndexAndAlignment,f=l.getStartIndexForOffset,p=l.getStopIndexForStartIndex,m=l.initInstanceProps,b=l.shouldResetStyleCacheOnItemSizeChange,k=l.validateProps;return u=(function(N){lb(T,N);function T(j){var x;return x=N.call(this,j)||this,x._instanceProps=m(x.props,ip(x)),x._outerRef=void 0,x._resetIsScrollingTimeoutId=null,x.state={instance:ip(x),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof x.props.initialScrollOffset=="number"?x.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},x._callOnItemsRendered=void 0,x._callOnItemsRendered=Bc(function(v,y,C,E){return x.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:E})}),x._callOnScroll=void 0,x._callOnScroll=Bc(function(v,y,C){return x.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),x._getItemStyle=void 0,x._getItemStyle=function(v){var y=x.props,C=y.direction,E=y.itemSize,U=y.layout,B=x._getItemStyleCache(b&&E,b&&U,b&&C),Z;if(B.hasOwnProperty(v))Z=B[v];else{var Y=o(x.props,v,x._instanceProps),ne=h(x.props,v,x._instanceProps),F=C==="horizontal"||U==="horizontal",ge=C==="rtl",ce=F?Y:0;B[v]=Z={position:"absolute",left:ge?void 0:ce,right:ge?ce:void 0,top:F?0:Y,height:F?"100%":ne,width:F?ne:"100%"}}return Z},x._getItemStyleCache=void 0,x._getItemStyleCache=Bc(function(v,y,C){return{}}),x._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,E=y.scrollLeft,U=y.scrollWidth;x.setState(function(B){if(B.scrollOffset===E)return null;var Z=x.props.direction,Y=E;if(Z==="rtl")switch(up()){case"negative":Y=-E;break;case"positive-descending":Y=U-C-E;break}return Y=Math.max(0,Math.min(Y,U-C)),{isScrolling:!0,scrollDirection:B.scrollOffset<Y?"forward":"backward",scrollOffset:Y,scrollUpdateWasRequested:!1}},x._resetIsScrollingDebounced)},x._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,E=y.scrollHeight,U=y.scrollTop;x.setState(function(B){if(B.scrollOffset===U)return null;var Z=Math.max(0,Math.min(U,E-C));return{isScrolling:!0,scrollDirection:B.scrollOffset<Z?"forward":"backward",scrollOffset:Z,scrollUpdateWasRequested:!1}},x._resetIsScrollingDebounced)},x._outerRefSetter=function(v){var y=x.props.outerRef;x._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},x._resetIsScrollingDebounced=function(){x._resetIsScrollingTimeoutId!==null&&op(x._resetIsScrollingTimeoutId),x._resetIsScrollingTimeoutId=ob(x._resetIsScrolling,cb)},x._resetIsScrolling=function(){x._resetIsScrollingTimeoutId=null,x.setState({isScrolling:!1},function(){x._getItemStyleCache(-1,null)})},x}T.getDerivedStateFromProps=function(x,v){return fb(x,v),k(x),null};var S=T.prototype;return S.scrollTo=function(x){x=Math.max(0,x),this.setState(function(v){return v.scrollOffset===x?null:{scrollDirection:v.scrollOffset<x?"forward":"backward",scrollOffset:x,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},S.scrollToItem=function(x,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,E=y.layout,U=this.state.scrollOffset;x=Math.max(0,Math.min(x,C-1));var B=0;if(this._outerRef){var Z=this._outerRef;E==="vertical"?B=Z.scrollWidth>Z.clientWidth?cp():0:B=Z.scrollHeight>Z.clientHeight?cp():0}this.scrollTo(d(this.props,x,v,U,this._instanceProps,B))},S.componentDidMount=function(){var x=this.props,v=x.direction,y=x.initialScrollOffset,C=x.layout;if(typeof y=="number"&&this._outerRef!=null){var E=this._outerRef;v==="horizontal"||C==="horizontal"?E.scrollLeft=y:E.scrollTop=y}this._callPropsCallbacks()},S.componentDidUpdate=function(){var x=this.props,v=x.direction,y=x.layout,C=this.state,E=C.scrollOffset,U=C.scrollUpdateWasRequested;if(U&&this._outerRef!=null){var B=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(up()){case"negative":B.scrollLeft=-E;break;case"positive-ascending":B.scrollLeft=E;break;default:var Z=B.clientWidth,Y=B.scrollWidth;B.scrollLeft=Y-Z-E;break}else B.scrollLeft=E;else B.scrollTop=E}this._callPropsCallbacks()},S.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&op(this._resetIsScrollingTimeoutId)},S.render=function(){var x=this.props,v=x.children,y=x.className,C=x.direction,E=x.height,U=x.innerRef,B=x.innerElementType,Z=x.innerTagName,Y=x.itemCount,ne=x.itemData,F=x.itemKey,ge=F===void 0?ub:F,ce=x.layout,M=x.outerElementType,H=x.outerTagName,_=x.style,W=x.useIsScrolling,X=x.width,I=this.state.isScrolling,xe=C==="horizontal"||ce==="horizontal",V=xe?this._onScrollHorizontal:this._onScrollVertical,oe=this._getRangeToRender(),A=oe[0],O=oe[1],P=[];if(Y>0)for(var le=A;le<=O;le++)P.push(z.createElement(v,{data:ne,key:ge(le,ne),index:le,isScrolling:W?I:void 0,style:this._getItemStyle(le)}));var de=c(this.props,this._instanceProps);return z.createElement(M||H||"div",{className:y,onScroll:V,ref:this._outerRefSetter,style:Qc({position:"relative",height:E,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},_)},z.createElement(B||Z||"div",{children:P,ref:U,style:{height:xe?"100%":de,pointerEvents:I?"none":void 0,width:xe?de:"100%"}}))},S._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var x=this.props.itemCount;if(x>0){var v=this._getRangeToRender(),y=v[0],C=v[1],E=v[2],U=v[3];this._callOnItemsRendered(y,C,E,U)}}if(typeof this.props.onScroll=="function"){var B=this.state,Z=B.scrollDirection,Y=B.scrollOffset,ne=B.scrollUpdateWasRequested;this._callOnScroll(Z,Y,ne)}},S._getRangeToRender=function(){var x=this.props,v=x.itemCount,y=x.overscanCount,C=this.state,E=C.isScrolling,U=C.scrollDirection,B=C.scrollOffset;if(v===0)return[0,0,0,0];var Z=f(this.props,B,this._instanceProps),Y=p(this.props,Z,B,this._instanceProps),ne=!E||U==="backward"?Math.max(1,y):1,F=!E||U==="forward"?Math.max(1,y):1;return[Math.max(0,Z-ne),Math.max(0,Math.min(v-1,Y+F)),Z,Y]},T})(z.PureComponent),u.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},u}var fb=function(u,o){u.children,u.direction,u.height,u.layout,u.innerTagName,u.outerTagName,u.width,o.instance},ys=db({getItemOffset:function(u,o){var c=u.itemSize;return o*c},getItemSize:function(u,o){var c=u.itemSize;return c},getEstimatedTotalSize:function(u){var o=u.itemCount,c=u.itemSize;return c*o},getOffsetForIndexAndAlignment:function(u,o,c,h,d,f){var p=u.direction,m=u.height,b=u.itemCount,k=u.itemSize,N=u.layout,T=u.width,S=p==="horizontal"||N==="horizontal",j=S?T:m,x=Math.max(0,b*k-j),v=Math.min(x,o*k),y=Math.max(0,o*k-j+k+f);switch(c==="smart"&&(h>=y-j&&h<=v+j?c="auto":c="center"),c){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(j/2)?0:C>x+Math.floor(j/2)?x:C}default:return h>=y&&h<=v?h:h<y?y:v}},getStartIndexForOffset:function(u,o){var c=u.itemCount,h=u.itemSize;return Math.max(0,Math.min(c-1,Math.floor(o/h)))},getStopIndexForStartIndex:function(u,o,c){var h=u.direction,d=u.height,f=u.itemCount,p=u.itemSize,m=u.layout,b=u.width,k=h==="horizontal"||m==="horizontal",N=o*p,T=k?b:d,S=Math.ceil((T+c-N)/p);return Math.max(0,Math.min(f-1,o+S-1))},initInstanceProps:function(u){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(u){u.itemSize}});const hb=async l=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(l),!0;{const u=document.createElement("textarea");u.value=l,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const o=document.execCommand("copy");return u.remove(),o}}catch(u){return console.error("Copy failed:",u),!1}},Kp=({text:l,label:u,className:o,iconClassName:c,onCopy:h,title:d,disabled:f=!1})=>{const[p,m]=z.useState(!1),b=async S=>{if(S.stopPropagation(),f)return;await hb(l)&&(m(!0),h?.(),setTimeout(()=>m(!1),2e3))},N=o||"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all text-[9px] font-bold uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed",T=p?N.replace("border-white/10","border-green-400 text-green-400"):N;return r.jsxs("button",{onClick:b,disabled:f,className:T,title:d||(p?"Copied":"Copy"),type:"button","aria-label":u||d||"Copy to clipboard",children:[p?r.jsx(je,{name:"check",className:`${c||"text-sm"} text-green-400`}):r.jsx(je,{name:"content_copy",className:c||"text-sm"}),u&&r.jsx("span",{children:p?"Copied":u})]})},pb=(l,u=2)=>{if(l===0)return"0 B";const o=1024,c=u<0?0:u,h=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],d=Math.floor(Math.log(l)/Math.log(o));return parseFloat((l/Math.pow(o,d)).toFixed(c))+" "+h[d]},mb=({capture:l,onDelete:u})=>{const o=new URL(l.url,window.location.origin).toString();return r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.02] overflow-hidden",children:[r.jsxs("div",{className:"p-3 border-b border-white/10 flex items-center justify-between",children:[r.jsx("div",{className:"text-[9px] font-bold text-white uppercase tracking-widest",children:l.type==="recording"?"Recording":"Screenshot"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Kp,{text:o,title:"Copy URL",className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all",iconClassName:"text-sm"}),r.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"text-[9px] font-bold uppercase tracking-widest text-blue-300 hover:text-blue-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Open"}),u&&r.jsx("button",{onClick:()=>u(l.name),className:"text-[9px] font-bold uppercase tracking-widest text-red-300 hover:text-red-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Delete"})]})]}),r.jsx("div",{className:"bg-black relative group",children:l.type==="recording"?r.jsx("video",{src:l.url,controls:!0,className:"w-full h-64 object-contain bg-black"}):r.jsx("img",{src:l.url,className:"w-full h-64 object-contain bg-black",alt:`Screenshot of ${l.name}`})}),r.jsxs("div",{className:"p-3 border-t border-white/5 bg-white/[0.01]",children:[r.jsx("div",{className:"text-[9px] text-white font-bold uppercase tracking-widest truncate",title:l.name,children:l.name}),r.jsxs("div",{className:"flex items-center justify-between mt-1 text-[8px] text-gray-500 uppercase tracking-widest",children:[r.jsx("span",{children:pb(l.size)}),r.jsx("span",{children:new Date(l.modified).toLocaleDateString()})]})]})]})},Qp=Dn.memo(mb);function is(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hc={exports:{}};var dp;function xb(){return dp||(dp=1,(function(l,u){(function(o){l.exports=o()})(function(){return(function o(c,h,d){function f(b,k){if(!h[b]){if(!c[b]){var N=typeof is=="function"&&is;if(!k&&N)return N(b,!0);if(p)return p(b,!0);var T=new Error("Cannot find module '"+b+"'");throw T.code="MODULE_NOT_FOUND",T}var S=h[b]={exports:{}};c[b][0].call(S.exports,function(j){var x=c[b][1][j];return f(x||j)},S,S.exports,o,c,h,d)}return h[b].exports}for(var p=typeof is=="function"&&is,m=0;m<d.length;m++)f(d[m]);return f})({1:[function(o,c,h){var d=o("./utils"),f=o("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";h.encode=function(m){for(var b,k,N,T,S,j,x,v=[],y=0,C=m.length,E=C,U=d.getTypeOf(m)!=="string";y<m.length;)E=C-y,N=U?(b=m[y++],k=y<C?m[y++]:0,y<C?m[y++]:0):(b=m.charCodeAt(y++),k=y<C?m.charCodeAt(y++):0,y<C?m.charCodeAt(y++):0),T=b>>2,S=(3&b)<<4|k>>4,j=1<E?(15&k)<<2|N>>6:64,x=2<E?63&N:64,v.push(p.charAt(T)+p.charAt(S)+p.charAt(j)+p.charAt(x));return v.join("")},h.decode=function(m){var b,k,N,T,S,j,x=0,v=0,y="data:";if(m.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var C,E=3*(m=m.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(m.charAt(m.length-1)===p.charAt(64)&&E--,m.charAt(m.length-2)===p.charAt(64)&&E--,E%1!=0)throw new Error("Invalid base64 input, bad content length.");for(C=f.uint8array?new Uint8Array(0|E):new Array(0|E);x<m.length;)b=p.indexOf(m.charAt(x++))<<2|(T=p.indexOf(m.charAt(x++)))>>4,k=(15&T)<<4|(S=p.indexOf(m.charAt(x++)))>>2,N=(3&S)<<6|(j=p.indexOf(m.charAt(x++))),C[v++]=b,S!==64&&(C[v++]=k),j!==64&&(C[v++]=N);return C}},{"./support":30,"./utils":32}],2:[function(o,c,h){var d=o("./external"),f=o("./stream/DataWorker"),p=o("./stream/Crc32Probe"),m=o("./stream/DataLengthProbe");function b(k,N,T,S,j){this.compressedSize=k,this.uncompressedSize=N,this.crc32=T,this.compression=S,this.compressedContent=j}b.prototype={getContentWorker:function(){var k=new f(d.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new m("data_length")),N=this;return k.on("end",function(){if(this.streamInfo.data_length!==N.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),k},getCompressedWorker:function(){return new f(d.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(k,N,T){return k.pipe(new p).pipe(new m("uncompressedSize")).pipe(N.compressWorker(T)).pipe(new m("compressedSize")).withStreamInfo("compression",N)},c.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,c,h){var d=o("./stream/GenericWorker");h.STORE={magic:"\0\0",compressWorker:function(){return new d("STORE compression")},uncompressWorker:function(){return new d("STORE decompression")}},h.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,c,h){var d=o("./utils"),f=(function(){for(var p,m=[],b=0;b<256;b++){p=b;for(var k=0;k<8;k++)p=1&p?3988292384^p>>>1:p>>>1;m[b]=p}return m})();c.exports=function(p,m){return p!==void 0&&p.length?d.getTypeOf(p)!=="string"?(function(b,k,N,T){var S=f,j=T+N;b^=-1;for(var x=T;x<j;x++)b=b>>>8^S[255&(b^k[x])];return-1^b})(0|m,p,p.length,0):(function(b,k,N,T){var S=f,j=T+N;b^=-1;for(var x=T;x<j;x++)b=b>>>8^S[255&(b^k.charCodeAt(x))];return-1^b})(0|m,p,p.length,0):0}},{"./utils":32}],5:[function(o,c,h){h.base64=!1,h.binary=!1,h.dir=!1,h.createFolders=!0,h.date=null,h.compression=null,h.compressionOptions=null,h.comment=null,h.unixPermissions=null,h.dosPermissions=null},{}],6:[function(o,c,h){var d=null;d=typeof Promise<"u"?Promise:o("lie"),c.exports={Promise:d}},{lie:37}],7:[function(o,c,h){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",f=o("pako"),p=o("./utils"),m=o("./stream/GenericWorker"),b=d?"uint8array":"array";function k(N,T){m.call(this,"FlateWorker/"+N),this._pako=null,this._pakoAction=N,this._pakoOptions=T,this.meta={}}h.magic="\b\0",p.inherits(k,m),k.prototype.processChunk=function(N){this.meta=N.meta,this._pako===null&&this._createPako(),this._pako.push(p.transformTo(b,N.data),!1)},k.prototype.flush=function(){m.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},k.prototype.cleanUp=function(){m.prototype.cleanUp.call(this),this._pako=null},k.prototype._createPako=function(){this._pako=new f[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var N=this;this._pako.onData=function(T){N.push({data:T,meta:N.meta})}},h.compressWorker=function(N){return new k("Deflate",N)},h.uncompressWorker=function(){return new k("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(o,c,h){function d(S,j){var x,v="";for(x=0;x<j;x++)v+=String.fromCharCode(255&S),S>>>=8;return v}function f(S,j,x,v,y,C){var E,U,B=S.file,Z=S.compression,Y=C!==b.utf8encode,ne=p.transformTo("string",C(B.name)),F=p.transformTo("string",b.utf8encode(B.name)),ge=B.comment,ce=p.transformTo("string",C(ge)),M=p.transformTo("string",b.utf8encode(ge)),H=F.length!==B.name.length,_=M.length!==ge.length,W="",X="",I="",xe=B.dir,V=B.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};j&&!x||(oe.crc32=S.crc32,oe.compressedSize=S.compressedSize,oe.uncompressedSize=S.uncompressedSize);var A=0;j&&(A|=8),Y||!H&&!_||(A|=2048);var O=0,P=0;xe&&(O|=16),y==="UNIX"?(P=798,O|=(function(de,Ne){var Te=de;return de||(Te=Ne?16893:33204),(65535&Te)<<16})(B.unixPermissions,xe)):(P=20,O|=(function(de){return 63&(de||0)})(B.dosPermissions)),E=V.getUTCHours(),E<<=6,E|=V.getUTCMinutes(),E<<=5,E|=V.getUTCSeconds()/2,U=V.getUTCFullYear()-1980,U<<=4,U|=V.getUTCMonth()+1,U<<=5,U|=V.getUTCDate(),H&&(X=d(1,1)+d(k(ne),4)+F,W+="up"+d(X.length,2)+X),_&&(I=d(1,1)+d(k(ce),4)+M,W+="uc"+d(I.length,2)+I);var le="";return le+=`
12
- \0`,le+=d(A,2),le+=Z.magic,le+=d(E,2),le+=d(U,2),le+=d(oe.crc32,4),le+=d(oe.compressedSize,4),le+=d(oe.uncompressedSize,4),le+=d(ne.length,2),le+=d(W.length,2),{fileRecord:N.LOCAL_FILE_HEADER+le+ne+W,dirRecord:N.CENTRAL_FILE_HEADER+d(P,2)+le+d(ce.length,2)+"\0\0\0\0"+d(O,4)+d(v,4)+ne+W+ce}}var p=o("../utils"),m=o("../stream/GenericWorker"),b=o("../utf8"),k=o("../crc32"),N=o("../signature");function T(S,j,x,v){m.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=j,this.zipPlatform=x,this.encodeFileName=v,this.streamFiles=S,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}p.inherits(T,m),T.prototype.push=function(S){var j=S.meta.percent||0,x=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(S):(this.bytesWritten+=S.data.length,m.prototype.push.call(this,{data:S.data,meta:{currentFile:this.currentFile,percent:x?(j+100*(x-v-1))/x:100}}))},T.prototype.openedSource=function(S){this.currentSourceOffset=this.bytesWritten,this.currentFile=S.file.name;var j=this.streamFiles&&!S.file.dir;if(j){var x=f(S,j,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:x.fileRecord,meta:{percent:0}})}else this.accumulate=!0},T.prototype.closedSource=function(S){this.accumulate=!1;var j=this.streamFiles&&!S.file.dir,x=f(S,j,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(x.dirRecord),j)this.push({data:(function(v){return N.DATA_DESCRIPTOR+d(v.crc32,4)+d(v.compressedSize,4)+d(v.uncompressedSize,4)})(S),meta:{percent:100}});else for(this.push({data:x.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},T.prototype.flush=function(){for(var S=this.bytesWritten,j=0;j<this.dirRecords.length;j++)this.push({data:this.dirRecords[j],meta:{percent:100}});var x=this.bytesWritten-S,v=(function(y,C,E,U,B){var Z=p.transformTo("string",B(U));return N.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(y,2)+d(y,2)+d(C,4)+d(E,4)+d(Z.length,2)+Z})(this.dirRecords.length,x,S,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},T.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},T.prototype.registerPrevious=function(S){this._sources.push(S);var j=this;return S.on("data",function(x){j.processChunk(x)}),S.on("end",function(){j.closedSource(j.previous.streamInfo),j._sources.length?j.prepareNextSource():j.end()}),S.on("error",function(x){j.error(x)}),this},T.prototype.resume=function(){return!!m.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},T.prototype.error=function(S){var j=this._sources;if(!m.prototype.error.call(this,S))return!1;for(var x=0;x<j.length;x++)try{j[x].error(S)}catch{}return!0},T.prototype.lock=function(){m.prototype.lock.call(this);for(var S=this._sources,j=0;j<S.length;j++)S[j].lock()},c.exports=T},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,c,h){var d=o("../compressions"),f=o("./ZipFileWorker");h.generateWorker=function(p,m,b){var k=new f(m.streamFiles,b,m.platform,m.encodeFileName),N=0;try{p.forEach(function(T,S){N++;var j=(function(C,E){var U=C||E,B=d[U];if(!B)throw new Error(U+" is not a valid compression method !");return B})(S.options.compression,m.compression),x=S.options.compressionOptions||m.compressionOptions||{},v=S.dir,y=S.date;S._compressWorker(j,x).withStreamInfo("file",{name:T,dir:v,date:y,comment:S.comment||"",unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions}).pipe(k)}),k.entriesCount=N}catch(T){k.error(T)}return k}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,c,h){function d(){if(!(this instanceof d))return new d;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var f=new d;for(var p in this)typeof this[p]!="function"&&(f[p]=this[p]);return f}}(d.prototype=o("./object")).loadAsync=o("./load"),d.support=o("./support"),d.defaults=o("./defaults"),d.version="3.10.1",d.loadAsync=function(f,p){return new d().loadAsync(f,p)},d.external=o("./external"),c.exports=d},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,c,h){var d=o("./utils"),f=o("./external"),p=o("./utf8"),m=o("./zipEntries"),b=o("./stream/Crc32Probe"),k=o("./nodejsUtils");function N(T){return new f.Promise(function(S,j){var x=T.decompressed.getContentWorker().pipe(new b);x.on("error",function(v){j(v)}).on("end",function(){x.streamInfo.crc32!==T.decompressed.crc32?j(new Error("Corrupted zip : CRC32 mismatch")):S()}).resume()})}c.exports=function(T,S){var j=this;return S=d.extend(S||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:p.utf8decode}),k.isNode&&k.isStream(T)?f.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):d.prepareContent("the loaded zip file",T,!0,S.optimizedBinaryString,S.base64).then(function(x){var v=new m(S);return v.load(x),v}).then(function(x){var v=[f.Promise.resolve(x)],y=x.files;if(S.checkCRC32)for(var C=0;C<y.length;C++)v.push(N(y[C]));return f.Promise.all(v)}).then(function(x){for(var v=x.shift(),y=v.files,C=0;C<y.length;C++){var E=y[C],U=E.fileNameStr,B=d.resolve(E.fileNameStr);j.file(B,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:S.createFolders}),E.dir||(j.file(B).unsafeOriginalName=U)}return v.zipComment.length&&(j.comment=v.zipComment),j})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,c,h){var d=o("../utils"),f=o("../stream/GenericWorker");function p(m,b){f.call(this,"Nodejs stream input adapter for "+m),this._upstreamEnded=!1,this._bindStream(b)}d.inherits(p,f),p.prototype._bindStream=function(m){var b=this;(this._stream=m).pause(),m.on("data",function(k){b.push({data:k,meta:{percent:0}})}).on("error",function(k){b.isPaused?this.generatedError=k:b.error(k)}).on("end",function(){b.isPaused?b._upstreamEnded=!0:b.end()})},p.prototype.pause=function(){return!!f.prototype.pause.call(this)&&(this._stream.pause(),!0)},p.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},c.exports=p},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,c,h){var d=o("readable-stream").Readable;function f(p,m,b){d.call(this,m),this._helper=p;var k=this;p.on("data",function(N,T){k.push(N)||k._helper.pause(),b&&b(T)}).on("error",function(N){k.emit("error",N)}).on("end",function(){k.push(null)})}o("../utils").inherits(f,d),f.prototype._read=function(){this._helper.resume()},c.exports=f},{"../utils":32,"readable-stream":16}],14:[function(o,c,h){c.exports={isNode:typeof Buffer<"u",newBufferFrom:function(d,f){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(d,f);if(typeof d=="number")throw new Error('The "data" argument must not be a number');return new Buffer(d,f)},allocBuffer:function(d){if(Buffer.alloc)return Buffer.alloc(d);var f=new Buffer(d);return f.fill(0),f},isBuffer:function(d){return Buffer.isBuffer(d)},isStream:function(d){return d&&typeof d.on=="function"&&typeof d.pause=="function"&&typeof d.resume=="function"}}},{}],15:[function(o,c,h){function d(B,Z,Y){var ne,F=p.getTypeOf(Z),ge=p.extend(Y||{},k);ge.date=ge.date||new Date,ge.compression!==null&&(ge.compression=ge.compression.toUpperCase()),typeof ge.unixPermissions=="string"&&(ge.unixPermissions=parseInt(ge.unixPermissions,8)),ge.unixPermissions&&16384&ge.unixPermissions&&(ge.dir=!0),ge.dosPermissions&&16&ge.dosPermissions&&(ge.dir=!0),ge.dir&&(B=y(B)),ge.createFolders&&(ne=v(B))&&C.call(this,ne,!0);var ce=F==="string"&&ge.binary===!1&&ge.base64===!1;Y&&Y.binary!==void 0||(ge.binary=!ce),(Z instanceof N&&Z.uncompressedSize===0||ge.dir||!Z||Z.length===0)&&(ge.base64=!1,ge.binary=!0,Z="",ge.compression="STORE",F="string");var M=null;M=Z instanceof N||Z instanceof m?Z:j.isNode&&j.isStream(Z)?new x(B,Z):p.prepareContent(B,Z,ge.binary,ge.optimizedBinaryString,ge.base64);var H=new T(B,M,ge);this.files[B]=H}var f=o("./utf8"),p=o("./utils"),m=o("./stream/GenericWorker"),b=o("./stream/StreamHelper"),k=o("./defaults"),N=o("./compressedObject"),T=o("./zipObject"),S=o("./generate"),j=o("./nodejsUtils"),x=o("./nodejs/NodejsStreamInputAdapter"),v=function(B){B.slice(-1)==="/"&&(B=B.substring(0,B.length-1));var Z=B.lastIndexOf("/");return 0<Z?B.substring(0,Z):""},y=function(B){return B.slice(-1)!=="/"&&(B+="/"),B},C=function(B,Z){return Z=Z!==void 0?Z:k.createFolders,B=y(B),this.files[B]||d.call(this,B,null,{dir:!0,createFolders:Z}),this.files[B]};function E(B){return Object.prototype.toString.call(B)==="[object RegExp]"}var U={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(B){var Z,Y,ne;for(Z in this.files)ne=this.files[Z],(Y=Z.slice(this.root.length,Z.length))&&Z.slice(0,this.root.length)===this.root&&B(Y,ne)},filter:function(B){var Z=[];return this.forEach(function(Y,ne){B(Y,ne)&&Z.push(ne)}),Z},file:function(B,Z,Y){if(arguments.length!==1)return B=this.root+B,d.call(this,B,Z,Y),this;if(E(B)){var ne=B;return this.filter(function(ge,ce){return!ce.dir&&ne.test(ge)})}var F=this.files[this.root+B];return F&&!F.dir?F:null},folder:function(B){if(!B)return this;if(E(B))return this.filter(function(F,ge){return ge.dir&&B.test(F)});var Z=this.root+B,Y=C.call(this,Z),ne=this.clone();return ne.root=Y.name,ne},remove:function(B){B=this.root+B;var Z=this.files[B];if(Z||(B.slice(-1)!=="/"&&(B+="/"),Z=this.files[B]),Z&&!Z.dir)delete this.files[B];else for(var Y=this.filter(function(F,ge){return ge.name.slice(0,B.length)===B}),ne=0;ne<Y.length;ne++)delete this.files[Y[ne].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(B){var Z,Y={};try{if((Y=p.extend(B||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:f.utf8encode})).type=Y.type.toLowerCase(),Y.compression=Y.compression.toUpperCase(),Y.type==="binarystring"&&(Y.type="string"),!Y.type)throw new Error("No output type specified.");p.checkSupport(Y.type),Y.platform!=="darwin"&&Y.platform!=="freebsd"&&Y.platform!=="linux"&&Y.platform!=="sunos"||(Y.platform="UNIX"),Y.platform==="win32"&&(Y.platform="DOS");var ne=Y.comment||this.comment||"";Z=S.generateWorker(this,Y,ne)}catch(F){(Z=new m("error")).error(F)}return new b(Z,Y.type||"string",Y.mimeType)},generateAsync:function(B,Z){return this.generateInternalStream(B).accumulate(Z)},generateNodeStream:function(B,Z){return(B=B||{}).type||(B.type="nodebuffer"),this.generateInternalStream(B).toNodejsStream(Z)}};c.exports=U},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(o,c,h){c.exports=o("stream")},{stream:void 0}],17:[function(o,c,h){var d=o("./DataReader");function f(p){d.call(this,p);for(var m=0;m<this.data.length;m++)p[m]=255&p[m]}o("../utils").inherits(f,d),f.prototype.byteAt=function(p){return this.data[this.zero+p]},f.prototype.lastIndexOfSignature=function(p){for(var m=p.charCodeAt(0),b=p.charCodeAt(1),k=p.charCodeAt(2),N=p.charCodeAt(3),T=this.length-4;0<=T;--T)if(this.data[T]===m&&this.data[T+1]===b&&this.data[T+2]===k&&this.data[T+3]===N)return T-this.zero;return-1},f.prototype.readAndCheckSignature=function(p){var m=p.charCodeAt(0),b=p.charCodeAt(1),k=p.charCodeAt(2),N=p.charCodeAt(3),T=this.readData(4);return m===T[0]&&b===T[1]&&k===T[2]&&N===T[3]},f.prototype.readData=function(p){if(this.checkOffset(p),p===0)return[];var m=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,m},c.exports=f},{"../utils":32,"./DataReader":18}],18:[function(o,c,h){var d=o("../utils");function f(p){this.data=p,this.length=p.length,this.index=0,this.zero=0}f.prototype={checkOffset:function(p){this.checkIndex(this.index+p)},checkIndex:function(p){if(this.length<this.zero+p||p<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+p+"). Corrupted zip ?")},setIndex:function(p){this.checkIndex(p),this.index=p},skip:function(p){this.setIndex(this.index+p)},byteAt:function(){},readInt:function(p){var m,b=0;for(this.checkOffset(p),m=this.index+p-1;m>=this.index;m--)b=(b<<8)+this.byteAt(m);return this.index+=p,b},readString:function(p){return d.transformTo("string",this.readData(p))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var p=this.readInt(4);return new Date(Date.UTC(1980+(p>>25&127),(p>>21&15)-1,p>>16&31,p>>11&31,p>>5&63,(31&p)<<1))}},c.exports=f},{"../utils":32}],19:[function(o,c,h){var d=o("./Uint8ArrayReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.readData=function(p){this.checkOffset(p);var m=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,m},c.exports=f},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,c,h){var d=o("./DataReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.byteAt=function(p){return this.data.charCodeAt(this.zero+p)},f.prototype.lastIndexOfSignature=function(p){return this.data.lastIndexOf(p)-this.zero},f.prototype.readAndCheckSignature=function(p){return p===this.readData(4)},f.prototype.readData=function(p){this.checkOffset(p);var m=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,m},c.exports=f},{"../utils":32,"./DataReader":18}],21:[function(o,c,h){var d=o("./ArrayReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.readData=function(p){if(this.checkOffset(p),p===0)return new Uint8Array(0);var m=this.data.subarray(this.zero+this.index,this.zero+this.index+p);return this.index+=p,m},c.exports=f},{"../utils":32,"./ArrayReader":17}],22:[function(o,c,h){var d=o("../utils"),f=o("../support"),p=o("./ArrayReader"),m=o("./StringReader"),b=o("./NodeBufferReader"),k=o("./Uint8ArrayReader");c.exports=function(N){var T=d.getTypeOf(N);return d.checkSupport(T),T!=="string"||f.uint8array?T==="nodebuffer"?new b(N):f.uint8array?new k(d.transformTo("uint8array",N)):new p(d.transformTo("array",N)):new m(N)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,c,h){h.LOCAL_FILE_HEADER="PK",h.CENTRAL_FILE_HEADER="PK",h.CENTRAL_DIRECTORY_END="PK",h.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",h.ZIP64_CENTRAL_DIRECTORY_END="PK",h.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(o,c,h){var d=o("./GenericWorker"),f=o("../utils");function p(m){d.call(this,"ConvertWorker to "+m),this.destType=m}f.inherits(p,d),p.prototype.processChunk=function(m){this.push({data:f.transformTo(this.destType,m.data),meta:m.meta})},c.exports=p},{"../utils":32,"./GenericWorker":28}],25:[function(o,c,h){var d=o("./GenericWorker"),f=o("../crc32");function p(){d.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(p,d),p.prototype.processChunk=function(m){this.streamInfo.crc32=f(m.data,this.streamInfo.crc32||0),this.push(m)},c.exports=p},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,c,h){var d=o("../utils"),f=o("./GenericWorker");function p(m){f.call(this,"DataLengthProbe for "+m),this.propName=m,this.withStreamInfo(m,0)}d.inherits(p,f),p.prototype.processChunk=function(m){if(m){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+m.data.length}f.prototype.processChunk.call(this,m)},c.exports=p},{"../utils":32,"./GenericWorker":28}],27:[function(o,c,h){var d=o("../utils"),f=o("./GenericWorker");function p(m){f.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,m.then(function(k){b.dataIsReady=!0,b.data=k,b.max=k&&k.length||0,b.type=d.getTypeOf(k),b.isPaused||b._tickAndRepeat()},function(k){b.error(k)})}d.inherits(p,f),p.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},p.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,d.delay(this._tickAndRepeat,[],this)),!0)},p.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(d.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},p.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var m=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":m=this.data.substring(this.index,b);break;case"uint8array":m=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":m=this.data.slice(this.index,b)}return this.index=b,this.push({data:m,meta:{percent:this.max?this.index/this.max*100:0}})},c.exports=p},{"../utils":32,"./GenericWorker":28}],28:[function(o,c,h){function d(f){this.name=f||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d.prototype={push:function(f){this.emit("data",f)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(f){this.emit("error",f)}return!0},error:function(f){return!this.isFinished&&(this.isPaused?this.generatedError=f:(this.isFinished=!0,this.emit("error",f),this.previous&&this.previous.error(f),this.cleanUp()),!0)},on:function(f,p){return this._listeners[f].push(p),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(f,p){if(this._listeners[f])for(var m=0;m<this._listeners[f].length;m++)this._listeners[f][m].call(this,p)},pipe:function(f){return f.registerPrevious(this)},registerPrevious:function(f){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=f.streamInfo,this.mergeStreamInfo(),this.previous=f;var p=this;return f.on("data",function(m){p.processChunk(m)}),f.on("end",function(){p.end()}),f.on("error",function(m){p.error(m)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var f=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),f=!0),this.previous&&this.previous.resume(),!f},flush:function(){},processChunk:function(f){this.push(f)},withStreamInfo:function(f,p){return this.extraStreamInfo[f]=p,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var f in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,f)&&(this.streamInfo[f]=this.extraStreamInfo[f])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var f="Worker "+this.name;return this.previous?this.previous+" -> "+f:f}},c.exports=d},{}],29:[function(o,c,h){var d=o("../utils"),f=o("./ConvertWorker"),p=o("./GenericWorker"),m=o("../base64"),b=o("../support"),k=o("../external"),N=null;if(b.nodestream)try{N=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function T(j,x){return new k.Promise(function(v,y){var C=[],E=j._internalType,U=j._outputType,B=j._mimeType;j.on("data",function(Z,Y){C.push(Z),x&&x(Y)}).on("error",function(Z){C=[],y(Z)}).on("end",function(){try{var Z=(function(Y,ne,F){switch(Y){case"blob":return d.newBlob(d.transformTo("arraybuffer",ne),F);case"base64":return m.encode(ne);default:return d.transformTo(Y,ne)}})(U,(function(Y,ne){var F,ge=0,ce=null,M=0;for(F=0;F<ne.length;F++)M+=ne[F].length;switch(Y){case"string":return ne.join("");case"array":return Array.prototype.concat.apply([],ne);case"uint8array":for(ce=new Uint8Array(M),F=0;F<ne.length;F++)ce.set(ne[F],ge),ge+=ne[F].length;return ce;case"nodebuffer":return Buffer.concat(ne);default:throw new Error("concat : unsupported type '"+Y+"'")}})(E,C),B);v(Z)}catch(Y){y(Y)}C=[]}).resume()})}function S(j,x,v){var y=x;switch(x){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=x,this._mimeType=v,d.checkSupport(y),this._worker=j.pipe(new f(y)),j.lock()}catch(C){this._worker=new p("error"),this._worker.error(C)}}S.prototype={accumulate:function(j){return T(this,j)},on:function(j,x){var v=this;return j==="data"?this._worker.on(j,function(y){x.call(v,y.data,y.meta)}):this._worker.on(j,function(){d.delay(x,arguments,v)}),this},resume:function(){return d.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(j){if(d.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new N(this,{objectMode:this._outputType!=="nodebuffer"},j)}},c.exports=S},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,c,h){if(h.base64=!0,h.array=!0,h.string=!0,h.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",h.nodebuffer=typeof Buffer<"u",h.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")h.blob=!1;else{var d=new ArrayBuffer(0);try{h.blob=new Blob([d],{type:"application/zip"}).size===0}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);f.append(d),h.blob=f.getBlob("application/zip").size===0}catch{h.blob=!1}}}try{h.nodestream=!!o("readable-stream").Readable}catch{h.nodestream=!1}},{"readable-stream":16}],31:[function(o,c,h){for(var d=o("./utils"),f=o("./support"),p=o("./nodejsUtils"),m=o("./stream/GenericWorker"),b=new Array(256),k=0;k<256;k++)b[k]=252<=k?6:248<=k?5:240<=k?4:224<=k?3:192<=k?2:1;b[254]=b[254]=1;function N(){m.call(this,"utf-8 decode"),this.leftOver=null}function T(){m.call(this,"utf-8 encode")}h.utf8encode=function(S){return f.nodebuffer?p.newBufferFrom(S,"utf-8"):(function(j){var x,v,y,C,E,U=j.length,B=0;for(C=0;C<U;C++)(64512&(v=j.charCodeAt(C)))==55296&&C+1<U&&(64512&(y=j.charCodeAt(C+1)))==56320&&(v=65536+(v-55296<<10)+(y-56320),C++),B+=v<128?1:v<2048?2:v<65536?3:4;for(x=f.uint8array?new Uint8Array(B):new Array(B),C=E=0;E<B;C++)(64512&(v=j.charCodeAt(C)))==55296&&C+1<U&&(64512&(y=j.charCodeAt(C+1)))==56320&&(v=65536+(v-55296<<10)+(y-56320),C++),v<128?x[E++]=v:(v<2048?x[E++]=192|v>>>6:(v<65536?x[E++]=224|v>>>12:(x[E++]=240|v>>>18,x[E++]=128|v>>>12&63),x[E++]=128|v>>>6&63),x[E++]=128|63&v);return x})(S)},h.utf8decode=function(S){return f.nodebuffer?d.transformTo("nodebuffer",S).toString("utf-8"):(function(j){var x,v,y,C,E=j.length,U=new Array(2*E);for(x=v=0;x<E;)if((y=j[x++])<128)U[v++]=y;else if(4<(C=b[y]))U[v++]=65533,x+=C-1;else{for(y&=C===2?31:C===3?15:7;1<C&&x<E;)y=y<<6|63&j[x++],C--;1<C?U[v++]=65533:y<65536?U[v++]=y:(y-=65536,U[v++]=55296|y>>10&1023,U[v++]=56320|1023&y)}return U.length!==v&&(U.subarray?U=U.subarray(0,v):U.length=v),d.applyFromCharCode(U)})(S=d.transformTo(f.uint8array?"uint8array":"array",S))},d.inherits(N,m),N.prototype.processChunk=function(S){var j=d.transformTo(f.uint8array?"uint8array":"array",S.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var x=j;(j=new Uint8Array(x.length+this.leftOver.length)).set(this.leftOver,0),j.set(x,this.leftOver.length)}else j=this.leftOver.concat(j);this.leftOver=null}var v=(function(C,E){var U;for((E=E||C.length)>C.length&&(E=C.length),U=E-1;0<=U&&(192&C[U])==128;)U--;return U<0||U===0?E:U+b[C[U]]>E?U:E})(j),y=j;v!==j.length&&(f.uint8array?(y=j.subarray(0,v),this.leftOver=j.subarray(v,j.length)):(y=j.slice(0,v),this.leftOver=j.slice(v,j.length))),this.push({data:h.utf8decode(y),meta:S.meta})},N.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:h.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},h.Utf8DecodeWorker=N,d.inherits(T,m),T.prototype.processChunk=function(S){this.push({data:h.utf8encode(S.data),meta:S.meta})},h.Utf8EncodeWorker=T},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,c,h){var d=o("./support"),f=o("./base64"),p=o("./nodejsUtils"),m=o("./external");function b(x){return x}function k(x,v){for(var y=0;y<x.length;++y)v[y]=255&x.charCodeAt(y);return v}o("setimmediate"),h.newBlob=function(x,v){h.checkSupport("blob");try{return new Blob([x],{type:v})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(x),y.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var N={stringifyByChunk:function(x,v,y){var C=[],E=0,U=x.length;if(U<=y)return String.fromCharCode.apply(null,x);for(;E<U;)v==="array"||v==="nodebuffer"?C.push(String.fromCharCode.apply(null,x.slice(E,Math.min(E+y,U)))):C.push(String.fromCharCode.apply(null,x.subarray(E,Math.min(E+y,U)))),E+=y;return C.join("")},stringifyByChar:function(x){for(var v="",y=0;y<x.length;y++)v+=String.fromCharCode(x[y]);return v},applyCanBeUsed:{uint8array:(function(){try{return d.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return d.nodebuffer&&String.fromCharCode.apply(null,p.allocBuffer(1)).length===1}catch{return!1}})()}};function T(x){var v=65536,y=h.getTypeOf(x),C=!0;if(y==="uint8array"?C=N.applyCanBeUsed.uint8array:y==="nodebuffer"&&(C=N.applyCanBeUsed.nodebuffer),C)for(;1<v;)try{return N.stringifyByChunk(x,y,v)}catch{v=Math.floor(v/2)}return N.stringifyByChar(x)}function S(x,v){for(var y=0;y<x.length;y++)v[y]=x[y];return v}h.applyFromCharCode=T;var j={};j.string={string:b,array:function(x){return k(x,new Array(x.length))},arraybuffer:function(x){return j.string.uint8array(x).buffer},uint8array:function(x){return k(x,new Uint8Array(x.length))},nodebuffer:function(x){return k(x,p.allocBuffer(x.length))}},j.array={string:T,array:b,arraybuffer:function(x){return new Uint8Array(x).buffer},uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return p.newBufferFrom(x)}},j.arraybuffer={string:function(x){return T(new Uint8Array(x))},array:function(x){return S(new Uint8Array(x),new Array(x.byteLength))},arraybuffer:b,uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return p.newBufferFrom(new Uint8Array(x))}},j.uint8array={string:T,array:function(x){return S(x,new Array(x.length))},arraybuffer:function(x){return x.buffer},uint8array:b,nodebuffer:function(x){return p.newBufferFrom(x)}},j.nodebuffer={string:T,array:function(x){return S(x,new Array(x.length))},arraybuffer:function(x){return j.nodebuffer.uint8array(x).buffer},uint8array:function(x){return S(x,new Uint8Array(x.length))},nodebuffer:b},h.transformTo=function(x,v){if(v=v||"",!x)return v;h.checkSupport(x);var y=h.getTypeOf(v);return j[y][x](v)},h.resolve=function(x){for(var v=x.split("/"),y=[],C=0;C<v.length;C++){var E=v[C];E==="."||E===""&&C!==0&&C!==v.length-1||(E===".."?y.pop():y.push(E))}return y.join("/")},h.getTypeOf=function(x){return typeof x=="string"?"string":Object.prototype.toString.call(x)==="[object Array]"?"array":d.nodebuffer&&p.isBuffer(x)?"nodebuffer":d.uint8array&&x instanceof Uint8Array?"uint8array":d.arraybuffer&&x instanceof ArrayBuffer?"arraybuffer":void 0},h.checkSupport=function(x){if(!d[x.toLowerCase()])throw new Error(x+" is not supported by this platform")},h.MAX_VALUE_16BITS=65535,h.MAX_VALUE_32BITS=-1,h.pretty=function(x){var v,y,C="";for(y=0;y<(x||"").length;y++)C+="\\x"+((v=x.charCodeAt(y))<16?"0":"")+v.toString(16).toUpperCase();return C},h.delay=function(x,v,y){setImmediate(function(){x.apply(y||null,v||[])})},h.inherits=function(x,v){function y(){}y.prototype=v.prototype,x.prototype=new y},h.extend=function(){var x,v,y={};for(x=0;x<arguments.length;x++)for(v in arguments[x])Object.prototype.hasOwnProperty.call(arguments[x],v)&&y[v]===void 0&&(y[v]=arguments[x][v]);return y},h.prepareContent=function(x,v,y,C,E){return m.Promise.resolve(v).then(function(U){return d.blob&&(U instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(U))!==-1)&&typeof FileReader<"u"?new m.Promise(function(B,Z){var Y=new FileReader;Y.onload=function(ne){B(ne.target.result)},Y.onerror=function(ne){Z(ne.target.error)},Y.readAsArrayBuffer(U)}):U}).then(function(U){var B=h.getTypeOf(U);return B?(B==="arraybuffer"?U=h.transformTo("uint8array",U):B==="string"&&(E?U=f.decode(U):y&&C!==!0&&(U=(function(Z){return k(Z,d.uint8array?new Uint8Array(Z.length):new Array(Z.length))})(U))),U):m.Promise.reject(new Error("Can't read the data of '"+x+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,c,h){var d=o("./reader/readerFor"),f=o("./utils"),p=o("./signature"),m=o("./zipEntry"),b=o("./support");function k(N){this.files=[],this.loadOptions=N}k.prototype={checkSignature:function(N){if(!this.reader.readAndCheckSignature(N)){this.reader.index-=4;var T=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+f.pretty(T)+", expected "+f.pretty(N)+")")}},isSignature:function(N,T){var S=this.reader.index;this.reader.setIndex(N);var j=this.reader.readString(4)===T;return this.reader.setIndex(S),j},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var N=this.reader.readData(this.zipCommentLength),T=b.uint8array?"uint8array":"array",S=f.transformTo(T,N);this.zipComment=this.loadOptions.decodeFileName(S)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var N,T,S,j=this.zip64EndOfCentralSize-44;0<j;)N=this.reader.readInt(2),T=this.reader.readInt(4),S=this.reader.readData(T),this.zip64ExtensibleData[N]={id:N,length:T,value:S}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var N,T;for(N=0;N<this.files.length;N++)T=this.files[N],this.reader.setIndex(T.localHeaderOffset),this.checkSignature(p.LOCAL_FILE_HEADER),T.readLocalPart(this.reader),T.handleUTF8(),T.processAttributes()},readCentralDir:function(){var N;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(p.CENTRAL_FILE_HEADER);)(N=new m({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(N);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var N=this.reader.lastIndexOfSignature(p.CENTRAL_DIRECTORY_END);if(N<0)throw this.isSignature(0,p.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(N);var T=N;if(this.checkSignature(p.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===f.MAX_VALUE_16BITS||this.diskWithCentralDirStart===f.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===f.MAX_VALUE_16BITS||this.centralDirRecords===f.MAX_VALUE_16BITS||this.centralDirSize===f.MAX_VALUE_32BITS||this.centralDirOffset===f.MAX_VALUE_32BITS){if(this.zip64=!0,(N=this.reader.lastIndexOfSignature(p.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(N),this.checkSignature(p.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,p.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(p.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(p.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var S=this.centralDirOffset+this.centralDirSize;this.zip64&&(S+=20,S+=12+this.zip64EndOfCentralSize);var j=T-S;if(0<j)this.isSignature(T,p.CENTRAL_FILE_HEADER)||(this.reader.zero=j);else if(j<0)throw new Error("Corrupted zip: missing "+Math.abs(j)+" bytes.")},prepareReader:function(N){this.reader=d(N)},load:function(N){this.prepareReader(N),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},c.exports=k},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,c,h){var d=o("./reader/readerFor"),f=o("./utils"),p=o("./compressedObject"),m=o("./crc32"),b=o("./utf8"),k=o("./compressions"),N=o("./support");function T(S,j){this.options=S,this.loadOptions=j}T.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(S){var j,x;if(S.skip(22),this.fileNameLength=S.readInt(2),x=S.readInt(2),this.fileName=S.readData(this.fileNameLength),S.skip(x),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((j=(function(v){for(var y in k)if(Object.prototype.hasOwnProperty.call(k,y)&&k[y].magic===v)return k[y];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new p(this.compressedSize,this.uncompressedSize,this.crc32,j,S.readData(this.compressedSize))},readCentralPart:function(S){this.versionMadeBy=S.readInt(2),S.skip(2),this.bitFlag=S.readInt(2),this.compressionMethod=S.readString(2),this.date=S.readDate(),this.crc32=S.readInt(4),this.compressedSize=S.readInt(4),this.uncompressedSize=S.readInt(4);var j=S.readInt(2);if(this.extraFieldsLength=S.readInt(2),this.fileCommentLength=S.readInt(2),this.diskNumberStart=S.readInt(2),this.internalFileAttributes=S.readInt(2),this.externalFileAttributes=S.readInt(4),this.localHeaderOffset=S.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");S.skip(j),this.readExtraFields(S),this.parseZIP64ExtraField(S),this.fileComment=S.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var S=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),S==0&&(this.dosPermissions=63&this.externalFileAttributes),S==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var S=d(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=S.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=S.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=S.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=S.readInt(4))}},readExtraFields:function(S){var j,x,v,y=S.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});S.index+4<y;)j=S.readInt(2),x=S.readInt(2),v=S.readData(x),this.extraFields[j]={id:j,length:x,value:v};S.setIndex(y)},handleUTF8:function(){var S=N.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=b.utf8decode(this.fileName),this.fileCommentStr=b.utf8decode(this.fileComment);else{var j=this.findExtraFieldUnicodePath();if(j!==null)this.fileNameStr=j;else{var x=f.transformTo(S,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(x)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var y=f.transformTo(S,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var S=this.extraFields[28789];if(S){var j=d(S.value);return j.readInt(1)!==1||m(this.fileName)!==j.readInt(4)?null:b.utf8decode(j.readData(S.length-5))}return null},findExtraFieldUnicodeComment:function(){var S=this.extraFields[25461];if(S){var j=d(S.value);return j.readInt(1)!==1||m(this.fileComment)!==j.readInt(4)?null:b.utf8decode(j.readData(S.length-5))}return null}},c.exports=T},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,c,h){function d(j,x,v){this.name=j,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=x,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var f=o("./stream/StreamHelper"),p=o("./stream/DataWorker"),m=o("./utf8"),b=o("./compressedObject"),k=o("./stream/GenericWorker");d.prototype={internalStream:function(j){var x=null,v="string";try{if(!j)throw new Error("No output type specified.");var y=(v=j.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),x=this._decompressWorker();var C=!this._dataBinary;C&&!y&&(x=x.pipe(new m.Utf8EncodeWorker)),!C&&y&&(x=x.pipe(new m.Utf8DecodeWorker))}catch(E){(x=new k("error")).error(E)}return new f(x,v,"")},async:function(j,x){return this.internalStream(j).accumulate(x)},nodeStream:function(j,x){return this.internalStream(j||"nodebuffer").toNodejsStream(x)},_compressWorker:function(j,x){if(this._data instanceof b&&this._data.compression.magic===j.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new m.Utf8EncodeWorker)),b.createWorkerFrom(v,j,x)},_decompressWorker:function(){return this._data instanceof b?this._data.getContentWorker():this._data instanceof k?this._data:new p(this._data)}};for(var N=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],T=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},S=0;S<N.length;S++)d.prototype[N[S]]=T;c.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,c,h){(function(d){var f,p,m=d.MutationObserver||d.WebKitMutationObserver;if(m){var b=0,k=new m(j),N=d.document.createTextNode("");k.observe(N,{characterData:!0}),f=function(){N.data=b=++b%2}}else if(d.setImmediate||d.MessageChannel===void 0)f="document"in d&&"onreadystatechange"in d.document.createElement("script")?function(){var x=d.document.createElement("script");x.onreadystatechange=function(){j(),x.onreadystatechange=null,x.parentNode.removeChild(x),x=null},d.document.documentElement.appendChild(x)}:function(){setTimeout(j,0)};else{var T=new d.MessageChannel;T.port1.onmessage=j,f=function(){T.port2.postMessage(0)}}var S=[];function j(){var x,v;p=!0;for(var y=S.length;y;){for(v=S,S=[],x=-1;++x<y;)v[x]();y=S.length}p=!1}c.exports=function(x){S.push(x)!==1||p||f()}}).call(this,typeof ns<"u"?ns:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,c,h){var d=o("immediate");function f(){}var p={},m=["REJECTED"],b=["FULFILLED"],k=["PENDING"];function N(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=k,this.queue=[],this.outcome=void 0,y!==f&&x(this,y)}function T(y,C,E){this.promise=y,typeof C=="function"&&(this.onFulfilled=C,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function S(y,C,E){d(function(){var U;try{U=C(E)}catch(B){return p.reject(y,B)}U===y?p.reject(y,new TypeError("Cannot resolve promise with itself")):p.resolve(y,U)})}function j(y){var C=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof C=="function")return function(){C.apply(y,arguments)}}function x(y,C){var E=!1;function U(Y){E||(E=!0,p.reject(y,Y))}function B(Y){E||(E=!0,p.resolve(y,Y))}var Z=v(function(){C(B,U)});Z.status==="error"&&U(Z.value)}function v(y,C){var E={};try{E.value=y(C),E.status="success"}catch(U){E.status="error",E.value=U}return E}(c.exports=N).prototype.finally=function(y){if(typeof y!="function")return this;var C=this.constructor;return this.then(function(E){return C.resolve(y()).then(function(){return E})},function(E){return C.resolve(y()).then(function(){throw E})})},N.prototype.catch=function(y){return this.then(null,y)},N.prototype.then=function(y,C){if(typeof y!="function"&&this.state===b||typeof C!="function"&&this.state===m)return this;var E=new this.constructor(f);return this.state!==k?S(E,this.state===b?y:C,this.outcome):this.queue.push(new T(E,y,C)),E},T.prototype.callFulfilled=function(y){p.resolve(this.promise,y)},T.prototype.otherCallFulfilled=function(y){S(this.promise,this.onFulfilled,y)},T.prototype.callRejected=function(y){p.reject(this.promise,y)},T.prototype.otherCallRejected=function(y){S(this.promise,this.onRejected,y)},p.resolve=function(y,C){var E=v(j,C);if(E.status==="error")return p.reject(y,E.value);var U=E.value;if(U)x(y,U);else{y.state=b,y.outcome=C;for(var B=-1,Z=y.queue.length;++B<Z;)y.queue[B].callFulfilled(C)}return y},p.reject=function(y,C){y.state=m,y.outcome=C;for(var E=-1,U=y.queue.length;++E<U;)y.queue[E].callRejected(C);return y},N.resolve=function(y){return y instanceof this?y:p.resolve(new this(f),y)},N.reject=function(y){var C=new this(f);return p.reject(C,y)},N.all=function(y){var C=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=y.length,U=!1;if(!E)return this.resolve([]);for(var B=new Array(E),Z=0,Y=-1,ne=new this(f);++Y<E;)F(y[Y],Y);return ne;function F(ge,ce){C.resolve(ge).then(function(M){B[ce]=M,++Z!==E||U||(U=!0,p.resolve(ne,B))},function(M){U||(U=!0,p.reject(ne,M))})}},N.race=function(y){var C=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=y.length,U=!1;if(!E)return this.resolve([]);for(var B=-1,Z=new this(f);++B<E;)Y=y[B],C.resolve(Y).then(function(ne){U||(U=!0,p.resolve(Z,ne))},function(ne){U||(U=!0,p.reject(Z,ne))});var Y;return Z}},{immediate:36}],38:[function(o,c,h){var d={};(0,o("./lib/utils/common").assign)(d,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),c.exports=d},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,c,h){var d=o("./zlib/deflate"),f=o("./utils/common"),p=o("./utils/strings"),m=o("./zlib/messages"),b=o("./zlib/zstream"),k=Object.prototype.toString,N=0,T=-1,S=0,j=8;function x(y){if(!(this instanceof x))return new x(y);this.options=f.assign({level:T,method:j,chunkSize:16384,windowBits:15,memLevel:8,strategy:S,to:""},y||{});var C=this.options;C.raw&&0<C.windowBits?C.windowBits=-C.windowBits:C.gzip&&0<C.windowBits&&C.windowBits<16&&(C.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var E=d.deflateInit2(this.strm,C.level,C.method,C.windowBits,C.memLevel,C.strategy);if(E!==N)throw new Error(m[E]);if(C.header&&d.deflateSetHeader(this.strm,C.header),C.dictionary){var U;if(U=typeof C.dictionary=="string"?p.string2buf(C.dictionary):k.call(C.dictionary)==="[object ArrayBuffer]"?new Uint8Array(C.dictionary):C.dictionary,(E=d.deflateSetDictionary(this.strm,U))!==N)throw new Error(m[E]);this._dict_set=!0}}function v(y,C){var E=new x(C);if(E.push(y,!0),E.err)throw E.msg||m[E.err];return E.result}x.prototype.push=function(y,C){var E,U,B=this.strm,Z=this.options.chunkSize;if(this.ended)return!1;U=C===~~C?C:C===!0?4:0,typeof y=="string"?B.input=p.string2buf(y):k.call(y)==="[object ArrayBuffer]"?B.input=new Uint8Array(y):B.input=y,B.next_in=0,B.avail_in=B.input.length;do{if(B.avail_out===0&&(B.output=new f.Buf8(Z),B.next_out=0,B.avail_out=Z),(E=d.deflate(B,U))!==1&&E!==N)return this.onEnd(E),!(this.ended=!0);B.avail_out!==0&&(B.avail_in!==0||U!==4&&U!==2)||(this.options.to==="string"?this.onData(p.buf2binstring(f.shrinkBuf(B.output,B.next_out))):this.onData(f.shrinkBuf(B.output,B.next_out)))}while((0<B.avail_in||B.avail_out===0)&&E!==1);return U===4?(E=d.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===N):U!==2||(this.onEnd(N),!(B.avail_out=0))},x.prototype.onData=function(y){this.chunks.push(y)},x.prototype.onEnd=function(y){y===N&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},h.Deflate=x,h.deflate=v,h.deflateRaw=function(y,C){return(C=C||{}).raw=!0,v(y,C)},h.gzip=function(y,C){return(C=C||{}).gzip=!0,v(y,C)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,c,h){var d=o("./zlib/inflate"),f=o("./utils/common"),p=o("./utils/strings"),m=o("./zlib/constants"),b=o("./zlib/messages"),k=o("./zlib/zstream"),N=o("./zlib/gzheader"),T=Object.prototype.toString;function S(x){if(!(this instanceof S))return new S(x);this.options=f.assign({chunkSize:16384,windowBits:0,to:""},x||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||x&&x.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&(15&v.windowBits)==0&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var y=d.inflateInit2(this.strm,v.windowBits);if(y!==m.Z_OK)throw new Error(b[y]);this.header=new N,d.inflateGetHeader(this.strm,this.header)}function j(x,v){var y=new S(v);if(y.push(x,!0),y.err)throw y.msg||b[y.err];return y.result}S.prototype.push=function(x,v){var y,C,E,U,B,Z,Y=this.strm,ne=this.options.chunkSize,F=this.options.dictionary,ge=!1;if(this.ended)return!1;C=v===~~v?v:v===!0?m.Z_FINISH:m.Z_NO_FLUSH,typeof x=="string"?Y.input=p.binstring2buf(x):T.call(x)==="[object ArrayBuffer]"?Y.input=new Uint8Array(x):Y.input=x,Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0&&(Y.output=new f.Buf8(ne),Y.next_out=0,Y.avail_out=ne),(y=d.inflate(Y,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&F&&(Z=typeof F=="string"?p.string2buf(F):T.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,y=d.inflateSetDictionary(this.strm,Z)),y===m.Z_BUF_ERROR&&ge===!0&&(y=m.Z_OK,ge=!1),y!==m.Z_STREAM_END&&y!==m.Z_OK)return this.onEnd(y),!(this.ended=!0);Y.next_out&&(Y.avail_out!==0&&y!==m.Z_STREAM_END&&(Y.avail_in!==0||C!==m.Z_FINISH&&C!==m.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=p.utf8border(Y.output,Y.next_out),U=Y.next_out-E,B=p.buf2string(Y.output,E),Y.next_out=U,Y.avail_out=ne-U,U&&f.arraySet(Y.output,Y.output,E,U,0),this.onData(B)):this.onData(f.shrinkBuf(Y.output,Y.next_out)))),Y.avail_in===0&&Y.avail_out===0&&(ge=!0)}while((0<Y.avail_in||Y.avail_out===0)&&y!==m.Z_STREAM_END);return y===m.Z_STREAM_END&&(C=m.Z_FINISH),C===m.Z_FINISH?(y=d.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===m.Z_OK):C!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(Y.avail_out=0))},S.prototype.onData=function(x){this.chunks.push(x)},S.prototype.onEnd=function(x){x===m.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},h.Inflate=S,h.inflate=j,h.inflateRaw=function(x,v){return(v=v||{}).raw=!0,j(x,v)},h.ungzip=j},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,c,h){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";h.assign=function(m){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var k=b.shift();if(k){if(typeof k!="object")throw new TypeError(k+"must be non-object");for(var N in k)k.hasOwnProperty(N)&&(m[N]=k[N])}}return m},h.shrinkBuf=function(m,b){return m.length===b?m:m.subarray?m.subarray(0,b):(m.length=b,m)};var f={arraySet:function(m,b,k,N,T){if(b.subarray&&m.subarray)m.set(b.subarray(k,k+N),T);else for(var S=0;S<N;S++)m[T+S]=b[k+S]},flattenChunks:function(m){var b,k,N,T,S,j;for(b=N=0,k=m.length;b<k;b++)N+=m[b].length;for(j=new Uint8Array(N),b=T=0,k=m.length;b<k;b++)S=m[b],j.set(S,T),T+=S.length;return j}},p={arraySet:function(m,b,k,N,T){for(var S=0;S<N;S++)m[T+S]=b[k+S]},flattenChunks:function(m){return[].concat.apply([],m)}};h.setTyped=function(m){m?(h.Buf8=Uint8Array,h.Buf16=Uint16Array,h.Buf32=Int32Array,h.assign(h,f)):(h.Buf8=Array,h.Buf16=Array,h.Buf32=Array,h.assign(h,p))},h.setTyped(d)},{}],42:[function(o,c,h){var d=o("./common"),f=!0,p=!0;try{String.fromCharCode.apply(null,[0])}catch{f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{p=!1}for(var m=new d.Buf8(256),b=0;b<256;b++)m[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;function k(N,T){if(T<65537&&(N.subarray&&p||!N.subarray&&f))return String.fromCharCode.apply(null,d.shrinkBuf(N,T));for(var S="",j=0;j<T;j++)S+=String.fromCharCode(N[j]);return S}m[254]=m[254]=1,h.string2buf=function(N){var T,S,j,x,v,y=N.length,C=0;for(x=0;x<y;x++)(64512&(S=N.charCodeAt(x)))==55296&&x+1<y&&(64512&(j=N.charCodeAt(x+1)))==56320&&(S=65536+(S-55296<<10)+(j-56320),x++),C+=S<128?1:S<2048?2:S<65536?3:4;for(T=new d.Buf8(C),x=v=0;v<C;x++)(64512&(S=N.charCodeAt(x)))==55296&&x+1<y&&(64512&(j=N.charCodeAt(x+1)))==56320&&(S=65536+(S-55296<<10)+(j-56320),x++),S<128?T[v++]=S:(S<2048?T[v++]=192|S>>>6:(S<65536?T[v++]=224|S>>>12:(T[v++]=240|S>>>18,T[v++]=128|S>>>12&63),T[v++]=128|S>>>6&63),T[v++]=128|63&S);return T},h.buf2binstring=function(N){return k(N,N.length)},h.binstring2buf=function(N){for(var T=new d.Buf8(N.length),S=0,j=T.length;S<j;S++)T[S]=N.charCodeAt(S);return T},h.buf2string=function(N,T){var S,j,x,v,y=T||N.length,C=new Array(2*y);for(S=j=0;S<y;)if((x=N[S++])<128)C[j++]=x;else if(4<(v=m[x]))C[j++]=65533,S+=v-1;else{for(x&=v===2?31:v===3?15:7;1<v&&S<y;)x=x<<6|63&N[S++],v--;1<v?C[j++]=65533:x<65536?C[j++]=x:(x-=65536,C[j++]=55296|x>>10&1023,C[j++]=56320|1023&x)}return k(C,j)},h.utf8border=function(N,T){var S;for((T=T||N.length)>N.length&&(T=N.length),S=T-1;0<=S&&(192&N[S])==128;)S--;return S<0||S===0?T:S+m[N[S]]>T?S:T}},{"./common":41}],43:[function(o,c,h){c.exports=function(d,f,p,m){for(var b=65535&d|0,k=d>>>16&65535|0,N=0;p!==0;){for(p-=N=2e3<p?2e3:p;k=k+(b=b+f[m++]|0)|0,--N;);b%=65521,k%=65521}return b|k<<16|0}},{}],44:[function(o,c,h){c.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(o,c,h){var d=(function(){for(var f,p=[],m=0;m<256;m++){f=m;for(var b=0;b<8;b++)f=1&f?3988292384^f>>>1:f>>>1;p[m]=f}return p})();c.exports=function(f,p,m,b){var k=d,N=b+m;f^=-1;for(var T=b;T<N;T++)f=f>>>8^k[255&(f^p[T])];return-1^f}},{}],46:[function(o,c,h){var d,f=o("../utils/common"),p=o("./trees"),m=o("./adler32"),b=o("./crc32"),k=o("./messages"),N=0,T=4,S=0,j=-2,x=-1,v=4,y=2,C=8,E=9,U=286,B=30,Z=19,Y=2*U+1,ne=15,F=3,ge=258,ce=ge+F+1,M=42,H=113,_=1,W=2,X=3,I=4;function xe(w,fe){return w.msg=k[fe],fe}function V(w){return(w<<1)-(4<w?9:0)}function oe(w){for(var fe=w.length;0<=--fe;)w[fe]=0}function A(w){var fe=w.state,re=fe.pending;re>w.avail_out&&(re=w.avail_out),re!==0&&(f.arraySet(w.output,fe.pending_buf,fe.pending_out,re,w.next_out),w.next_out+=re,fe.pending_out+=re,w.total_out+=re,w.avail_out-=re,fe.pending-=re,fe.pending===0&&(fe.pending_out=0))}function O(w,fe){p._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,fe),w.block_start=w.strstart,A(w.strm)}function P(w,fe){w.pending_buf[w.pending++]=fe}function le(w,fe){w.pending_buf[w.pending++]=fe>>>8&255,w.pending_buf[w.pending++]=255&fe}function de(w,fe){var re,L,D=w.max_chain_length,J=w.strstart,te=w.prev_length,me=w.nice_match,G=w.strstart>w.w_size-ce?w.strstart-(w.w_size-ce):0,we=w.window,Se=w.w_mask,ye=w.prev,ze=w.strstart+ge,Ge=we[J+te-1],Be=we[J+te];w.prev_length>=w.good_match&&(D>>=2),me>w.lookahead&&(me=w.lookahead);do if(we[(re=fe)+te]===Be&&we[re+te-1]===Ge&&we[re]===we[J]&&we[++re]===we[J+1]){J+=2,re++;do;while(we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&we[++J]===we[++re]&&J<ze);if(L=ge-(ze-J),J=ze-ge,te<L){if(w.match_start=fe,me<=(te=L))break;Ge=we[J+te-1],Be=we[J+te]}}while((fe=ye[fe&Se])>G&&--D!=0);return te<=w.lookahead?te:w.lookahead}function Ne(w){var fe,re,L,D,J,te,me,G,we,Se,ye=w.w_size;do{if(D=w.window_size-w.lookahead-w.strstart,w.strstart>=ye+(ye-ce)){for(f.arraySet(w.window,w.window,ye,ye,0),w.match_start-=ye,w.strstart-=ye,w.block_start-=ye,fe=re=w.hash_size;L=w.head[--fe],w.head[fe]=ye<=L?L-ye:0,--re;);for(fe=re=ye;L=w.prev[--fe],w.prev[fe]=ye<=L?L-ye:0,--re;);D+=ye}if(w.strm.avail_in===0)break;if(te=w.strm,me=w.window,G=w.strstart+w.lookahead,we=D,Se=void 0,Se=te.avail_in,we<Se&&(Se=we),re=Se===0?0:(te.avail_in-=Se,f.arraySet(me,te.input,te.next_in,Se,G),te.state.wrap===1?te.adler=m(te.adler,me,Se,G):te.state.wrap===2&&(te.adler=b(te.adler,me,Se,G)),te.next_in+=Se,te.total_in+=Se,Se),w.lookahead+=re,w.lookahead+w.insert>=F)for(J=w.strstart-w.insert,w.ins_h=w.window[J],w.ins_h=(w.ins_h<<w.hash_shift^w.window[J+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[J+F-1])&w.hash_mask,w.prev[J&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=J,J++,w.insert--,!(w.lookahead+w.insert<F)););}while(w.lookahead<ce&&w.strm.avail_in!==0)}function Te(w,fe){for(var re,L;;){if(w.lookahead<ce){if(Ne(w),w.lookahead<ce&&fe===N)return _;if(w.lookahead===0)break}if(re=0,w.lookahead>=F&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+F-1])&w.hash_mask,re=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),re!==0&&w.strstart-re<=w.w_size-ce&&(w.match_length=de(w,re)),w.match_length>=F)if(L=p._tr_tally(w,w.strstart-w.match_start,w.match_length-F),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=F){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+F-1])&w.hash_mask,re=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else L=p._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(L&&(O(w,!1),w.strm.avail_out===0))return _}return w.insert=w.strstart<F-1?w.strstart:F-1,fe===T?(O(w,!0),w.strm.avail_out===0?X:I):w.last_lit&&(O(w,!1),w.strm.avail_out===0)?_:W}function Ae(w,fe){for(var re,L,D;;){if(w.lookahead<ce){if(Ne(w),w.lookahead<ce&&fe===N)return _;if(w.lookahead===0)break}if(re=0,w.lookahead>=F&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+F-1])&w.hash_mask,re=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=F-1,re!==0&&w.prev_length<w.max_lazy_match&&w.strstart-re<=w.w_size-ce&&(w.match_length=de(w,re),w.match_length<=5&&(w.strategy===1||w.match_length===F&&4096<w.strstart-w.match_start)&&(w.match_length=F-1)),w.prev_length>=F&&w.match_length<=w.prev_length){for(D=w.strstart+w.lookahead-F,L=p._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-F),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=D&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+F-1])&w.hash_mask,re=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=F-1,w.strstart++,L&&(O(w,!1),w.strm.avail_out===0))return _}else if(w.match_available){if((L=p._tr_tally(w,0,w.window[w.strstart-1]))&&O(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return _}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(L=p._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<F-1?w.strstart:F-1,fe===T?(O(w,!0),w.strm.avail_out===0?X:I):w.last_lit&&(O(w,!1),w.strm.avail_out===0)?_:W}function De(w,fe,re,L,D){this.good_length=w,this.max_lazy=fe,this.nice_length=re,this.max_chain=L,this.func=D}function Ke(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new f.Buf16(2*Y),this.dyn_dtree=new f.Buf16(2*(2*B+1)),this.bl_tree=new f.Buf16(2*(2*Z+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new f.Buf16(ne+1),this.heap=new f.Buf16(2*U+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new f.Buf16(2*U+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Je(w){var fe;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=y,(fe=w.state).pending=0,fe.pending_out=0,fe.wrap<0&&(fe.wrap=-fe.wrap),fe.status=fe.wrap?M:H,w.adler=fe.wrap===2?0:1,fe.last_flush=N,p._tr_init(fe),S):xe(w,j)}function ut(w){var fe=Je(w);return fe===S&&(function(re){re.window_size=2*re.w_size,oe(re.head),re.max_lazy_match=d[re.level].max_lazy,re.good_match=d[re.level].good_length,re.nice_match=d[re.level].nice_length,re.max_chain_length=d[re.level].max_chain,re.strstart=0,re.block_start=0,re.lookahead=0,re.insert=0,re.match_length=re.prev_length=F-1,re.match_available=0,re.ins_h=0})(w.state),fe}function xt(w,fe,re,L,D,J){if(!w)return j;var te=1;if(fe===x&&(fe=6),L<0?(te=0,L=-L):15<L&&(te=2,L-=16),D<1||E<D||re!==C||L<8||15<L||fe<0||9<fe||J<0||v<J)return xe(w,j);L===8&&(L=9);var me=new Ke;return(w.state=me).strm=w,me.wrap=te,me.gzhead=null,me.w_bits=L,me.w_size=1<<me.w_bits,me.w_mask=me.w_size-1,me.hash_bits=D+7,me.hash_size=1<<me.hash_bits,me.hash_mask=me.hash_size-1,me.hash_shift=~~((me.hash_bits+F-1)/F),me.window=new f.Buf8(2*me.w_size),me.head=new f.Buf16(me.hash_size),me.prev=new f.Buf16(me.w_size),me.lit_bufsize=1<<D+6,me.pending_buf_size=4*me.lit_bufsize,me.pending_buf=new f.Buf8(me.pending_buf_size),me.d_buf=1*me.lit_bufsize,me.l_buf=3*me.lit_bufsize,me.level=fe,me.strategy=J,me.method=re,ut(w)}d=[new De(0,0,0,0,function(w,fe){var re=65535;for(re>w.pending_buf_size-5&&(re=w.pending_buf_size-5);;){if(w.lookahead<=1){if(Ne(w),w.lookahead===0&&fe===N)return _;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var L=w.block_start+re;if((w.strstart===0||w.strstart>=L)&&(w.lookahead=w.strstart-L,w.strstart=L,O(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-ce&&(O(w,!1),w.strm.avail_out===0))return _}return w.insert=0,fe===T?(O(w,!0),w.strm.avail_out===0?X:I):(w.strstart>w.block_start&&(O(w,!1),w.strm.avail_out),_)}),new De(4,4,8,4,Te),new De(4,5,16,8,Te),new De(4,6,32,32,Te),new De(4,4,16,16,Ae),new De(8,16,32,32,Ae),new De(8,16,128,128,Ae),new De(8,32,128,256,Ae),new De(32,128,258,1024,Ae),new De(32,258,258,4096,Ae)],h.deflateInit=function(w,fe){return xt(w,fe,C,15,8,0)},h.deflateInit2=xt,h.deflateReset=ut,h.deflateResetKeep=Je,h.deflateSetHeader=function(w,fe){return w&&w.state?w.state.wrap!==2?j:(w.state.gzhead=fe,S):j},h.deflate=function(w,fe){var re,L,D,J;if(!w||!w.state||5<fe||fe<0)return w?xe(w,j):j;if(L=w.state,!w.output||!w.input&&w.avail_in!==0||L.status===666&&fe!==T)return xe(w,w.avail_out===0?-5:j);if(L.strm=w,re=L.last_flush,L.last_flush=fe,L.status===M)if(L.wrap===2)w.adler=0,P(L,31),P(L,139),P(L,8),L.gzhead?(P(L,(L.gzhead.text?1:0)+(L.gzhead.hcrc?2:0)+(L.gzhead.extra?4:0)+(L.gzhead.name?8:0)+(L.gzhead.comment?16:0)),P(L,255&L.gzhead.time),P(L,L.gzhead.time>>8&255),P(L,L.gzhead.time>>16&255),P(L,L.gzhead.time>>24&255),P(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),P(L,255&L.gzhead.os),L.gzhead.extra&&L.gzhead.extra.length&&(P(L,255&L.gzhead.extra.length),P(L,L.gzhead.extra.length>>8&255)),L.gzhead.hcrc&&(w.adler=b(w.adler,L.pending_buf,L.pending,0)),L.gzindex=0,L.status=69):(P(L,0),P(L,0),P(L,0),P(L,0),P(L,0),P(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),P(L,3),L.status=H);else{var te=C+(L.w_bits-8<<4)<<8;te|=(2<=L.strategy||L.level<2?0:L.level<6?1:L.level===6?2:3)<<6,L.strstart!==0&&(te|=32),te+=31-te%31,L.status=H,le(L,te),L.strstart!==0&&(le(L,w.adler>>>16),le(L,65535&w.adler)),w.adler=1}if(L.status===69)if(L.gzhead.extra){for(D=L.pending;L.gzindex<(65535&L.gzhead.extra.length)&&(L.pending!==L.pending_buf_size||(L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),A(w),D=L.pending,L.pending!==L.pending_buf_size));)P(L,255&L.gzhead.extra[L.gzindex]),L.gzindex++;L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),L.gzindex===L.gzhead.extra.length&&(L.gzindex=0,L.status=73)}else L.status=73;if(L.status===73)if(L.gzhead.name){D=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),A(w),D=L.pending,L.pending===L.pending_buf_size)){J=1;break}J=L.gzindex<L.gzhead.name.length?255&L.gzhead.name.charCodeAt(L.gzindex++):0,P(L,J)}while(J!==0);L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),J===0&&(L.gzindex=0,L.status=91)}else L.status=91;if(L.status===91)if(L.gzhead.comment){D=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),A(w),D=L.pending,L.pending===L.pending_buf_size)){J=1;break}J=L.gzindex<L.gzhead.comment.length?255&L.gzhead.comment.charCodeAt(L.gzindex++):0,P(L,J)}while(J!==0);L.gzhead.hcrc&&L.pending>D&&(w.adler=b(w.adler,L.pending_buf,L.pending-D,D)),J===0&&(L.status=103)}else L.status=103;if(L.status===103&&(L.gzhead.hcrc?(L.pending+2>L.pending_buf_size&&A(w),L.pending+2<=L.pending_buf_size&&(P(L,255&w.adler),P(L,w.adler>>8&255),w.adler=0,L.status=H)):L.status=H),L.pending!==0){if(A(w),w.avail_out===0)return L.last_flush=-1,S}else if(w.avail_in===0&&V(fe)<=V(re)&&fe!==T)return xe(w,-5);if(L.status===666&&w.avail_in!==0)return xe(w,-5);if(w.avail_in!==0||L.lookahead!==0||fe!==N&&L.status!==666){var me=L.strategy===2?(function(G,we){for(var Se;;){if(G.lookahead===0&&(Ne(G),G.lookahead===0)){if(we===N)return _;break}if(G.match_length=0,Se=p._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,Se&&(O(G,!1),G.strm.avail_out===0))return _}return G.insert=0,we===T?(O(G,!0),G.strm.avail_out===0?X:I):G.last_lit&&(O(G,!1),G.strm.avail_out===0)?_:W})(L,fe):L.strategy===3?(function(G,we){for(var Se,ye,ze,Ge,Be=G.window;;){if(G.lookahead<=ge){if(Ne(G),G.lookahead<=ge&&we===N)return _;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=F&&0<G.strstart&&(ye=Be[ze=G.strstart-1])===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]){Ge=G.strstart+ge;do;while(ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ye===Be[++ze]&&ze<Ge);G.match_length=ge-(Ge-ze),G.match_length>G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=F?(Se=p._tr_tally(G,1,G.match_length-F),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(Se=p._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),Se&&(O(G,!1),G.strm.avail_out===0))return _}return G.insert=0,we===T?(O(G,!0),G.strm.avail_out===0?X:I):G.last_lit&&(O(G,!1),G.strm.avail_out===0)?_:W})(L,fe):d[L.level].func(L,fe);if(me!==X&&me!==I||(L.status=666),me===_||me===X)return w.avail_out===0&&(L.last_flush=-1),S;if(me===W&&(fe===1?p._tr_align(L):fe!==5&&(p._tr_stored_block(L,0,0,!1),fe===3&&(oe(L.head),L.lookahead===0&&(L.strstart=0,L.block_start=0,L.insert=0))),A(w),w.avail_out===0))return L.last_flush=-1,S}return fe!==T?S:L.wrap<=0?1:(L.wrap===2?(P(L,255&w.adler),P(L,w.adler>>8&255),P(L,w.adler>>16&255),P(L,w.adler>>24&255),P(L,255&w.total_in),P(L,w.total_in>>8&255),P(L,w.total_in>>16&255),P(L,w.total_in>>24&255)):(le(L,w.adler>>>16),le(L,65535&w.adler)),A(w),0<L.wrap&&(L.wrap=-L.wrap),L.pending!==0?S:1)},h.deflateEnd=function(w){var fe;return w&&w.state?(fe=w.state.status)!==M&&fe!==69&&fe!==73&&fe!==91&&fe!==103&&fe!==H&&fe!==666?xe(w,j):(w.state=null,fe===H?xe(w,-3):S):j},h.deflateSetDictionary=function(w,fe){var re,L,D,J,te,me,G,we,Se=fe.length;if(!w||!w.state||(J=(re=w.state).wrap)===2||J===1&&re.status!==M||re.lookahead)return j;for(J===1&&(w.adler=m(w.adler,fe,Se,0)),re.wrap=0,Se>=re.w_size&&(J===0&&(oe(re.head),re.strstart=0,re.block_start=0,re.insert=0),we=new f.Buf8(re.w_size),f.arraySet(we,fe,Se-re.w_size,re.w_size,0),fe=we,Se=re.w_size),te=w.avail_in,me=w.next_in,G=w.input,w.avail_in=Se,w.next_in=0,w.input=fe,Ne(re);re.lookahead>=F;){for(L=re.strstart,D=re.lookahead-(F-1);re.ins_h=(re.ins_h<<re.hash_shift^re.window[L+F-1])&re.hash_mask,re.prev[L&re.w_mask]=re.head[re.ins_h],re.head[re.ins_h]=L,L++,--D;);re.strstart=L,re.lookahead=F-1,Ne(re)}return re.strstart+=re.lookahead,re.block_start=re.strstart,re.insert=re.lookahead,re.lookahead=0,re.match_length=re.prev_length=F-1,re.match_available=0,w.next_in=me,w.input=G,w.avail_in=te,re.wrap=J,S},h.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,c,h){c.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(o,c,h){c.exports=function(d,f){var p,m,b,k,N,T,S,j,x,v,y,C,E,U,B,Z,Y,ne,F,ge,ce,M,H,_,W;p=d.state,m=d.next_in,_=d.input,b=m+(d.avail_in-5),k=d.next_out,W=d.output,N=k-(f-d.avail_out),T=k+(d.avail_out-257),S=p.dmax,j=p.wsize,x=p.whave,v=p.wnext,y=p.window,C=p.hold,E=p.bits,U=p.lencode,B=p.distcode,Z=(1<<p.lenbits)-1,Y=(1<<p.distbits)-1;e:do{E<15&&(C+=_[m++]<<E,E+=8,C+=_[m++]<<E,E+=8),ne=U[C&Z];t:for(;;){if(C>>>=F=ne>>>24,E-=F,(F=ne>>>16&255)===0)W[k++]=65535&ne;else{if(!(16&F)){if((64&F)==0){ne=U[(65535&ne)+(C&(1<<F)-1)];continue t}if(32&F){p.mode=12;break e}d.msg="invalid literal/length code",p.mode=30;break e}ge=65535&ne,(F&=15)&&(E<F&&(C+=_[m++]<<E,E+=8),ge+=C&(1<<F)-1,C>>>=F,E-=F),E<15&&(C+=_[m++]<<E,E+=8,C+=_[m++]<<E,E+=8),ne=B[C&Y];a:for(;;){if(C>>>=F=ne>>>24,E-=F,!(16&(F=ne>>>16&255))){if((64&F)==0){ne=B[(65535&ne)+(C&(1<<F)-1)];continue a}d.msg="invalid distance code",p.mode=30;break e}if(ce=65535&ne,E<(F&=15)&&(C+=_[m++]<<E,(E+=8)<F&&(C+=_[m++]<<E,E+=8)),S<(ce+=C&(1<<F)-1)){d.msg="invalid distance too far back",p.mode=30;break e}if(C>>>=F,E-=F,(F=k-N)<ce){if(x<(F=ce-F)&&p.sane){d.msg="invalid distance too far back",p.mode=30;break e}if(H=y,(M=0)===v){if(M+=j-F,F<ge){for(ge-=F;W[k++]=y[M++],--F;);M=k-ce,H=W}}else if(v<F){if(M+=j+v-F,(F-=v)<ge){for(ge-=F;W[k++]=y[M++],--F;);if(M=0,v<ge){for(ge-=F=v;W[k++]=y[M++],--F;);M=k-ce,H=W}}}else if(M+=v-F,F<ge){for(ge-=F;W[k++]=y[M++],--F;);M=k-ce,H=W}for(;2<ge;)W[k++]=H[M++],W[k++]=H[M++],W[k++]=H[M++],ge-=3;ge&&(W[k++]=H[M++],1<ge&&(W[k++]=H[M++]))}else{for(M=k-ce;W[k++]=W[M++],W[k++]=W[M++],W[k++]=W[M++],2<(ge-=3););ge&&(W[k++]=W[M++],1<ge&&(W[k++]=W[M++]))}break}}break}}while(m<b&&k<T);m-=ge=E>>3,C&=(1<<(E-=ge<<3))-1,d.next_in=m,d.next_out=k,d.avail_in=m<b?b-m+5:5-(m-b),d.avail_out=k<T?T-k+257:257-(k-T),p.hold=C,p.bits=E}},{}],49:[function(o,c,h){var d=o("../utils/common"),f=o("./adler32"),p=o("./crc32"),m=o("./inffast"),b=o("./inftrees"),k=1,N=2,T=0,S=-2,j=1,x=852,v=592;function y(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function C(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new d.Buf16(320),this.work=new d.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(M){var H;return M&&M.state?(H=M.state,M.total_in=M.total_out=H.total=0,M.msg="",H.wrap&&(M.adler=1&H.wrap),H.mode=j,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new d.Buf32(x),H.distcode=H.distdyn=new d.Buf32(v),H.sane=1,H.back=-1,T):S}function U(M){var H;return M&&M.state?((H=M.state).wsize=0,H.whave=0,H.wnext=0,E(M)):S}function B(M,H){var _,W;return M&&M.state?(W=M.state,H<0?(_=0,H=-H):(_=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?S:(W.window!==null&&W.wbits!==H&&(W.window=null),W.wrap=_,W.wbits=H,U(M))):S}function Z(M,H){var _,W;return M?(W=new C,(M.state=W).window=null,(_=B(M,H))!==T&&(M.state=null),_):S}var Y,ne,F=!0;function ge(M){if(F){var H;for(Y=new d.Buf32(512),ne=new d.Buf32(32),H=0;H<144;)M.lens[H++]=8;for(;H<256;)M.lens[H++]=9;for(;H<280;)M.lens[H++]=7;for(;H<288;)M.lens[H++]=8;for(b(k,M.lens,0,288,Y,0,M.work,{bits:9}),H=0;H<32;)M.lens[H++]=5;b(N,M.lens,0,32,ne,0,M.work,{bits:5}),F=!1}M.lencode=Y,M.lenbits=9,M.distcode=ne,M.distbits=5}function ce(M,H,_,W){var X,I=M.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new d.Buf8(I.wsize)),W>=I.wsize?(d.arraySet(I.window,H,_-I.wsize,I.wsize,0),I.wnext=0,I.whave=I.wsize):(W<(X=I.wsize-I.wnext)&&(X=W),d.arraySet(I.window,H,_-W,X,I.wnext),(W-=X)?(d.arraySet(I.window,H,_-W,W,0),I.wnext=W,I.whave=I.wsize):(I.wnext+=X,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=X))),0}h.inflateReset=U,h.inflateReset2=B,h.inflateResetKeep=E,h.inflateInit=function(M){return Z(M,15)},h.inflateInit2=Z,h.inflate=function(M,H){var _,W,X,I,xe,V,oe,A,O,P,le,de,Ne,Te,Ae,De,Ke,Je,ut,xt,w,fe,re,L,D=0,J=new d.Buf8(4),te=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return S;(_=M.state).mode===12&&(_.mode=13),xe=M.next_out,X=M.output,oe=M.avail_out,I=M.next_in,W=M.input,V=M.avail_in,A=_.hold,O=_.bits,P=V,le=oe,fe=T;e:for(;;)switch(_.mode){case j:if(_.wrap===0){_.mode=13;break}for(;O<16;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(2&_.wrap&&A===35615){J[_.check=0]=255&A,J[1]=A>>>8&255,_.check=p(_.check,J,2,0),O=A=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&A)<<8)+(A>>8))%31){M.msg="incorrect header check",_.mode=30;break}if((15&A)!=8){M.msg="unknown compression method",_.mode=30;break}if(O-=4,w=8+(15&(A>>>=4)),_.wbits===0)_.wbits=w;else if(w>_.wbits){M.msg="invalid window size",_.mode=30;break}_.dmax=1<<w,M.adler=_.check=1,_.mode=512&A?10:12,O=A=0;break;case 2:for(;O<16;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(_.flags=A,(255&_.flags)!=8){M.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){M.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=A>>8&1),512&_.flags&&(J[0]=255&A,J[1]=A>>>8&255,_.check=p(_.check,J,2,0)),O=A=0,_.mode=3;case 3:for(;O<32;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.head&&(_.head.time=A),512&_.flags&&(J[0]=255&A,J[1]=A>>>8&255,J[2]=A>>>16&255,J[3]=A>>>24&255,_.check=p(_.check,J,4,0)),O=A=0,_.mode=4;case 4:for(;O<16;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.head&&(_.head.xflags=255&A,_.head.os=A>>8),512&_.flags&&(J[0]=255&A,J[1]=A>>>8&255,_.check=p(_.check,J,2,0)),O=A=0,_.mode=5;case 5:if(1024&_.flags){for(;O<16;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.length=A,_.head&&(_.head.extra_len=A),512&_.flags&&(J[0]=255&A,J[1]=A>>>8&255,_.check=p(_.check,J,2,0)),O=A=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(V<(de=_.length)&&(de=V),de&&(_.head&&(w=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),d.arraySet(_.head.extra,W,I,de,w)),512&_.flags&&(_.check=p(_.check,W,de,I)),V-=de,I+=de,_.length-=de),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(V===0)break e;for(de=0;w=W[I+de++],_.head&&w&&_.length<65536&&(_.head.name+=String.fromCharCode(w)),w&&de<V;);if(512&_.flags&&(_.check=p(_.check,W,de,I)),V-=de,I+=de,w)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(V===0)break e;for(de=0;w=W[I+de++],_.head&&w&&_.length<65536&&(_.head.comment+=String.fromCharCode(w)),w&&de<V;);if(512&_.flags&&(_.check=p(_.check,W,de,I)),V-=de,I+=de,w)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;O<16;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(A!==(65535&_.check)){M.msg="header crc mismatch",_.mode=30;break}O=A=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),M.adler=_.check=0,_.mode=12;break;case 10:for(;O<32;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}M.adler=_.check=y(A),O=A=0,_.mode=11;case 11:if(_.havedict===0)return M.next_out=xe,M.avail_out=oe,M.next_in=I,M.avail_in=V,_.hold=A,_.bits=O,2;M.adler=_.check=1,_.mode=12;case 12:if(H===5||H===6)break e;case 13:if(_.last){A>>>=7&O,O-=7&O,_.mode=27;break}for(;O<3;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}switch(_.last=1&A,O-=1,3&(A>>>=1)){case 0:_.mode=14;break;case 1:if(ge(_),_.mode=20,H!==6)break;A>>>=2,O-=2;break e;case 2:_.mode=17;break;case 3:M.msg="invalid block type",_.mode=30}A>>>=2,O-=2;break;case 14:for(A>>>=7&O,O-=7&O;O<32;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if((65535&A)!=(A>>>16^65535)){M.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&A,O=A=0,_.mode=15,H===6)break e;case 15:_.mode=16;case 16:if(de=_.length){if(V<de&&(de=V),oe<de&&(de=oe),de===0)break e;d.arraySet(X,W,I,de,xe),V-=de,I+=de,oe-=de,xe+=de,_.length-=de;break}_.mode=12;break;case 17:for(;O<14;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(_.nlen=257+(31&A),A>>>=5,O-=5,_.ndist=1+(31&A),A>>>=5,O-=5,_.ncode=4+(15&A),A>>>=4,O-=4,286<_.nlen||30<_.ndist){M.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;O<3;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.lens[te[_.have++]]=7&A,A>>>=3,O-=3}for(;_.have<19;)_.lens[te[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,re={bits:_.lenbits},fe=b(0,_.lens,0,19,_.lencode,0,_.work,re),_.lenbits=re.bits,fe){M.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;De=(D=_.lencode[A&(1<<_.lenbits)-1])>>>16&255,Ke=65535&D,!((Ae=D>>>24)<=O);){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(Ke<16)A>>>=Ae,O-=Ae,_.lens[_.have++]=Ke;else{if(Ke===16){for(L=Ae+2;O<L;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(A>>>=Ae,O-=Ae,_.have===0){M.msg="invalid bit length repeat",_.mode=30;break}w=_.lens[_.have-1],de=3+(3&A),A>>>=2,O-=2}else if(Ke===17){for(L=Ae+3;O<L;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}O-=Ae,w=0,de=3+(7&(A>>>=Ae)),A>>>=3,O-=3}else{for(L=Ae+7;O<L;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}O-=Ae,w=0,de=11+(127&(A>>>=Ae)),A>>>=7,O-=7}if(_.have+de>_.nlen+_.ndist){M.msg="invalid bit length repeat",_.mode=30;break}for(;de--;)_.lens[_.have++]=w}}if(_.mode===30)break;if(_.lens[256]===0){M.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,re={bits:_.lenbits},fe=b(k,_.lens,0,_.nlen,_.lencode,0,_.work,re),_.lenbits=re.bits,fe){M.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,re={bits:_.distbits},fe=b(N,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,re),_.distbits=re.bits,fe){M.msg="invalid distances set",_.mode=30;break}if(_.mode=20,H===6)break e;case 20:_.mode=21;case 21:if(6<=V&&258<=oe){M.next_out=xe,M.avail_out=oe,M.next_in=I,M.avail_in=V,_.hold=A,_.bits=O,m(M,le),xe=M.next_out,X=M.output,oe=M.avail_out,I=M.next_in,W=M.input,V=M.avail_in,A=_.hold,O=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;De=(D=_.lencode[A&(1<<_.lenbits)-1])>>>16&255,Ke=65535&D,!((Ae=D>>>24)<=O);){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(De&&(240&De)==0){for(Je=Ae,ut=De,xt=Ke;De=(D=_.lencode[xt+((A&(1<<Je+ut)-1)>>Je)])>>>16&255,Ke=65535&D,!(Je+(Ae=D>>>24)<=O);){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}A>>>=Je,O-=Je,_.back+=Je}if(A>>>=Ae,O-=Ae,_.back+=Ae,_.length=Ke,De===0){_.mode=26;break}if(32&De){_.back=-1,_.mode=12;break}if(64&De){M.msg="invalid literal/length code",_.mode=30;break}_.extra=15&De,_.mode=22;case 22:if(_.extra){for(L=_.extra;O<L;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.length+=A&(1<<_.extra)-1,A>>>=_.extra,O-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;De=(D=_.distcode[A&(1<<_.distbits)-1])>>>16&255,Ke=65535&D,!((Ae=D>>>24)<=O);){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if((240&De)==0){for(Je=Ae,ut=De,xt=Ke;De=(D=_.distcode[xt+((A&(1<<Je+ut)-1)>>Je)])>>>16&255,Ke=65535&D,!(Je+(Ae=D>>>24)<=O);){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}A>>>=Je,O-=Je,_.back+=Je}if(A>>>=Ae,O-=Ae,_.back+=Ae,64&De){M.msg="invalid distance code",_.mode=30;break}_.offset=Ke,_.extra=15&De,_.mode=24;case 24:if(_.extra){for(L=_.extra;O<L;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}_.offset+=A&(1<<_.extra)-1,A>>>=_.extra,O-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){M.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(oe===0)break e;if(de=le-oe,_.offset>de){if((de=_.offset-de)>_.whave&&_.sane){M.msg="invalid distance too far back",_.mode=30;break}Ne=de>_.wnext?(de-=_.wnext,_.wsize-de):_.wnext-de,de>_.length&&(de=_.length),Te=_.window}else Te=X,Ne=xe-_.offset,de=_.length;for(oe<de&&(de=oe),oe-=de,_.length-=de;X[xe++]=Te[Ne++],--de;);_.length===0&&(_.mode=21);break;case 26:if(oe===0)break e;X[xe++]=_.length,oe--,_.mode=21;break;case 27:if(_.wrap){for(;O<32;){if(V===0)break e;V--,A|=W[I++]<<O,O+=8}if(le-=oe,M.total_out+=le,_.total+=le,le&&(M.adler=_.check=_.flags?p(_.check,X,le,xe-le):f(_.check,X,le,xe-le)),le=oe,(_.flags?A:y(A))!==_.check){M.msg="incorrect data check",_.mode=30;break}O=A=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;O<32;){if(V===0)break e;V--,A+=W[I++]<<O,O+=8}if(A!==(4294967295&_.total)){M.msg="incorrect length check",_.mode=30;break}O=A=0}_.mode=29;case 29:fe=1;break e;case 30:fe=-3;break e;case 31:return-4;default:return S}return M.next_out=xe,M.avail_out=oe,M.next_in=I,M.avail_in=V,_.hold=A,_.bits=O,(_.wsize||le!==M.avail_out&&_.mode<30&&(_.mode<27||H!==4))&&ce(M,M.output,M.next_out,le-M.avail_out)?(_.mode=31,-4):(P-=M.avail_in,le-=M.avail_out,M.total_in+=P,M.total_out+=le,_.total+=le,_.wrap&&le&&(M.adler=_.check=_.flags?p(_.check,X,le,M.next_out-le):f(_.check,X,le,M.next_out-le)),M.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(P==0&&le===0||H===4)&&fe===T&&(fe=-5),fe)},h.inflateEnd=function(M){if(!M||!M.state)return S;var H=M.state;return H.window&&(H.window=null),M.state=null,T},h.inflateGetHeader=function(M,H){var _;return M&&M.state?(2&(_=M.state).wrap)==0?S:((_.head=H).done=!1,T):S},h.inflateSetDictionary=function(M,H){var _,W=H.length;return M&&M.state?(_=M.state).wrap!==0&&_.mode!==11?S:_.mode===11&&f(1,H,W,0)!==_.check?-3:ce(M,H,W,W)?(_.mode=31,-4):(_.havedict=1,T):S},h.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,c,h){var d=o("../utils/common"),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],p=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],b=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];c.exports=function(k,N,T,S,j,x,v,y){var C,E,U,B,Z,Y,ne,F,ge,ce=y.bits,M=0,H=0,_=0,W=0,X=0,I=0,xe=0,V=0,oe=0,A=0,O=null,P=0,le=new d.Buf16(16),de=new d.Buf16(16),Ne=null,Te=0;for(M=0;M<=15;M++)le[M]=0;for(H=0;H<S;H++)le[N[T+H]]++;for(X=ce,W=15;1<=W&&le[W]===0;W--);if(W<X&&(X=W),W===0)return j[x++]=20971520,j[x++]=20971520,y.bits=1,0;for(_=1;_<W&&le[_]===0;_++);for(X<_&&(X=_),M=V=1;M<=15;M++)if(V<<=1,(V-=le[M])<0)return-1;if(0<V&&(k===0||W!==1))return-1;for(de[1]=0,M=1;M<15;M++)de[M+1]=de[M]+le[M];for(H=0;H<S;H++)N[T+H]!==0&&(v[de[N[T+H]]++]=H);if(Y=k===0?(O=Ne=v,19):k===1?(O=f,P-=257,Ne=p,Te-=257,256):(O=m,Ne=b,-1),M=_,Z=x,xe=H=A=0,U=-1,B=(oe=1<<(I=X))-1,k===1&&852<oe||k===2&&592<oe)return 1;for(;;){for(ne=M-xe,ge=v[H]<Y?(F=0,v[H]):v[H]>Y?(F=Ne[Te+v[H]],O[P+v[H]]):(F=96,0),C=1<<M-xe,_=E=1<<I;j[Z+(A>>xe)+(E-=C)]=ne<<24|F<<16|ge|0,E!==0;);for(C=1<<M-1;A&C;)C>>=1;if(C!==0?(A&=C-1,A+=C):A=0,H++,--le[M]==0){if(M===W)break;M=N[T+v[H]]}if(X<M&&(A&B)!==U){for(xe===0&&(xe=X),Z+=_,V=1<<(I=M-xe);I+xe<W&&!((V-=le[I+xe])<=0);)I++,V<<=1;if(oe+=1<<I,k===1&&852<oe||k===2&&592<oe)return 1;j[U=A&B]=X<<24|I<<16|Z-x|0}}return A!==0&&(j[Z+A]=M-xe<<24|64<<16|0),y.bits=X,0}},{"../utils/common":41}],51:[function(o,c,h){c.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(o,c,h){var d=o("../utils/common"),f=0,p=1;function m(D){for(var J=D.length;0<=--J;)D[J]=0}var b=0,k=29,N=256,T=N+1+k,S=30,j=19,x=2*T+1,v=15,y=16,C=7,E=256,U=16,B=17,Z=18,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ne=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ge=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ce=new Array(2*(T+2));m(ce);var M=new Array(2*S);m(M);var H=new Array(512);m(H);var _=new Array(256);m(_);var W=new Array(k);m(W);var X,I,xe,V=new Array(S);function oe(D,J,te,me,G){this.static_tree=D,this.extra_bits=J,this.extra_base=te,this.elems=me,this.max_length=G,this.has_stree=D&&D.length}function A(D,J){this.dyn_tree=D,this.max_code=0,this.stat_desc=J}function O(D){return D<256?H[D]:H[256+(D>>>7)]}function P(D,J){D.pending_buf[D.pending++]=255&J,D.pending_buf[D.pending++]=J>>>8&255}function le(D,J,te){D.bi_valid>y-te?(D.bi_buf|=J<<D.bi_valid&65535,P(D,D.bi_buf),D.bi_buf=J>>y-D.bi_valid,D.bi_valid+=te-y):(D.bi_buf|=J<<D.bi_valid&65535,D.bi_valid+=te)}function de(D,J,te){le(D,te[2*J],te[2*J+1])}function Ne(D,J){for(var te=0;te|=1&D,D>>>=1,te<<=1,0<--J;);return te>>>1}function Te(D,J,te){var me,G,we=new Array(v+1),Se=0;for(me=1;me<=v;me++)we[me]=Se=Se+te[me-1]<<1;for(G=0;G<=J;G++){var ye=D[2*G+1];ye!==0&&(D[2*G]=Ne(we[ye]++,ye))}}function Ae(D){var J;for(J=0;J<T;J++)D.dyn_ltree[2*J]=0;for(J=0;J<S;J++)D.dyn_dtree[2*J]=0;for(J=0;J<j;J++)D.bl_tree[2*J]=0;D.dyn_ltree[2*E]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function De(D){8<D.bi_valid?P(D,D.bi_buf):0<D.bi_valid&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function Ke(D,J,te,me){var G=2*J,we=2*te;return D[G]<D[we]||D[G]===D[we]&&me[J]<=me[te]}function Je(D,J,te){for(var me=D.heap[te],G=te<<1;G<=D.heap_len&&(G<D.heap_len&&Ke(J,D.heap[G+1],D.heap[G],D.depth)&&G++,!Ke(J,me,D.heap[G],D.depth));)D.heap[te]=D.heap[G],te=G,G<<=1;D.heap[te]=me}function ut(D,J,te){var me,G,we,Se,ye=0;if(D.last_lit!==0)for(;me=D.pending_buf[D.d_buf+2*ye]<<8|D.pending_buf[D.d_buf+2*ye+1],G=D.pending_buf[D.l_buf+ye],ye++,me===0?de(D,G,J):(de(D,(we=_[G])+N+1,J),(Se=Y[we])!==0&&le(D,G-=W[we],Se),de(D,we=O(--me),te),(Se=ne[we])!==0&&le(D,me-=V[we],Se)),ye<D.last_lit;);de(D,E,J)}function xt(D,J){var te,me,G,we=J.dyn_tree,Se=J.stat_desc.static_tree,ye=J.stat_desc.has_stree,ze=J.stat_desc.elems,Ge=-1;for(D.heap_len=0,D.heap_max=x,te=0;te<ze;te++)we[2*te]!==0?(D.heap[++D.heap_len]=Ge=te,D.depth[te]=0):we[2*te+1]=0;for(;D.heap_len<2;)we[2*(G=D.heap[++D.heap_len]=Ge<2?++Ge:0)]=1,D.depth[G]=0,D.opt_len--,ye&&(D.static_len-=Se[2*G+1]);for(J.max_code=Ge,te=D.heap_len>>1;1<=te;te--)Je(D,we,te);for(G=ze;te=D.heap[1],D.heap[1]=D.heap[D.heap_len--],Je(D,we,1),me=D.heap[1],D.heap[--D.heap_max]=te,D.heap[--D.heap_max]=me,we[2*G]=we[2*te]+we[2*me],D.depth[G]=(D.depth[te]>=D.depth[me]?D.depth[te]:D.depth[me])+1,we[2*te+1]=we[2*me+1]=G,D.heap[1]=G++,Je(D,we,1),2<=D.heap_len;);D.heap[--D.heap_max]=D.heap[1],(function(Be,_e){var Ce,Ee,Re,qe,dt,Mt,ft=_e.dyn_tree,nn=_e.max_code,Yl=_e.stat_desc.static_tree,el=_e.stat_desc.has_stree,Ma=_e.stat_desc.extra_bits,Ot=_e.stat_desc.extra_base,wt=_e.stat_desc.max_length,Ut=0;for(qe=0;qe<=v;qe++)Be.bl_count[qe]=0;for(ft[2*Be.heap[Be.heap_max]+1]=0,Ce=Be.heap_max+1;Ce<x;Ce++)wt<(qe=ft[2*ft[2*(Ee=Be.heap[Ce])+1]+1]+1)&&(qe=wt,Ut++),ft[2*Ee+1]=qe,nn<Ee||(Be.bl_count[qe]++,dt=0,Ot<=Ee&&(dt=Ma[Ee-Ot]),Mt=ft[2*Ee],Be.opt_len+=Mt*(qe+dt),el&&(Be.static_len+=Mt*(Yl[2*Ee+1]+dt)));if(Ut!==0){do{for(qe=wt-1;Be.bl_count[qe]===0;)qe--;Be.bl_count[qe]--,Be.bl_count[qe+1]+=2,Be.bl_count[wt]--,Ut-=2}while(0<Ut);for(qe=wt;qe!==0;qe--)for(Ee=Be.bl_count[qe];Ee!==0;)nn<(Re=Be.heap[--Ce])||(ft[2*Re+1]!==qe&&(Be.opt_len+=(qe-ft[2*Re+1])*ft[2*Re],ft[2*Re+1]=qe),Ee--)}})(D,J),Te(we,Ge,D.bl_count)}function w(D,J,te){var me,G,we=-1,Se=J[1],ye=0,ze=7,Ge=4;for(Se===0&&(ze=138,Ge=3),J[2*(te+1)+1]=65535,me=0;me<=te;me++)G=Se,Se=J[2*(me+1)+1],++ye<ze&&G===Se||(ye<Ge?D.bl_tree[2*G]+=ye:G!==0?(G!==we&&D.bl_tree[2*G]++,D.bl_tree[2*U]++):ye<=10?D.bl_tree[2*B]++:D.bl_tree[2*Z]++,we=G,Ge=(ye=0)===Se?(ze=138,3):G===Se?(ze=6,3):(ze=7,4))}function fe(D,J,te){var me,G,we=-1,Se=J[1],ye=0,ze=7,Ge=4;for(Se===0&&(ze=138,Ge=3),me=0;me<=te;me++)if(G=Se,Se=J[2*(me+1)+1],!(++ye<ze&&G===Se)){if(ye<Ge)for(;de(D,G,D.bl_tree),--ye!=0;);else G!==0?(G!==we&&(de(D,G,D.bl_tree),ye--),de(D,U,D.bl_tree),le(D,ye-3,2)):ye<=10?(de(D,B,D.bl_tree),le(D,ye-3,3)):(de(D,Z,D.bl_tree),le(D,ye-11,7));we=G,Ge=(ye=0)===Se?(ze=138,3):G===Se?(ze=6,3):(ze=7,4)}}m(V);var re=!1;function L(D,J,te,me){le(D,(b<<1)+(me?1:0),3),(function(G,we,Se,ye){De(G),P(G,Se),P(G,~Se),d.arraySet(G.pending_buf,G.window,we,Se,G.pending),G.pending+=Se})(D,J,te)}h._tr_init=function(D){re||((function(){var J,te,me,G,we,Se=new Array(v+1);for(G=me=0;G<k-1;G++)for(W[G]=me,J=0;J<1<<Y[G];J++)_[me++]=G;for(_[me-1]=G,G=we=0;G<16;G++)for(V[G]=we,J=0;J<1<<ne[G];J++)H[we++]=G;for(we>>=7;G<S;G++)for(V[G]=we<<7,J=0;J<1<<ne[G]-7;J++)H[256+we++]=G;for(te=0;te<=v;te++)Se[te]=0;for(J=0;J<=143;)ce[2*J+1]=8,J++,Se[8]++;for(;J<=255;)ce[2*J+1]=9,J++,Se[9]++;for(;J<=279;)ce[2*J+1]=7,J++,Se[7]++;for(;J<=287;)ce[2*J+1]=8,J++,Se[8]++;for(Te(ce,T+1,Se),J=0;J<S;J++)M[2*J+1]=5,M[2*J]=Ne(J,5);X=new oe(ce,Y,N+1,T,v),I=new oe(M,ne,0,S,v),xe=new oe(new Array(0),F,0,j,C)})(),re=!0),D.l_desc=new A(D.dyn_ltree,X),D.d_desc=new A(D.dyn_dtree,I),D.bl_desc=new A(D.bl_tree,xe),D.bi_buf=0,D.bi_valid=0,Ae(D)},h._tr_stored_block=L,h._tr_flush_block=function(D,J,te,me){var G,we,Se=0;0<D.level?(D.strm.data_type===2&&(D.strm.data_type=(function(ye){var ze,Ge=4093624447;for(ze=0;ze<=31;ze++,Ge>>>=1)if(1&Ge&&ye.dyn_ltree[2*ze]!==0)return f;if(ye.dyn_ltree[18]!==0||ye.dyn_ltree[20]!==0||ye.dyn_ltree[26]!==0)return p;for(ze=32;ze<N;ze++)if(ye.dyn_ltree[2*ze]!==0)return p;return f})(D)),xt(D,D.l_desc),xt(D,D.d_desc),Se=(function(ye){var ze;for(w(ye,ye.dyn_ltree,ye.l_desc.max_code),w(ye,ye.dyn_dtree,ye.d_desc.max_code),xt(ye,ye.bl_desc),ze=j-1;3<=ze&&ye.bl_tree[2*ge[ze]+1]===0;ze--);return ye.opt_len+=3*(ze+1)+5+5+4,ze})(D),G=D.opt_len+3+7>>>3,(we=D.static_len+3+7>>>3)<=G&&(G=we)):G=we=te+5,te+4<=G&&J!==-1?L(D,J,te,me):D.strategy===4||we===G?(le(D,2+(me?1:0),3),ut(D,ce,M)):(le(D,4+(me?1:0),3),(function(ye,ze,Ge,Be){var _e;for(le(ye,ze-257,5),le(ye,Ge-1,5),le(ye,Be-4,4),_e=0;_e<Be;_e++)le(ye,ye.bl_tree[2*ge[_e]+1],3);fe(ye,ye.dyn_ltree,ze-1),fe(ye,ye.dyn_dtree,Ge-1)})(D,D.l_desc.max_code+1,D.d_desc.max_code+1,Se+1),ut(D,D.dyn_ltree,D.dyn_dtree)),Ae(D),me&&De(D)},h._tr_tally=function(D,J,te){return D.pending_buf[D.d_buf+2*D.last_lit]=J>>>8&255,D.pending_buf[D.d_buf+2*D.last_lit+1]=255&J,D.pending_buf[D.l_buf+D.last_lit]=255&te,D.last_lit++,J===0?D.dyn_ltree[2*te]++:(D.matches++,J--,D.dyn_ltree[2*(_[te]+N+1)]++,D.dyn_dtree[2*O(J)]++),D.last_lit===D.lit_bufsize-1},h._tr_align=function(D){le(D,2,3),de(D,E,ce),(function(J){J.bi_valid===16?(P(J,J.bi_buf),J.bi_buf=0,J.bi_valid=0):8<=J.bi_valid&&(J.pending_buf[J.pending++]=255&J.bi_buf,J.bi_buf>>=8,J.bi_valid-=8)})(D)}},{"../utils/common":41}],53:[function(o,c,h){c.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(o,c,h){(function(d){(function(f,p){if(!f.setImmediate){var m,b,k,N,T=1,S={},j=!1,x=f.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(f);v=v&&v.setTimeout?v:f,m={}.toString.call(f.process)==="[object process]"?function(U){process.nextTick(function(){C(U)})}:(function(){if(f.postMessage&&!f.importScripts){var U=!0,B=f.onmessage;return f.onmessage=function(){U=!1},f.postMessage("","*"),f.onmessage=B,U}})()?(N="setImmediate$"+Math.random()+"$",f.addEventListener?f.addEventListener("message",E,!1):f.attachEvent("onmessage",E),function(U){f.postMessage(N+U,"*")}):f.MessageChannel?((k=new MessageChannel).port1.onmessage=function(U){C(U.data)},function(U){k.port2.postMessage(U)}):x&&"onreadystatechange"in x.createElement("script")?(b=x.documentElement,function(U){var B=x.createElement("script");B.onreadystatechange=function(){C(U),B.onreadystatechange=null,b.removeChild(B),B=null},b.appendChild(B)}):function(U){setTimeout(C,0,U)},v.setImmediate=function(U){typeof U!="function"&&(U=new Function(""+U));for(var B=new Array(arguments.length-1),Z=0;Z<B.length;Z++)B[Z]=arguments[Z+1];var Y={callback:U,args:B};return S[T]=Y,m(T),T++},v.clearImmediate=y}function y(U){delete S[U]}function C(U){if(j)setTimeout(C,0,U);else{var B=S[U];if(B){j=!0;try{(function(Z){var Y=Z.callback,ne=Z.args;switch(ne.length){case 0:Y();break;case 1:Y(ne[0]);break;case 2:Y(ne[0],ne[1]);break;case 3:Y(ne[0],ne[1],ne[2]);break;default:Y.apply(p,ne)}})(B)}finally{y(U),j=!1}}}}function E(U){U.source===f&&typeof U.data=="string"&&U.data.indexOf(N)===0&&C(+U.data.slice(N.length))}})(typeof self>"u"?d===void 0?this:d:self)}).call(this,typeof ns<"u"?ns:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Hc)),Hc.exports}var gb=xb();const bb=Fc(gb),yb=l=>{switch(l.split(".").pop()?.toLowerCase()||""){case"pdf":return"picture_as_pdf";case"csv":case"xls":case"xlsx":return"table_view";case"png":case"jpg":case"jpeg":case"gif":case"svg":return"image";case"txt":case"md":return"description";case"json":return"data_object";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}},rs=6e4,qc=200,fp=200,Hi=1e6,Yc=2e3,Vc=2e3,vb=360,Ip=12,ss=vb+Ip,wb=4,Sb=4,_b=({index:l,style:u,data:o})=>{const c=o[l];return c?r.jsx("div",{style:{...u,paddingBottom:Ip},children:r.jsx(Qp,{capture:c})}):null},jb=l=>`${(l/(1024*1024)).toFixed(2)} MB`,Nb=l=>{if(typeof l=="boolean")return l;if(typeof l=="string"){const u=l.trim().toLowerCase();if(u==="true")return!0;if(u==="false")return!1}return null},os=(l,u)=>l.length<=u?{text:l,truncated:!1}:{text:l.slice(0,u),truncated:!0},Eb=l=>!l||l.data===void 0||l.data===null?{reason:"No data to copy."}:{raw:l.data},cs=(l,u,o)=>l.length<=u?l:(o.push(`first ${u.toLocaleString()} chars`),l.slice(0,u)),Cb=l=>{const u=[];if(typeof l=="string")return{text:cs(l,Hi,u),truncated:u.length>0,reason:u.join(", ")};if(Array.isArray(l)){let c=l;l.length>Yc&&(c=l.slice(0,Yc),u.push(`first ${Yc.toLocaleString()} items`));let h="";try{h=JSON.stringify(c,null,2)}catch{h=String(c)}return h=cs(h,Hi,u),{text:h,truncated:u.length>0,reason:u.join(", ")}}if(l&&typeof l=="object"){let c=l;const h=Object.keys(l);h.length>Vc&&(c=h.slice(0,Vc).reduce((f,p)=>(f[p]=l[p],f),{}),u.push(`first ${Vc.toLocaleString()} keys`));let d="";try{d=JSON.stringify(c,null,2)}catch{d=String(c)}return d=cs(d,Hi,u),{text:d,truncated:u.length>0,reason:u.join(", ")}}return{text:cs(String(l),Hi,u),truncated:u.length>0,reason:u.join(", ")}},kb=l=>{if(typeof l=="string")return l;try{return JSON.stringify(l,null,2)}catch{return String(l)}},hp=l=>{if(!l||l.data===void 0||l.data===null||l.data==="")return{text:"",truncated:!1,language:"plain"};const u=l.data;if(typeof u=="string"){const c=u.trim(),h=c.startsWith("<")&&c.includes(">")?"html":c.startsWith("{")||c.startsWith("[")?"json":"plain",d=os(u,rs);return{text:d.text,truncated:d.truncated,language:h}}if(Array.isArray(u)){const c=u.length>qc?u.slice(0,qc):u,h=JSON.stringify(c,null,2),d=os(h,rs);return{text:d.text,truncated:d.truncated||u.length>qc,language:"json"}}if(u&&typeof u=="object"){const c=Object.keys(u);let h=u,d=!1;c.length>fp&&(d=!0,h=c.slice(0,fp).reduce((m,b)=>(m[b]=u[b],m),{}));const f=JSON.stringify(h,null,2),p=os(f,rs);return{text:p.text,truncated:p.truncated||d,language:"json"}}const o=os(String(u),rs);return{text:o.text,truncated:o.truncated,language:"plain"}},Ab=l=>{const u=[];let o=[],c="",h=!1;for(let d=0;d<l.length;d+=1){const f=l[d];h?f==='"'?l[d+1]==='"'?(c+='"',d+=1):h=!1:c+=f:f==='"'?h=!0:f===","?(o.push(c),c=""):f===`
13
- `?(o.push(c),u.push(o),o=[],c=""):f==="\r"||(c+=f)}return o.push(c),(o.length>1||o[0]!==""||u.length>0)&&u.push(o),u},zb=l=>{if(!l)return null;if(typeof l=="string"){const u=l.trim();if(!u.includes(",")||!u.includes(`
14
- `))return null;const o=Ab(u).filter(d=>d.some(f=>String(f||"").trim()!==""));if(o.length<2)return null;const c=o[0].map((d,f)=>String(d||"").trim()||`column_${f+1}`),h=o.slice(1);return c.length<2?null:{headers:c,rows:h}}if(Array.isArray(l)){if(l.length===0)return null;if(l.every(u=>u&&typeof u=="object"&&!Array.isArray(u))){const u=[];if(l.forEach(c=>{Object.keys(c).forEach(h=>{u.includes(h)||u.push(h)})}),u.length===0)return null;const o=l.map(c=>u.map(h=>c[h]??""));return{headers:u,rows:o}}if(l.every(u=>Array.isArray(u))){const u=Math.max(...l.map(c=>c.length));return{headers:Array.from({length:u},(c,h)=>`column_${h+1}`),rows:l}}return null}if(l&&typeof l=="object"){const u=Object.keys(l);return u.length===0?null:{headers:u,rows:[u.map(o=>l[o]??"")]}}return null},Tb=(l,u)=>l==null?null:typeof l=="string"?u?{content:l,mime:"text/csv",ext:"csv"}:{content:l,mime:"application/json",ext:"json"}:{content:JSON.stringify(l,null,2),mime:"application/json",ext:"json"},Rb=(l,u,o)=>{const c=new Blob([u],{type:o}),h=URL.createObjectURL(c),d=document.createElement("a");d.href=h,d.download=l,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(h)},Ob=({results:l,pinnedResults:u,isExecuting:o,isHeadful:c,runId:h,onConfirm:d,onNotify:f,onPin:p,onUnpin:m,fullWidth:b})=>{const[k,N]=z.useState(null),[T,S]=z.useState("raw"),[j,x]=z.useState("data"),[v,y]=z.useState(()=>u&&!l?"pinned":"latest"),[C,E]=z.useState("checking"),[U,B]=z.useState(!1),[Z,Y]=z.useState(!1),[ne,F]=z.useState([]),ge=z.useRef(null),ce=v==="pinned"&&u?u:l,M=z.useMemo(()=>zb(ce?.data),[ce?.data]),H=z.useMemo(()=>ce&&ce.data!==void 0&&ce.data!==null&&ce.data!==""?hp(ce):null,[ce]),_=z.useMemo(()=>ce?.screenshotUrl?`${ce.screenshotUrl}${v==="latest"?`?t=${Date.now()}`:""}`:null,[ce,v]),W=V=>{const oe=Nb(V);return oe!==null?oe?r.jsx(je,{name:"check",className:"text-xs text-blue-400"}):"":V??""},X=async()=>{Y(!0);try{const V=h?`?runId=${encodeURIComponent(h)}`:"",oe=await fetch(`/api/data/captures${V}`),A=oe.ok?await oe.json():{captures:[]};F(Array.isArray(A.captures)?A.captures:[])}catch{F([])}finally{Y(!1)}};z.useEffect(()=>{S(M?"table":"raw"),!ce?.downloads||ce.downloads.length===0?x("data"):ce?.data||x("downloads")},[ce]),z.useEffect(()=>{if(l){y("latest");return}u&&y("pinned")},[l,u]),z.useEffect(()=>{!u&&v==="pinned"&&y("latest")},[u,v]),z.useEffect(()=>{if(!c||v!=="latest")return;let V=!1;return(async()=>{try{const A=await fetch("/novnc/core/rfb.js",{method:"HEAD",cache:"no-store"});V||E(A.ok?"novnc":"native")}catch{V||E("native")}})(),()=>{V=!0}},[c,v]);const I=async(V,oe,A)=>{if(!V){f("Nothing to copy.","error");return}let O=V;try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(O);else{const P=document.createElement("textarea");P.value=O,P.style.position="fixed",P.style.left="-999999px",P.style.top="-999999px",document.body.appendChild(P),P.focus(),P.select(),document.execCommand("copy"),P.remove()}N(oe),setTimeout(()=>N(null),2e3),A?.truncatedNotice?f("Copied truncated data.","success"):O.length!==V.length&&f("Copied a truncated preview.","success")}catch(P){console.error("Copy failed:",P),f("Copy failed.","error")}};if(c&&v==="latest"){const{origin:V,hostname:oe}=window.location,A=`${V}/novnc.html?host=${oe}&path=websockify`,O=()=>{const P=ge.current;if(P){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}P.requestFullscreen?.().catch(()=>{})}};return C==="native"?r.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex flex-col items-center justify-center p-8 text-center gap-4",children:[r.jsx("div",{className:"text-[12px] font-bold uppercase tracking-widest text-white",children:"Headful Session Active"}),r.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-amber-500/80 max-w-lg leading-relaxed",children:"Figranium is not optimized for native browser windows. Please install the proper tools for stability (Xvfb, x11vnc, websockify) or simply use the Docker version."})]}):C==="checking"?r.jsx("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex items-center justify-center",children:r.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-500",children:"Checking headful viewer..."})}):r.jsxs("div",{ref:ge,className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative",children:[r.jsx("button",{type:"button",onClick:O,className:"absolute top-4 right-4 z-10 px-3 py-2 rounded-xl border border-white/20 bg-black/40 text-[9px] font-bold uppercase tracking-widest text-white/80 hover:bg-black/60 transition-all",title:"Toggle fullscreen",children:"Fullscreen"}),r.jsx("iframe",{src:A,className:"absolute inset-0 w-full h-full",title:"Headful Browser"})]})}if(!ce&&!(o&&v==="latest"))return r.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-4 opacity-20",children:[r.jsx("div",{className:"w-16 h-16 border border-white/10 rounded-full flex items-center justify-center",children:r.jsx(je,{name:"terminal",className:"text-2xl text-white"})}),r.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.3em]",children:"Ready"})]});const xe=b?"space-y-12 relative z-10 w-full":"space-y-12 relative z-10 max-w-5xl mx-auto";return r.jsxs("div",{className:xe,children:[r.jsxs("div",{className:"flex items-end justify-between border-b border-white/5 pb-10",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Preview"}),r.jsx("h2",{className:"text-xl font-mono text-white truncate max-w-xl tracking-tight italic",children:ce?.finalUrl||ce?.url||""})]}),r.jsx("div",{className:`px-4 py-2 rounded-xl text-[9px] font-bold uppercase tracking-[0.2em] ${v==="pinned"?"bg-amber-500/10 text-amber-300":o?"bg-blue-500/10 text-blue-400 animate-pulse":"bg-green-500/10 text-green-400"}`,children:v==="pinned"?"Pinned":o?"Running":"Finished"})]}),r.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-8",children:[r.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden flex flex-col min-h-[400px]",children:[r.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:[r.jsx("span",{children:"Screenshot"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-white/20",children:ce?.timestamp||"--:--:--"}),r.jsx("button",{type:"button",onClick:()=>{B(!0),X()},className:"px-3 py-2 rounded-xl border border-white/10 text-[8px] font-bold uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all",children:"View All Captures"})]})]}),r.jsx("div",{className:"relative bg-black flex-1 flex items-center justify-center overflow-hidden",children:_?r.jsx("img",{src:_,className:"absolute inset-0 w-full h-full object-contain transition-opacity duration-1000"}):r.jsx("div",{className:"text-[8px] font-bold text-white/5 uppercase tracking-widest",children:"Waiting for Frame..."})})]}),r.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col h-[400px]",children:[r.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest mb-6 border-b border-white/5 pb-4",children:"Activity Log"}),r.jsxs("div",{className:"flex-1 font-mono text-[10px] text-gray-400 space-y-2 overflow-y-auto custom-scrollbar pr-2",children:[ce?.logs?.map((V,oe)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx("span",{className:"text-white/10 shrink-0",children:"›"})," ",r.jsx("span",{children:V})]},oe)),o&&v==="latest"&&(!ce?.logs||ce?.logs.length===0)&&r.jsx("div",{className:"animate-pulse",children:"Connecting to kernel..."})]})]})]}),U&&r.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 flex items-center justify-center p-6",children:r.jsxs("div",{className:"glass-card rounded-[32px] w-full max-w-5xl max-h-[85vh] overflow-hidden flex flex-col",children:[r.jsxs("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-widest",children:"Captures"}),r.jsx("div",{className:"text-sm font-bold text-white",children:"Recordings and Screenshots"})]}),r.jsx("button",{onClick:()=>B(!1),className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all bg-white/5 border-white/10 text-white hover:bg-white/10",children:"Close"})]}),r.jsxs("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:[Z&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!Z&&ne.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!Z&&ne.length>0&&r.jsx(ys,{height:Math.min(Math.max(ss,ne.length*ss),ss*wb),width:"100%",itemCount:ne.length,itemSize:ss,overscanCount:Sb,itemData:ne,className:"custom-scrollbar",children:_b})]})]})}),r.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col relative",children:[r.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[r.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:j==="downloads"?"Downloads":"Data"}),r.jsxs("div",{className:"flex items-center gap-2",children:[ce?.downloads&&ce.downloads.length>0&&r.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["data","downloads"].map(V=>r.jsx("button",{onClick:()=>x(V),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${j===V?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:V},V))}),u&&r.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["latest","pinned"].map(V=>r.jsx("button",{onClick:()=>y(V),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${v===V?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:V},V))}),M&&j==="data"&&r.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["table","raw"].map(V=>r.jsx("button",{onClick:()=>S(V),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${T===V?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:V},V))}),v==="pinned"?r.jsx("button",{onClick:()=>{m?.(),y("latest")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-amber-200 hover:bg-white/10",title:"Unpin data",children:"Unpin"}):r.jsx("button",{onClick:()=>{if(!ce){f("No data to pin.","error");return}p?.(ce),y("pinned")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Pin data",children:u?"Update Pin":"Pin"}),j==="data"&&r.jsx("button",{onClick:()=>{const V=Tb(ce?.data,M);if(!V){f("No data to export.","error");return}const oe=`doppelganger-data-${new Date().toISOString().replace(/[:.]/g,"-")}.${V.ext}`;Rb(oe,V.content,V.mime),f(`Exported ${V.ext.toUpperCase()}.`,"success")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Export extracted data",children:"Export"}),j==="downloads"&&r.jsxs("button",{onClick:async()=>{if(!(!ce?.downloads||ce.downloads.length===0)){if(ce.downloads.length===1){const V=ce.downloads[0],oe=document.createElement("a");oe.href=V.path,oe.download=V.name,document.body.appendChild(oe),oe.click(),oe.remove(),f(`Downloading ${V.name}`,"success");return}f("Generating ZIP...","success");try{const V=new bb;for(const P of ce.downloads){const de=await(await fetch(P.path)).blob();V.file(P.name,de)}const oe=await V.generateAsync({type:"blob"}),A=URL.createObjectURL(oe),O=document.createElement("a");O.href=A,O.download=`doppelganger-downloads-${new Date().toISOString().replace(/[:.]/g,"-")}.zip`,document.body.appendChild(O),O.click(),O.remove(),URL.revokeObjectURL(A)}catch(V){console.error("Failed to zip files:",V),f("Failed to zip files.","error")}}},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:ce?.downloads?.length===1?"Download File":"Download ZIP",children:[r.jsx(je,{name:"folder_zip",className:"text-[14px]"}),ce?.downloads?.length===1?"Download":"Download ZIP"]}),j==="data"&&r.jsxs("button",{onClick:async()=>{const V=Eb(ce);if(V.reason){f(V.reason||"Data too large to copy safely.","error");return}const oe=hp(ce);let O=kb(V.raw),P=!1;oe.truncated&&(await d({message:"Preview is truncated for performance.",confirmLabel:"Copy full",cancelLabel:"Copy preview"})||(O=oe.text||"",P=!0)),O.length>Hi&&(await d({message:`Copying ${jb(O.length)} may freeze your browser.`,confirmLabel:"Copy full",cancelLabel:P?"Copy preview":"Copy truncated"})||(O=Cb(V.raw).text,P=!0)),I(O,"data",{skipSizeConfirm:!0,truncatedNotice:P})},className:`px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 ${k==="data"?"bg-green-500/10 border-green-500/20 text-green-400":"bg-white/5 border-white/10 text-white hover:bg-white/10"}`,title:"Copy extracted data",children:[k==="data"?r.jsx(je,{name:"check",className:"text-sm"}):r.jsx(je,{name:"content_copy",className:"text-sm"}),k==="data"?"Copied":"Copy"]})]})]}),H?.truncated&&r.jsx("button",{type:"button",onClick:()=>f("Preview truncated for performance.","error"),className:"absolute top-5 right-5 h-2.5 w-2.5 rounded-full bg-amber-400 shadow-[0_0_8px_rgba(251,191,36,0.6)]",title:"Preview truncated","aria-label":"Preview truncated"}),r.jsx("div",{className:"max-h-[70vh] overflow-y-auto custom-scrollbar pr-2 relative",children:(()=>{const V=ce&&ce.data!==void 0&&ce.data!==null&&ce.data!=="",oe=ce&&ce.downloads&&ce.downloads.length>0;return o&&v==="latest"&&(!ce||!V&&!oe)?r.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"Buffering data stream..."}):!ce||!V&&!oe?r.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"No data available."}):r.jsx("div",{className:"h-full",children:j==="downloads"?r.jsx("div",{className:"space-y-2",children:ce.downloads.map((A,O)=>r.jsxs("div",{className:"flex items-center justify-between bg-white/[0.02] border border-white/5 rounded-xl p-4 hover:bg-white/[0.04] transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-4 overflow-hidden pr-4",children:[r.jsx("div",{className:"p-3 bg-white/5 rounded-lg border border-white/10 shrink-0",children:r.jsx(je,{name:yb(A.name),className:"text-2xl text-white/70"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("h4",{className:"text-sm font-bold text-white truncate",children:A.name}),r.jsx("p",{className:"text-[10px] text-gray-500 truncate mt-1",children:A.url})]})]}),r.jsx("a",{href:A.path,download:A.name,className:"shrink-0 p-3 rounded-lg border border-white/10 bg-white/5 text-white/80 hover:bg-white/10 hover:text-white transition-all flex items-center justify-center",title:"Download file","aria-label":"Download file",children:r.jsx(je,{name:"download",className:"text-[18px]"})})]},O))}):M&&T==="table"?r.jsx("div",{className:"overflow-auto custom-scrollbar rounded-2xl border border-white/10",children:r.jsxs("table",{className:"min-w-full table-auto text-[10px] text-left text-white/80 font-mono",children:[r.jsx("thead",{className:"bg-white/5 text-[9px] uppercase tracking-widest text-white/50",children:r.jsx("tr",{children:M.headers.map(A=>r.jsx("th",{className:"px-3 py-2 border-b border-white/10 whitespace-nowrap",children:A},A))})}),r.jsx("tbody",{children:M.rows.map((A,O)=>r.jsx("tr",{className:"odd:bg-white/[0.02]",children:M.headers.map((P,le)=>r.jsx("td",{className:"px-3 py-2 border-b border-white/5 align-top whitespace-normal break-words",children:W(A[le])},`${O}-${le}`))},O))})]})}):r.jsx(Yi,{readOnly:!0,value:H?.text||"",language:H?.language||"plain"})})})()})]})]})},Jp=z.memo(Ob),Db=[{value:"Control",label:"Ctrl"},{value:"Shift",label:"Shift"},{value:"Alt",label:"Alt"},{value:"Meta",label:"Meta"}],Mb=["Enter","Tab","Escape","Space","Backspace","Delete","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5"].concat([...Array(10)].map((l,u)=>`${u}`)).concat(Array.from({length:26},(l,u)=>String.fromCharCode(65+u))),Ub=[{value:"replace",label:"Replace Text"},{value:"append",label:"Append Text"}],Bb=l=>{if(!l)return{modifiers:[],baseKey:""};const u=l.split("+"),o=u.pop()||"";return{modifiers:u,baseKey:o}},pp=(l,u)=>[...l.filter(Boolean),u].filter(Boolean).join("+"),mp=l=>{const u=(l||"").trim(),o=u.match(/^\{\$([\w.]+)\}$/);return o?o[1]:u},On={string:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"contains",label:"Contains"},{value:"starts_with",label:"Starts with"},{value:"ends_with",label:"Ends with"},{value:"matches",label:"Matches regex"}],number:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"gt",label:"Greater than"},{value:"gte",label:"Greater or equal"},{value:"lt",label:"Less than"},{value:"lte",label:"Less or equal"}],boolean:[{value:"is_true",label:"Is true"},{value:"is_false",label:"Is false"}]},xp=z.memo(({action:l,index:u,status:o,isDragging:c,isDragOver:h,translateY:d,variables:f,availableTasks:p,onUpdate:m,onAutoSave:b,onOpenPalette:k,onOpenContextMenu:N,onPointerDown:T,dragTransformY:S,onGenerateSelector:j,isSelected:x})=>{const[v,y]=z.useState(!1),[C,E]=z.useState(""),[U,B]=z.useState(!1),Z=z.useRef(null),[Y,ne]=z.useState(!1);z.useEffect(()=>{const H=_=>{Z.current&&!Z.current.contains(_.target)&&y(!1)};return v&&document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[v]);const F=o==="running"?"border-yellow-400/60":o==="success"?"border-green-400/60":o==="error"?"border-red-400/70":o==="skipped"?"border-gray-500/40":"",ge=H=>{const _="text-[12px]";return H==="if"||H==="else"?r.jsx(je,{name:"call_split",className:`${_} text-white`}):H==="end"?r.jsx(je,{name:"subdirectory_arrow_right",className:`${_} text-gray-500`}):H==="while"||H==="repeat"?r.jsx(je,{name:"repeat",className:`${_} text-white`}):H==="foreach"?r.jsx(je,{name:"list",className:`${_} text-white`}):H==="on_error"?r.jsx(je,{name:"warning",className:`${_} text-red-400`}):H==="set"?r.jsx(je,{name:"data_object",className:`${_} text-white`}):H==="stop"?r.jsx(je,{name:"stop",className:`${_} text-white`}):H==="click"?r.jsx(je,{name:"ads_click",className:`${_} text-white`}):H==="type"?r.jsx(je,{name:"text_format",className:`${_} text-white`}):H==="hover"?r.jsx(je,{name:"my_location",className:`${_} text-white`}):H==="press"?r.jsx(je,{name:"keyboard",className:`${_} text-white`}):H==="wait"?r.jsx(je,{name:"schedule",className:`${_} text-white`}):H==="wait_selector"?r.jsx(je,{name:"schedule",className:`${_} text-white`}):H==="scroll"?r.jsx(je,{name:"swap_vert",className:`${_} text-white`}):H==="javascript"?r.jsx(je,{name:"code",className:`${_} text-white`}):H==="csv"?r.jsx(je,{name:"table_chart",className:`${_} text-white`}):H==="merge"?r.jsx(je,{name:"layers",className:`${_} text-white`}):H==="screenshot"?r.jsx(je,{name:"photo_camera",className:`${_} text-white`}):H==="start"?r.jsx(je,{name:"play_circle",className:`${_} text-white`}):H==="navigate"?r.jsx(je,{name:"navigation",className:`${_} text-white`}):r.jsx("span",{className:"text-[9px] text-white/20",children:"|"})},ce=H=>!H||!(H instanceof HTMLElement)?!1:!!H.closest('input, textarea, select, button, a, [contenteditable="true"], [data-no-drag="true"]'),M=c?`translateY(${S||0}px)`:d?`translateY(${d}px)`:void 0;return r.jsxs("div",{id:`action-${l.id}`,"data-action-id":l.id,onPointerDown:H=>{ce(H.target)||H.button===0&&(H.preventDefault(),T(H,l.id,u))},onContextMenu:H=>N(H,l.id),className:`bg-black min-w-[280px] w-full max-w-sm mx-auto border p-5 rounded-2xl space-y-4 group/item relative transition-[transform,box-shadow,opacity,filter,background-color,border-color] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform select-none touch-none ${F||(x?"border-blue-500 ring-2 ring-blue-500/50":"border-white/20")} ${c?"ring-2 ring-white/40 scale-[1.02] shadow-[0_30px_80px_rgba(0,0,0,0.45)] opacity-85 z-20 mx-auto":""} ${h&&!c?"ring-2 ring-blue-400/60 bg-blue-500/5":""} ${l.disabled?"opacity-40 grayscale":""}`,style:{transform:M,zIndex:v?40:void 0},children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>ne(!Y),children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"text-[8px] font-bold text-white/20 font-mono tracking-tighter",children:(u+1).toString().padStart(2,"0")}),r.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:ge(l.type)}),r.jsx("button",{onClick:H=>{H.stopPropagation(),k(l.id)},className:"action-type-select text-[10px] font-bold uppercase tracking-[0.2em] text-white focus:outline-none cursor-pointer rounded focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Change action type: ${l.type}`,children:Kc.find(H=>H.type===l.type)?.label||l.type})]}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsx(je,{name:Y?"expand_less":"expand_more",className:"text-base text-gray-600"})})]}),Y&&r.jsxs(r.Fragment,{children:[(l.type==="click"||l.type==="type"||l.type==="hover"||l.type==="wait_selector"||l.type==="scroll")&&r.jsxs("div",{className:"space-y-1.5 relative",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1 block",children:l.type==="scroll"?"Selector (Optional)":"Selector"}),v&&r.jsxs("div",{ref:Z,className:"absolute right-0 top-6 z-30 w-64 bg-[#111] border border-white/10 rounded-xl shadow-2xl p-3 space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-[8px] font-bold text-gray-400 uppercase tracking-widest block",children:"Describe Element"}),r.jsx("button",{onClick:()=>y(!1),className:"text-gray-500 hover:text-white transition-colors p-1 -mr-1",title:"Close","aria-label":"Close",children:r.jsx(je,{name:"close",className:"text-[12px]"})})]}),r.jsx("input",{autoFocus:!0,value:C,onChange:H=>E(H.target.value),onKeyDown:async H=>{if(H.key==="Enter"&&C.trim()&&!U&&j){B(!0);try{await j(l.id,C),y(!1),E("")}finally{B(!1)}}},disabled:U,placeholder:"e.g. The green submit button",className:"w-full bg-white/5 border border-white/10 rounded-lg px-2 py-1.5 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-purple-500/50 transition-colors disabled:opacity-50"}),r.jsx("div",{className:"flex justify-end pt-1",children:r.jsxs("button",{onClick:async()=>{if(C.trim()&&!U&&j){B(!0);try{await j(l.id,C),y(!1),E("")}finally{B(!1)}}},disabled:U||!C.trim(),className:"bg-purple-500/20 text-purple-300 hover:bg-purple-500/30 px-3 py-1 rounded border border-purple-500/30 text-[9px] font-bold uppercase tracking-widest transition-colors disabled:opacity-50 flex items-center gap-1",children:[U?r.jsx("div",{className:"w-2.5 h-2.5 border border-purple-300/30 border-t-purple-300 rounded-full animate-spin"}):r.jsx(je,{name:"search",className:"text-[10px]"}),"Find"]})})]}),r.jsxs("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all flex items-center gap-2 relative",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(ya,{value:l.selector||"",onChange:H=>m(l.id,{selector:H}),onBlur:()=>b(),variables:f,placeholder:l.type==="scroll"?".scroll-container or leave empty":".btn-primary"})}),j&&r.jsx("button",{onClick:()=>y(!v),disabled:l.disabled,className:"text-purple-400 hover:text-purple-300 transition-colors focus:outline-none flex items-center justify-center opacity-50 hover:opacity-100 shrink-0 disabled:opacity-20 disabled:hover:opacity-20 disabled:cursor-not-allowed",title:"AI Selector Finder",children:r.jsx(je,{name:"auto_awesome",className:"text-lg"})})]})]}),l.type==="scroll"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Scroll Speed (ms)"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.key||"",onChange:H=>m(l.id,{key:H}),onBlur:()=>b(),variables:f,placeholder:"500"})})]}),(l.type==="navigate"||l.type==="type"||l.type==="wait"||l.type==="wait_selector"||l.type==="javascript"||l.type==="csv")&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:l.type==="navigate"?"URL":l.type==="type"?"Content":l.type==="wait"?"Seconds":l.type==="wait_selector"?"Timeout (Sec)":l.type==="csv"?"CSV Input":"Script"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:l.type==="javascript"?r.jsx(Yi,{value:l.value||"",onChange:H=>m(l.id,{value:H}),onBlur:()=>b(),language:"javascript",variables:f,className:"min-h-[120px]",placeholder:"return document.title"}):l.type==="csv"?r.jsx(Yi,{value:l.value||"",onChange:H=>m(l.id,{value:H}),onBlur:()=>b(),language:"plain",variables:f,className:"min-h-[120px]",placeholder:"name,age\\nAda,31"}):r.jsx(ya,{value:l.value||"",onChange:H=>m(l.id,{value:H}),onBlur:()=>b(),variables:f,placeholder:l.type==="navigate"?"https://example.com":l.type==="type"?"Search keywords":l.type==="wait"?"3":l.type==="wait_selector"?"10":"400"})}),l.type==="type"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Mode"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx("select",{value:l.typeMode||"replace",onChange:H=>{m(l.id,{typeMode:H.target.value},!0)},className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:Ub.map(H=>r.jsx("option",{value:H.value,children:H.label},H.value))})})]})]}),l.type==="screenshot"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Label (Optional)"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.value||"",onChange:H=>m(l.id,{value:H}),onBlur:()=>b(),variables:f,placeholder:"checkout-step"})})]}),l.type==="press"&&(()=>{const{modifiers:H,baseKey:_}=Bb(l.key);return r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Key"}),r.jsx("div",{className:"grid grid-cols-2 gap-1 text-[10px] text-white",children:Db.map(W=>r.jsxs("label",{className:"inline-flex items-center space-x-1",children:[r.jsx("input",{type:"checkbox",checked:H.includes(W.value),onChange:X=>{const I=X.target.checked?[...H,W.value]:H.filter(xe=>xe!==W.value);m(l.id,{key:pp(I,_)},!0)},className:"h-3 w-3 rounded border border-white/30 bg-black/80"}),r.jsx("span",{className:"uppercase text-[9px] text-white/70",children:W.label})]},W.value))}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsxs("select",{value:_,onChange:W=>m(l.id,{key:pp(H,W.target.value)},!0),className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:[r.jsx("option",{value:"",children:"Select key"}),Mb.map(W=>r.jsx("option",{value:W,children:W},W))]})})]})})(),l.type==="if"&&(()=>{const H=Object.keys(f||{}),_=mp(l.conditionVar||""),W=_&&f?.[_]?.type,X=l.conditionVarType||W||"string",I=On[X]||On.string,xe=l.conditionOp||I[0].value;return r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),r.jsx("input",{type:"text",list:`if-var-${l.id}`,value:l.conditionVar||"",onChange:V=>m(l.id,{conditionVar:V.target.value}),onBlur:()=>b(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),H.length>0&&r.jsx("datalist",{id:`if-var-${l.id}`,children:H.map(V=>r.jsx("option",{value:V},V))})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),r.jsxs("select",{value:X,onChange:V=>{const oe=V.target.value,A=On[oe]||On.string;m(l.id,{conditionVarType:oe,conditionOp:A[0].value,conditionValue:oe==="boolean"?"":l.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[r.jsx("option",{value:"string",children:"String"}),r.jsx("option",{value:"number",children:"Number"}),r.jsx("option",{value:"boolean",children:"Boolean"})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),r.jsx("select",{value:xe,onChange:V=>m(l.id,{conditionOp:V.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:I.map(V=>r.jsx("option",{value:V.value,children:V.label},V.value))})]})]}),X!=="boolean"&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),r.jsx("input",{type:X==="number"?"number":"text",value:l.conditionValue||"",onChange:V=>m(l.id,{conditionValue:V.target.value}),onBlur:()=>b(),placeholder:X==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),l.type==="while"&&(()=>{const H=Object.keys(f||{}),_=mp(l.conditionVar||""),W=_&&f?.[_]?.type,X=l.conditionVarType||W||"string",I=On[X]||On.string,xe=l.conditionOp||I[0].value;return r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),r.jsx("input",{type:"text",list:`while-var-${l.id}`,value:l.conditionVar||"",onChange:V=>m(l.id,{conditionVar:V.target.value}),onBlur:()=>b(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),H.length>0&&r.jsx("datalist",{id:`while-var-${l.id}`,children:H.map(V=>r.jsx("option",{value:V},V))})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),r.jsxs("select",{value:X,onChange:V=>{const oe=V.target.value,A=On[oe]||On.string;m(l.id,{conditionVarType:oe,conditionOp:A[0].value,conditionValue:oe==="boolean"?"":l.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[r.jsx("option",{value:"string",children:"String"}),r.jsx("option",{value:"number",children:"Number"}),r.jsx("option",{value:"boolean",children:"Boolean"})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),r.jsx("select",{value:xe,onChange:V=>m(l.id,{conditionOp:V.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:I.map(V=>r.jsx("option",{value:V.value,children:V.label},V.value))})]})]}),X!=="boolean"&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),r.jsx("input",{type:X==="number"?"number":"text",value:l.conditionValue||"",onChange:V=>m(l.id,{conditionValue:V.target.value}),onBlur:()=>b(),placeholder:X==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),l.type==="repeat"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Times"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.value||"",onChange:H=>m(l.id,{value:H}),variables:f,placeholder:"3"})})]}),l.type==="foreach"&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Selector (Optional)"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.selector||"",onChange:H=>m(l.id,{selector:H}),variables:f,placeholder:".list-item"})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable (Array Name)"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.varName||"",onChange:H=>m(l.id,{varName:H}),variables:f,placeholder:"items"})})]})]}),l.type==="set"&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable Name"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.varName||"",onChange:H=>m(l.id,{varName:H}),variables:f,placeholder:"status"})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Value"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.value||"",onChange:H=>m(l.id,{value:H}),variables:f,placeholder:"ready"})})]})]}),l.type==="merge"&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Sources"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.value||"",onChange:H=>m(l.id,{value:H}),variables:f,placeholder:"items, extraItems, {$block.output}"})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Target Variable (Optional)"}),r.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:r.jsx(ya,{value:l.varName||"",onChange:H=>m(l.id,{varName:H}),variables:f,placeholder:"allItems"})})]})]}),l.type==="stop"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Outcome"}),r.jsxs("select",{value:l.value||"success",onChange:H=>m(l.id,{value:H.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[r.jsx("option",{value:"success",children:"Success"}),r.jsx("option",{value:"error",children:"Error"})]})]}),l.type==="on_error"&&r.jsx("div",{className:"text-[8px] text-gray-600 uppercase tracking-widest",children:"Runs if any action fails."}),l.type==="start"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Task"}),r.jsxs("select",{value:l.value||"",onChange:H=>m(l.id,{value:H.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[r.jsx("option",{value:"",disabled:!0,children:"Select task"}),p.length===0&&r.jsx("option",{value:"",disabled:!0,children:"No other tasks"}),p.map(H=>r.jsx("option",{value:H.id,children:H.name||H.id},H.id))]})]})]})]})}),Lb=({isOpen:l,onClose:u,currentTask:o,onUpdateTask:c,proxyListLoaded:h,proxyList:d,initialTab:f="mode",versions:p,versionsLoading:m,onRollback:b,onPreview:k})=>{const[N,T]=Dn.useState(f);if(Dn.useEffect(()=>{l&&T(f)},[l,f]),!l)return null;const S=h&&d.length===1&&d[0]?.id==="host",j=(E,U,B,Z)=>{const Y={...o.variables};E!==U&&delete Y[E],Y[U]={type:B,value:Z},c({variables:Y})},x=E=>{const U={...o.variables};delete U[E],c({variables:U})},v=()=>{const E=`var_${Object.keys(o.variables||{}).length+1}`;j(E,E,"string","")},y=E=>{c({stealth:{...o.stealth,[E]:!o.stealth[E]}})},C=(E,U,B)=>r.jsxs("button",{onClick:()=>T(E),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all ${N===E?"bg-white text-black shadow-lg shadow-white/10":"text-gray-500 hover:text-white hover:bg-white/5"}`,children:[r.jsx(je,{name:B,className:"text-sm"}),U]});return r.jsxs("div",{className:"fixed inset-y-0 right-0 w-[450px] z-[100] flex",children:[r.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px]",onClick:u}),r.jsxs("div",{className:"relative h-full w-full bg-[#080808]/90 border-l border-white/10 backdrop-blur-2xl shadow-[-20px_0_50px_rgba(0,0,0,0.5)] flex flex-col animate-in slide-in-from-right duration-300 ease-out p-8",children:[r.jsxs("div",{className:"flex items-center justify-between mb-8",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Task Settings"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-[0.2em] mt-1",children:o.name||"Untitled Task"})]}),r.jsx("button",{onClick:u,className:"w-10 h-10 rounded-full flex items-center justify-center hover:bg-white/5 text-gray-400 hover:text-white transition-colors",children:r.jsx(je,{name:"close"})})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 mb-8 bg-black/40 p-1 rounded-2xl border border-white/5",children:[C("mode","Mode","settings_input_component"),C("variables","Vars","data_object"),C("behavior","Behavior","psychology"),C("extraction","Extract","terminal"),C("api","API","api"),C("history","History","history")]}),r.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar pr-2 -mr-2",children:[N==="mode"&&r.jsx("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Execution Mode"}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("button",{onClick:()=>c({mode:"agent"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 ${o.mode==="agent"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:r.jsx(je,{name:"smart_toy",className:"text-white/60"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold text-white",children:"Agent Mode"}),r.jsx("div",{className:"text-[9px] text-gray-500",children:"Autonomous decision making"})]})]}),r.jsxs("button",{onClick:()=>c({mode:"scrape"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 ${o.mode==="scrape"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:r.jsx(je,{name:"api",className:"text-white/60"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold text-white",children:"Scrape Mode"}),r.jsx("div",{className:"text-[9px] text-gray-500",children:"Fixed data extraction flow"})]})]})]})]})}),N==="variables"&&r.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Task Variables"}),r.jsx("button",{onClick:v,className:"px-3 py-1 rounded-lg bg-white/10 text-white text-[10px] font-bold uppercase tracking-wider hover:bg-white/20 transition-all border border-white/10",children:"+ Add Var"})]}),r.jsxs("div",{className:"space-y-3",children:[Object.entries(o.variables||{}).map(([E,U])=>r.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",defaultValue:E,onBlur:B=>{B.target.value!==E&&j(E,B.target.value,U.type,U.value)},placeholder:"Name",className:"flex-1 bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white placeholder:text-gray-700"}),r.jsxs("select",{value:U.type,onChange:B=>j(E,E,B.target.value,U.value),className:"bg-black/40 border border-white/5 rounded-xl px-2 py-2 text-[10px] font-bold uppercase text-gray-500",children:[r.jsx("option",{value:"string",children:"String"}),r.jsx("option",{value:"number",children:"Number"}),r.jsx("option",{value:"boolean",children:"Bool"})]}),r.jsx("button",{onClick:()=>x(E),className:"text-red-500/50 hover:text-red-500 p-2",children:r.jsx(je,{name:"delete",className:"text-sm"})})]}),r.jsx("div",{className:"pl-1",children:U.type==="boolean"?r.jsxs("select",{value:String(U.value),onChange:B=>j(E,E,U.type,B.target.value==="true"),className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white",children:[r.jsx("option",{value:"true",children:"True"}),r.jsx("option",{value:"false",children:"False"})]}):r.jsx("input",{type:U.type==="number"?"number":"text",value:U.value,onChange:B=>j(E,E,U.type,U.type==="number"?parseFloat(B.target.value):B.target.value),placeholder:"Default Value",className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white"})})]},E)),Object.keys(o.variables||{}).length===0&&r.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No variables defined"})})]})]}),N==="behavior"&&r.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Runtime Flags"}),r.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{label:"Stateless Execution",key:"statelessExecution",icon:"auto_delete"},{label:"Disable Recording",key:"disableRecording",icon:"videocam_off"},{label:"Rotate Proxies",key:"rotateProxies",icon:"vpn_lock",disabled:S},{label:"Rotate User Agents",key:"rotateUserAgents",icon:"person_search"},{label:"Rotate Viewport",key:"rotateViewport",icon:"screenshot_monitor"},{label:"Include Shadow DOM",key:"includeShadowDom",icon:"layers"}].map(E=>r.jsxs("button",{disabled:E.disabled,onClick:()=>c({[E.key]:!o[E.key]}),className:`flex items-center justify-between p-4 rounded-2xl border transition-all ${o[E.key]?"bg-white/10 border-white/30 text-white":"bg-white/5 border-white/5 text-gray-400 opacity-60 hover:opacity-100"} ${E.disabled?"opacity-20 cursor-not-allowed":""}`,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(je,{name:E.icon,className:"text-sm opacity-70"}),r.jsx("span",{className:"text-xs font-medium",children:E.label})]}),r.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors ${o[E.key]?"bg-white":"bg-white/10"}`,children:r.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${o[E.key]?"right-1 bg-black":"left-1 bg-white/20"}`})})]},E.key))})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Stealth & Behavior"}),r.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Human Typing",key:"naturalTyping",icon:"keyboard"},{label:"Cursor Glide",key:"cursorGlide",icon:"near_me"},{label:"Idle Moves",key:"idleMovements",icon:"mouse"},{label:"Dead Clicks",key:"deadClicks",icon:"ads_click"},{label:"Fatigue Sim",key:"fatigue",icon:"hourglass_empty"},{label:"Allow Typos",key:"allowTypos",icon:"spellcheck"},{label:"Random Clicks",key:"randomizeClicks",icon:"shuffle"},{label:"Overscroll",key:"overscroll",icon:"unfold_more"}].map(E=>r.jsxs("button",{onClick:()=>y(E.key),className:`flex flex-col gap-2 p-4 rounded-2xl border transition-all text-left ${o.stealth[E.key]?"bg-white/15 border-white/40 text-white":"bg-white/5 border-white/5 text-gray-500 opacity-60 hover:opacity-100"}`,children:[r.jsx(je,{name:E.icon,className:"text-sm opacity-70"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-tight",children:E.label})]},E.key))})]})]}),N==="extraction"&&r.jsx("div",{className:"space-y-6 h-full flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300",children:r.jsxs("div",{className:"space-y-4 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Post-Execution Script"}),r.jsxs("select",{value:o.extractionFormat||"json",onChange:E=>c({extractionFormat:E.target.value}),className:"bg-black/40 border border-white/5 rounded-lg px-2 py-1 text-[8px] font-bold uppercase text-gray-500",children:[r.jsx("option",{value:"json",children:"JSON"}),r.jsx("option",{value:"csv",children:"CSV"})]})]}),r.jsx("div",{className:"flex-1 bg-black/40 border border-white/5 rounded-2xl overflow-hidden min-h-[300px]",children:r.jsx(Yi,{language:"javascript",value:o.extractionScript||"",onChange:E=>c({extractionScript:E}),placeholder:"// Example: return { title: document.title };",className:"h-full text-[11px]"})})]})}),N==="api"&&r.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Trigger via API"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] text-gray-500",children:"Run this task from external tools using the endpoint below:"}),r.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-xl p-4 font-mono text-[10px] text-white/80 break-all border-dashed",children:["POST /api/tasks/",o.id,"/api"]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Passing Variables"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] text-gray-500",children:"You can override task variables in the request body:"}),r.jsx("div",{className:"bg-black/40 border border-white/5 rounded-xl p-4 font-mono text-[10px] text-white/60",children:r.jsx("pre",{children:JSON.stringify({variables:Object.fromEntries(Object.entries(o.variables||{}).slice(0,2).map(([E,U])=>[E,U.value]))},null,2)})})]})]})]}),N==="history"&&r.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Version History"}),m&&r.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),r.jsxs("div",{className:"space-y-2",children:[p.map(E=>r.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 flex items-center justify-between group hover:border-white/20 transition-all",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("div",{className:"text-xs font-bold text-white mb-0.5",children:new Date(E.timestamp).toLocaleString()}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/10 text-gray-400 font-bold uppercase tracking-widest",children:E.mode}),r.jsx("span",{className:"text-[9px] text-gray-600 truncate max-w-[150px]",children:E.name||"Untitled"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>k(E.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all",title:"Preview version",children:r.jsx(je,{name:"visibility",className:"text-sm"})}),r.jsx("button",{onClick:()=>b(E.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all",title:"Rollback to this version",children:r.jsx(je,{name:"restore",className:"text-sm"})})]})]},E.id)),p.length===0&&!m&&r.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No previous versions found"})})]})]})]})]})]})},Hb=new Set(["if","while","repeat","foreach","on_error"]),$p=({currentTask:l,setCurrentTask:u,tasks:o=[],editorView:c,setEditorView:h,isExecuting:d,onSave:f,onRun:p,results:m,pinnedResults:b,onConfirm:k,onNotify:N,onPinResults:T,onUnpinResults:S,onRunSnapshot:j,runId:x,onStop:v,isHeadfulOpen:y,onOpenHeadful:C,onStopHeadful:E})=>{const[U,B]=z.useState(null),[Z,Y]=z.useState(null),ne=z.useRef(null),F=z.useRef(null),[,ge]=z.useState(null),[ce,M]=z.useState(null),[H,_]=z.useState(null),[W,X]=z.useState([]),[I,xe]=z.useState(!1),[V,oe]=z.useState(!1),[A,O]=z.useState(!1),[P,le]=z.useState("mode"),de=(Q="mode")=>{le(Q),Q==="history"&&Un(),O(!0)},[Ne,Te]=z.useState(new Set),[Ae,De]=z.useState(null),[Ke,Je]=z.useState(""),[ut,xt]=z.useState(null),[w,fe]=z.useState(null),[re,L]=z.useState(null),[D,J]=z.useState(!1),[te,me]=z.useState({}),[G,we]=z.useState([]),[Se,ye]=z.useState(!1),[ze,Ge]=z.useState(!1),[Be,_e]=z.useState({x:0,y:0}),[Ce,Ee]=z.useState(1),Re=z.useRef(!1),qe=z.useRef({x:0,y:0,offsetX:0,offsetY:0}),dt=z.useRef(!1),Mt=z.useRef(null),ft=z.useRef(!1),[nn,Yl]=z.useState(!1),el=z.useRef(null),Ma=z.useRef(Ce);z.useEffect(()=>{Ma.current=Ce},[Ce]);const Ot=z.useRef([]),wt=z.useRef(-1),Ut=z.useRef(!1),Ua=z.useRef(""),Ca=z.useRef(l);z.useEffect(()=>{Ca.current=l},[l]);const Xi=z.useRef(y);z.useEffect(()=>{Xi.current=y},[y]),z.useEffect(()=>()=>{Xi.current&&E?.()},[E]);const Nt=z.useCallback(Q=>{f(Q||Ca.current,!1)},[f]),tl=()=>{try{const Q=localStorage.getItem("doppelganger.layout.leftWidthPct");if(!Q)return .3;const se=parseFloat(Q);return Number.isNaN(se)?.3:Math.min(.75,Math.max(.25,se))}catch{return .3}},Ba=Q=>{const he=Math.floor(window.innerWidth*.8);return Math.max(320,Math.min(he,Q))},[vs,Vl]=z.useState(()=>{if(typeof window>"u")return 360;const Q=tl();return Ba(Math.round(window.innerWidth*Q))}),Gl=z.useRef(!1),Zl=z.useMemo(()=>o.filter(Q=>String(Q.id||"")!==String(l.id||"")),[o,l.id]),al=Se&&G.length===1&&G[0]?.id==="host";z.useEffect(()=>{let Q=!1;return(async()=>{try{const he=await fetch("/api/settings/proxies",{credentials:"include"});if(!he.ok)throw new Error("Failed to load proxies");const ke=await he.json();if(Q)return;we(Array.isArray(ke.proxies)?ke.proxies:[])}catch{Q||we([])}finally{Q||ye(!0)}})(),()=>{Q=!0}},[]),z.useEffect(()=>{if(al&&l.rotateProxies){const Q={...l,rotateProxies:!1};u(Q),Nt(Q)}},[al,l]),z.useEffect(()=>{if(Ut.current){Ut.current=!1;return}const Q=JSON.stringify(l);if(Q===Ua.current)return;const se=setTimeout(()=>{Ua.current=Q,wt.current<Ot.current.length-1&&(Ot.current=Ot.current.slice(0,wt.current+1)),Ot.current.push(JSON.parse(Q)),wt.current=Ot.current.length-1,Ot.current.length>50&&(Ot.current.shift(),wt.current-=1)},300);return()=>clearTimeout(se)},[l]),z.useMemo(()=>{let Q=0;return l.actions.map(se=>{(se.type==="else"||se.type==="end")&&(Q=Math.max(0,Q-1));const he=Q;return(se.type==="else"||Hb.has(se.type))&&(Q+=1),he})},[l.actions]);const Xl=Q=>{const se={id:"act_"+Date.now(),type:Q,selector:"",value:""};if(Q==="set"&&(se.varName=""),Q==="merge"&&(se.varName=""),Q==="start"&&(se.value=""),Q==="type"&&(se.typeMode="replace"),Q==="if"&&(se.conditionVar="",se.conditionVarType="string",se.conditionOp="equals",se.conditionValue=""),Q==="while"&&(se.conditionVar="",se.conditionVarType="string",se.conditionOp="equals",se.conditionValue=""),Q==="wait_downloads"&&(se.value="30"),Q==="if"||Q==="while"){const he={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""},ke={...l,actions:[...l.actions,se,he]};u(ke),Nt(ke)}else{const he={...l,actions:[...l.actions,se]};u(he),Nt(he)}},ta=z.useCallback((Q,se)=>{oe(!0),Je(""),xt(Q||null),fe(se!==void 0?se:null)},[]),Kl=z.useCallback(Q=>{const se=Ca.current;if(!se)return;const he={...se,actions:se.actions.filter(ke=>ke.id!==Q)};u(he),f(he,!1)},[u,f]),Vt=z.useCallback((Q,se,he=!1)=>{if(he){const ke=Ca.current;if(!ke)return;const Ye={...ke,actions:ke.actions.map(Le=>Le.id===Q?{...Le,...se}:Le)};u(Ye),f(Ye,!1)}else u(ke=>ke?{...ke,actions:ke.actions.map(Ye=>Ye.id===Q?{...Ye,...se}:Ye)}:null)},[u,f]),Tt=(Q,se)=>{if(Q===se)return;const he=[...l.actions],ke=he.findIndex(at=>at.id===Q),Ye=he.findIndex(at=>at.id===se);if(ke===-1||Ye===-1)return;const[Le]=he.splice(ke,1);he.splice(Ye,0,Le);const tt={...l,actions:he};u(tt),Nt(tt)},Bt=async(Q,se)=>{const he=l.actions.findIndex(ke=>ke.id===Q);if(he!==-1)try{const ke=await fetch("/api/tasks/generate-selector",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({task:l,actionIndex:he,prompt:se})});if(!ke.ok){const Le=await ke.json().catch(()=>({}));throw new Error(Le.error||"Failed to generate selector")}const Ye=await ke.json();Ye.selector&&(Vt(Q,{selector:Ye.selector},!0),N("Selector generated by AI","success"))}catch(ke){throw N(ke.message||"Failed to generate selector","error"),ke}},ln=(Q,se,he,ke)=>{if(he!==void 0&&ke!==void 0&&Math.abs(Q-ke)<14)return he;const Ye=l.actions;let Le=Ye.length-1;for(let tt=0;tt<Ye.length;tt++){if(Ye[tt].id===se)continue;const at=document.getElementById(`action-${Ye[tt].id}`);if(!at)continue;const gt=at.getBoundingClientRect(),Et=gt.top+gt.height*.4;if(Q<Et){Le=tt;break}}return Le},Ql=()=>{if(ce){if(H!==null&&H!==ce.index){const Q=l.actions[H]?.id;Q&&Tt(ce.id,Q)}M(null),_(null),ne.current=null}};z.useEffect(()=>{if(!ce)return;const Q=he=>{if(ne.current!==null&&he.pointerId!==ne.current)return;if(F.current){const Le=F.current.getBoundingClientRect();he.clientY<Le.top+28&&(F.current.scrollTop-=14),he.clientY>Le.bottom-28&&(F.current.scrollTop+=14)}const ke=ce.originTop+ce.height/2,Ye=ln(he.clientY,ce.id,ce.index,ke);M(Le=>Le&&{...Le,currentY:he.clientY}),_(Ye)},se=he=>{ne.current!==null&&he.pointerId!==ne.current||Ql()};return window.addEventListener("pointermove",Q),window.addEventListener("pointerup",se),window.addEventListener("pointercancel",se),()=>{window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",se),window.removeEventListener("pointercancel",se)}},[ce,H,l.actions]);const Il=Q=>({...Q,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)}),Ki=z.useCallback((Q,se)=>{Q.preventDefault();const he=8,ke=200,Ye=190,Le=Math.min(Math.max(Q.clientX+12,he),window.innerWidth-ke-he),tt=Math.min(Math.max(Q.clientY+12,he),window.innerHeight-Ye-he);Y({id:se,x:Le,y:tt})},[]),rn=()=>Y(null);z.useEffect(()=>{if(!Z)return;const Q=he=>{he.target?.closest(".action-context-menu")||Y(null)},se=he=>{he.key==="Escape"&&Y(null)};return window.addEventListener("mousedown",Q),window.addEventListener("keydown",se),window.addEventListener("scroll",Q,!0),()=>{window.removeEventListener("mousedown",Q),window.removeEventListener("keydown",se),window.removeEventListener("scroll",Q,!0)}},[Z]),z.useEffect(()=>{if(!x||l.mode!=="agent")return;me({});const Q=new EventSource(`/api/executions/stream?runId=${encodeURIComponent(x)}`,{withCredentials:!0});return Q.onmessage=se=>{if(se.data)try{const he=JSON.parse(se.data);he&&he.actionId&&he.status&&me(ke=>({...ke,[he.actionId]:he.status}))}catch{}},Q.addEventListener("ready",()=>{}),Q.onopen=()=>{},Q.onerror=()=>{Q.close()},()=>{Q.close()}},[x,l.mode]),z.useEffect(()=>{if(typeof window>"u")return;const Q=tl();Vl(Ba(Math.round(window.innerWidth*Q)))},[]);const sn=Q=>{const se=Q.tagName.toLowerCase();return se==="input"||se==="textarea"||Q.isContentEditable||Q.closest('[data-interactive-target="true"]')};z.useEffect(()=>{const Q=se=>{if(!sn(se.target))if(se.key==="Backspace"||se.key==="Delete"){if(Ne.size>0){se.preventDefault();let he=[...l.actions];Ne.forEach(Ye=>{const Le=he.findIndex(tt=>tt.id===Ye);if(Le!==-1){const tt=he[Le];if(tt.type==="if"||tt.type==="while"){let at=1;for(let gt=Le+1;gt<he.length;gt++)if((he[gt].type==="if"||he[gt].type==="while")&&at++,he[gt].type==="end"&&at--,at===0){he.splice(gt,1);break}}he.splice(Le,1)}});const ke={...l,actions:he};u(ke),Nt(ke),Te(new Set)}}else(se.ctrlKey||se.metaKey)&&se.key==="a"&&(se.preventDefault(),Te(new Set(l.actions.map(he=>he.id))))};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[Ne,l,Nt]),z.useEffect(()=>{const Q=se=>{if((se.metaKey||se.ctrlKey)&&se.key==="k"&&(se.preventDefault(),V||ta()),(se.metaKey||se.ctrlKey)&&se.key.toLowerCase()==="z"){const he=document.activeElement;if(he){const ke=he.tagName.toLowerCase(),Ye=he.getAttribute("contenteditable")==="true";if(ke==="input"||ke==="textarea"||Ye)return}if(se.preventDefault(),se.shiftKey){if(wt.current<Ot.current.length-1){wt.current+=1;const ke=Ot.current[wt.current];Ut.current=!0,Ua.current=JSON.stringify(ke),u(ke),Nt(ke)}}else if(wt.current>0){wt.current-=1;const ke=Ot.current[wt.current];Ut.current=!0,Ua.current=JSON.stringify(ke),u(ke),Nt(ke)}}};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[V,ta,u,Nt]),z.useEffect(()=>{const Q=he=>{if(!Gl.current)return;const ke=Ba(he.clientX);Vl(ke)},se=()=>{Gl.current=!1,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("pointermove",Q),window.addEventListener("pointerup",se),window.addEventListener("pointercancel",se),()=>{window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",se),window.removeEventListener("pointercancel",se)}},[]);const Un=async()=>{if(l.id){xe(!0);try{const Q=await fetch(`/api/tasks/${l.id}/versions`);if(!Q.ok)throw new Error("Failed to load versions");const se=await Q.json();X(Array.isArray(se.versions)?se.versions:[])}catch{X([])}finally{xe(!1)}}},on=async Q=>{if(!(!l.id||!await k("Rollback to this version? Current changes will be saved as a new version.")))try{const he=await fetch(`/api/tasks/${l.id}/rollback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({versionId:Q})});if(!he.ok)throw new Error("Rollback failed");const ke=await he.json();u(ke),N("Rolled back to selected version.","success"),Un()}catch{N("Rollback failed.","error")}},cn=async Q=>{if(l.id){J(!0);try{const se=await fetch(`/api/tasks/${l.id}/versions/${Q}`);if(!se.ok)throw new Error("Failed to load version");const he=await se.json();if(!he?.snapshot)throw new Error("Missing snapshot");L({id:he.metadata?.id||Q,timestamp:he.metadata?.timestamp||Date.now(),snapshot:he.snapshot})}catch{N("Failed to load version snapshot.","error")}finally{J(!1)}}};return z.useEffect(()=>{c==="history"&&Un()},[c,l.id]),z.useEffect(()=>{if(ft.current)return;ft.current=!0;const Q=Mt.current;if(!Q)return;const se=Q.clientWidth;_e({x:(se-400)/2,y:20})},[]),z.useEffect(()=>{const Q=Mt.current;if(!Q)return;const se=he=>{if(he.ctrlKey||he.metaKey){he.preventDefault();const ke=Q.getBoundingClientRect(),Ye=he.clientX-ke.left,Le=he.clientY-ke.top,tt=Ma.current,at=he.deltaY<0?1.1:.9,gt=Math.min(2,Math.max(.25,tt*at)),Et=gt/tt;_e(It=>({x:Ye-Et*(Ye-It.x),y:Le-Et*(Le-It.y)})),Ee(gt)}else _e(ke=>({x:ke.x-he.deltaX,y:ke.y-he.deltaY}))};return Q.addEventListener("wheel",se,{passive:!1}),()=>Q.removeEventListener("wheel",se)},[]),z.useCallback((Q,se,he)=>{const ke=Q.currentTarget.getBoundingClientRect(),Ye=Q.clientY-ke.top;ne.current=Q.pointerId,Q.currentTarget.setPointerCapture(Q.pointerId),M({id:se,startY:Q.clientY,currentY:Q.clientY,height:ke.height,index:he,originTop:ke.top,pointerOffset:Ye}),_(he)},[]),r.jsxs("div",{className:"flex-1 flex overflow-hidden animate-in fade-in slide-in-from-bottom-4 duration-500 bg-black relative","data-editor-width":vs,children:[r.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 w-full pointer-events-none",children:r.jsxs("div",{className:"glass-card flex items-center justify-between p-1 px-6 border-b border-white/10 backdrop-blur-xl pointer-events-auto",children:[r.jsx("div",{className:"flex-1 overflow-hidden flex justify-center",children:r.jsx("input",{type:"text",value:l.name||"",onChange:Q=>u({...l,name:Q.target.value}),onBlur:()=>Nt(),placeholder:"Task name",className:"bg-transparent border-none text-[11px] font-bold text-white uppercase tracking-[0.25em] focus:outline-none w-full max-w-[400px] text-center placeholder:text-white/20 py-1"})}),r.jsx("div",{className:"flex items-center gap-1",children:r.jsx("button",{onClick:()=>de("history"),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/5 transition-all",title:"Version History",children:r.jsx(je,{name:"history",className:"text-base"})})})]})}),r.jsx("div",{ref:Mt,className:"flex-1 overflow-hidden relative cursor-grab active:cursor-grabbing select-none",style:{touchAction:"none"},onPointerDown:Q=>{Q.button===1||Q.button===0&&dt.current?(Q.preventDefault(),Re.current=!0,qe.current={x:Q.clientX,y:Q.clientY,offsetX:Be.x,offsetY:Be.y},Q.target.setPointerCapture?.(Q.pointerId)):Q.button===0&&!sn(Q.target)&&(De({startX:Q.clientX,startY:Q.clientY,currentX:Q.clientX,currentY:Q.clientY}),!Q.shiftKey&&!Q.ctrlKey&&!Q.metaKey&&Te(new Set),Q.target.setPointerCapture?.(Q.pointerId))},onPointerMove:Q=>{if(Re.current){const se=Q.clientX-qe.current.x,he=Q.clientY-qe.current.y;_e({x:qe.current.offsetX+se,y:qe.current.offsetY+he})}else if(Ae){if(De(Ye=>Ye?{...Ye,currentX:Q.clientX,currentY:Q.clientY}:null),!Ae)return;const se={left:Math.min(Ae.startX,Q.clientX),right:Math.max(Ae.startX,Q.clientX),top:Math.min(Ae.startY,Q.clientY),bottom:Math.max(Ae.startY,Q.clientY)},he=document.querySelectorAll("[data-action-id]"),ke=new Set(Q.shiftKey||Q.ctrlKey||Q.metaKey?Array.from(Ne):[]);he.forEach(Ye=>{const Le=Ye.getBoundingClientRect();!(Le.right<se.left||Le.left>se.right||Le.bottom<se.top||Le.top>se.bottom)&&ke.add(Ye.getAttribute("data-action-id"))}),Te(ke)}},onPointerUp:()=>{Re.current=!1,De(null)},onPointerCancel:()=>{Re.current=!1,De(null)},children:r.jsxs("div",{className:"absolute origin-top-left",style:{transform:`translate(${Be.x}px, ${Be.y}px) scale(${Ce})`},children:[r.jsx("div",{className:"absolute pointer-events-none z-0",style:{inset:"-1000vw -1000vh",backgroundImage:`radial-gradient(circle, rgba(255,255,255,0.3) ${.8/Ce}px, transparent 0)`,backgroundSize:"20px 20px"}}),r.jsxs("div",{className:"flex flex-col items-center",style:{paddingTop:"60px",minWidth:"500px"},children:[r.jsxs("div",{className:"w-[360px] bg-black border border-white/15 p-5 rounded-2xl shadow-2xl shadow-black/50 select-text cursor-auto relative z-10",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>Yl(!nn),children:[r.jsx(je,{name:"bolt",className:"text-white/40 text-base"}),r.jsx("h3",{className:"text-white/60 font-bold tracking-widest uppercase text-[10px]",children:"On Execution"}),r.jsx(je,{name:nn?"expand_less":"expand_more",className:"text-xs text-gray-600"})]}),r.jsx("button",{onClick:()=>de("mode"),className:"p-2 rounded-lg hover:bg-white/10 text-white/30 hover:text-white transition-all focus:outline-none",title:"Task Settings",children:r.jsx(je,{name:"settings",className:"text-lg"})})]}),nn&&r.jsxs("div",{className:"space-y-4 mt-4 pt-3 border-t border-white/10",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"URL"}),r.jsx("div",{className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus-within:border-white/30 transition-all",children:r.jsx(ya,{value:l.url,onChange:Q=>u({...l,url:Q}),onBlur:()=>Nt(),variables:l.variables,placeholder:"https://..."})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Wait (sec)"}),r.jsx("input",{type:"number",value:l.wait,onChange:Q=>u({...l,wait:parseFloat(Q.target.value)||0}),onBlur:()=>Nt(),className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-white/30 transition-all text-white"})]})]})]}),l.mode==="agent"&&r.jsx("div",{className:"w-px h-10 bg-white/25"}),l.mode==="agent"&&r.jsx("div",{className:"flex flex-col items-center w-full select-text cursor-auto",children:r.jsxs("div",{className:"space-y-6 w-full flex flex-col items-center relative",ref:F,children:[(()=>{const Q=(se,he,ke=0)=>{const Ye=[];let Le=se;for(;Le<he;){const tt=Le,at=l.actions[tt];if(!at){Le++;continue}if(at.type==="if"||at.type==="while"){const gt=Le;let Et=1,It=Le+1,Gt=-1;for(;It<he&&Et>0;){const Zt=l.actions[It];if((Zt.type==="if"||Zt.type==="while")&&Et++,Zt.type==="end"&&(Et--,Et===0))break;Zt.type==="else"&&Et===1&&at.type==="if"&&(Gt=It),It++}const wa=It,Sa=gt+1,Kt=Gt!==-1?Gt:wa,nl=Gt!==-1?Gt+1:-1,Qi=Gt!==-1?wa:-1;Ye.push(r.jsxs("div",{className:"flex flex-col items-center w-full",children:[r.jsx("div",{className:"w-[360px]",children:r.jsx(xp,{action:at,index:tt,isDragOver:!1,isDragging:!1,isSelected:Ne.has(at.id),status:te[at.id],translateY:0,variables:l.variables,availableTasks:Zl,onUpdate:(Zt,ca,_a)=>Vt(Zt,ca,_a),onAutoSave:Nt,onOpenPalette:ta,onOpenContextMenu:Ki,onPointerDown:(Zt,ca)=>{Zt.shiftKey||Zt.ctrlKey||Zt.metaKey?Te(_a=>{const ll=new Set(_a);return ll.has(ca)?ll.delete(ca):ll.add(ca),ll}):Te(new Set([ca]))},onGenerateSelector:Bt})}),r.jsxs("div",{className:"flex gap-16 mt-4 relative",children:[r.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[r.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:at.type==="while"?"Loop":"True"}),r.jsx("div",{className:"w-px h-6 bg-white/25"}),r.jsx("div",{className:"flex flex-col items-center gap-3",children:Q(Sa,Kt,ke+1)}),r.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[r.jsx("div",{className:"w-px h-4 bg-white/20"}),r.jsx("button",{onClick:()=>ta(void 0,Kt),className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:r.jsx(je,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]}),at.type==="if"&&r.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[r.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:"Otherwise"}),r.jsx("div",{className:"w-px h-6 bg-white/25"}),r.jsx("div",{className:"flex flex-col items-center gap-3",children:nl!==-1?Q(nl,Qi,ke+1):null}),r.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[r.jsx("div",{className:"w-px h-4 bg-white/20"}),r.jsx("button",{onClick:()=>{if(nl!==-1)ta(void 0,Qi);else{const Zt={id:"act_"+Date.now()+"_else",type:"else",selector:"",value:""},ca=[...l.actions];ca.splice(wa,0,Zt);const _a={...l,actions:ca};u(_a),Nt(_a),setTimeout(()=>ta(void 0,wa+1),50)}},className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:r.jsx(je,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]})]}),r.jsxs("div",{className:"flex flex-col items-center mt-3",children:[r.jsx("div",{className:"w-px h-2 bg-white/25"}),r.jsx("button",{onClick:()=>ta(void 0,wa+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:r.jsx(je,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),r.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},at.id)),Le=wa+1}else at.type==="end"||at.type==="else"||Ye.push(r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("div",{className:"w-[360px]",children:r.jsx(xp,{action:at,index:tt,isDragOver:!1,isDragging:!1,isSelected:Ne.has(at.id),status:te[at.id],translateY:0,variables:l.variables,availableTasks:Zl,onUpdate:(gt,Et,It)=>Vt(gt,Et,It),onAutoSave:Nt,onOpenPalette:ta,onOpenContextMenu:Ki,onPointerDown:(gt,Et)=>{gt.shiftKey||gt.ctrlKey||gt.metaKey?Te(It=>{const Gt=new Set(It);return Gt.has(Et)?Gt.delete(Et):Gt.add(Et),Gt}):Te(new Set([Et]))},onGenerateSelector:Bt})}),Le<he-1&&l.actions[Le+1]?.type!=="end"&&r.jsxs("div",{className:"flex flex-col items-center my-1",children:[r.jsx("div",{className:"w-px h-2 bg-white/25"}),r.jsx("button",{onClick:()=>ta(void 0,tt+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:r.jsx(je,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),r.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},at.id)),Le++}return Ye};return Q(0,l.actions.length)})(),r.jsxs("div",{className:"pt-2 flex flex-col items-center",children:[r.jsx("div",{className:"w-px h-6 bg-white/10"}),r.jsxs("button",{onClick:()=>ta(),className:"w-[360px] bg-[#0a0a0a] border border-dashed border-white/15 rounded-2xl p-6 hover:border-white/30 hover:bg-white/[0.03] transition-all flex flex-col items-center justify-center gap-2 group cursor-pointer",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-white/5 group-hover:bg-white/10 transition-all flex items-center justify-center",children:r.jsx(je,{name:"add",className:"text-2xl text-gray-500 group-hover:text-white transition-colors"})}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[0.2em] text-gray-500 group-hover:text-gray-300 transition-colors",children:"Add Action"})]})]})]})})]})]})}),r.jsxs("div",{className:"absolute bottom-24 left-6 z-30 flex flex-col gap-1 bg-[#111] border border-white/10 rounded-xl p-1 shadow-xl",children:[r.jsx("button",{onClick:()=>{const Q=Math.min(2,Ce*1.2);Ee(Q)},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold",title:"Zoom In",children:"+"}),r.jsxs("div",{className:"text-[8px] text-center text-gray-500 font-bold select-none",children:[Math.round(Ce*100),"%"]}),r.jsx("button",{onClick:()=>{const Q=Math.max(.25,Ce*.8);Ee(Q)},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold",title:"Zoom Out",children:"−"}),r.jsx("button",{onClick:()=>{Ee(1);const Q=Mt.current,se=Q?Q.clientWidth:1e3;_e({x:(se-400)/2,y:20})},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center",title:"Reset View",children:r.jsx(je,{name:"fit_screen",className:"text-sm"})})]}),Ae&&r.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 overflow-hidden",children:r.jsx("div",{className:"absolute bg-blue-500/10 border border-blue-400",style:{left:Math.min(Ae.startX,Ae.currentX),top:Math.min(Ae.startY,Ae.currentY),width:Math.abs(Ae.currentX-Ae.startX),height:Math.abs(Ae.currentY-Ae.startY)}})}),Z&&(()=>{const Q=l.actions.findIndex(he=>he.id===Z.id),se=l.actions[Q];return se?r.jsxs("div",{className:"action-context-menu fixed z-50 w-[200px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:Z.x,top:Z.y},children:[r.jsx("button",{onClick:()=>{Vt(se.id,{disabled:!se.disabled},!0),rn()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:se.disabled?"Enable":"Disable"}),r.jsx("button",{onClick:()=>{Kl(se.id),rn()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400",children:"Delete"}),r.jsx("button",{onClick:()=>{ge(Il(se)),Kl(se.id),rn()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Cut"}),r.jsx("button",{onClick:()=>{ge(Il(se)),rn()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Copy"}),r.jsx("button",{onClick:()=>{const he=Il(se),ke=[...l.actions];ke.splice(Q+1,0,he),u({...l,actions:ke}),rn()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Duplicate"})]}):null})(),r.jsx(nb,{open:V,query:Ke,onQueryChange:Je,onClose:()=>oe(!1),onSelect:Q=>{if(ut)Q==="if"?Vt(ut,{type:Q,conditionVar:"",conditionVarType:"string",conditionOp:"equals",conditionValue:""},!0):Q==="while"?Vt(ut,{type:Q,conditionVar:"",conditionVarType:"string",conditionOp:"equals",conditionValue:""},!0):Vt(ut,{type:Q},!0);else if(w!==null){const se={id:"act_"+Date.now(),type:Q,selector:"",value:""};Q==="set"&&(se.varName=""),Q==="merge"&&(se.varName=""),Q==="start"&&(se.value=""),Q==="type"&&(se.typeMode="replace"),Q==="if"&&(se.conditionVar="",se.conditionVarType="string",se.conditionOp="equals",se.conditionValue=""),Q==="while"&&(se.conditionVar="",se.conditionVarType="string",se.conditionOp="equals",se.conditionValue=""),Q==="wait_downloads"&&(se.value="30");const he=[...l.actions];if(Q==="if"||Q==="while"){const Ye={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""};he.splice(w,0,se,Ye)}else he.splice(w,0,se);const ke={...l,actions:he};u(ke),Nt(ke)}else Xl(Q);oe(!1),fe(null)}}),r.jsxs("div",{className:`fixed top-0 right-0 h-full w-[600px] max-w-[90vw] bg-[#080808] border-l border-white/10 shadow-2xl transition-transform duration-500 ease-in-out z-40 transform ${ze?"translate-x-0":"translate-x-full"}`,children:[r.jsx("button",{onClick:()=>Ge(!ze),className:"absolute top-1/2 -left-8 -translate-y-1/2 w-8 h-24 bg-[#111] border border-r-0 border-white/10 rounded-l-xl flex items-center justify-center cursor-pointer shadow-[-8px_0_15px_rgba(0,0,0,0.5)] transition-all hover:bg-white/5 hover:w-10 hover:-left-10",children:r.jsx(je,{name:"drag_indicator",className:`text-white/30 text-xl transition-transform duration-500 ${ze?"rotate-180":""}`})}),r.jsx("div",{className:"h-full w-full overflow-y-auto custom-scrollbar p-6",children:r.jsx(Jp,{results:m,pinnedResults:b,isExecuting:d,isHeadful:y,runId:x,onConfirm:k,onNotify:N,onPin:T,onUnpin:S,fullWidth:!0})})]}),re&&r.jsx("div",{className:"fixed inset-0 z-[210] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:r.jsxs("div",{className:"glass-card w-full max-w-6xl rounded-[32px] border border-white/10 p-8 shadow-2xl flex flex-col max-h-[90vh]",children:[r.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Task Snapshot"}),r.jsx("div",{className:"text-lg font-bold text-white",children:re.snapshot.name}),r.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(re.timestamp).toLocaleString()," | ",re.snapshot.mode]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>L(null),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Close"}),r.jsx("button",{onClick:()=>{j&&j(re.snapshot),L(null)},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white text-black hover:bg-white/90 transition-all",children:"Run Version"})]})]}),r.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-6 overflow-y-auto custom-scrollbar pr-2 flex-1 min-h-0",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Snapshot JSON"}),r.jsx(Yi,{readOnly:!0,value:JSON.stringify(re.snapshot,null,2),language:"json",className:"min-h-[320px]"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"}),r.jsx("div",{className:"glass-card rounded-2xl p-6 border border-white/10 text-[10px] text-gray-500",children:"No output captured for this snapshot yet. Run this version to see results."})]})]})]})}),y&&(()=>{const{origin:Q,hostname:se}=window.location,he=`${Q}/novnc.html?host=${se}&path=websockify`,ke=()=>{const Ye=el.current;if(Ye){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}Ye.requestFullscreen?.().catch(()=>{})}};return r.jsx("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-md flex items-center justify-center p-8 pointer-events-auto",children:r.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[800px] bg-black/60 backdrop-blur-3xl border border-white/20 rounded-[32px] shadow-2xl overflow-hidden flex flex-col",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between px-6 py-4 border-b border-white/10 bg-black/20 gap-4",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-white",children:"Active Browser Session"})}),r.jsx("span",{className:"text-[10px] text-amber-500/80 max-w-md hidden sm:block",children:"Figranium is not optimized for native browser windows. Please install the proper tools for stability (Xvfb, x11vnc, websockify) or use Docker."})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:ke,className:"p-2 text-white/60 hover:text-white transition-colors",title:"Toggle fullscreen",children:r.jsx(je,{name:"fullscreen",className:"text-[16px]"})}),r.jsx("button",{onClick:()=>E?.(),className:"p-2 text-white/60 hover:text-white transition-colors",title:"Close Browser",children:r.jsx(je,{name:"close",className:"text-[16px]"})})]})]}),r.jsx("div",{ref:el,className:"flex-1 relative bg-black",children:r.jsx("iframe",{src:he,className:"absolute inset-0 w-full h-full border-0",title:"Headful Browser"})})]})})})(),r.jsxs("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-[#111] border border-white/10 p-2 rounded-3xl shadow-2xl backdrop-blur-xl",children:[r.jsxs("button",{onClick:()=>{Ge(!0),p()},disabled:d||y,className:"shine-effect bg-white text-black px-8 py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase transition-all shadow-xl shadow-white/5 flex items-center justify-center gap-3 disabled:opacity-50 disabled:cursor-not-allowed min-w-[200px]",children:[d?r.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):r.jsx(je,{name:"play_arrow",className:"text-sm text-black"}),r.jsx("span",{children:d?"Running...":"Run Task"})]}),d&&r.jsx("button",{onClick:()=>v?.(),className:"w-12 h-12 rounded-2xl border border-white/10 text-white/80 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center",title:"Stop task","aria-label":"Stop task",children:r.jsx(je,{name:"stop",className:"text-base"})}),r.jsxs("button",{onClick:()=>{y?E?.():C?.(l.url||"https://www.google.com")},disabled:d,className:`px-4 h-12 rounded-2xl border text-[9px] font-bold uppercase tracking-widest transition-all flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed ${y?"border-blue-500/30 bg-blue-500/20 text-blue-400 hover:bg-blue-500/30":"border-white/10 text-white/80 hover:text-white hover:bg-white/10"}`,title:y?"Stop headful browser":"Open browser to log in",children:[r.jsx(je,{name:y?"stop":"open_in_browser",className:"text-base"}),y?"Close Browser":"Open Browser"]})]}),r.jsx(Lb,{isOpen:A,onClose:()=>O(!1),currentTask:l,onUpdateTask:Q=>{const se={...l,...Q};u(se),Nt(se)},proxyListLoaded:Se,proxyList:G,initialTab:P,versions:W,versionsLoading:I,onRollback:on,onPreview:cn})]})},qb=({config:l,onConfirm:u})=>{const[o,c]=z.useState(l.startEditing||!1),[h,d]=z.useState(l.startEditing&&l.value||""),[f,p]=z.useState(!1),m=()=>{d(l.value||""),p(!1),c(!0)},b=()=>{c(!1),d(""),p(!1)},k=async()=>{const S=h.trim();await l.onSave(S),c(!1)},N=async()=>{l.onRegenerate&&await l.onRegenerate()},T=l.loading?"Loading...":l.value?"••••••••••••••••••••••••••••••••••••••••":"No key set";return r.jsxs("div",{className:"flex flex-col gap-4 py-4 border-b border-white/5 last:border-0",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-blue-400 overflow-hidden",children:l.iconUrl?r.jsx("img",{src:l.iconUrl,alt:l.name,className:"w-6 h-6 object-contain"}):l.iconComponent?r.jsx(l.iconComponent,{className:"w-5 h-5"}):r.jsx(je,{name:l.icon||"key",className:"text-xl"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h4",{className:"text-sm font-bold text-white uppercase tracking-widest",children:l.name}),l.badge&&r.jsx("span",{className:`text-[8px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full ${l.badge==="Primary"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-white/10 text-white/50 border border-white/10"}`,children:l.badge})]}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:l.description})]})]}),o?r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex-1 flex items-center gap-3 rounded-2xl bg-black/40 border border-white/30 focus-within:border-white px-4 py-2 transition-all",children:[r.jsx("input",{type:f?"text":"password",value:h,onChange:S=>d(S.target.value),disabled:l.saving,placeholder:"Enter new API key...",className:"flex-1 bg-transparent text-[10px] text-white font-mono focus:outline-none",autoFocus:!0}),r.jsx("button",{onClick:()=>p(!f),type:"button",className:"p-2 rounded-xl text-white/50 hover:text-white hover:bg-white/10 transition-all",title:f?"Hide value":"Show value","aria-label":f?"Hide value":"Show value",children:r.jsx(je,{name:f?"visibility_off":"visibility",className:"text-base"})})]}),r.jsx("button",{onClick:b,disabled:l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-transparent border border-white/20 text-white hover:bg-white/10 transition-all disabled:opacity-50",children:"Cancel"}),r.jsxs("button",{onClick:k,disabled:l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-blue-500 text-white hover:bg-blue-400 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[r.jsx(je,{name:"save",className:"text-base"}),l.saving?"Saving...":"Save"]})]}):r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex-1 rounded-2xl bg-black/40 border border-white/10 px-4 py-3 font-mono text-[10px] text-blue-200/80 break-all min-h-[44px] flex items-center",children:r.jsx("span",{className:"opacity-80 select-none",children:T})}),!l.readOnly&&r.jsxs("button",{onClick:m,disabled:l.loading||l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white/10 text-white hover:bg-white/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[r.jsx(je,{name:"edit",className:"text-base"}),"Edit"]}),l.onRegenerate&&r.jsxs("button",{onClick:N,disabled:l.loading||l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all disabled:opacity-50 disabled:hover:scale-100 disabled:cursor-not-allowed flex items-center gap-2",children:[r.jsx(je,{name:"autorenew",className:"text-base"}),l.saving?"Generating...":"Regenerate"]}),l.showCopyButton&&l.value&&r.jsx(Kp,{text:l.value,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",iconClassName:"text-base"}),l.onDelete&&r.jsx("button",{onClick:async()=>{(u?await u(`Are you sure you want to delete the ${l.name}?`):confirm(`Are you sure you want to delete the ${l.name}?`))&&await l.onDelete?.()},disabled:l.loading||l.saving,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-red-400 hover:bg-red-500/20 hover:border-red-500/30 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:"Delete Key","aria-label":"Delete Key",children:r.jsx(je,{name:"delete",className:"text-base"})})]})]})},Yb=({keys:l,availableProviders:u,onAddProvider:o,onConfirm:c})=>{const[h,d]=z.useState(!1);return z.useEffect(()=>{if(h){document.body.style.overflow="hidden";const f=document.querySelector("main");f&&(f.style.overflow="hidden")}else{document.body.style.overflow="";const f=document.querySelector("main");f&&(f.style.overflow="")}return()=>{document.body.style.overflow="";const f=document.querySelector("main");f&&(f.style.overflow="")}},[h]),r.jsxs("div",{className:"glass-card p-8 rounded-[40px]",children:[r.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-bold text-white uppercase tracking-widest",children:"API Keys"}),r.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-widest mt-1",children:"Manage external integrations and API access"})]}),u&&u.length>0&&o&&r.jsxs("div",{children:[r.jsxs("button",{onClick:()=>d(!0),className:"px-6 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-all flex items-center gap-2 border border-blue-500/10",children:[r.jsx(je,{name:"add",className:"text-base"}),"Add API Key"]}),h&&Kg.createPortal(r.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md animate-in fade-in duration-200",style:{position:"fixed",top:0,left:0,right:0,bottom:0},children:r.jsxs("div",{className:"glass-card max-w-2xl w-full p-10 rounded-[40px] shadow-2xl relative border border-white/10 animate-in zoom-in-95 duration-300 bg-gray-900/80",children:[r.jsx("button",{onClick:()=>d(!1),className:"absolute top-6 right-6 p-3 rounded-2xl text-white/50 hover:text-white hover:bg-white/10 transition-all","aria-label":"Close",children:r.jsx(je,{name:"close",className:"text-2xl"})}),r.jsx("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:"Select Provider"}),r.jsx("p",{className:"text-sm text-white/50 mb-8",children:"Choose an AI provider to add to your workspace."}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:u.map(f=>r.jsxs("button",{onClick:()=>{f.disabled||(o(f.id),d(!1))},disabled:f.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${f.disabled?"border-white/5 bg-white/5 opacity-40 cursor-not-allowed grayscale":"border-white/10 hover:border-blue-400/30 hover:bg-blue-500/5 cursor-pointer group"}`,children:[r.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${f.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:f.iconUrl?r.jsx("img",{src:f.iconUrl,alt:f.name,className:"w-8 h-8 object-contain drop-shadow-md"}):f.iconComponent?r.jsx(f.iconComponent,{className:"w-6 h-6 text-white"}):r.jsx(je,{name:"api",className:"text-xl text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-base font-bold text-white mb-1",children:f.name}),r.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:f.disabled?"Coming Soon":"Available"})]})]},f.id))})]})}),document.body)]})]}),r.jsx("div",{className:"flex flex-col",children:l.map(f=>r.jsx(qb,{config:f,onConfirm:c},f.id))})]})},Vb=({onClearStorage:l})=>r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:r.jsx(je,{name:"delete",className:"text-xl"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Storage"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Manage stored data"})]})]}),r.jsxs("div",{className:"flex gap-4",children:[r.jsx("button",{onClick:()=>l("screenshots"),className:"flex-1 px-6 py-4 bg-red-500/5 border border-red-500/10 text-red-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-red-500/10 transition-all",children:"Clear Captures"}),r.jsx("button",{onClick:()=>l("cookies"),className:"flex-1 px-6 py-4 bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-yellow-500/10 transition-all",children:"Reset Cookies"})]})]}),Gb=72,Fp=6,us=Gb+Fp,Zb=5,Xb=2,Kb=({index:l,style:u,data:o})=>{const c=o.captures[l];return c?r.jsx("div",{style:{...u,paddingBottom:Fp},children:r.jsxs("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:c.type==="recording"?"Recording":"Screenshot"}),r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:c.name})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("a",{href:c.url,target:"_blank",rel:"noreferrer",className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all","aria-label":`Open ${c.name}`,children:"Open"}),r.jsx("button",{onClick:()=>o.onDelete(c.name),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all",children:"Delete"})]})]})}):null},Qb=({captures:l,loading:u,onRefresh:o,onDelete:c})=>{const h=Math.min(Math.max(us,l.length*us),us*Zb),d=z.useMemo(()=>({captures:l,onDelete:c}),[l,c]);return r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Captures"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Recordings and screenshots"})]}),r.jsx("button",{onClick:o,disabled:u,className:"px-4 py-2 border border-white/10 text-[9px] font-bold rounded-xl uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all disabled:opacity-50",children:"Refresh"})]}),u&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!u&&l.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!u&&l.length>0&&r.jsx(ys,{height:h,width:"100%",itemCount:l.length,itemSize:us,overscanCount:Xb,itemData:d,children:Kb})]})},Gc=l=>`${l.name}|${l.domain||""}|${l.path||""}|${l.expires||""}`,gp=l=>{if(!l)return!1;let u=0;for(let o=0;o<l.length;o+=1){const c=l.charCodeAt(o);(c===9||c===10||c===13||c>=32&&c<=126)&&(u+=1)}return u/l.length>=.85},Ib=l=>{if(!l)return null;if(/%[0-9A-Fa-f]{2}/.test(l))try{const u=decodeURIComponent(l);if(u!==l&&gp(u))return{value:u,kind:"URL"}}catch{}if(/^[A-Za-z0-9+/=]+$/.test(l)&&l.length>=12&&l.length%4===0)try{const u=atob(l);if(u&&gp(u))return{value:u,kind:"Base64"}}catch{}return null},Jb=({cookies:l,originsCount:u,loading:o,onClear:c,onDelete:h})=>{const[d,f]=z.useState({}),[p,m]=z.useState({}),b=T=>{const S=Gc(T);f(j=>({...j,[S]:!j[S]}))},k=T=>{const S=Gc(T);m(j=>({...j,[S]:!j[S]}))},N=z.useMemo(()=>l.map(T=>{const S=Gc(T),j=T.value||"";return{cookie:T,key:S,value:j,decodedCandidate:Ib(j)}}),[l]);return r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:r.jsx(je,{name:"database",className:"text-xl"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Cookies"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Browser storage state"})]})]}),r.jsx("button",{onClick:c,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 hover:bg-yellow-500/10 transition-all",children:"Clear Cookies"})]}),o&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading data..."}),!o&&l.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No cookies found."}),r.jsx("div",{className:"space-y-3",children:N.map(({cookie:T,key:S,value:j,decodedCandidate:x})=>{const v=!!d[S],y=!!x&&!!p[S],C=y&&x?x.value:j,E=v||C.length<=120?C:`${C.slice(0,120)}...`;return r.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:T.name}),r.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[T.domain||"local"," | ",T.path||"/",T.expires?` | ${new Date(T.expires*1e3).toLocaleString()}`:""]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[x&&r.jsx("button",{onClick:()=>k(T),className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all",children:y?"Show Raw":`Decode ${x.kind}`}),r.jsx("button",{onClick:()=>h(T),className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all",children:"Delete"})]})]}),r.jsx("div",{onClick:()=>b(T),className:"cursor-pointer rounded-xl bg-black/40 border border-white/10 px-3 py-2 font-mono text-[10px] text-blue-200/80 whitespace-pre-wrap break-words",title:"Click to expand/collapse",children:E||"(empty)"})]},S)})}),!o&&u>0&&r.jsxs("div",{className:"pt-2 text-[8px] text-gray-600 uppercase tracking-widest",children:["Origins stored: ",u]})]})},$b=({tab:l,onTabChange:u})=>r.jsxs("div",{className:"flex items-end justify-between mb-8",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-purple-500 uppercase tracking-[0.4em]",children:"System"}),r.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Settings"})]}),r.jsx("div",{className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["system","data","proxies"].map(o=>r.jsx("button",{onClick:()=>u(o),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all ${l===o?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:o},o))})]}),Fb=({proxies:l,defaultProxyId:u,includeDefaultInRotation:o,rotationMode:c,loading:h,onRefresh:d,onAdd:f,onImport:p,onUpdate:m,onDelete:b,onDeleteMultiple:k,onSetDefault:N,onToggleIncludeDefault:T,onRotationModeChange:S})=>{const[j,x]=z.useState(""),[v,y]=z.useState(""),[C,E]=z.useState(""),[U,B]=z.useState(""),[Z,Y]=z.useState(!1),[ne,F]=z.useState(""),[ge,ce]=z.useState(null),[M,H]=z.useState(""),[_,W]=z.useState(""),[X,I]=z.useState(""),[xe,V]=z.useState(""),[oe,A]=z.useState(!1),[O,P]=z.useState(""),[le,de]=z.useState(""),[Ne,Te]=z.useState(new Set),[Ae,De]=z.useState(null),Ke=z.useRef(null),Je=()=>{j.trim()&&(f({server:j.trim(),username:v.trim()||void 0,password:C.trim()||void 0,label:U.trim()||void 0,isRotatingPool:Z,estimatedPoolSize:ne?parseInt(ne,10):void 0}),x(""),y(""),E(""),B(""),Y(!1),F(""))},ut=G=>{ce(G.id),H(G.server),W(G.username||""),I(""),V(G.label||""),A(!!G.isRotatingPool),P(G.estimatedPoolSize?String(G.estimatedPoolSize):"")},xt=()=>{ce(null),H(""),W(""),I(""),V(""),A(!1),P("")},w=()=>{!ge||!M.trim()||(m(ge,{server:M.trim(),username:_.trim()||void 0,password:X.trim()||void 0,label:xe.trim()||void 0,isRotatingPool:oe,estimatedPoolSize:O?parseInt(O,10):void 0}),xt())},fe=G=>{const we=G.trim();if(!we)return null;if(we.includes("://"))return{server:we};const Se=we.split(":");if(Se.length<2)return null;const ye=Se[0]?.trim(),ze=Se[1]?.trim();if(!ye||!ze)return null;const Ge=Se[2]?Se[2].trim():"",Be=Se.length>3?Se.slice(3).join(":").trim():"";return{server:`${ye}:${ze}`,username:Ge||void 0,password:Be||void 0}},re=async G=>{const we=Array.from(G.target.files||[]);if(we.length)try{const ze=(await Promise.all(we.map(Ge=>Ge.text()))).join(`
15
- `).split(/\r?\n/).flatMap(Ge=>Ge.split(/[,;]+/)).map(fe).filter(Boolean);if(ze.length===0){de("No valid proxies found in file.");return}de(""),p(ze)}catch{de("Failed to read file.")}finally{Ke.current&&(Ke.current.value="")}},L=(G,we)=>{Te(Se=>{const ye=new Set(Se);if(we?.shiftKey&&Ae){const ze=l.filter(_e=>_e.id!=="host"),Ge=ze.findIndex(_e=>_e.id===Ae),Be=ze.findIndex(_e=>_e.id===G);if(Ge!==-1&&Be!==-1){const _e=Math.min(Ge,Be),Ce=Math.max(Ge,Be);for(let Ee=_e;Ee<=Ce;Ee++)ye.add(ze[Ee].id);return ye}}return ye.has(G)?ye.delete(G):ye.add(G),ye}),De(G)},D=()=>{const G=l.filter(we=>we.id!=="host");Ne.size>=G.length&&G.length>0?Te(new Set):Te(new Set(G.map(we=>we.id)))},J=()=>{Ne.size>0&&(k(Array.from(Ne)),Te(new Set))},te=l.filter(G=>G.id!=="host"),me=te.length>0&&Ne.size>=te.length;return r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:r.jsx(je,{name:"security",className:"text-xl"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Proxies"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Set defaults and rotate per task"})]}),r.jsx("div",{className:"ml-auto",children:r.jsxs("button",{onClick:d,disabled:h,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all disabled:opacity-50 inline-flex items-center gap-2",children:[r.jsx(je,{name:"sync",className:`text-base ${h?"animate-spin":""}`}),"Refresh"]})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx("input",{type:"text",placeholder:"Proxy server (host:port or scheme://host:port)",value:j,onChange:G=>x(G.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy server address"}),r.jsx("input",{type:"text",placeholder:"Label (optional)",value:U,onChange:G=>B(G.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy label"}),r.jsx("input",{type:"text",placeholder:"Username (optional)",value:v,onChange:G=>y(G.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy username"}),r.jsx("input",{type:"password",placeholder:"Password (optional)",value:C,onChange:G=>E(G.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy password"}),r.jsxs("label",{className:"flex items-center gap-3 px-4 py-3 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:Z,onChange:G=>Y(G.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),r.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),Z&&r.jsx("input",{type:"number",placeholder:"Estimated size (optional)",value:ne,onChange:G=>F(G.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:Je,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all",children:"Add Proxy"}),r.jsx("button",{onClick:()=>Ke.current?.click(),className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 text-white hover:bg-white/5 transition-all",children:"Import"}),r.jsx("button",{onClick:()=>N("host"),className:`px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 transition-all ${u?"text-white hover:bg-white/5":"bg-white/10 text-white"}`,children:"Use Host IP"})]}),(Ne.size>0||te.length>0)&&r.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.02] border border-white/5",children:[r.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[r.jsx("input",{type:"checkbox",checked:me,onChange:D,disabled:te.length===0,className:"w-4 h-4 rounded border-white/20 bg-transparent disabled:opacity-50"}),r.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white transition-colors",children:Ne.size>0?`${Ne.size} Selected`:"Select All"})]}),Ne.size>0&&r.jsxs("button",{onClick:J,className:"px-4 py-2 rounded-xl bg-red-500/10 border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-400 hover:bg-red-500/20 transition-all inline-flex items-center gap-2",children:[r.jsx(je,{name:"delete",className:"text-base"}),"Delete Selected"]})]}),r.jsx("input",{ref:Ke,type:"file",accept:".txt,text/plain",onChange:re,className:"hidden"}),le&&r.jsx("div",{className:"text-[9px] text-red-400 uppercase tracking-widest",children:le}),r.jsxs("label",{className:"flex items-center justify-between gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all group",children:[r.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Rotation mode"}),r.jsxs("select",{value:c,onChange:G=>S(G.target.value==="random"?"random":"round-robin"),className:"bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[10px] text-white uppercase tracking-widest","aria-label":"Rotation mode",children:[r.jsx("option",{value:"round-robin",children:"Round robin"}),r.jsx("option",{value:"random",children:"Random"})]})]}),r.jsxs("label",{className:"flex items-center gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all cursor-pointer group",children:[r.jsx("input",{type:"checkbox",checked:o,onChange:G=>T(G.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),r.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Include default IP in rotation pool"})]}),r.jsxs("div",{className:"space-y-3",children:[h&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading proxies..."}),!h&&l.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No proxies saved yet."}),!h&&l.map(G=>{const we=G.id===u,Se=G.id===ge;return r.jsx("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:Se?r.jsxs("div",{className:"w-full space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[r.jsx("input",{type:"text",value:M,onChange:ye=>H(ye.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Proxy server","aria-label":"Proxy server"}),r.jsx("input",{type:"text",value:xe,onChange:ye=>V(ye.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Label","aria-label":"Label"}),r.jsx("input",{type:"text",value:_,onChange:ye=>W(ye.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Username","aria-label":"Username"}),r.jsx("input",{type:"password",value:X,onChange:ye=>I(ye.target.value),placeholder:"Password (leave blank to keep)",className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Password"}),r.jsxs("label",{className:"flex items-center gap-3 px-4 py-2 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:oe,onChange:ye=>A(ye.target.checked),className:"w-3.5 h-3.5 rounded border-white/20 bg-transparent"}),r.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),oe&&r.jsx("input",{type:"number",placeholder:"Estimated size",value:O,onChange:ye=>P(ye.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:w,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",children:"Save"}),r.jsx("button",{onClick:xt,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white/70 hover:bg-white/5 transition-all",children:"Cancel"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex items-center gap-4 border-r border-white/10 pr-4 w-12 justify-center",children:G.id!=="host"?r.jsx("input",{type:"checkbox",checked:Ne.has(G.id),onChange:()=>{},onClick:ye=>{ye.stopPropagation(),L(G.id,ye)},className:"w-4 h-4 rounded border-white/20 bg-transparent"}):r.jsx("div",{title:"Host IP (Cannot be deleted)",className:"flex items-center justify-center opacity-70",children:r.jsx(je,{name:"computer",className:"text-lg text-white"})})}),r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:G.label||G.server}),r.jsxs("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest flex items-center gap-2",children:[r.jsx("span",{children:G.server}),G.isRotatingPool&&r.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-white/10 text-white font-bold inline-flex items-center gap-1",children:[r.jsx(je,{name:"autorenew",className:"text-[10px]"}),"Pool",G.estimatedPoolSize?`(~${G.estimatedPoolSize})`:""]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>N(G.id),className:`px-3 py-2 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all inline-flex items-center gap-2 ${we?"bg-white text-black border-white":"border-white/10 text-white hover:bg-white/5"}`,children:[we?r.jsx(je,{name:"star",className:"text-base"}):r.jsx(je,{name:"star_outline",className:"text-base"}),we?"Default":"Set Default"]}),G.id!=="host"&&r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>ut(G),className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",children:"Edit"}),r.jsxs("button",{onClick:()=>b(G.id),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all inline-flex items-center gap-2",children:[r.jsx(je,{name:"delete",className:"text-base"}),"Delete"]})]})]})]})},G.id)})]})]})},Wb=({selection:l,options:u,loading:o,onChange:c})=>r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"User Agent"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Default browser identity"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("select",{value:l,onChange:h=>c(h.target.value),disabled:o,className:"w-full bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white uppercase tracking-widest disabled:opacity-60",children:[r.jsx("option",{value:"system",children:"System user agent (default)"}),u.map(h=>r.jsx("option",{value:h,children:h},h))]}),r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Applies when rotate UA is disabled in tasks."})]})]}),Pb=({version:l})=>{const[u,o]=z.useState(!1),c=l?`v${l}`:"Unknown",h=async()=>{const d=l||c;try{if(typeof navigator<"u"&&navigator.clipboard&&typeof window<"u"&&window.isSecureContext)await navigator.clipboard.writeText(d);else if(typeof document<"u"){const p=document.createElement("textarea");p.value=d,p.style.position="fixed",p.style.opacity="0",document.body.appendChild(p),p.select(),document.execCommand("copy"),document.body.removeChild(p)}o(!0),setTimeout(()=>o(!1),1500)}catch{o(!1)}};return r.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:r.jsx(je,{name:"content_copy",className:"text-xl"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Version"}),r.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Package metadata"})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsx("div",{className:"text-[9px] font-bold uppercase tracking-[0.3em] text-white",children:c}),r.jsx("button",{onClick:h,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",type:"button",children:u?"Copied":"Copy version"})]})]})},ey="0.9.0",ty={version:ey},Jc=ty.version,ay=({onClearStorage:l,onConfirm:u,onNotify:o})=>{const[c,h]=z.useState("system"),[d,f]=z.useState([]),[p,m]=z.useState([]),[b,k]=z.useState([]),[N,T]=z.useState([]),[S,j]=z.useState(!1),[x,v]=z.useState(null),[y,C]=z.useState(!0),[E,U]=z.useState(!1),[B,Z]=z.useState([]),[Y,ne]=z.useState(!0),[F,ge]=z.useState(!1),[ce,M]=z.useState([]),[H,_]=z.useState(null),[W,X]=z.useState(!1),[I,xe]=z.useState("round-robin"),[V,oe]=z.useState(!1),[A,O]=z.useState("system"),[P,le]=z.useState([]),[de,Ne]=z.useState(!1),Te=z.useCallback(async()=>{j(!0);try{const[_e,Ce]=await Promise.all([fetch("/api/data/captures"),fetch("/api/data/cookies")]),Ee=_e.ok?await _e.json():{captures:[]},Re=Ce.ok?await Ce.json():{cookies:[],origins:[]};m(Array.isArray(Ee.captures)?Ee.captures:[]),k(Array.isArray(Re.cookies)?Re.cookies:[]),T(Array.isArray(Re.origins)?Re.origins:[])}catch{m([]),k([]),T([])}finally{j(!1)}},[]),Ae=z.useCallback(async _e=>{if(!await u(`Delete capture ${_e}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(_e)}`,{method:"DELETE"})).ok?(o("Capture deleted.","success"),Te()):o("Delete failed.","error")},[u,o,Te]),De=z.useCallback(async _e=>{if(!await u(`Delete cookie ${_e.name}?`))return;(await fetch("/api/data/cookies/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_e.name,domain:_e.domain,path:_e.path})})).ok?(o("Cookie deleted.","success"),Te()):o("Delete failed.","error")},[u,o,Te]),Ke=async()=>{C(!0);try{const _e=await fetch("/api/settings/api-key",{credentials:"include"});if(!_e.ok){_e.status===401&&o("Session expired. Please log in again.","error"),v(null);return}const Ce=await _e.json();v(Ce.apiKey||null)}catch{v(null)}finally{C(!1)}},Je=async()=>{ne(!0);try{const _e=await fetch("/api/settings/gemini-api-key",{credentials:"include"});if(!_e.ok){_e.status===401&&o("Session expired. Please log in again.","error"),Z([]);return}const Ce=await _e.json();Z(Array.isArray(Ce.geminiApiKeys)?Ce.geminiApiKeys:[])}catch{Z([])}finally{ne(!1)}},ut=async()=>{oe(!0);try{const _e=await fetch("/api/settings/proxies",{credentials:"include"});if(!_e.ok){_e.status===401&&o("Session expired. Please log in again.","error"),M([]),_(null),xe("round-robin");return}const Ce=await _e.json();M(Array.isArray(Ce.proxies)?Ce.proxies:[]),_(Ce.defaultProxyId||null),X(!!Ce.includeDefaultInRotation),xe(Ce.rotationMode==="random"?"random":"round-robin")}catch{M([]),_(null),X(!1),xe("round-robin")}finally{oe(!1)}},xt=async _e=>{oe(!0);try{const Ce=await fetch("/api/settings/proxies",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_e)});if(!Ce.ok){let Re="";try{const qe=await Ce.json();Re=qe?.error||qe?.message||""}catch{Re=""}o(`Failed to add proxy${Re?`: ${Re}`:""}.`,"error");return}const Ee=await Ce.json();M(Array.isArray(Ee.proxies)?Ee.proxies:[]),_(Ee.defaultProxyId||null),X(!!Ee.includeDefaultInRotation),xe(Ee.rotationMode==="random"?"random":"round-robin"),o("Proxy added.","success")}catch{o("Failed to add proxy.","error")}finally{oe(!1)}},w=async()=>{Ne(!0);try{const _e=await fetch("/api/settings/user-agent",{credentials:"include"});if(!_e.ok){_e.status===401&&o("Session expired. Please log in again.","error"),O("system"),le([]);return}const Ce=await _e.json();O(Ce.selection==="system"?"system":String(Ce.selection||"system")),le(Array.isArray(Ce.userAgents)?Ce.userAgents:[])}catch{O("system"),le([])}finally{Ne(!1)}},fe=async _e=>{Ne(!0);try{const Ce=await fetch("/api/settings/user-agent",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({selection:_e})});if(!Ce.ok){o("Failed to update user agent.","error");return}const Ee=await Ce.json();O(Ee.selection==="system"?"system":String(Ee.selection||"system")),le(Array.isArray(Ee.userAgents)?Ee.userAgents:[]),o("User agent updated.","success")}catch{o("Failed to update user agent.","error")}finally{Ne(!1)}},re=async _e=>{if(!_e.length){o("No valid proxies found in file.","error");return}oe(!0);try{const Ce=await fetch("/api/settings/proxies/import",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({proxies:_e})});if(!Ce.ok){let Re="";try{const qe=await Ce.json();Re=qe?.error||qe?.message||""}catch{Re=""}o(`Failed to import proxies${Re?`: ${Re}`:""}.`,"error");return}const Ee=await Ce.json();M(Array.isArray(Ee.proxies)?Ee.proxies:[]),_(Ee.defaultProxyId||null),X(!!Ee.includeDefaultInRotation),xe(Ee.rotationMode==="random"?"random":"round-robin"),o("Proxies imported.","success")}catch{o("Failed to import proxies.","error")}finally{oe(!1)}},L=async(_e,Ce)=>{oe(!0);try{const Ee=await fetch(`/api/settings/proxies/${encodeURIComponent(_e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(Ce)});if(!Ee.ok){let qe="";try{const dt=await Ee.json();qe=dt?.error||dt?.message||""}catch{qe=""}o(`Failed to update proxy${qe?`: ${qe}`:""}.`,"error");return}const Re=await Ee.json();M(Array.isArray(Re.proxies)?Re.proxies:[]),_(Re.defaultProxyId||null),X(!!Re.includeDefaultInRotation),xe(Re.rotationMode==="random"?"random":"round-robin"),o("Proxy updated.","success")}catch{o("Failed to update proxy.","error")}finally{oe(!1)}},D=async _e=>{if(!(_e==="host"||!await u("Delete this proxy?"))){oe(!0);try{const Ee=await fetch(`/api/settings/proxies/${encodeURIComponent(_e)}`,{method:"DELETE",credentials:"include"});if(!Ee.ok){o("Delete failed.","error");return}const Re=await Ee.json();M(Array.isArray(Re.proxies)?Re.proxies:[]),_(Re.defaultProxyId||null),X(!!Re.includeDefaultInRotation),xe(Re.rotationMode==="random"?"random":"round-robin"),o("Proxy deleted.","success")}catch{o("Delete failed.","error")}finally{oe(!1)}}},J=async _e=>{if(!(_e.length===0||!await u(`Delete ${_e.length} proxies?`))){oe(!0);try{const Ee=await fetch("/api/settings/proxies",{method:"DELETE",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ids:_e})});if(!Ee.ok){o("Bulk delete failed.","error");return}const Re=await Ee.json();M(Array.isArray(Re.proxies)?Re.proxies:[]),_(Re.defaultProxyId||null),X(!!Re.includeDefaultInRotation),xe(Re.rotationMode==="random"?"random":"round-robin"),o(`${_e.length} proxies deleted.`,"success")}catch{o("Bulk delete failed.","error")}finally{oe(!1)}}},te=async _e=>{const Ce=_e==="host"?null:_e;oe(!0);try{const Ee=await fetch("/api/settings/proxies/default",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:Ce})});if(!Ee.ok){o("Failed to set default.","error");return}const Re=await Ee.json();M(Array.isArray(Re.proxies)?Re.proxies:[]),_(Re.defaultProxyId||null),X(!!Re.includeDefaultInRotation),xe(Re.rotationMode==="random"?"random":"round-robin"),o("Default proxy updated.","success")}catch{o("Failed to set default.","error")}finally{oe(!1)}},me=async _e=>{oe(!0);try{const Ce=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({includeDefaultInRotation:_e})});if(!Ce.ok){o("Failed to update rotation setting.","error");return}const Ee=await Ce.json();M(Array.isArray(Ee.proxies)?Ee.proxies:[]),_(Ee.defaultProxyId||null),X(!!Ee.includeDefaultInRotation),xe(Ee.rotationMode==="random"?"random":"round-robin"),o("Rotation setting updated.","success")}catch{o("Failed to update rotation setting.","error")}finally{oe(!1)}},G=async _e=>{oe(!0);try{const Ce=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({rotationMode:_e})});if(!Ce.ok){o("Failed to update rotation mode.","error");return}const Ee=await Ce.json();M(Array.isArray(Ee.proxies)?Ee.proxies:[]),_(Ee.defaultProxyId||null),X(!!Ee.includeDefaultInRotation),xe(Ee.rotationMode==="random"?"random":"round-robin"),o("Rotation mode updated.","success")}catch{o("Failed to update rotation mode.","error")}finally{oe(!1)}},we=async()=>{U(!0);try{const _e=await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!_e.ok){let Ee="";try{const Re=await _e.json();Ee=Re?.error||Re?.message||""}catch{Ee=""}_e.status===401?o("Session expired. Please log in again.","error"):o(`Failed to generate API key${Ee?`: ${Ee}`:""}.`,"error");return}const Ce=await _e.json();v(Ce.apiKey||null),o("API key generated.","success")}catch{o("Failed to generate API key.","error")}finally{U(!1)}},Se=async _e=>{ge(!0);try{const Ce=await fetch("/api/settings/gemini-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({geminiApiKeys:_e})});if(!Ce.ok){Ce.status===401?o("Session expired. Please log in again.","error"):o("Failed to save Gemini API keys.","error");return}const Ee=await Ce.json();Z(Array.isArray(Ee.geminiApiKeys)?Ee.geminiApiKeys:[]),o("Gemini API keys saved.","success")}catch{o("Failed to save Gemini API keys.","error")}finally{ge(!1)}};z.useEffect(()=>{c==="data"&&Te(),c==="system"&&(Ke(),Je(),w()),c==="proxies"&&ut()},[c]),z.useEffect(()=>{c==="system"&&(Ke(),Je())},[]);const ye=[{id:"gemini_api_key",name:"Gemini API Key",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",disabled:!1},{id:"anthropic_api_key",name:"Anthropic API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",disabled:!0},{id:"openai_api_key",name:"OpenAI API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",disabled:!0},{id:"ollama_api_key",name:"Ollama API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/ollama.svg",disabled:!0}],ze=[{id:"doppelganger_api_key",name:"Tasks API",description:"Manage task API access via `x-api-key` header",icon:"database",value:x,saving:E,loading:y,showCopyButton:!0,readOnly:!0,onSave:async()=>{},onRegenerate:async()=>{await we()}}];B.filter(_e=>_e&&_e.trim()).forEach((_e,Ce)=>{ze.push({id:`gemini_api_key_${Ce}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:_e,saving:F,loading:Y,badge:Ce===0?"Primary":"Backup",onSave:async Ee=>{const Re=[...B];Re[Ce]=Ee,await Se(Re)},onDelete:async()=>{const Ee=B.filter((Re,qe)=>qe!==Ce);await Se(Ee)}})});const Be=d.filter(_e=>_e==="gemini_api_key").length;for(let _e=0;_e<Be;_e++)ze.push({id:`gemini_api_key_unsaved_${_e}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:null,saving:F,loading:Y,startEditing:!0,onSave:async Ce=>{const Ee=[...B,Ce];await Se(Ee),f(Re=>{const qe=Re.indexOf("gemini_api_key");if(qe!==-1){const dt=[...Re];return dt.splice(qe,1),dt}return Re})},onDelete:async()=>{f(Ce=>{const Ee=Ce.indexOf("gemini_api_key");if(Ee!==-1){const Re=[...Ce];return Re.splice(Ee,1),Re}return Ce})}});return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[r.jsx($b,{tab:c,onTabChange:h}),c==="system"&&r.jsxs(r.Fragment,{children:[r.jsx(Yb,{keys:ze,availableProviders:ye,onAddProvider:_e=>f(Ce=>[...Ce,_e]),onConfirm:u}),r.jsx(Wb,{selection:A,options:P,loading:de,onChange:fe}),r.jsx(Pb,{version:Jc}),r.jsx(Vb,{onClearStorage:l})]}),c==="data"&&r.jsxs(r.Fragment,{children:[r.jsx(Qb,{captures:p,loading:S,onRefresh:Te,onDelete:Ae}),r.jsx(Jb,{cookies:b,originsCount:N.length,loading:S,onClear:()=>l("cookies"),onDelete:De})]}),c==="proxies"&&r.jsx(Fb,{proxies:ce,defaultProxyId:H,includeDefaultInRotation:W,rotationMode:I,loading:V,onRefresh:ut,onAdd:xt,onImport:re,onUpdate:L,onDelete:D,onDeleteMultiple:J,onSetDefault:te,onToggleIncludeDefault:me,onRotationModeChange:G}),r.jsx("div",{className:"pt-8 flex justify-center border-t border-white/5 mt-8",children:r.jsx(Gp,{})})]})})},$c=({title:l="Loading",subtitle:u})=>r.jsxs("div",{className:"fixed inset-0 z-[80] bg-[#020202] flex items-center justify-center",children:[r.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),r.jsxs("div",{className:"glass-card p-10 rounded-[40px] text-center space-y-4",children:[r.jsx("div",{className:"w-12 h-12 mx-auto rounded-full border border-white/10 flex items-center justify-center",children:r.jsx("div",{className:"w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:l}),u&&r.jsx("p",{className:"text-xs font-mono text-white/80",children:u})]})]})]}),ds=140,ny=6,ly=4,iy=({index:l,style:u,data:o})=>{const c=o.items[l];return c?r.jsxs("div",{style:u,onClick:()=>o.navigate(`/executions/${c.id}`),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o.navigate(`/executions/${c.id}`))},role:"button",tabIndex:0,className:"glass-card w-full rounded-2xl p-5 flex items-center gap-4 text-left hover:bg-white/[0.06] transition-all cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:c.source==="api"?r.jsx(je,{name:"cloud",className:"text-xl"}):r.jsx(je,{name:"monitor",className:"text-xl"})}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[r.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:c.taskName||c.mode}),r.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(c.timestamp).toLocaleString()," | ",c.source," | ",c.mode," | ",c.status," | ",c.durationMs,"ms"]}),c.url&&r.jsx("div",{className:"text-[9px] text-white/50 truncate font-mono",children:c.url})]}),r.jsx("button",{onClick:h=>{h.stopPropagation(),o.deleteExecution(c.id)},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Delete execution ${c.id}`,children:"Delete"})]}):null},ry=({onConfirm:l,onNotify:u})=>{const o=Pn(),[c,h]=z.useState([]),[d,f]=z.useState("all"),[p,m]=z.useState(!1),b=z.useCallback(async()=>{m(!0);try{const j=await fetch("/api/executions");if(!j.ok)throw new Error("Failed to load");const x=await j.json();h(Array.isArray(x.executions)?x.executions:[])}catch{h([])}finally{m(!1)}},[]),k=z.useCallback(async()=>{if(!await l("Clear all executions?"))return;(await fetch("/api/executions/clear",{method:"POST"})).ok?(u("Executions cleared.","success"),b()):u("Clear failed.","error")},[b,l,u]),N=z.useCallback(async j=>{if(!await l("Delete this execution?"))return;(await fetch(`/api/executions/${j}`,{method:"DELETE"})).ok?(u("Execution deleted.","success"),h(y=>y.filter(C=>C.id!==j))):u("Delete failed.","error")},[l,u]);z.useEffect(()=>{b()},[b]);const T=z.useMemo(()=>c.filter(j=>d==="all"?!0:j.source===d),[c,d]),S=z.useMemo(()=>({items:T,deleteExecution:N,navigate:o}),[T,N,o]);return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[r.jsxs("div",{className:"flex items-end justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-[0.4em]",children:"Executions"}),r.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Run History"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["all","editor","api"].map(j=>r.jsx("button",{onClick:()=>f(j),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${d===j?"bg-white text-black":"text-gray-500 hover:text-white"}`,"aria-pressed":d===j,children:j},j))}),r.jsx("button",{onClick:b,disabled:p,"aria-busy":p,className:"w-10 h-10 rounded-2xl border border-white/10 text-gray-400 hover:text-white hover:bg-white/5 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh","aria-label":"Refresh executions",children:r.jsx(je,{name:"sync",className:`text-xl ${p?"animate-spin":""}`})}),r.jsx("button",{onClick:k,className:"w-10 h-10 rounded-2xl border border-red-500/20 text-red-400 hover:bg-red-500/10 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Clear all","aria-label":"Clear all executions",children:r.jsx(je,{name:"delete",className:"text-xl"})})]})]}),p&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading executions..."}),!p&&T.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No executions found."}),!p&&T.length>0&&r.jsx(ys,{height:Math.min(Math.max(ds,T.length*ds),ds*ny),itemCount:T.length,itemSize:ds,width:"100%",overscanCount:ly,itemData:S,className:"custom-scrollbar",children:iy})]})})},sy=l=>{if(!l.result)return null;const u=l.result||{};return{url:l.url||u.url||"",finalUrl:u.final_url||u.finalUrl,html:u.html,data:u.data??u.html??"",screenshotUrl:u.screenshot_url||u.screenshotUrl,logs:u.logs||[],timestamp:new Date(l.timestamp).toLocaleTimeString()}},oy=({onConfirm:l,onNotify:u})=>{const{id:o}=Dp(),c=Pn(),[h,d]=z.useState(null),[f,p]=z.useState(!1);if(z.useEffect(()=>{(async()=>{if(o){p(!0);try{const k=await fetch(`/api/executions/${o}`);if(!k.ok)throw new Error("Failed to load execution");const N=await k.json();d(N.execution||null)}catch{d(null)}finally{p(!1)}}})()},[o]),f)return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsx("div",{className:"max-w-6xl mx-auto text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading execution..."})});if(!h)return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[r.jsx("button",{onClick:()=>c("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"}),r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"Execution not found."})]})});const m=sy(h);return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[r.jsxs("div",{className:"flex items-end justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-[0.4em]",children:"Execution"}),r.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:h.taskName||h.mode}),r.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(h.timestamp).toLocaleString()," | ",h.source," | ",h.mode," | ",h.status," | ",h.durationMs,"ms"]})]}),r.jsx("button",{onClick:()=>c("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"})]}),r.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col min-h-[420px]",children:[r.jsx("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:r.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"})}),m?r.jsx(Jp,{results:m,isExecuting:!1,onConfirm:l,onNotify:u,fullWidth:!0}):r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"No output captured."})]})]})})},cy=360,Wp=12,fs=cy+Wp,uy=6,dy=4,fy=({index:l,style:u,data:o})=>{const c=o.captures[l];return c?r.jsx("div",{style:{...u,paddingBottom:Wp},children:r.jsx(Qp,{capture:c,onDelete:o.onDelete})}):null},hy=({onConfirm:l,onNotify:u})=>{const o=Pn(),[c,h]=z.useState([]),[d,f]=z.useState(!1),p=async()=>{f(!0);try{const k=await fetch("/api/data/captures"),N=k.ok?await k.json():{captures:[]};h(Array.isArray(N.captures)?N.captures:[])}catch{h([])}finally{f(!1)}},m=z.useCallback(async k=>{if(!await l(`Delete capture ${k}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(k)}`,{method:"DELETE"})).ok?(h(S=>S.filter(j=>j.name!==k)),u("Capture deleted.","success")):u("Delete failed.","error")},[l,u]);z.useEffect(()=>{p()},[]);const b=z.useMemo(()=>({captures:c,onDelete:m}),[c,m]);return r.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[r.jsxs("div",{className:"flex items-end justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-[0.4em]",children:"Captures"}),r.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:"All Captures"}),r.jsx("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:"Recordings and screenshots from every run"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:p,disabled:d,"aria-busy":d,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all disabled:opacity-50 inline-flex items-center gap-2",children:[r.jsx(je,{name:"sync",className:`text-base ${d?"animate-spin":""}`}),"Refresh"]}),r.jsx("button",{onClick:()=>o("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Executions"})]})]}),r.jsxs("div",{className:"glass-card rounded-[32px] p-8",children:[d&&r.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!d&&c.length===0&&r.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!d&&c.length>0&&r.jsx("div",{className:"space-y-4",children:r.jsx(ys,{height:Math.min(Math.max(fs,c.length*fs),fs*uy),width:"100%",itemCount:c.length,itemSize:fs,overscanCount:dy,itemData:b,className:"custom-scrollbar",children:fy})})]})]})})},Pp=({title:l="Not Found",subtitle:u="The page you requested does not exist.",onBack:o})=>r.jsx("div",{className:"h-full flex items-center justify-center px-10",children:r.jsxs("div",{className:"glass-card w-full max-w-2xl rounded-[40px] border border-white/10 p-10 text-center space-y-6",children:[r.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"404"}),r.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:l}),r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-gray-500",children:u}),o&&r.jsxs("button",{onClick:o,className:"mt-2 inline-flex items-center gap-2 px-6 py-3 rounded-2xl bg-white text-black text-[9px] font-bold uppercase tracking-[0.3em] hover:scale-105 transition-all",children:[r.jsx(je,{name:"arrow_back",className:"text-base"}),"Back"]})]})}),py=({message:l,tone:u,onClose:o})=>{const[c,h]=z.useState(!1);return z.useEffect(()=>{const d=setTimeout(()=>{h(!0)},2500);return()=>clearTimeout(d)},[]),z.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(),240);return()=>clearTimeout(d)},[c,o]),r.jsx("div",{className:`fixed bottom-6 right-6 z-[220] max-w-sm w-full ${c?"animate-out fade-out slide-out-to-bottom-3 duration-200":"animate-in fade-in slide-in-from-bottom-3 duration-300"}`,children:r.jsxs("div",{className:`glass-card rounded-2xl border border-white/10 p-4 shadow-2xl flex items-start gap-3 ${c?"animate-out fade-out zoom-out-95 duration-200":"animate-in fade-in zoom-in-95 duration-300"}`,children:[r.jsx("div",{className:`mt-1 h-2.5 w-2.5 rounded-full ${u==="error"?"bg-red-400":"bg-emerald-400"}`}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-[8px] font-bold uppercase tracking-[0.35em] text-gray-500",children:"Notification"}),r.jsx("p",{className:"mt-2 font-mono text-[11px] text-white leading-relaxed",children:l})]}),r.jsx("button",{onClick:()=>h(!0),className:"px-2 py-1 text-[8px] font-bold uppercase tracking-[0.2em] text-white/60 hover:text-white",children:"Close"})]})})},my=({request:l,onResolve:u})=>r.jsx("div",{className:"fixed inset-0 z-[201] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:r.jsxs("div",{className:"glass-card w-full max-w-md rounded-[32px] border border-white/10 p-8 text-center shadow-2xl",children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:l.title??"Confirm"}),r.jsx("p",{className:"mt-4 font-mono text-sm text-white",children:l.message}),r.jsxs("div",{className:"mt-6 flex gap-4",children:[r.jsx("button",{onClick:()=>u(!1),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white/5 border border-white/10 text-gray-300 hover:bg-white/10",children:l.cancelLabel??"Cancel"}),r.jsx("button",{onClick:()=>u(!0),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10",children:l.confirmLabel??"Confirm"})]})]})}),xy=({tasks:l,loadTasks:u,touchTask:o,currentTask:c,setCurrentTask:h,onTaskLoaded:d,...f})=>{const{id:p}=Dp(),m=Pn(),[b,k]=z.useState(!1),[N,T]=z.useState(!1);return z.useEffect(()=>{(async()=>{if(c?.id===p)return;k(!0),T(!1);let j=l;l.length===0&&(j=await u());const x=j.find(v=>String(v.id)===String(p));if(x){const v={...x};(!v.variables||Array.isArray(v.variables))&&(v.variables={}),v.stealth||(v.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),v.stealth.cursorGlide===void 0&&(v.stealth.cursorGlide=v.stealth.humanCursor??!1),delete v.stealth.humanCursor,v.stealth.randomizeClicks===void 0&&(v.stealth.randomizeClicks=!1),Array.isArray(v.actions)&&(v.actions=v.actions.map((y,C)=>y&&y.id?y:{...y,id:`act_${Date.now()}_${C}_${Math.floor(Math.random()*1e3)}`})),v.includeShadowDom===void 0&&(v.includeShadowDom=!0),h(v),d?.(v),p&&o(p)}else T(!0);k(!1)})()},[p,l]),N?r.jsx(Pp,{title:"Task Not Found",subtitle:"This task does not exist or was deleted.",onBack:()=>m("/dashboard")}):b||!c||String(c.id)!==String(p)?r.jsx($c,{title:"Loading Mission Data",subtitle:"Syncing task payload"}):r.jsx($p,{currentTask:c,setCurrentTask:h,tasks:l,...f})},bp="doppelganger.seenReleaseNotes_0_8";function gy(){const[l,u]=z.useState(!1),[o,c]=z.useState(""),[h,d]=z.useState(!0);z.useEffect(()=>{Jc.startsWith("0.8.")&&(localStorage.getItem(bp)||(u(!0),f()))},[]);const f=async()=>{try{const m=await fetch("https://api.github.com/repos/figranium/figranium/releases/tags/v0.8.0");if(m.ok){const b=await m.json();c(b.body||"No release notes available.")}else c("Failed to load release notes. Please check our GitHub repository.")}catch{c("Failed to load release notes. Please check our GitHub repository.")}finally{d(!1)}},p=()=>{u(!1),localStorage.setItem(bp,"true")};return l?r.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:r.jsxs("div",{className:"glass-card w-full max-w-2xl max-h-[80vh] flex flex-col rounded-[32px] border border-white/10 p-8 text-left shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6 shrink-0",children:[r.jsx("h2",{className:"text-lg md:text-2xl font-bold text-white tracking-tight",children:"What's new in v0.8.0"}),r.jsxs("span",{className:"bg-white/10 text-white/70 px-3 py-1 rounded-full text-xs font-mono ml-4 shrink-0",children:["v",Jc]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto pr-2 custom-scrollbar text-sm text-gray-300",children:h?r.jsx("div",{className:"flex justify-center items-center h-32",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):r.jsx("div",{className:"whitespace-pre-wrap font-mono text-xs",children:o})}),r.jsx("div",{className:"mt-8 flex justify-end shrink-0",children:r.jsx("button",{onClick:p,className:"rounded-2xl px-8 py-3 text-[10px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10",children:"Got it"})})]})}):null}const by=(l,u)=>{if(typeof l!="string"||!l)return u;switch(l){case"ALREADY_SETUP":return"An account already exists";case"INVALID":return"Invalid credentials";case"SESSION_SAVE_FAILED":return"Unable to persist your session";default:{const o=l.toLowerCase().replace(/_/g," ");return o.charAt(0).toUpperCase()+o.slice(1)}}};function yy(){const l=Pn(),[u,o]=z.useState(null),[c,h]=z.useState("checking"),[d,f]=z.useState(""),[p,m]=z.useState(!1),b=z.useCallback(async()=>{try{const S=await(await fetch("/api/auth/me",{credentials:"include"})).json();if(S.authenticated)return o(S.user),h("authenticated"),!0;const x=await(await fetch("/api/auth/check-setup",{credentials:"include"})).json();h(x.setupRequired?"setup":"login")}catch{h("login")}return!1},[]);z.useEffect(()=>{b()},[b]);const k=z.useCallback(async(T,S,j,x)=>{if(!T||!S){f("Email and password are required");return}if(c==="setup"&&(!j||S!==x)){f(j?"Passwords do not match":"Name required");return}if(p)return;const v=c==="setup"?"/api/auth/setup":"/api/auth/login",y=c==="setup"?{name:j,email:T,password:S}:{email:T,password:S};m(!0);try{const C=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(y)}),E=await C.json().catch(()=>({}));if(C.ok)f(""),h("checking"),await b()?l("/"):(f("Authentication failed"),h("login"));else{const U=c==="setup"?"Setup failed":"Invalid credentials";f(by(E?.error,U))}}catch{f("Network error")}finally{m(!1)}},[c,p,l,b]),N=z.useCallback(async T=>{await T("Are you sure you want to log out?")&&(await fetch("/api/auth/logout",{method:"POST",credentials:"include"}),o(null),h("login"),l("/"))},[l]);return{user:u,setUser:o,authStatus:c,setAuthStatus:h,authError:d,authBusy:p,checkAuth:b,handleAuthSubmit:k,logout:N}}const yp=l=>{if(!l)return"";const u=JSON.parse(JSON.stringify(l));return delete u.last_opened,JSON.stringify(u)},xs=l=>{if(typeof l=="boolean")return l;if(l==null)return!1;const u=String(l).toLowerCase();return u==="true"||u==="1"},vy=l=>l&&l[0].toUpperCase()+l.slice(1),em=l=>{if(!l.actions||!Array.isArray(l.actions))return l;let u=!1;const o=l.actions.map((c,h)=>c.id?c:(u=!0,{...c,id:`act_${Date.now()}_${h}_${Math.floor(Math.random()*1e3)}`}));return u?{...l,actions:o}:l},wy=()=>({name:"Imported Task",url:"",mode:"scrape",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},includeShadowDom:!0,disableRecording:!1,statelessExecution:!1}),Sy=(l,u)=>{if(!l||typeof l!="object")return null;const o=wy(),c={...o,...l};return(!c.name||typeof c.name!="string")&&(c.name=`Imported Task ${u+1}`),(!c.mode||!["scrape","agent","headful"].includes(c.mode))&&(c.mode="scrape"),typeof c.wait!="number"&&(c.wait=3),c.stealth||(c.stealth=o.stealth),(!c.variables||Array.isArray(c.variables))&&(c.variables={}),Array.isArray(c.actions)||(c.actions=[]),c.rotateProxies===void 0&&(c.rotateProxies=!1),c.disableRecording===void 0&&(c.disableRecording=!1),c.disableRecording=xs(c.disableRecording),c.statelessExecution===void 0&&(c.statelessExecution=!1),c.statelessExecution=xs(c.statelessExecution),delete c.versions,delete c.last_opened,c},_y=()=>({name:"Task "+Math.floor(Math.random()*100),url:"",mode:"agent",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},extractionFormat:"json",includeShadowDom:!0,disableRecording:!1,statelessExecution:!1});function jy(l,u,o){const[c,h]=z.useState([]),[d,f]=z.useState(null),p=z.useRef(null);z.useEffect(()=>{p.current=d},[d]);const m=z.useCallback(async()=>{try{const C=[...await(await fetch("/api/tasks",{credentials:"include"})).json()].sort((E,U)=>(U.last_opened||0)-(E.last_opened||0));return h(C),C}catch(v){return console.error("Failed to load tasks",v),[]}},[]),b=z.useCallback(async v=>{try{await fetch(`/api/tasks/${v}/touch`,{method:"POST"}),m()}catch(y){console.error("Failed to touch task",y)}},[m]),k=z.useCallback((v,y)=>{const C=_y();y(!0),f(C),v(null),l("/tasks/new")},[l]),N=z.useCallback((v,y,C)=>{const E={...v};(!E.variables||Array.isArray(E.variables))&&(E.variables={}),E.stealth||(E.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),E.stealth.cursorGlide===void 0&&(E.stealth.cursorGlide=E.stealth.humanCursor??!1),delete E.stealth.humanCursor,E.stealth.randomizeClicks===void 0&&(E.stealth.randomizeClicks=!1),E.rotateProxies===void 0&&(E.rotateProxies=!1),E.rotateViewport===void 0&&(E.rotateViewport=!1),E.extractionFormat||(E.extractionFormat="json"),E.includeShadowDom===void 0&&(E.includeShadowDom=!0),E.disableRecording===void 0&&(E.disableRecording=!1),E.disableRecording=xs(E.disableRecording),E.statelessExecution===void 0&&(E.statelessExecution=!1),E.statelessExecution=xs(E.statelessExecution);const U=em(E);f(U),y(U),C(null),l(`/tasks/${v.id}`),v.id&&b(v.id)},[l,b]),T=z.useCallback(async(v,y)=>{await o("Are you sure you want to delete this task?")&&(await fetch(`/api/tasks/${v}`,{method:"DELETE"}),m(),y.includes(v)&&l("/dashboard"))},[o,m,l]),S=z.useCallback(async(v,y,C,E=!1)=>{const U=C||p.current;if(!U)return;const B={...U,last_opened:Date.now()},ne=await(await fetch(`/api/tasks${E?"?version=true":""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})).json();f(ne),v(ne),m(),y.includes("new")&&l(`/tasks/${ne.id}`,{replace:!0})},[l,m]),j=z.useCallback(v=>{let y=c;if(v&&v.length>0&&(y=c.filter(Y=>Y.id&&v.includes(Y.id))),y.length===0){u("No tasks selected to export.","error");return}const C={exportedAt:new Date().toISOString(),tasks:y},E=new Blob([JSON.stringify(C,null,2)],{type:"application/json"}),U=URL.createObjectURL(E),B=document.createElement("a"),Z=new Date().toISOString().slice(0,10);B.href=U,B.download=`doppelganger-tasks-${Z}.json`,document.body.appendChild(B),B.click(),B.remove(),URL.revokeObjectURL(U),u(`Exported ${y.length} task(s).`,"success")},[c,u]),x=z.useCallback(async v=>{try{const y=await v.text(),C=JSON.parse(y),E=Array.isArray(C)?C:C?.tasks;if(!Array.isArray(E)){u("Invalid import file.","error");return}const U=Date.now(),B=E.map((Z,Y)=>Sy(Z,Y)).filter(Z=>!!Z).map(Z=>Z.id?Z:{...Z,id:`task_${U}`});if(B.length===0){u("No tasks to import.","error");return}await Promise.all(B.map(Z=>fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)}))),await m(),u(`Imported ${B.length} task(s).`,"success")}catch(y){u(`Import failed: ${y.message||"Unknown error"}`,"error")}},[u,m]);return z.useEffect(()=>{m()},[m]),{tasks:c,setTasks:h,currentTask:d,setCurrentTask:f,loadTasks:m,touchTask:b,createNewTask:k,editTask:N,deleteTask:T,saveTask:S,exportTasks:j,importTasks:x}}const vp=(l,u)=>{const o=String(l||"").trim();if(!o)return"Execution failed.";const c=o.toLowerCase();if(u==="headful"){if(c.includes("missing x server")||c.includes("$display"))return"Headful browser could not start because no display server is available.";if(c.includes("failed to connect to the bus"))return"Headful browser could not start due to missing system services."}let h=o;const d=h.indexOf("--disable-");return d>0&&(h=h.slice(0,d).trim()),h.length>240&&(h=`${h.slice(0,240)}...`),h||"Execution failed."},Ny=l=>{const u=String(l||"").toLowerCase();return u.includes("missing x server")||u.includes("$display")||u.includes("platform failed to initialize")||u.includes("no display server")};function Ey(l){const[u,o]=z.useState(!1),[c,h]=z.useState(!1),[d,f]=z.useState(null),[p,m]=z.useState(null),b=z.useRef(null),k=async()=>{try{await fetch("/headful/stop",{method:"POST"})}catch(j){console.error("Failed to stop headful session",j)}finally{h(!1)}};return{isExecuting:u,isHeadfulOpen:c,results:d,setResults:f,activeRunId:p,runTaskWithSnapshot:async(j,x,v)=>{if(!j||!j.url)return;const y=em(j);x&&y!==x&&v(y);const C=`run_${Date.now()}_${Math.floor(Math.random()*1e3)}`;if(m(C),u)return;o(!0),f({url:y.url,logs:[],timestamp:"Running..."});let E=null;try{const U={};Object.entries(y.variables).forEach(([M,H])=>{U[M]=H.value});const B=M=>M.replace(/\\{\$(\w+)\\}/g,(H,_)=>{if(_==="now")return new Date().toISOString();const W=U[_];return W==null||W===""?"":String(W)}),Z=M=>typeof M!="string"?M:B(M),Y=y.mode!=="agent";E={...{...y,url:Y?B(y.url||""):y.url||"",selector:Y?Z(y.selector):y.selector,actions:Y?y.actions.map(M=>({...M,selector:Z(M.selector),value:Z(M.value),key:Z(M.key)})):y.actions},taskVariables:U,variables:U,runSource:"editor",taskId:y.id,taskName:y.name,taskSnapshot:y,runId:C};const F=async M=>{const H=new AbortController;b.current=H;const _=await fetch(`/${M}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E),signal:H.signal});if(!_.ok){let W=null;try{W=await _.json()}catch{W=null}const X=new Error(W?.details||W?.error||"Request failed");throw X.code=W?.error,X}return _.json()},ge=y.mode==="headful"?"scrape":y.mode,ce=await F(ge);f({url:y.url,finalUrl:ce.final_url,html:ce.html,data:ce.data??ce.html??"No data captured.",screenshotUrl:ce.screenshot_url,downloads:ce.downloads,logs:ce.logs||[],timestamp:new Date().toLocaleTimeString()})}catch(U){if(U?.name==="AbortError"){l("Execution stopped.","success"),o(!1);return}if(y?.mode==="headful"&&E&&(U?.code==="HEADFUL_DISPLAY_UNAVAILABLE"||Ny(U?.message||String(U))))try{const Z=await(async()=>{const Y=new AbortController;b.current=Y;const ne=await fetch("/scrape",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E),signal:Y.signal});if(!ne.ok){const F=await ne.json();throw new Error(F.details||F.error||"Request failed")}return ne.json()})();Z.logs=["Headful display unavailable; ran headless instead.",...Z.logs||[]],f({url:y.url,finalUrl:Z.final_url,html:Z.html,data:Z.data??Z.html??"No data captured.",screenshotUrl:Z.screenshot_url,downloads:Z.downloads,logs:Z.logs||[],timestamp:new Date().toLocaleTimeString()}),o(!1);return}catch(Z){const Y=vp(Z?.message||String(Z),y?.mode);l(`Execution crash: ${Y}`,"error"),o(!1);return}const B=vp(U?.message||String(U),y?.mode);l(`Execution crash: ${B}`,"error"),y?.mode==="headful"&&o(!1)}finally{b.current=null,o(!1)}},stopTask:async()=>{if(p)try{await fetch("/api/executions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:p})})}catch(j){console.error("Failed to request stop",j)}b.current&&b.current.abort(),o(!1)},openHeadful:async j=>{if(c){await k();return}h(!0);try{const x=await fetch("/headful",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:j})});if(!x.ok){const v=await x.json().catch(()=>({})),y=v?.details||v?.error||"Failed to start headful session";l(y,"error"),h(!1)}}catch{l("Failed to start headful session","error"),h(!1)}},stopHeadful:k}}function Cy(){const[l,u]=z.useState(null),[o,c]=z.useState(null),h=z.useRef(null),d=z.useCallback((m,b="success")=>{u({message:m,tone:b}),b==="success"&&setTimeout(()=>{u(k=>k&&k.message===m?null:k)},2e3)},[]),f=z.useCallback(m=>new Promise(b=>{h.current=b,c(typeof m=="string"?{message:m}:m)}),[]),p=z.useCallback(m=>{const b=h.current;h.current=null,c(null),b&&b(m)},[]);return{centerAlert:l,setCenterAlert:u,centerConfirm:o,showAlert:d,requestConfirm:f,closeConfirm:p}}function ky(){const l=Pn(),u=Mn(),{centerAlert:o,setCenterAlert:c,centerConfirm:h,showAlert:d,requestConfirm:f,closeConfirm:p}=Cy(),{authStatus:m,authError:b,authBusy:k,handleAuthSubmit:N,logout:T}=yy(),{tasks:S,currentTask:j,setCurrentTask:x,loadTasks:v,touchTask:y,createNewTask:C,editTask:E,deleteTask:U,saveTask:B,exportTasks:Z,importTasks:Y}=jy(l,d,f),{isExecuting:ne,isHeadfulOpen:F,results:ge,setResults:ce,activeRunId:M,runTaskWithSnapshot:H,stopTask:_,openHeadful:W,stopHeadful:X}=Ey(d);z.useEffect(()=>{m==="authenticated"&&v()},[m]);const[I,xe]=z.useState(!1),V=z.useRef(""),[oe,A]=z.useState("visual"),[O,P]=z.useState({}),le="doppelganger.pinnedResults",Ne=(te=>te?.id?String(te.id):"new")(j),Te=j&&O[Ne]||null;z.useEffect(()=>{try{const te=localStorage.getItem(le);if(te){const me=JSON.parse(te);me&&typeof me=="object"&&P(me)}}catch{}},[]),z.useEffect(()=>{try{localStorage.setItem(le,JSON.stringify(O))}catch{}},[O]),z.useEffect(()=>{!u.pathname.startsWith("/tasks")&&oe==="history"&&A("visual")},[u.pathname,oe]),z.useEffect(()=>{u.pathname==="/tasks/new"&&!j&&C(ce,xe)},[u.pathname]),z.useEffect(()=>{if(!j){xe(!1);return}const te=yp(j);xe(te!==V.current)},[j]),z.useEffect(()=>{if(typeof window>"u")return;const te=me=>{I&&(me.preventDefault(),me.returnValue="")};return window.addEventListener("beforeunload",te),()=>window.removeEventListener("beforeunload",te)},[I]);const Ae=z.useCallback(te=>{V.current=yp(te),xe(!1)},[]),De=te=>{j&&P(me=>({...me,[Ne]:te}))},Ke=()=>{j&&P(te=>{const me={...te};return delete me[Ne],me})},Je=async te=>{if(!await f(`Delete all ${te}?`))return;await fetch(te==="screenshots"?"/api/clear-screenshots":"/api/clear-cookies",{method:"POST"}),d(`${vy(te)} cleared.`,"success")},ut=()=>u.pathname.startsWith("/tasks")?"editor":u.pathname==="/settings"?"settings":u.pathname==="/executions"?"executions":u.pathname==="/captures"?"captures":"dashboard",xt=z.useCallback(te=>{te==="dashboard"?l("/dashboard"):te==="settings"?l("/settings"):te==="executions"?l("/executions"):te==="captures"&&l("/captures")},[l]),w=z.useCallback(()=>{C(ce,xe)},[C,ce,xe]),fe=z.useCallback(te=>{E(te,Ae,ce)},[E,Ae,ce]),re=z.useCallback(te=>{U(te,u.pathname)},[U,u.pathname]),L=z.useCallback((te,me)=>B(Ae,u.pathname,te,me),[B,Ae,u.pathname]),D=z.useCallback(()=>{T(f)},[T,f]);let J;return m==="login"||m==="setup"?J=r.jsx(Jg,{status:m,onSubmit:N,error:b,busy:k}):m==="checking"?J=r.jsx($c,{title:"Authenticating",subtitle:"Verifying session state"}):J=r.jsxs("div",{className:"h-full flex flex-row overflow-hidden bg-[#020202]",children:[r.jsx(gy,{}),r.jsx(Ig,{onNavigate:xt,onNewTask:w,onLogout:D,currentScreen:ut()}),r.jsxs(fg,{children:[r.jsx(Ra,{path:"/",element:r.jsx(lp,{tasks:S,onNewTask:w,onEditTask:fe,onDeleteTask:re,onExportTasks:Z,onImportTasks:Y})}),r.jsx(Ra,{path:"/dashboard",element:r.jsx(lp,{tasks:S,onNewTask:w,onEditTask:fe,onDeleteTask:re,onExportTasks:Z,onImportTasks:Y})}),r.jsx(Ra,{path:"/tasks/new",element:j?r.jsx($p,{currentTask:j,setCurrentTask:x,tasks:S,editorView:oe,setEditorView:A,isExecuting:ne,onSave:L,onRun:()=>H(j,j,x),onRunSnapshot:te=>H(te||j,j,x),results:ge,pinnedResults:Te,onConfirm:f,onNotify:d,onPinResults:De,onUnpinResults:Ke,runId:M,onStop:()=>_(),isHeadfulOpen:F,onOpenHeadful:te=>W(te),onStopHeadful:X}):r.jsx($c,{title:"Initializing",subtitle:"Preparing task workspace"})}),r.jsx(Ra,{path:"/tasks/:id",element:r.jsx(xy,{tasks:S,loadTasks:v,touchTask:y,currentTask:j,setCurrentTask:x,editorView:oe,setEditorView:A,isExecuting:ne,onSave:L,onRun:()=>H(j,j,x),onRunSnapshot:te=>H(te||j,j,x),results:ge,pinnedResults:Te,onConfirm:f,onNotify:d,onPinResults:De,onUnpinResults:Ke,runId:M,onStop:()=>_(),onTaskLoaded:Ae,isHeadfulOpen:F,onOpenHeadful:te=>W(te),onStopHeadful:X})}),r.jsx(Ra,{path:"/settings",element:r.jsx(ay,{onClearStorage:Je,onConfirm:f,onNotify:d})}),r.jsx(Ra,{path:"/executions",element:r.jsx(ry,{onConfirm:f,onNotify:d})}),r.jsx(Ra,{path:"/executions/:id",element:r.jsx(oy,{onConfirm:f,onNotify:d})}),r.jsx(Ra,{path:"/captures",element:r.jsx(hy,{onConfirm:f,onNotify:d})}),r.jsx(Ra,{path:"*",element:r.jsx(Pp,{onBack:()=>l("/dashboard")})})]})]}),r.jsxs("div",{className:"h-full",children:[o&&r.jsx(py,{message:o.message,tone:o.tone,onClose:()=>c(null)}),h&&r.jsx(my,{request:h,onResolve:p}),J]})}m0.createRoot(document.getElementById("root")).render(r.jsx(Dn.StrictMode,{children:r.jsx(Ug,{children:r.jsx(ky,{})})}));