easel-canvas 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +0,0 @@
1
- (function(){const d=document.createElement("link").relList;if(d&&d.supports&&d.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))f(g);new MutationObserver(g=>{for(const y of g)if(y.type==="childList")for(const z of y.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&f(z)}).observe(document,{childList:!0,subtree:!0});function h(g){const y={};return g.integrity&&(y.integrity=g.integrity),g.referrerPolicy&&(y.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?y.credentials="include":g.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function f(g){if(g.ep)return;g.ep=!0;const y=h(g);fetch(g.href,y)}})();var Yr={exports:{}},Xu={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Jm;function $y(){if(Jm)return Xu;Jm=1;var u=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function h(f,g,y){var z=null;if(y!==void 0&&(z=""+y),g.key!==void 0&&(z=""+g.key),"key"in g){y={};for(var D in g)D!=="key"&&(y[D]=g[D])}else y=g;return g=y.ref,{$$typeof:u,type:f,key:z,ref:g!==void 0?g:null,props:y}}return Xu.Fragment=d,Xu.jsx=h,Xu.jsxs=h,Xu}var Fm;function Jy(){return Fm||(Fm=1,Yr.exports=$y()),Yr.exports}var o=Jy(),qr={exports:{}},Vu={},Gr={exports:{}},Xr={};/**
10
- * @license React
11
- * scheduler.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Wm;function Fy(){return Wm||(Wm=1,(function(u){function d($,le){var ee=$.length;$.push(le);e:for(;0<ee;){var je=ee-1>>>1,L=$[je];if(0<g(L,le))$[je]=le,$[ee]=L,ee=je;else break e}}function h($){return $.length===0?null:$[0]}function f($){if($.length===0)return null;var le=$[0],ee=$.pop();if(ee!==le){$[0]=ee;e:for(var je=0,L=$.length,de=L>>>1;je<de;){var Ne=2*(je+1)-1,_e=$[Ne],w=Ne+1,X=$[w];if(0>g(_e,ee))w<L&&0>g(X,_e)?($[je]=X,$[w]=ee,je=w):($[je]=_e,$[Ne]=ee,je=Ne);else if(w<L&&0>g(X,ee))$[je]=X,$[w]=ee,je=w;else break e}}return le}function g($,le){var ee=$.sortIndex-le.sortIndex;return ee!==0?ee:$.id-le.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;u.unstable_now=function(){return y.now()}}else{var z=Date,D=z.now();u.unstable_now=function(){return z.now()-D}}var j=[],S=[],p=1,b=null,N=3,Y=!1,E=!1,k=!1,K=!1,Te=typeof setTimeout=="function"?setTimeout:null,re=typeof clearTimeout=="function"?clearTimeout:null,be=typeof setImmediate<"u"?setImmediate:null;function Q($){for(var le=h(S);le!==null;){if(le.callback===null)f(S);else if(le.startTime<=$)f(S),le.sortIndex=le.expirationTime,d(j,le);else break;le=h(S)}}function fe($){if(k=!1,Q($),!E)if(h(j)!==null)E=!0,ae||(ae=!0,Qe());else{var le=h(S);le!==null&&ne(fe,le.startTime-$)}}var ae=!1,oe=-1,F=5,ce=-1;function ue(){return K?!0:!(u.unstable_now()-ce<F)}function xe(){if(K=!1,ae){var $=u.unstable_now();ce=$;var le=!0;try{e:{E=!1,k&&(k=!1,re(oe),oe=-1),Y=!0;var ee=N;try{t:{for(Q($),b=h(j);b!==null&&!(b.expirationTime>$&&ue());){var je=b.callback;if(typeof je=="function"){b.callback=null,N=b.priorityLevel;var L=je(b.expirationTime<=$);if($=u.unstable_now(),typeof L=="function"){b.callback=L,Q($),le=!0;break t}b===h(j)&&f(j),Q($)}else f(j);b=h(j)}if(b!==null)le=!0;else{var de=h(S);de!==null&&ne(fe,de.startTime-$),le=!1}}break e}finally{b=null,N=ee,Y=!1}le=void 0}}finally{le?Qe():ae=!1}}}var Qe;if(typeof be=="function")Qe=function(){be(xe)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,W=G.port2;G.port1.onmessage=xe,Qe=function(){W.postMessage(null)}}else Qe=function(){Te(xe,0)};function ne($,le){oe=Te(function(){$(u.unstable_now())},le)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function($){$.callback=null},u.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<$?Math.floor(1e3/$):5},u.unstable_getCurrentPriorityLevel=function(){return N},u.unstable_next=function($){switch(N){case 1:case 2:case 3:var le=3;break;default:le=N}var ee=N;N=le;try{return $()}finally{N=ee}},u.unstable_requestPaint=function(){K=!0},u.unstable_runWithPriority=function($,le){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ee=N;N=$;try{return le()}finally{N=ee}},u.unstable_scheduleCallback=function($,le,ee){var je=u.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?je+ee:je):ee=je,$){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ee+L,$={id:p++,callback:le,priorityLevel:$,startTime:ee,expirationTime:L,sortIndex:-1},ee>je?($.sortIndex=ee,d(S,$),h(j)===null&&$===h(S)&&(k?(re(oe),oe=-1):k=!0,ne(fe,ee-je))):($.sortIndex=L,d(j,$),E||Y||(E=!0,ae||(ae=!0,Qe()))),$},u.unstable_shouldYield=ue,u.unstable_wrapCallback=function($){var le=N;return function(){var ee=N;N=le;try{return $.apply(this,arguments)}finally{N=ee}}}})(Xr)),Xr}var Im;function Wy(){return Im||(Im=1,Gr.exports=Fy()),Gr.exports}var Vr={exports:{}},Me={};/**
18
- * @license React
19
- * react.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Pm;function Iy(){if(Pm)return Me;Pm=1;var u=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),z=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),N=Symbol.for("react.view_transition"),Y=Symbol.iterator;function E(w){return w===null||typeof w!="object"?null:(w=Y&&w[Y]||w["@@iterator"],typeof w=="function"?w:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,Te={};function re(w,X,te){this.props=w,this.context=X,this.refs=Te,this.updater=te||k}re.prototype.isReactComponent={},re.prototype.setState=function(w,X){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,X,"setState")},re.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function be(){}be.prototype=re.prototype;function Q(w,X,te){this.props=w,this.context=X,this.refs=Te,this.updater=te||k}var fe=Q.prototype=new be;fe.constructor=Q,K(fe,re.prototype),fe.isPureReactComponent=!0;var ae=Array.isArray;function oe(){}var F={H:null,A:null,T:null,S:null},ce=Object.prototype.hasOwnProperty;function ue(w,X,te){var P=te.ref;return{$$typeof:u,type:w,key:X,ref:P!==void 0?P:null,props:te}}function xe(w,X){return ue(w.type,X,w.props)}function Qe(w){return typeof w=="object"&&w!==null&&w.$$typeof===u}function G(w){var X={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return X[te]})}var W=/\/+/g;function ne(w,X){return typeof w=="object"&&w!==null&&w.key!=null?G(""+w.key):X.toString(36)}function $(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(oe,oe):(w.status="pending",w.then(function(X){w.status==="pending"&&(w.status="fulfilled",w.value=X)},function(X){w.status==="pending"&&(w.status="rejected",w.reason=X)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function le(w,X,te,P,me){var ke=typeof w;(ke==="undefined"||ke==="boolean")&&(w=null);var qe=!1;if(w===null)qe=!0;else switch(ke){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(w.$$typeof){case u:case d:qe=!0;break;case p:return qe=w._init,le(qe(w._payload),X,te,P,me)}}if(qe)return me=me(w),qe=P===""?"."+ne(w,0):P,ae(me)?(te="",qe!=null&&(te=qe.replace(W,"$&/")+"/"),le(me,X,te,"",function(Ol){return Ol})):me!=null&&(Qe(me)&&(me=xe(me,te+(me.key==null||w&&w.key===me.key?"":(""+me.key).replace(W,"$&/")+"/")+qe)),X.push(me)),1;qe=0;var ye=P===""?".":P+":";if(ae(w))for(var ze=0;ze<w.length;ze++)P=w[ze],ke=ye+ne(P,ze),qe+=le(P,X,te,ke,me);else if(ze=E(w),typeof ze=="function")for(w=ze.call(w),ze=0;!(P=w.next()).done;)P=P.value,ke=ye+ne(P,ze++),qe+=le(P,X,te,ke,me);else if(ke==="object"){if(typeof w.then=="function")return le($(w),X,te,P,me);throw X=String(w),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return qe}function ee(w,X,te){if(w==null)return w;var P=[],me=0;return le(w,P,"","",function(ke){return X.call(te,ke,me++)}),P}function je(w){if(w._status===-1){var X=w._result,te=X();te.then(function(P){(w._status===0||w._status===-1)&&(w._status=1,w._result=P,te.status===void 0&&(te.status="fulfilled",te.value=P))},function(P){(w._status===0||w._status===-1)&&(w._status=2,w._result=P,te.status===void 0&&(te.status="rejected",te.reason=P))}),w._status===-1&&(w._status=0,w._result=te)}if(w._status===1)return w._result.default;throw w._result}var L=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function de(w){var X=F.T,te={};te.types=X!==null?X.types:null,F.T=te;try{var P=w(),me=F.S;me!==null&&me(te,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(oe,L)}catch(ke){L(ke)}finally{X!==null&&te.types!==null&&(X.types=te.types),F.T=X}}function Ne(w){var X=F.T;if(X!==null){var te=X.types;te===null?X.types=[w]:te.indexOf(w)===-1&&te.push(w)}else de(Ne.bind(null,w))}var _e={map:ee,forEach:function(w,X,te){ee(w,function(){X.apply(this,arguments)},te)},count:function(w){var X=0;return ee(w,function(){X++}),X},toArray:function(w){return ee(w,function(X){return X})||[]},only:function(w){if(!Qe(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Me.Activity=b,Me.Children=_e,Me.Component=re,Me.Fragment=h,Me.Profiler=g,Me.PureComponent=Q,Me.StrictMode=f,Me.Suspense=j,Me.ViewTransition=N,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Me.__COMPILER_RUNTIME={__proto__:null,c:function(w){return F.H.useMemoCache(w)}},Me.addTransitionType=Ne,Me.cache=function(w){return function(){return w.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(w,X,te){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var P=K({},w.props),me=w.key;if(X!=null)for(ke in X.key!==void 0&&(me=""+X.key),X)!ce.call(X,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&X.ref===void 0||(P[ke]=X[ke]);var ke=arguments.length-2;if(ke===1)P.children=te;else if(1<ke){for(var qe=Array(ke),ye=0;ye<ke;ye++)qe[ye]=arguments[ye+2];P.children=qe}return ue(w.type,me,P)},Me.createContext=function(w){return w={$$typeof:z,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:y,_context:w},w},Me.createElement=function(w,X,te){var P,me={},ke=null;if(X!=null)for(P in X.key!==void 0&&(ke=""+X.key),X)ce.call(X,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(me[P]=X[P]);var qe=arguments.length-2;if(qe===1)me.children=te;else if(1<qe){for(var ye=Array(qe),ze=0;ze<qe;ze++)ye[ze]=arguments[ze+2];me.children=ye}if(w&&w.defaultProps)for(P in qe=w.defaultProps,qe)me[P]===void 0&&(me[P]=qe[P]);return ue(w,ke,me)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(w){return{$$typeof:D,render:w}},Me.isValidElement=Qe,Me.lazy=function(w){return{$$typeof:p,_payload:{_status:-1,_result:w},_init:je}},Me.memo=function(w,X){return{$$typeof:S,type:w,compare:X===void 0?null:X}},Me.startTransition=de,Me.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Me.use=function(w){return F.H.use(w)},Me.useActionState=function(w,X,te){return F.H.useActionState(w,X,te)},Me.useCallback=function(w,X){return F.H.useCallback(w,X)},Me.useContext=function(w){return F.H.useContext(w)},Me.useDebugValue=function(){},Me.useDeferredValue=function(w,X){return F.H.useDeferredValue(w,X)},Me.useEffect=function(w,X){return F.H.useEffect(w,X)},Me.useEffectEvent=function(w){return F.H.useEffectEvent(w)},Me.useId=function(){return F.H.useId()},Me.useImperativeHandle=function(w,X,te){return F.H.useImperativeHandle(w,X,te)},Me.useInsertionEffect=function(w,X){return F.H.useInsertionEffect(w,X)},Me.useLayoutEffect=function(w,X){return F.H.useLayoutEffect(w,X)},Me.useMemo=function(w,X){return F.H.useMemo(w,X)},Me.useOptimistic=function(w,X){return F.H.useOptimistic(w,X)},Me.useReducer=function(w,X,te){return F.H.useReducer(w,X,te)},Me.useRef=function(w){return F.H.useRef(w)},Me.useState=function(w){return F.H.useState(w)},Me.useSyncExternalStore=function(w,X,te){return F.H.useSyncExternalStore(w,X,te)},Me.useTransition=function(){return F.H.useTransition()},Me.version="19.3.0",Me}var eg;function Pr(){return eg||(eg=1,Vr.exports=Iy()),Vr.exports}var Qr={exports:{}},Qt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var tg;function Py(){if(tg)return Qt;tg=1;var u=Pr();function d(p){var b="https://react.dev/errors/"+p;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)b+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+p+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(){}var f={d:{f:h,r:function(){throw Error(d(522))},D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},g=Symbol.for("react.portal"),y=Symbol.for("react.recoverable"),z=Symbol.for("react.optimistic_key");function D(p,b,N){var Y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:Y==null?null:Y===z?z:""+Y,children:p,containerInfo:b,implementation:N}}var j=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(p,b){if(p==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,Qt.browser=function(p){return{$$typeof:y,_reason:p}},Qt.createPortal=function(p,b){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(d(299));return D(p,b,null,N)},Qt.flushSync=function(p){var b=j.T,N=f.p;try{if(j.T=null,f.p=2,p)return p()}finally{j.T=b,f.p=N,f.d.f()}},Qt.preconnect=function(p,b){typeof p=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,f.d.C(p,b))},Qt.prefetchDNS=function(p){typeof p=="string"&&f.d.D(p)},Qt.preinit=function(p,b){if(typeof p=="string"&&b&&typeof b.as=="string"){var N=b.as,Y=S(N,b.crossOrigin),E=typeof b.integrity=="string"?b.integrity:void 0,k=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;N==="style"?f.d.S(p,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:Y,integrity:E,fetchPriority:k}):N==="script"&&f.d.X(p,{crossOrigin:Y,integrity:E,fetchPriority:k,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Qt.preinitModule=function(p,b){if(typeof p=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var N=S(b.as,b.crossOrigin);f.d.M(p,{crossOrigin:N,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&f.d.M(p)},Qt.preload=function(p,b){if(typeof p=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var N=b.as,Y=S(N,b.crossOrigin);f.d.L(p,N,{crossOrigin:Y,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})}},Qt.preloadModule=function(p,b){if(typeof p=="string")if(b){var N=S(b.as,b.crossOrigin);f.d.m(p,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:N,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else f.d.m(p)},Qt.requestFormReset=function(p){f.d.r(p)},Qt.unstable_batchedUpdates=function(p,b){return p(b)},Qt.useFormState=function(p,b,N){return j.H.useFormState(p,b,N)},Qt.useFormStatus=function(){return j.H.useHostTransitionStatus()},Qt.version="19.3.0",Qt}var lg;function e0(){if(lg)return Qr.exports;lg=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(d){console.error(d)}}return u(),Qr.exports=Py(),Qr.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var ng;function t0(){if(ng)return Vu;ng=1;var u=Wy(),d=Pr(),h=e0();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function y(e){for(var t=e,l=t;l&&!l.alternate;)t=l,(t.flags&4098)!==0&&(e=t.return),l=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function z(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function D(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j(e){if(y(e)!==e)throw Error(f(188))}function S(e){var t=e.alternate;if(!t){if(t=y(e),t===null)throw Error(f(188));return t!==e?null:e}for(var l=e,n=t;;){var a=l.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){l=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===l)return j(a),e;if(i===n)return j(a),t;i=i.sibling}throw Error(f(188))}if(l.return!==n.return)l=a,n=i;else{for(var r=!1,m=a.child;m;){if(m===l){r=!0,l=a,n=i;break}if(m===n){r=!0,n=a,l=i;break}m=m.sibling}if(!r){for(m=i.child;m;){if(m===l){r=!0,l=i,n=a;break}if(m===n){r=!0,n=i,l=a;break}m=m.sibling}if(!r)throw Error(f(189))}}if(l.alternate!==n)throw Error(f(190))}if(l.tag!==3)throw Error(f(188));return l.stateNode.current===l?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function b(e,t,l,n,a,i){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&l(e,n,a,i)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&b(e.child,t,l,n,a,i))return!0;e=e.sibling}return!1}function N(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function Y(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function E(e){var t=[null,null],l=N(e);return l===null||k(t,e,l.child,{foundSelf:!1}),t}function k(e,t,l,n){for(;l!==null;){if(l===t)n.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(n.foundSelf)return e[1]=l,!0;e[0]=l}else if((l.tag!==22||l.memoizedState===null)&&k(e,t,l.child,n))return!0;l=l.sibling}return!1}function K(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(f(559))}}var Te=null,re=null;function be(e,t,l){return e===l?!0:e===t?(Te=e,!0):!1}function Q(e,t,l){return e===l?(re=e,!1):e===t?(re!==null&&(Te=e),!0):!1}function fe(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ae(e,t,l){for(var n=0,a=e;a;a=l(a))n++;a=0;for(var i=t;i;i=l(i))a++;for(;0<n-a;)e=l(e),n--;for(;0<a-n;)t=l(t),a--;for(;n--;){if(e===t||t!==null&&e===t.alternate)return e;e=l(e),t=l(t)}return null}var oe=Object.assign,F=Symbol.for("react.element"),ce=Symbol.for("react.transitional.element"),ue=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),Qe=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),_e=Symbol.for("react.memo_cache_sentinel"),w=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),te=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function ke(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case xe:return"Fragment";case G:return"Profiler";case Qe:return"StrictMode";case le:return"Suspense";case ee:return"SuspenseList";case de:return"Activity";case w:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case ue:return"Portal";case ne:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case je:return t=e.displayName||null,t!==null?t:ke(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return ke(e(t))}catch{}}return null}var qe=Array.isArray,ye=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=h.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ol={pending:!1,data:null,method:null,action:null},Qa=[],$l=-1;function Ot(e){return{current:e}}function St(e){0>$l||(e.current=Qa[$l],Qa[$l]=null,$l--)}function Je(e,t){$l++,Qa[$l]=e.current,e.current=t}var yl=Ot(null),Jl=Ot(null),Pt=Ot(null),Et=Ot(null);function Dl(e,t){switch(Je(Pt,t),Je(Jl,e),Je(yl,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?am(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=am(t),e=im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}St(yl),Je(yl,e)}function yn(){St(yl),St(Jl),St(Pt)}function Za(e){var t=e.memoizedState;t!==null&&(Xi._currentValue=t.memoizedState,Je(Et,e)),t=yl.current;var l=im(t,e.type);t!==l&&(Je(Jl,e),Je(yl,l))}function gt(e){Jl.current===e&&(St(yl),St(Jl)),Et.current===e&&(St(Et),Xi._currentValue=Ol)}var va,Zi;function Rl(e){if(va===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);va=t&&t[1]||"",Zi=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+va+e+Zi}var ya=!1;function Ka(e,t){if(!e||ya)return"";ya=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(I){var O=I}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(I){O=I}Z=!1;try{var H=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Z=!0,new e}finally{Z&&(H!==void 0?Object.defineProperty(e.prototype,"props",H):delete e.prototype.props)}}}else{try{throw Error()}catch(I){O=I}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(I){if(I&&O&&typeof I.stack=="string")return[I.stack,O.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),r=i[0],m=i[1];if(r&&m){var T=r.split(`
44
- `),_=m.split(`
45
- `);for(a=n=0;n<T.length&&!T[n].includes("DetermineComponentFrameRoot");)n++;for(;a<_.length&&!_[a].includes("DetermineComponentFrameRoot");)a++;if(n===T.length||a===_.length)for(n=T.length-1,a=_.length-1;1<=n&&0<=a&&T[n]!==_[a];)a--;for(;1<=n&&0<=a;n--,a--)if(T[n]!==_[a]){if(n!==1||a!==1)do if(n--,a--,0>a||T[n]!==_[a]){var q=`
46
- `+T[n].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=n&&0<=a);break}}}finally{ya=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Rl(l):""}function Fu(e,t){switch(e.tag){case 26:case 27:case 5:return Rl(e.type);case 16:return Rl("Lazy");case 13:return e.child!==t&&t!==null?Rl("Suspense Fallback"):Rl("Suspense");case 19:return Rl("SuspenseList");case 0:case 15:return Ka(e.type,!1);case 11:return Ka(e.type.render,!1);case 1:return Ka(e.type,!0);case 31:return Rl("Activity");case 30:return Rl("ViewTransition");default:return""}}function $a(e){try{var t="",l=null;do t+=Fu(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}var ba=Object.prototype.hasOwnProperty,Ja=u.unstable_scheduleCallback,bl=u.unstable_cancelCallback,Tc=u.unstable_shouldYield,pa=u.unstable_requestPaint,Ht=u.unstable_now,Ki=u.unstable_getCurrentPriorityLevel,jt=u.unstable_ImmediatePriority,Bn=u.unstable_UserBlockingPriority,Fa=u.unstable_NormalPriority,Wu=u.unstable_LowPriority,Ee=u.unstable_IdlePriority,ol=u.log,Nc=u.unstable_setDisableYieldValue,_l=null,ct=null;function el(e){if(typeof ol=="function"&&Nc(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(_l,e)}catch{}}var Fe=Math.clz32?Math.clz32:Ia,Wa=Math.log,Hn=Math.LN2;function Ia(e){return e>>>=0,e===0?32:31-(Wa(e)/Hn|0)|0}var ft=256,pl=262144,dt=4194304;function et(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&-e;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 xa(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var a=0,i=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var m=n&134217727;return m!==0?(n=m&~i,n!==0?a=et(n):(r&=m,r!==0?a=et(r):l||(l=m&~e,l!==0&&(a=et(l))))):(m=n&~i,m!==0?a=et(m):r!==0?a=et(r):l||(l=n&~e,l!==0&&(a=et(l)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:a}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $i(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var n=31-Fe(l),a=1<<n;t|=e[n],l&=~a}return t}function Iu(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 Ji(){var e=dt;return dt<<=1,(dt&62914560)===0&&(dt=4194304),e}function Pa(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Sa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ei(e,t,l,n,a,i){var r=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var m=e.entanglements,T=e.expirationTimes,_=e.hiddenUpdates;for(l=r&~l;0<l;){var q=31-Fe(l),Z=1<<q;m[q]=0,T[q]=-1;var O=_[q];if(O!==null)for(_[q]=null,q=0;q<O.length;q++){var H=O[q];H!==null&&(H.lane&=-536870913)}l&=~Z}n!==0&&Se(e,n,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(r&~t))}function Se(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Fe(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function ut(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-Fe(l),a=1<<n;a&t|e[n]&t&&(e[n]|=t),l&=~a}}function $t(e,t){var l=t&-t;return l=(l&42)!==0?1:Fl(l),(l&(e.suspendedLanes|t))!==0?0:l}function Fl(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 wt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ti(){var e=ze.p;return e!==0?e:(e=window.event,e===void 0?32:Gm(e.type))}function vt(e,t){var l=ze.p;try{return ze.p=e,t()}finally{ze.p=l}}var Ul=Math.random().toString(36).slice(2),yt="__reactFiber$"+Ul,bt="__reactProps$"+Ul,xl="__reactContainer$"+Ul,li="__reactEvents$"+Ul,Wl="__reactListeners$"+Ul,Ta="__reactHandles$"+Ul,Na="__reactResources$"+Ul,Il="__reactMarker$"+Ul,Ln="__reactLoad$"+Ul;function bn(e){delete e[yt],delete e[bt],delete e[Wl],delete e[Ta]}function Pl(e){var t;if(t=e[yt])return t;for(var l=e.parentNode;l;){if(t=l[xl]||l[yt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Tm(e);e!==null;){if(l=e[yt])return l;e=Tm(e)}return t}e=l,l=e.parentNode}return null}function Yn(e){if(e=e[yt]||e[xl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ea(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function Lt(e){var t=e[Na];return t||(t=e[Na]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[Il]=!0}function Bl(e){e[Ln]=void 0}var Pu=new Set,eo={};function en(e,t){tn(e,t),tn(e+"Capture",t)}function tn(e,t){for(eo[e]=t,e=0;e<t.length;e++)Pu.add(t[e])}var ni=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]*$"),cl={},Fi={};function to(e){return ba.call(Fi,e)?!0:ba.call(cl,e)?!1:ni.test(e)?Fi[e]=!0:(cl[e]=!0,!1)}var Be=!1;function ai(){var e=Be;return Be=!1,e}function pn(e,t,l){if(to(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){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,l)}}function qn(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,l)}}function Hl(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,n)}}function _t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ec(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(r){l=""+r,i.call(this,r)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(r){l=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wi(e){if(!e._valueTracker){var t=lo(e)?"checked":"value";e._valueTracker=Ec(e,t,""+e[t])}}function ii(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=lo(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}var jc=/[\n"\\]/g;function Jt(e){return e.replace(jc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ii(e,t,l,n,a,i,r,m){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?r==="number"&&e.value==t?ui(e,_t(e.value)):ui(e,_t(t)):l!=null?ui(e,_t(l)):n!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+_t(m):e.removeAttribute("name")}function Gn(e,t,l,n,a,i,r,m){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Wi(e);return}l=l!=null?""+_t(l):"",t=t!=null?""+_t(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=m?e.checked:!!n,e.defaultChecked=!!n,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),Wi(e)}function ui(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function xn(e,t,l,n){if(e=e.options,t){t={};for(var a=0;a<l.length;a++)t["$"+l[a]]=!0;for(l=0;l<e.length;l++)a=t.hasOwnProperty("$"+e[l].value),e[l].selected!==a&&(e[l].selected=a),a&&n&&(e[l].defaultSelected=!0)}else{for(l=""+_t(l),t=null,a=0;a<e.length;a++){if(e[a].value===l){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function no(e,t,l){if(t!=null&&(t=""+_t(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+_t(l):""}function ao(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(f(92));if(qe(n)){if(1<n.length)throw Error(f(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=_t(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),Wi(e)}function Xn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var wc=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 Pi(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||wc.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function eu(e,t,l){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="",Be=!0);for(var a in t)n=t[a],t.hasOwnProperty(a)&&l[a]!==n&&(Pi(e,a,n),Be=!0)}else for(var i in t)t.hasOwnProperty(i)&&Pi(e,i,t[i])}function Dt(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 zc=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"],["maskType","mask-type"],["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"]]),io=/^[\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 oi(e){return io.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function He(){}var ln=null;function tu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,Sn=null;function lu(e){var t=Yn(e);if(t&&(e=t.stateNode)){var l=e[bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ii(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Jt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var a=n[bt]||null;if(!a)throw Error(f(90));Ii(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&ii(n)}break e;case"textarea":no(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&xn(e,!!l.multiple,t,!1)}}}var ci=!1;function nu(e,t,l){if(ci)return e(t,l);ci=!0;try{var n=e(t);return n}finally{if(ci=!1,(nn!==null||Sn!==null)&&(lc(),nn&&(t=nn,e=Sn,Sn=nn=null,lu(t),e)))for(t=0;t<e.length;t++)lu(e[t])}}function Vn(e,t){var l=e.stateNode;if(l===null)return null;var n=l[bt]||null;if(n===null)return null;l=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(l&&typeof l!="function")throw Error(f(231,t,typeof l));return l}var Sl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),si=!1;if(Sl)try{var Qn={};Object.defineProperty(Qn,"passive",{get:function(){si=!0}}),window.addEventListener("test",Qn,Qn),window.removeEventListener("test",Qn,Qn)}catch{si=!1}var c=null,v=null,x=null;function M(){if(x)return x;var e,t=v,l=t.length,n,a="value"in c?c.value:c.textContent,i=a.length;for(e=0;e<l&&t[e]===a[e];e++);var r=l-e;for(n=1;n<=r&&t[l-n]===a[i-n];n++);return x=a.slice(e,1<n?1-n:void 0)}function B(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 J(){return!0}function ge(){return!1}function ie(e){function t(l,n,a,i,r){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=r,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(i):i[m]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?J:ge,this.isPropagationStopped=ge,this}return oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=J)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=J)},persist:function(){},isPersistent:J}),t}var Ae={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tt=ie(Ae),st=oe({},Ae,{view:0,detail:0}),Tn=ie(st),Ll,Yl,ql,an=oe({},st,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cc,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!==ql&&(ql&&e.type==="mousemove"?(Ll=e.screenX-ql.screenX,Yl=e.screenY-ql.screenY):Yl=Ll=0,ql=e),Ll)},movementY:function(e){return"movementY"in e?e.movementY:Yl}}),we=ie(an),Ge=oe({},an,{dataTransfer:0}),ht=ie(Ge),sl=oe({},st,{relatedTarget:0}),Zt=ie(sl),ri=oe({},Ae,{animationName:0,elapsedTime:0,pseudoElement:0}),uo=ie(ri),au=oe({},Ae,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wg=ie(au),zg=oe({},Ae,{data:0}),lf=ie(zg),Cg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mg={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"},Ag={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Og(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ag[e])?!!t[e]:!1}function Cc(){return Og}var Dg=oe({},st,{key:function(e){if(e.key){var t=Cg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=B(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cc,charCode:function(e){return e.type==="keypress"?B(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?B(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rg=ie(Dg),_g=oe({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nf=ie(_g),kg=oe({},Ae,{submitter:0}),Ug=ie(kg),Bg=oe({},st,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cc}),Hg=ie(Bg),Lg=oe({},Ae,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yg=ie(Lg),qg=oe({},an,{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}),Gg=ie(qg),Xg=oe({},Ae,{newState:0,oldState:0,source:0}),Vg=ie(Xg),Qg=[9,13,27,32],Mc=Sl&&"CompositionEvent"in window,iu=null;Sl&&"documentMode"in document&&(iu=document.documentMode);var Zg=Sl&&"TextEvent"in window&&!iu,af=Sl&&(!Mc||iu&&8<iu&&11>=iu),uf=" ",of=!1;function cf(e,t){switch(e){case"keyup":return Qg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function Kg(e,t){switch(e){case"compositionend":return sf(t);case"keypress":return t.which!==32?null:(of=!0,uf);case"textInput":return e=t.data,e===uf&&of?null:e;default:return null}}function $g(e,t){if(fi)return e==="compositionend"||!Mc&&cf(e,t)?(e=M(),x=v=c=null,fi=!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 af&&t.locale!=="ko"?null:t.data;default:return null}}var Jg={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 rf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jg[e.type]:t==="textarea"}function ff(e,t,l,n){nn?Sn?Sn.push(n):Sn=[n]:nn=n,t=cc(t,"onChange"),0<t.length&&(l=new tt("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var uu=null,ou=null;function Fg(e){Ih(e,0)}function oo(e){var t=Ea(e);if(ii(t))return e}function df(e,t){if(e==="change")return t}var hf=!1;if(Sl){var Ac;if(Sl){var Oc="oninput"in document;if(!Oc){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),Oc=typeof mf.oninput=="function"}Ac=Oc}else Ac=!1;hf=Ac&&(!document.documentMode||9<document.documentMode)}function gf(){uu&&(uu.detachEvent("onpropertychange",vf),ou=uu=null)}function vf(e){if(e.propertyName==="value"&&oo(ou)){var t=[];ff(t,ou,e,tu(e)),nu(Fg,t)}}function Wg(e,t,l){e==="focusin"?(gf(),uu=t,ou=l,uu.attachEvent("onpropertychange",vf)):e==="focusout"&&gf()}function Ig(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oo(ou)}function Pg(e,t){if(e==="click")return oo(t)}function ev(e,t){if(e==="input"||e==="change")return oo(t)}function tv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rl=typeof Object.is=="function"?Object.is:tv;function cu(e,t){if(rl(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var a=l[n];if(!ba.call(t,a)||!rl(e[a],t[a]))return!1}return!0}function Dc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bf(e,t){var l=yf(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=yf(l)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dc(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Dc(e.document)}return t}function Rc(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 lv=Sl&&"documentMode"in document&&11>=document.documentMode,di=null,_c=null,su=null,kc=!1;function Sf(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kc||di==null||di!==Dc(n)||(n=di,"selectionStart"in n&&Rc(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}),su&&cu(su,n)||(su=n,n=cc(_c,"onSelect"),0<n.length&&(t=new tt("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=di)))}function ja(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var hi={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionrun:ja("Transition","TransitionRun"),transitionstart:ja("Transition","TransitionStart"),transitioncancel:ja("Transition","TransitionCancel"),transitionend:ja("Transition","TransitionEnd")},Uc={},Tf={};Sl&&(Tf=document.createElement("div").style,"AnimationEvent"in window||(delete hi.animationend.animation,delete hi.animationiteration.animation,delete hi.animationstart.animation),"TransitionEvent"in window||delete hi.transitionend.transition);function wa(e){if(Uc[e])return Uc[e];if(!hi[e])return e;var t=hi[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Tf)return Uc[e]=t[l];return e}var Nf=wa("animationend"),Ef=wa("animationiteration"),jf=wa("animationstart"),nv=wa("transitionrun"),av=wa("transitionstart"),iv=wa("transitioncancel"),wf=wa("transitionend"),zf=new Map,Bc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Bc.push("scrollEnd");function Gl(e,t){zf.set(e,t),en(t,[e])}var uv=0;function Nn(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Zl.identifierPrefix;var l=uv++;return e="_"+e+"t_"+l.toString(32)+"_",t.autoName=e}function Cf(e){if(e==null||typeof e=="string")return e;var t=null,l=Ri;if(l!==null)for(var n=0;n<l.length;n++){var a=e[l[n]];if(a!=null){if(a==="none")return"none";t=t==null?a:t+(" "+a)}}return t??e.default}function En(e,t){return e=Cf(e),t=Cf(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var co=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)},Tl=[],mi=0,Hc=0;function so(){for(var e=mi,t=Hc=mi=0;t<e;){var l=Tl[t];Tl[t++]=null;var n=Tl[t];Tl[t++]=null;var a=Tl[t];Tl[t++]=null;var i=Tl[t];if(Tl[t++]=null,n!==null&&a!==null){var r=n.pending;r===null?a.next=a:(a.next=r.next,r.next=a),n.pending=a}i!==0&&Mf(l,a,i)}}function ro(e,t,l,n){Tl[mi++]=e,Tl[mi++]=t,Tl[mi++]=l,Tl[mi++]=n,Hc|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Lc(e,t,l,n){return ro(e,t,l,n),fo(e)}function za(e,t){return ro(e,null,null,t),fo(e)}function Mf(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var a=!1,i=e.return;i!==null;)i.childLanes|=l,n=i.alternate,n!==null&&(n.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-Fe(l),e=i.hiddenUpdates,n=e[a],n===null?e[a]=[t]:n.push(t),t.lane=l|536870912),i):null}function fo(e){if(50<Ou)throw Ou=0,tc=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var gi={};function ov(e,t,l,n){this.tag=e,this.key=l,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 tl(e,t,l,n){return new ov(e,t,l,n)}function Yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jn(e,t){var l=e.alternate;return l===null?(l=tl(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&1206910976,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Af(e,t){e.flags&=1206910978;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ho(e,t,l,n,a,i){var r=0;if(n=e,typeof n=="function")Yc(n)&&(r=1);else if(typeof n=="string")r=ky(e,l,yl.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(n){case de:return e=tl(31,l,t,a),e.elementType=de,e.lanes=i,e;case xe:return Ca(l.children,a,i,t);case Qe:r=8,a|=24;break;case G:return e=tl(12,l,t,a|2),e.elementType=G,e.lanes=i,e;case le:return e=tl(13,l,t,a),e.elementType=le,e.lanes=i,e;case ee:return e=tl(19,l,t,a),e.elementType=ee,e.lanes=i,e;case Ne:case w:return e=a|32,e=tl(30,l,t,e),e.elementType=w,e.lanes=i,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ne:r=10;break e;case W:r=9;break e;case $:r=11;break e;case je:r=14;break e;case L:r=16,n=null;break e}r=29,l=Error(f(130,e===null?"null":typeof e,"")),n=null}return t=tl(r,l,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Ca(e,t,l,n){return e=tl(7,e,n,t),e.lanes=l,e}function qc(e,t,l){return e=tl(6,e,null,t),e.lanes=l,e}function Of(e){var t=tl(18,null,null,0);return t.stateNode=e,t}function Gc(e,t,l){return t=tl(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Df=new WeakMap;function Nl(e,t){if(typeof e=="object"&&e!==null){var l=Df.get(e);return l!==void 0?l:(t={value:e,source:t,stack:$a(t)},Df.set(e,t),t)}return{value:e,source:t,stack:$a(t)}}var vi=[],yi=0,mo=null,ru=0,El=[],jl=0,Zn=null,un=1,on="";function wn(e,t){vi[yi++]=ru,vi[yi++]=mo,mo=e,ru=t}function Rf(e,t,l){El[jl++]=un,El[jl++]=on,El[jl++]=Zn,Zn=e;var n=un;e=on;var a=32-Fe(n)-1;n&=~(1<<a),l+=1;var i=32-Fe(t)+a;if(30<i){var r=a-a%5;i=(n&(1<<r)-1).toString(32),n>>=r,a-=r,un=1<<32-Fe(t)+a|l<<a|n,on=i+e}else un=1<<i|l<<a|n,on=e}function go(e){e.return!==null&&(wn(e,1),Rf(e,1,0))}function Xc(e){for(;e===mo;)mo=vi[--yi],vi[yi]=null,ru=vi[--yi],vi[yi]=null;for(;e===Zn;)Zn=El[--jl],El[jl]=null,on=El[--jl],El[jl]=null,un=El[--jl],El[jl]=null}function _f(e,t){El[jl++]=un,El[jl++]=on,El[jl++]=Zn,un=t.id,on=t.overflow,Zn=e}var kt=null,at=null,Ue=!1,Kn=null,wl=!1,Vc=Error(f(519));function $n(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fu(Nl(t,e)),Vc}function kf(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[yt]=e,t[bt]=n,l){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(l=0;l<Ru.length;l++)Ye(Ru[l],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),Gn(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),ao(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||lm(t.textContent,l)?(n.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),n.onScroll!=null&&Ye("scroll",t),n.onScrollEnd!=null&&Ye("scrollend",t),n.onClick!=null&&(t.onclick=He),t=!0):t=!1,t||$n(e,!0)}function vo(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:wl=!1;return;case 27:case 3:wl=!0;return;default:kt=kt.return}}function bi(e){if(e!==kt)return!1;if(!Ue)return vo(e),Ue=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||xr(e.type,e.memoizedProps)),l=!l),l&&at&&$n(e),vo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));at=Sm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));at=Sm(e)}else t===27?(t=at,ra(e.type)?(e=Mr,Mr=null,at=e):at=t):at=kt?Cl(e.stateNode.nextSibling):null;return!0}function Ma(){at=kt=null,Ue=!1}function Qc(){var e=Kn;return e!==null&&(al===null?al=e:al.push.apply(al,e),Kn=null),e}function fu(e){Kn===null?Kn=[e]:Kn.push(e)}var Zc=Ot(null),Aa=null,zn=null;function Jn(e,t,l){Je(Zc,t._currentValue),t._currentValue=l}function Cn(e){e._currentValue=Zc.current,St(Zc)}function yo(e,t,l){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===l)break;e=e.return}}function Kc(e,t,l,n){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var r=a.child;i=i.firstContext;e:for(;i!==null;){var m=i;i=a;for(var T=0;T<t.length;T++)if(m.context===t[T]){i.lanes|=l,m=i.alternate,m!==null&&(m.lanes|=l),yo(i.return,l,e),n||(r=null);break e}i=m.next}}else if(a.tag===18){if(r=a.return,r===null)throw Error(f(341));r.lanes|=l,i=r.alternate,i!==null&&(i.lanes|=l),yo(r,l,e),r=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=l,r=a.alternate,r!==null&&(r.lanes|=l),yo(a.return,l,e),r=a.child,r=r!==null?r.sibling:null):r=a.child;if(r!==null)r.return=a;else for(r=a;r!==null;){if(r===e){r=null;break}if(a=r.sibling,a!==null){a.return=r.return,r=a;break}r=r.return}a=r}}function Oa(e,t,l,n){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var r=a.alternate;if(r===null)throw Error(f(387));if(r=r.memoizedProps,r!==null){var m=a.type;rl(a.pendingProps.value,r.value)||(e!==null?e.push(m):e=[m])}}else if(a===Et.current){if(r=a.alternate,r===null)throw Error(f(387));r.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Xi):e=[Xi])}a=a.return}return e!==null&&Kc(t,e,l,n),t.flags|=262144,e!==null}function bo(e){for(e=e.firstContext;e!==null;){if(!rl(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){Aa=e,zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return Uf(Aa,e)}function po(e,t){return Aa===null&&Da(e),Uf(e,t)}function Uf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},zn===null){if(e===null)throw Error(f(308));zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zn=zn.next=t;return l}var cv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},sv=u.unstable_scheduleCallback,rv=u.unstable_NormalPriority,zt={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $c(){return{controller:new cv,data:new Map,refCount:0}}function du(e){e.refCount--,e.refCount===0&&sv(rv,function(){e.controller.abort()})}function Bf(e,t){if((e.pendingLanes&4194048)!==0){var l=e.transitionTypes;for(l===null&&(l=e.transitionTypes=[]),e=0;e<t.length;e++){var n=t[e];l.indexOf(n)===-1&&l.push(n)}}}var hu=null;function fv(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var mu=null,Jc=0,Ra=0,pi=null;function dv(e,t){if(mu===null){var l=mu=[];Jc=0,Ra=fr(),pi={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Jc++,t.then(Hf,Hf),t}function Hf(){if(--Jc===0&&(hu=null,mu!==null)){pi!==null&&(pi.status="fulfilled");var e=mu;mu=null,Ra=0,pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function hv(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var a=0;a<l.length;a++)(0,l[a])(t)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var Lf=ye.S;ye.S=function(e,t){if(Oh=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&dv(e,t),hu!==null)for(var l=Bi;l!==null;)Bf(l,hu),l=l.next;if(l=e.types,l!==null){for(var n=Bi;n!==null;)Bf(n,l),n=n.next;if(Ra!==0){n=hu,n===null&&(n=hu=[]);for(var a=0;a<l.length;a++){var i=l[a];n.indexOf(i)===-1&&n.push(i)}}}Lf!==null&&Lf(e,t)};var _a=Ot(null);function Fc(){var e=_a.current;return e!==null?e:nt.pooledCache}function xo(e,t){t===null?Je(_a,_a.current):Je(_a,t.pool)}function Yf(){var e=Fc();return e===null?null:{parent:zt._currentValue,pool:e}}var xi=Error(f(460)),Wc=Error(f(474)),So=Error(f(542)),To={then:function(){}};function qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Gf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(He,He),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e===void 0&&!("reason"in t)?Error(f(600)):e;default:if(typeof t.status=="string")t.then(He,He);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=n}},function(n){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e}throw Ua=t,xi}}function ka(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ua=l,xi):l}}var Ua=null;function Xf(){if(Ua===null)throw Error(f(459));var e=Ua;return Ua=null,e}function Vf(e){if(e===xi||e===So)throw Error(f(483))}var Si=null,gu=0;function No(e){var t=gu;return gu+=1,Si===null&&(Si=[]),Gf(Si,e,t)}function Fn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Eo(e,t){throw t.$$typeof===F?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qf(e){function t(R,C){if(e){var U=R.deletions;U===null?(R.deletions=[C],R.flags|=16):U.push(C)}}function l(R,C){if(!e)return null;for(;C!==null;)t(R,C),C=C.sibling;return null}function n(R){for(var C=new Map;R!==null;)R.key===null?C.set(R.index,R):C.set(R.key,R),R=R.sibling;return C}function a(R,C){return R=jn(R,C),R.index=0,R.sibling=null,R}function i(R,C,U){return R.index=U,e?(U=R.alternate,U!==null?(U=U.index,U<C?(R.flags|=2,C):U):(R.flags|=134217730,C)):(R.flags|=1048576,C)}function r(R){return e&&R.alternate===null&&(R.flags|=134217730),R}function m(R,C,U,V){return C===null||C.tag!==6?(C=qc(U,R.mode,V),C.return=R,C):(C=a(C,U),C.return=R,C)}function T(R,C,U,V){var se=U.type;return se===xe?(R=q(R,C,U.props.children,V,U.key),Fn(R,U),R):C!==null&&(C.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===L&&ka(se)===C.type)?(C=a(C,U.props),Fn(C,U),C.return=R,C):(C=ho(U.type,U.key,U.props,null,R.mode,V),Fn(C,U),C.return=R,C)}function _(R,C,U,V){return C===null||C.tag!==4||C.stateNode.containerInfo!==U.containerInfo||C.stateNode.implementation!==U.implementation?(C=Gc(U,R.mode,V),C.return=R,C):(C=a(C,U.children||[]),C.return=R,C)}function q(R,C,U,V,se){return C===null||C.tag!==7?(C=Ca(U,R.mode,V,se),C.return=R,C):(C=a(C,U),C.return=R,C)}function Z(R,C,U){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=qc(""+C,R.mode,U),C.return=R,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ce:return U=ho(C.type,C.key,C.props,null,R.mode,U),Fn(U,C),U.return=R,U;case ue:return C=Gc(C,R.mode,U),C.return=R,C;case L:return C=ka(C),Z(R,C,U)}if(qe(C)||P(C))return C=Ca(C,R.mode,U,null),C.return=R,C;if(typeof C.then=="function")return Z(R,No(C),U);if(C.$$typeof===ne)return Z(R,po(R,C),U);Eo(R,C)}return null}function O(R,C,U,V){var se=C!==null?C.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return se!==null?null:m(R,C,""+U,V);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case ce:return U.key===se?T(R,C,U,V):null;case ue:return U.key===se?_(R,C,U,V):null;case L:return U=ka(U),O(R,C,U,V)}if(qe(U)||P(U))return se!==null?null:q(R,C,U,V,null);if(typeof U.then=="function")return O(R,C,No(U),V);if(U.$$typeof===ne)return O(R,C,po(R,U),V);Eo(R,U)}return null}function H(R,C,U,V,se){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return R=R.get(U)||null,m(C,R,""+V,se);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case ce:return R=R.get(V.key===null?U:V.key)||null,T(C,R,V,se);case ue:return R=R.get(V.key===null?U:V.key)||null,_(C,R,V,se);case L:return V=ka(V),H(R,C,U,V,se)}if(qe(V)||P(V))return R=R.get(U)||null,q(C,R,V,se,null);if(typeof V.then=="function")return H(R,C,U,No(V),se);if(V.$$typeof===ne)return H(R,C,U,po(C,V),se);Eo(C,V)}return null}function I(R,C,U,V){for(var se=null,Ve=null,pe=C,Ce=C=0,At=null;pe!==null&&Ce<U.length;Ce++){pe.index>Ce?(At=pe,pe=null):At=pe.sibling;var Ze=O(R,pe,U[Ce],V);if(Ze===null){pe===null&&(pe=At);break}e&&pe&&Ze.alternate===null&&t(R,pe),C=i(Ze,C,Ce),Ve===null?se=Ze:Ve.sibling=Ze,Ve=Ze,pe=At}if(Ce===U.length)return l(R,pe),Ue&&wn(R,Ce),se;if(pe===null){for(;Ce<U.length;Ce++)pe=Z(R,U[Ce],V),pe!==null&&(C=i(pe,C,Ce),Ve===null?se=pe:Ve.sibling=pe,Ve=pe);return Ue&&wn(R,Ce),se}for(pe=n(pe);Ce<U.length;Ce++)At=H(pe,R,Ce,U[Ce],V),At!==null&&(e&&(Ze=At.alternate,Ze!==null&&pe.delete(Ze.key===null?Ce:Ze.key)),C=i(At,C,Ce),Ve===null?se=At:Ve.sibling=At,Ve=At);return e&&pe.forEach(function(ga){return t(R,ga)}),Ue&&wn(R,Ce),se}function ve(R,C,U,V){if(U==null)throw Error(f(151));for(var se=null,Ve=null,pe=C,Ce=C=0,At=null,Ze=U.next();pe!==null&&!Ze.done;Ce++,Ze=U.next()){pe.index>Ce?(At=pe,pe=null):At=pe.sibling;var ga=O(R,pe,Ze.value,V);if(ga===null){pe===null&&(pe=At);break}e&&pe&&ga.alternate===null&&t(R,pe),C=i(ga,C,Ce),Ve===null?se=ga:Ve.sibling=ga,Ve=ga,pe=At}if(Ze.done)return l(R,pe),Ue&&wn(R,Ce),se;if(pe===null){for(;!Ze.done;Ce++,Ze=U.next())Ze=Z(R,Ze.value,V),Ze!==null&&(C=i(Ze,C,Ce),Ve===null?se=Ze:Ve.sibling=Ze,Ve=Ze);return Ue&&wn(R,Ce),se}for(pe=n(pe);!Ze.done;Ce++,Ze=U.next())Ze=H(pe,R,Ce,Ze.value,V),Ze!==null&&(e&&(At=Ze.alternate,At!==null&&pe.delete(At.key===null?Ce:At.key)),C=i(Ze,C,Ce),Ve===null?se=Ze:Ve.sibling=Ze,Ve=Ze);return e&&pe.forEach(function(Ky){return t(R,Ky)}),Ue&&wn(R,Ce),se}function Re(R,C,U,V){if(typeof U=="object"&&U!==null&&U.type===xe&&U.key===null&&U.props.ref===void 0&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case ce:e:{for(var se=U.key;C!==null;){if(C.key===se){if(se=U.type,se===xe){if(C.tag===7){l(R,C.sibling),V=a(C,U.props.children),Fn(V,U),V.return=R,R=V;break e}}else if(C.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===L&&ka(se)===C.type){l(R,C.sibling),V=a(C,U.props),Fn(V,U),V.return=R,R=V;break e}l(R,C);break}else t(R,C);C=C.sibling}U.type===xe?(V=Ca(U.props.children,R.mode,V,U.key),Fn(V,U),V.return=R,R=V):(V=ho(U.type,U.key,U.props,null,R.mode,V),Fn(V,U),V.return=R,R=V)}return r(R);case ue:e:{for(se=U.key;C!==null;){if(C.key===se)if(C.tag===4&&C.stateNode.containerInfo===U.containerInfo&&C.stateNode.implementation===U.implementation){l(R,C.sibling),V=a(C,U.children||[]),V.return=R,R=V;break e}else{l(R,C);break}else t(R,C);C=C.sibling}V=Gc(U,R.mode,V),V.return=R,R=V}return r(R);case L:return U=ka(U),Re(R,C,U,V)}if(qe(U))return I(R,C,U,V);if(P(U)){if(se=P(U),typeof se!="function")throw Error(f(150));return U=se.call(U),ve(R,C,U,V)}if(typeof U.then=="function")return Re(R,C,No(U),V);if(U.$$typeof===ne)return Re(R,C,po(R,U),V);Eo(R,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,C!==null&&C.tag===6?(l(R,C.sibling),V=a(C,U),V.return=R,R=V):(l(R,C),V=qc(U,R.mode,V),V.return=R,R=V),r(R)):l(R,C)}return function(R,C,U,V){try{gu=0;var se=Re(R,C,U,V);return Si=null,se}catch(pe){if(pe===xi||pe===So)throw pe;var Ve=tl(29,pe,null,R.mode);return Ve.lanes=V,Ve.return=R,Ve}finally{}}}var Ba=Qf(!0),Zf=Qf(!1),Wn=!1;function Ic(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pc(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 In(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ke&2)!==0){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,t=fo(e),Mf(e,null,l),t}return ro(e,n,t,l),fo(e)}function vu(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ut(e,l)}}function es(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var r={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?a=i=r:i=i.next=r,l=l.next}while(l!==null);i===null?a=i=t:i=i.next=t}else a=i=t;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var ts=!1;function yu(){if(ts){var e=pi;if(e!==null)throw e}}function bu(e,t,l,n){ts=!1;var a=e.updateQueue;Wn=!1;var i=a.firstBaseUpdate,r=a.lastBaseUpdate,m=a.shared.pending;if(m!==null){a.shared.pending=null;var T=m,_=T.next;T.next=null,r===null?i=_:r.next=_,r=T;var q=e.alternate;q!==null&&(q=q.updateQueue,m=q.lastBaseUpdate,m!==r&&(m===null?q.firstBaseUpdate=_:m.next=_,q.lastBaseUpdate=T))}if(i!==null){var Z=a.baseState;r=0,q=_=T=null,m=i;do{var O=m.lane&-536870913,H=O!==m.lane;if(H?(Xe&O)===O:(n&O)===O){O!==0&&O===Ra&&(ts=!0),q!==null&&(q=q.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var I=e,ve=m;O=t;var Re=l;switch(ve.tag){case 1:if(I=ve.payload,typeof I=="function"){Z=I.call(Re,Z,O);break e}Z=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ve.payload,O=typeof I=="function"?I.call(Re,Z,O):I,O==null)break e;Z=oe({},Z,O);break e;case 2:Wn=!0}}O=m.callback,O!==null&&(e.flags|=64,H&&(e.flags|=8192),H=a.callbacks,H===null?a.callbacks=[O]:H.push(O))}else H={lane:O,tag:m.tag,payload:m.payload,callback:m.callback,next:null},q===null?(_=q=H,T=Z):q=q.next=H,r|=O;if(m=m.next,m===null){if(m=a.shared.pending,m===null)break;H=m,m=H.next,H.next=null,a.lastBaseUpdate=H,a.shared.pending=null}}while(!0);q===null&&(T=Z),a.baseState=T,a.firstBaseUpdate=_,a.lastBaseUpdate=q,i===null&&(a.shared.lanes=0),ua|=r,e.lanes=r,e.memoizedState=Z}}function Kf(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function $f(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Kf(l[e],t)}var ea=Ot(null),jo=Ot(0);function Jf(e,t){e=Rn,Je(jo,e),Je(ea,t),Rn=e|t.baseLanes}function ls(){Je(jo,Rn),Je(ea,ea.current)}function ns(){Rn=jo.current,St(ea),St(jo)}var qt=Ot(null),Kt=null;function ta(e){var t=e.alternate;Je(Gt,Gt.current&1),Je(qt,e),Kt===null&&(t===null||ea.current!==null||t.memoizedState!==null)&&(Kt=e)}function as(e){Je(Gt,Gt.current),Je(qt,e),Kt===null&&(Kt=e)}function Ff(e){e.tag===22?(Je(Gt,Gt.current),Je(qt,e),Kt===null&&(Kt=e)):la()}function la(){Je(Gt,Gt.current),Je(qt,qt.current)}function fl(e){St(qt),Kt===e&&(Kt=null),St(Gt)}var Gt=Ot(0);function pu(e,t){Je(qt,qt.current),Je(Gt,t)}function is(e){St(Gt),St(qt),Kt===e&&(Kt=null)}function wo(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||zr(l)||Cr(l)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 Mn=0,De=null,lt=null,Ct=null,zo=!1,Ti=!1,Ha=!1,Co=0,xu=0,Ni=null,mv=0;function pt(){throw Error(f(321))}function us(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!rl(e[l],t[l]))return!1;return!0}function os(e,t,l,n,a,i){return Mn=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ye.H=e===null||e.memoizedState===null?Rd:_d,Ha=!1,i=l(n,a),Ha=!1,Ti&&(i=If(t,l,n,a)),Wf(e),i}function Wf(e){ye.H=ko;var t=lt!==null&&lt.next!==null;if(Mn=0,Ct=lt=De=null,zo=!1,xu=0,Ni=null,t)throw Error(f(300));e===null||Mt||(e=e.dependencies,e!==null&&bo(e)&&(Mt=!0))}function If(e,t,l,n){De=e;var a=0;do{if(Ti&&(Ni=null),xu=0,Ti=!1,25<=a)throw Error(f(301));if(a+=1,Ct=lt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}ye.H=Tv,i=t(l,n)}while(Ti);return i}function gv(){var e=ye.H,t=e.useState()[0];return t=typeof t.then=="function"?Su(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(De.flags|=1024),t}function cs(){var e=Co!==0;return Co=0,e}function ss(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function rs(e){if(zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zo=!1}Mn=0,Ct=lt=De=null,Ti=!1,xu=Co=0,Ni=null}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?De.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function Nt(){if(lt===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Ct===null?De.memoizedState:Ct.next;if(t!==null)Ct=t,lt=e;else{if(e===null)throw De.alternate===null?Error(f(467)):Error(f(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Ct===null?De.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Su(e){var t=xu;return xu+=1,Ni===null&&(Ni=[]),e=Gf(Ni,e,t),t=De,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,ye.H=t===null||t.memoizedState===null?Rd:_d),e}function Ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Su(e);if(e.$$typeof===X)return;if(e.$$typeof===ne)return Yt(e)}throw Error(f(438,String(e)))}function fs(e){var t=null,l=De.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=De.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Mo(),De.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=_e;return t.index++,l}function An(e,t){return typeof t=="function"?t(e):t}function Oo(e){var t=Nt();return ds(t,lt,e)}function ds(e,t,l){var n=e.queue;if(n===null)throw Error(f(311));n.lastRenderedReducer=l;var a=e.baseQueue,i=n.pending;if(i!==null){if(a!==null){var r=a.next;a.next=i.next,i.next=r}t.baseQueue=a=i,n.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var m=r=null,T=null,_=t,q=!1;do{var Z=_.lane&-536870913;if(Z!==_.lane?(Xe&Z)===Z:(Mn&Z)===Z){var O=_.revertLane;if(O===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),Z===Ra&&(q=!0);else if((Mn&O)===O){_=_.next,O===Ra&&(q=!0);continue}else Z={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},T===null?(m=T=Z,r=i):T=T.next=Z,De.lanes|=O,ua|=O;Z=_.action,Ha&&l(i,Z),i=_.hasEagerState?_.eagerState:l(i,Z)}else O={lane:Z,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},T===null?(m=T=O,r=i):T=T.next=O,De.lanes|=Z,ua|=Z;_=_.next}while(_!==null&&_!==t);if(T===null?r=i:T.next=m,!rl(i,e.memoizedState)&&(Mt=!0,q&&(l=pi,l!==null)))throw l;e.memoizedState=i,e.baseState=r,e.baseQueue=T,n.lastRenderedState=i}return a===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function hs(e){var t=Nt(),l=t.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=e;var n=l.dispatch,a=l.pending,i=t.memoizedState;if(a!==null){l.pending=null;var r=a=a.next;do i=e(i,r.action),r=r.next;while(r!==a);rl(i,t.memoizedState)||(Mt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,n]}function Pf(e,t,l){var n=De,a=Nt(),i=Ue;if(i){if(l===void 0)throw Error(f(407));l=l()}else l=t();var r=!rl((lt||a).memoizedState,l);if(r&&(a.memoizedState=l,Mt=!0),a=a.queue,vs(ld.bind(null,n,a,e),[e]),e=a.getSnapshot!==t||r||Ct!==null&&(Ct.memoizedState.tag&1)!==0,Ei(e?9:8,{destroy:void 0},td.bind(null,n,a,l,t),null),e){if(n.flags|=2048,nt===null)throw Error(f(349));i||(Mn&127)!==0||ed(n,t,l)}return l}function ed(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=De.updateQueue,t===null?(t=Mo(),De.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function td(e,t,l,n){t.value=l,t.getSnapshot=n,nd(t)&&ad(e)}function ld(e,t,l){return l(function(){nd(t)&&ad(e)})}function nd(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!rl(e,l)}catch{return!0}}function ad(e){var t=za(e,2);t!==null&&il(t,e,2)}function ms(e){var t=Ft();if(typeof e=="function"){var l=e;if(e=l(),Ha){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:An,lastRenderedState:e},t}function id(e,t,l,n){return e.baseState=l,ds(e,lt,typeof n=="function"?n:An)}function vv(e,t,l,n,a){if(_o(e))throw Error(f(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){i.listeners.push(r)}};ye.T!==null?l(!0):i.isTransition=!1,n(i),l=t.pending,l===null?(i.next=t.pending=i,ud(t,i)):(i.next=l.next,t.pending=l.next=i)}}function ud(e,t){var l=t.action,n=t.payload,a=e.state;if(t.isTransition){var i=ye.T,r={};r.types=i!==null?i.types:null,ye.T=r;try{var m=l(a,n),T=ye.S;T!==null&&T(r,m),od(e,t,m)}catch(_){gs(e,t,_)}finally{i!==null&&r.types!==null&&(i.types=r.types),ye.T=i}}else try{i=l(a,n),od(e,t,i)}catch(_){gs(e,t,_)}}function od(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){cd(e,t,n)},function(n){return gs(e,t,n)}):cd(e,t,l)}function cd(e,t,l){t.status="fulfilled",t.value=l,sd(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,ud(e,l)))}function gs(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,sd(t),t=t.next;while(t!==n)}e.action=null}function sd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function fd(e,t){if(Ue){var l=nt.formState;if(l!==null){e:{var n=De;if(Ue){if(at){t:{for(var a=at,i=wl;a.nodeType!==8;){if(!i){a=null;break t}if(a=Cl(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){at=Cl(a.nextSibling),n=a.data==="F!";break e}}$n(n)}n=!1}n&&(t=l[0])}}return l=Ft(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},l.queue=n,l=Ad.bind(null,De,n),n.dispatch=l,n=ms(!1),i=Ss.bind(null,De,!1,n.queue),n=Ft(),a={state:t,dispatch:null,action:e,pending:null},n.queue=a,l=vv.bind(null,De,a,i,l),a.dispatch=l,n.memoizedState=e,[t,l,!1]}function dd(e){var t=Nt();return hd(t,lt,e)}function hd(e,t,l){if(t=ds(e,t,rd)[0],e=Oo(An)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Su(t)}catch(r){throw r===xi?So:r}else n=t;t=Nt();var a=t.queue,i=a.dispatch;return l!==t.memoizedState&&(De.flags|=2048,Ei(9,{destroy:void 0},yv.bind(null,a,l),null)),[n,i,e]}function yv(e,t){e.action=t}function md(e){var t=Nt(),l=lt;if(l!==null)return hd(t,l,e);Nt(),t=t.memoizedState,l=Nt();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function Ei(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=De.updateQueue,t===null&&(t=Mo(),De.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function gd(){return Nt().memoizedState}function Do(e,t,l,n){var a=Ft();De.flags|=e,a.memoizedState=Ei(1|t,{destroy:void 0},l,n===void 0?null:n)}function Ro(e,t,l,n){var a=Nt();n=n===void 0?null:n;var i=a.memoizedState.inst;lt!==null&&n!==null&&us(n,lt.memoizedState.deps)?a.memoizedState=Ei(t,i,l,n):(De.flags|=e,a.memoizedState=Ei(1|t,i,l,n))}function vd(e,t){Do(8390656,8,e,t)}function vs(e,t){Ro(2048,8,e,t)}function bv(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=Mo(),De.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function yd(e){var t=Nt().memoizedState;return bv({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function bd(e,t){return Ro(4,2,e,t)}function pd(e,t){return Ro(4,4,e,t)}function xd(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sd(e,t,l){l=l!=null?l.concat([e]):null,Ro(4,4,xd.bind(null,t,e),l)}function ys(){}function Td(e,t){var l=Nt();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&us(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function Nd(e,t){var l=Nt();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&us(t,n[1]))return n[0];if(n=e(),Ha){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[n,t],n}function bs(e,t,l){return l===void 0||(Mn&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Rh(),De.lanes|=e,ua|=e,l)}function Ed(e,t,l,n){return rl(l,t)?l:ea.current!==null?(e=bs(e,l,n),rl(e,t)||(Mt=!0),e):(Mn&106)===0||(Mn&1073741824)!==0&&(Xe&261930)===0?(Mt=!0,e.memoizedState=l):(e=Rh(),De.lanes|=e,ua|=e,t)}function jd(e,t,l,n,a){var i=ze.p;ze.p=i!==0&&8>i?i:8;var r=ye.T,m={};m.types=r!==null?r.types:null,ye.T=m,Ss(e,!1,t,l);try{var T=a(),_=ye.S;if(_!==null&&_(m,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var q=hv(T,n);Tu(e,t,q,gl(e))}else Tu(e,t,n,gl(e))}catch(Z){Tu(e,t,{then:function(){},status:"rejected",reason:Z},gl())}finally{ze.p=i,r!==null&&m.types!==null&&(r.types=m.types),ye.T=r}}function pv(){}function ps(e,t,l,n){if(e.tag!==5)throw Error(f(476));var a=wd(e).queue;jd(e,a,t,Ol,l===null?pv:function(){return zd(e),l(n)})}function wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ol,baseState:Ol,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:An,lastRenderedState:Ol},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:An,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zd(e){var t=wd(e);t.next===null&&(t=e.alternate.memoizedState),Tu(e,t.next.queue,{},gl())}function xs(){return Yt(Xi)}function Cd(){return Nt().memoizedState}function Md(){return Nt().memoizedState}function xv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=gl();e=In(l);var n=Pn(t,e,l);n!==null&&(il(n,t,l),vu(n,t,l)),t={cache:$c()},e.payload=t;return}t=t.return}}function Sv(e,t,l){var n=gl();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_o(e)?Od(t,l):(l=Lc(e,t,l,n),l!==null&&(il(l,e,n),Dd(l,t,n)))}function Ad(e,t,l){var n=gl();Tu(e,t,l,n)}function Tu(e,t,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(_o(e))Od(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var r=t.lastRenderedState,m=i(r,l);if(a.hasEagerState=!0,a.eagerState=m,rl(m,r))return ro(e,t,a,0),nt===null&&so(),!1}catch{}finally{}if(l=Lc(e,t,a,n),l!==null)return il(l,e,n),Dd(l,t,n),!0}return!1}function Ss(e,t,l,n){if(n={lane:2,revertLane:fr(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(t)throw Error(f(479))}else t=Lc(e,l,n,2),t!==null&&il(t,e,2)}function _o(e){var t=e.alternate;return e===De||t!==null&&t===De}function Od(e,t){Ti=zo=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Dd(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ut(e,l)}}var ko={readContext:Yt,use:Ao,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt,useEffectEvent:pt},Rd={readContext:Yt,use:Ao,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:vd,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Do(4194308,4,xd.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Do(4194308,4,e,t)},useInsertionEffect:function(e,t){Do(4,2,e,t)},useMemo:function(e,t){var l=Ft();t=t===void 0?null:t;var n=e();if(Ha){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Ft();if(l!==void 0){var a=l(t);if(Ha){el(!0);try{l(t)}finally{el(!1)}}}else a=t;return n.memoizedState=n.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},n.queue=e,e=e.dispatch=Sv.bind(null,De,e),[n.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,l=Ad.bind(null,De,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ys,useDeferredValue:function(e,t){var l=Ft();return bs(l,e,t)},useTransition:function(){var e=ms(!1);return e=jd.bind(null,De,e.queue,!0,!1),Ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=De,a=Ft();if(Ue){if(l===void 0)throw Error(f(407));l=l()}else{if(l=t(),nt===null)throw Error(f(349));(Xe&127)!==0||ed(n,t,l)}a.memoizedState=l;var i={value:l,getSnapshot:t};return a.queue=i,vd(ld.bind(null,n,i,e),[e]),n.flags|=2048,Ei(9,{destroy:void 0},td.bind(null,n,i,l,t),null),l},useId:function(){var e=Ft(),t=nt.identifierPrefix;if(Ue){var l=on,n=un;l=(n&~(1<<32-Fe(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Co++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=mv++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:fd,useActionState:fd,useOptimistic:function(e){var t=Ft();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Ss.bind(null,De,!0,l),l.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return Ft().memoizedState=xv.bind(null,De)},useEffectEvent:function(e){var t=Ft(),l={impl:e};return t.memoizedState=l,function(){if((Ke&2)!==0)throw Error(f(440));return l.impl.apply(void 0,arguments)}}},_d={readContext:Yt,use:Ao,useCallback:Td,useContext:Yt,useEffect:vs,useImperativeHandle:Sd,useInsertionEffect:bd,useLayoutEffect:pd,useMemo:Nd,useReducer:Oo,useRef:gd,useState:function(){return Oo(An)},useDebugValue:ys,useDeferredValue:function(e,t){var l=Nt();return Ed(l,lt.memoizedState,e,t)},useTransition:function(){var e=Oo(An)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:Su(e),t]},useSyncExternalStore:Pf,useId:Cd,useHostTransitionStatus:xs,useFormState:dd,useActionState:dd,useOptimistic:function(e,t){var l=Nt();return id(l,lt,e,t)},useMemoCache:fs,useCacheRefresh:Md,useEffectEvent:yd},Tv={readContext:Yt,use:Ao,useCallback:Td,useContext:Yt,useEffect:vs,useImperativeHandle:Sd,useInsertionEffect:bd,useLayoutEffect:pd,useMemo:Nd,useReducer:hs,useRef:gd,useState:function(){return hs(An)},useDebugValue:ys,useDeferredValue:function(e,t){var l=Nt();return lt===null?bs(l,e,t):Ed(l,lt.memoizedState,e,t)},useTransition:function(){var e=hs(An)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:Su(e),t]},useSyncExternalStore:Pf,useId:Cd,useHostTransitionStatus:xs,useFormState:md,useActionState:md,useOptimistic:function(e,t){var l=Nt();return lt!==null?id(l,lt,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:fs,useCacheRefresh:Md,useEffectEvent:yd};function Ts(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:oe({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ns={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=gl(),a=In(n);a.payload=t,l!=null&&(a.callback=l),t=Pn(e,a,n),t!==null&&(il(t,e,n),vu(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=gl(),a=In(n);a.tag=1,a.payload=t,l!=null&&(a.callback=l),t=Pn(e,a,n),t!==null&&(il(t,e,n),vu(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=gl(),n=In(l);n.tag=2,t!=null&&(n.callback=t),t=Pn(e,n,l),t!==null&&(il(t,e,l),vu(t,e,l))}};function kd(e,t,l,n,a,i,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,r):t.prototype&&t.prototype.isPureReactComponent?!cu(l,n)||!cu(a,i):!0}function Ud(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function La(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=oe({},l));for(var a in e)l[a]===void 0&&(l[a]=e[a])}return l}function Bd(e){co(e)}function Hd(e){console.error(e)}function Ld(e){co(e)}function Uo(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Yd(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Es(e,t,l){return l=In(l),l.tag=3,l.payload={element:null},l.callback=function(){Uo(e,t)},l}function qd(e){return e=In(e),e.tag=3,e}function Gd(e,t,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var i=n.value;e.payload=function(){return a(i)},e.callback=function(){Yd(t,l,n)}}var r=l.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){Yd(t,l,n),typeof a!="function"&&(oa===null?oa=new Set([this]):oa.add(this));var m=n.stack;this.componentDidCatch(n.value,{componentStack:m!==null?m:""})})}function Nv(e,t,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Oa(t,l,a,!0),l=qt.current,l!==null){switch(l.tag){case 31:case 13:case 19:return Kt===null?nc():l.alternate===null&&xt===0&&(xt=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===To?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),cr(e,n,a)),!1;case 22:return l.flags|=65536,n===To?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),cr(e,n,a)),!1}throw Error(f(435,l.tag))}return cr(e,n,a),nc(),!1}if(Ue)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,n!==Vc&&(e=Error(f(422),{cause:n}),fu(Nl(e,l)))):(n!==Vc&&(t=Error(f(423),{cause:n}),fu(Nl(t,l))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,n=Nl(n,l),a=Es(e.stateNode,n,a),es(e,a),xt!==4&&(xt=2)),!1;var i=Error(f(520),{cause:n});if(i=Nl(i,l),Au===null?Au=[i]:Au.push(i),xt!==4&&(xt=2),t===null)return!0;n=Nl(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=a&-a,l.lanes|=e,e=Es(l.stateNode,n,e),es(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(oa===null||!oa.has(i))))return l.flags|=65536,a&=-a,l.lanes|=a,a=qd(a),Gd(a,e,l,n),es(l,a),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var js=Error(f(461)),Mt=!1;function Rt(e,t,l,n){t.child=e===null?Zf(t,null,l,n):Ba(t,e.child,l,n)}function Xd(e,t,l,n,a){l=l.render;var i=t.ref;if("ref"in n){var r={};for(var m in n)m!=="ref"&&(r[m]=n[m])}else r=n;return Da(t),n=os(e,t,l,r,i,a),m=cs(),e!==null&&!Mt?(ss(e,t,a),On(e,t,a)):(Ue&&m&&go(t),t.flags|=1,Rt(e,t,n,a),t.child)}function Vd(e,t,l,n,a){if(e===null){var i=l.type;return typeof i=="function"&&!Yc(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,Qd(e,t,i,n,a)):(e=ho(l.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Rs(e,a)){var r=i.memoizedProps;if(l=l.compare,l=l!==null?l:cu,l(r,n)&&e.ref===t.ref)return On(e,t,a)}return t.flags|=1,e=jn(i,n),e.ref=t.ref,e.return=t,t.child=e}function Qd(e,t,l,n,a){if(e!==null){var i=e.memoizedProps;if(cu(i,n)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=n=i,Rs(e,a))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,On(e,t,a)}return ws(e,t,l,n,a)}function Zd(e,t,l,n){var a=n.children,i=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(i=i!==null?i.baseLanes|l:l,e!==null){for(n=t.child=e.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~i}else n=0,t.child=null;return Kd(e,t,i,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xo(t,i!==null?i.cachePool:null),i!==null?Jf(t,i):ls(),Ff(t);else return n=t.lanes=536870912,Kd(e,t,i!==null?i.baseLanes|l:l,l,n)}else i!==null?(xo(t,i.cachePool),Jf(t,i),la(),t.memoizedState=null):(e!==null&&xo(t,null),ls(),la());return Rt(e,t,a,l),t.child}function Nu(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kd(e,t,l,n,a){var i=Fc();return i=i===null?null:{parent:zt._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&xo(t,null),ls(),Ff(t),e!==null&&Oa(e,t,n,!0),t.childLanes=a,null}function Bo(e,t){return t=Ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function $d(e,t,l){return Ba(t,e.child,null,l),e=Bo(t,t.pendingProps),e.flags|=2,fl(t),t.memoizedState=null,e}function Ev(e,t,l){var n=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(n.mode==="hidden")return e=Bo(t,n),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nu(null,e);if(as(t),(e=at)?(e=xm(e,wl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:un,overflow:on}:null,retryLane:536870912,hydrationErrors:null},l=Of(e),l.return=t,t.child=l,kt=t,at=null)):e=null,e===null)throw $n(t);return t.lanes=536870912,null}return Bo(t,n)}var i=e.memoizedState;if(i!==null){var r=i.dehydrated;if(as(t),a)if(t.flags&256)t.flags&=-257,t=$d(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(Mt||Oa(e,t,l,!1),a=(l&e.childLanes)!==0,Mt||a){if(ea.current===null){if(n=nt,n!==null&&(r=$t(n,l),r!==0&&r!==i.retryLane))throw i.retryLane=r,za(e,r),il(n,e,r),js;nc()}t=$d(e,t,l)}else e=i.treeContext,at=Cl(r.nextSibling),kt=t,Ue=!0,Kn=null,wl=!1,e!==null&&_f(t,e),t=Bo(t,n),t.flags|=134221824;return t}return e=jn(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ji(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(f(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function ws(e,t,l,n,a){return Da(t),l=os(e,t,l,n,void 0,a),n=cs(),e!==null&&!Mt?(ss(e,t,a),On(e,t,a)):(Ue&&n&&go(t),t.flags|=1,Rt(e,t,l,a),t.child)}function Jd(e,t,l,n,a,i){return Da(t),t.updateQueue=null,l=If(t,n,l,a),Wf(e),n=cs(),e!==null&&!Mt?(ss(e,t,i),On(e,t,i)):(Ue&&n&&go(t),t.flags|=1,Rt(e,t,l,i),t.child)}function Fd(e,t,l,n,a){if(Da(t),t.stateNode===null){var i=gi,r=l.contextType;typeof r=="object"&&r!==null&&(i=Yt(r)),i=new l(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ns,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Ic(t),r=l.contextType,i.context=typeof r=="object"&&r!==null?Yt(r):gi,i.state=t.memoizedState,r=l.getDerivedStateFromProps,typeof r=="function"&&(Ts(t,l,r,n),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(r=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),r!==i.state&&Ns.enqueueReplaceState(i,i.state,null),bu(t,n,i,a),yu(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var m=t.memoizedProps,T=La(l,m);i.props=T;var _=i.context,q=l.contextType;r=gi,typeof q=="object"&&q!==null&&(r=Yt(q));var Z=l.getDerivedStateFromProps;q=typeof Z=="function"||typeof i.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,q||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(m||_!==r)&&Ud(t,i,n,r),Wn=!1;var O=t.memoizedState;i.state=O,bu(t,n,i,a),yu(),_=t.memoizedState,m||O!==_||Wn?(typeof Z=="function"&&(Ts(t,l,Z,n),_=t.memoizedState),(T=Wn||kd(t,l,T,n,O,_,r))?(q||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=_),i.props=n,i.state=_,i.context=r,n=T):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Pc(e,t),r=t.memoizedProps,q=La(l,r),i.props=q,Z=t.pendingProps,O=i.context,_=l.contextType,T=gi,typeof _=="object"&&_!==null&&(T=Yt(_)),m=l.getDerivedStateFromProps,(_=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(r!==Z||O!==T)&&Ud(t,i,n,T),Wn=!1,O=t.memoizedState,i.state=O,bu(t,n,i,a),yu();var H=t.memoizedState;r!==Z||O!==H||Wn||e!==null&&e.dependencies!==null&&bo(e.dependencies)?(typeof m=="function"&&(Ts(t,l,m,n),H=t.memoizedState),(q=Wn||kd(t,l,q,n,O,H,T)||e!==null&&e.dependencies!==null&&bo(e.dependencies))?(_||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,H,T),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,H,T)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=H),i.props=n,i.state=H,i.context=T,n=q):(typeof i.componentDidUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,ji(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=Ba(t,e.child,null,a),t.child=Ba(t,null,l,a)):Rt(e,t,l,a),t.memoizedState=i.state,e=t.child):e=On(e,t,a),e}function Wd(e,t,l,n){return Ma(),t.flags|=256,Rt(e,t,l,n),t.child}var zs={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cs(e){return{baseLanes:e,cachePool:Yf()}}function Ms(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=ml),e}function Id(e,t,l){var n=t.pendingProps,a=!1,i=(t.flags&128)!==0,r;if((r=i)||(r=e!==null&&e.memoizedState===null?!1:(Gt.current&2)!==0),r&&(a=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(a?ta(t):la(),(e=at)?(e=xm(e,wl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:un,overflow:on}:null,retryLane:536870912,hydrationErrors:null},l=Of(e),l.return=t,t.child=l,kt=t,at=null)):e=null,e===null)throw $n(t);return Cr(e)?t.lanes=32:t.lanes=536870912,null}return i=n.children,n=n.fallback,a?(la(),a=t.mode,i=Ho({mode:"hidden",children:i},a),n=Ca(n,a,l,null),i.return=t,n.return=t,i.sibling=n,t.child=i,n=t.child,n.memoizedState=Cs(l),n.childLanes=Ms(e,r,l),t.memoizedState=zs,Nu(null,n)):(ta(t),As(t,i))}var m=e.memoizedState;if(m!==null){var T=m.dehydrated;if(T!==null)return jv(e,t,i,r,n,T,m,l)}return a?(la(),a=n.fallback,i=t.mode,m=e.child,T=m.sibling,n=jn(m,{mode:"hidden",children:n.children}),n.subtreeFlags=m.subtreeFlags&1206910976,T!==null?a=jn(T,a):(a=Ca(a,i,l,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,Nu(null,n),n=t.child,a=e.child.memoizedState,a===null?a=Cs(l):(i=a.cachePool,i!==null?(m=zt._currentValue,i=i.parent!==m?{parent:m,pool:m}:i):i=Yf(),a={baseLanes:a.baseLanes|l,cachePool:i}),n.memoizedState=a,n.childLanes=Ms(e,r,l),t.memoizedState=zs,Nu(e.child,n)):(ta(t),l=e.child,e=l.sibling,l=jn(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=l,t.memoizedState=null,l)}function As(e,t){return t=Ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ho(e,t){return e=tl(22,e,null,t),e.lanes=0,e}function Lo(e,t,l){return Ba(t,e.child,null,l),e=As(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jv(e,t,l,n,a,i,r,m){if(l)return t.flags&256?(ta(t),t.flags&=-257,Lo(e,t,m)):t.memoizedState!==null?(la(),t.child=e.child,t.flags|=128,null):(la(),i=a.fallback,r=t.mode,a=Ho({mode:"visible",children:a.children},r),i=Ca(i,r,m,null),i.flags|=2,a.return=t,i.return=t,a.sibling=i,t.child=a,Ba(t,e.child,null,m),a=t.child,a.memoizedState=Cs(m),a.childLanes=Ms(e,n,m),t.memoizedState=zs,Nu(null,a));if(ta(t),Cr(i)){if(n=i.nextSibling&&i.nextSibling.dataset,n)var T=n.dgst;return n=T,n!==""&&(a=Error(f(419)),a.stack="",a.digest=n,fu({value:a,source:null,stack:null})),Lo(e,t,m)}if(Mt||Oa(e,t,m,!1),n=(m&e.childLanes)!==0,Mt||n){if(ea.current!==null)return Lo(e,t,m);if(n=nt,n!==null&&(a=$t(n,m),a!==0&&a!==r.retryLane))throw r.retryLane=a,za(e,a),il(n,e,a),js;return zr(i)||nc(),Lo(e,t,m)}return zr(i)?(t.flags|=192,t.child=e.child,null):(e=r.treeContext,at=Cl(i.nextSibling),kt=t,Ue=!0,Kn=null,wl=!1,e!==null&&_f(t,e),t=As(t,a.children),t.flags|=134221824,t)}function Pd(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),yo(e.return,t,l)}function eh(e){for(var t=null;e!==null;){var l=e.alternate;l!==null&&wo(l)===null&&(t=e),e=e.sibling}return t}function Yo(e,t,l,n,a,i){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:i}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=n,r.tail=l,r.tailMode=a,r.treeForkCount=i)}function Os(e){var t=e.child;for(e.child=null;t!==null;){var l=t.sibling;t.sibling=e.child,e.child=t,t=l}}function Ds(e,t,l){var n=t.pendingProps,a=n.revealOrder,i=n.tail;n=n.children;var r=Gt.current;if(t.flags&128)return pu(t,r),null;var m=(r&2)!==0;if(m?(r=r&1|2,t.flags|=128):r&=1,pu(t,r),a==="backwards"&&e!==null?(Os(e),Rt(e,t,n,l),Os(e)):Rt(e,t,n,l),n=Ue?ru:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pd(e,l,t);else if(e.tag===19)Pd(e,l,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(a){case"backwards":l=eh(t.child),l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null,Os(t)),Yo(t,!0,a,null,i,n);break;case"unstable_legacy-backwards":for(l=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&wo(e)===null){t.child=a;break}e=a.sibling,a.sibling=l,l=a,a=e}Yo(t,!0,l,null,i,n);break;case"together":Yo(t,!1,null,null,void 0,n);break;case"independent":t.memoizedState=null;break;default:l=eh(t.child),l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null),Yo(t,!1,a,l,i,n)}return t.child}function th(e,t,l){var n=t.pendingProps;return Jn(t,t.type,n.value),Rt(e,t,n.children,l),t.child}function On(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Oa(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,l=jn(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=jn(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Rs(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&bo(e)))}function wv(e,t,l){switch(t.tag){case 3:Dl(t,t.stateNode.containerInfo),Jn(t,zt,e.memoizedState.cache),Ma();break;case 27:case 5:Za(t);break;case 4:Dl(t,t.stateNode.containerInfo);break;case 10:Jn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,as(t),null;break;case 13:var n=t.memoizedState;if(n!==null){if(n.dehydrated!==null)return ta(t),t.flags|=128,null;n=Oa(e,t,l,!1);var a=t.child.childLanes;return n||(l&a)!==0?Id(e,t,l):(ta(t),e=On(e,t,l),e!==null?e.sibling:null)}ta(t);break;case 19:if(t.flags&128)return Ds(e,t,l);if(a=(e.flags&128)!==0,n=(l&t.childLanes)!==0,n||(Oa(e,t,l,!1),n=(l&t.childLanes)!==0),a){if(n)return Ds(e,t,l);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),pu(t,Gt.current),n)break;return null;case 22:return t.lanes=0,Zd(e,t,l,t.pendingProps);case 24:Jn(t,zt,e.memoizedState.cache)}return On(e,t,l)}function lh(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Rs(e,l)&&(t.flags&128)===0)return Mt=!1,wv(e,t,l);Mt=(e.flags&131072)!==0}else Mt=!1,Ue&&(t.flags&1048576)!==0&&Rf(t,ru,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e=="function")Yc(e)?(n=La(e,n),t.tag=1,t=Fd(null,t,e,n,l)):(t.tag=0,t=ws(null,t,e,n,l));else{if(e!=null){var a=e.$$typeof;if(a===$){t.tag=11,t=Xd(null,t,e,n,l);break e}else if(a===je){t.tag=14,t=Vd(null,t,e,n,l);break e}else if(a===ne){t.tag=10,t.type=e,t=th(null,t,l);break e}}throw t=ke(e)||e,Error(f(306,t,""))}}return t;case 0:return ws(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,a=La(n,t.pendingProps),Fd(e,t,n,a,l);case 3:e:{if(Dl(t,t.stateNode.containerInfo),e===null)throw Error(f(387));n=t.pendingProps;var i=t.memoizedState;a=i.element,Pc(e,t),bu(t,n,null,l);var r=t.memoizedState;if(n=r.cache,Jn(t,zt,n),n!==i.cache&&Kc(t,[zt],l,!0),yu(),n=r.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Wd(e,t,n,l);break e}else if(n!==a){a=Nl(Error(f(424)),t),fu(a),t=Wd(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(at=Cl(e.firstChild),kt=t,Ue=!0,Kn=null,wl=!0,l=Zf(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling}else{if(Ma(),n===a){t=On(e,t,l);break e}Rt(e,t,n,l)}t=t.child}return t;case 26:return ji(e,t),e===null?(l=zm(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ue||(t.stateNode=um(t.type,t.pendingProps,Pt.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Za(t),e===null&&Ue&&(n=t.stateNode=Nm(t.type,t.pendingProps,Pt.current),kt=t,wl=!0,a=at,ra(t.type)?(Mr=a,at=Cl(n.firstChild)):at=a),Rt(e,t,t.pendingProps.children,l),ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((a=n=at)&&(n=xy(n,t.type,t.pendingProps,wl),n!==null?(t.stateNode=n,kt=t,at=Cl(n.firstChild),wl=!1,a=!0):a=!1),a||$n(t)),Za(t),a=t.type,i=t.pendingProps,r=e!==null?e.memoizedProps:null,n=i.children,xr(a,i)?n=null:r!==null&&xr(a,r)&&(t.flags|=32),t.memoizedState!==null&&(a=os(e,t,gv,null,null,l),Xi._currentValue=a),ji(e,t),Rt(e,t,n,l),t.child;case 6:return e===null&&Ue&&((e=l=at)&&(l=Sy(l,t.pendingProps,wl),l!==null?(t.stateNode=l,kt=t,at=null,e=!0):e=!1),e||$n(t)),null;case 13:return Id(e,t,l);case 4:return Dl(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ba(t,null,n,l):Rt(e,t,n,l),t.child;case 11:return Xd(e,t,t.type,t.pendingProps,l);case 7:return n=t.pendingProps,ji(e,t),Rt(e,t,n,l),t.child;case 8:return Rt(e,t,t.pendingProps.children,l),t.child;case 12:return Rt(e,t,t.pendingProps.children,l),t.child;case 10:return th(e,t,l);case 9:return a=t.type._context,n=t.pendingProps.children,Da(t),a=Yt(a),n=n(a),t.flags|=1,Rt(e,t,n,l),t.child;case 14:return Vd(e,t,t.type,t.pendingProps,l);case 15:return Qd(e,t,t.type,t.pendingProps,l);case 19:return Ds(e,t,l);case 31:return Ev(e,t,l);case 22:return Zd(e,t,l,t.pendingProps);case 24:return Da(t),n=Yt(zt),e===null?(a=Fc(),a===null&&(a=nt,i=$c(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=l),a=i),t.memoizedState={parent:n,cache:a},Ic(t),Jn(t,zt,a)):((e.lanes&l)!==0&&(Pc(e,t),bu(t,null,null,l),yu()),a=e.memoizedState,i=t.memoizedState,a.parent!==n?(a={parent:n,cache:n},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Jn(t,zt,n)):(n=i.cache,Jn(t,zt,n),n!==a.cache&&Kc(t,[zt],l,!0))),Rt(e,t,t.pendingProps.children,l),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),n=t.pendingProps,n.name!=null&&n.name!=="auto"?t.flags|=e===null?18882560:18874368:Ue&&go(t),e!==null&&e.memoizedProps.name!==n.name?t.flags|=4194816:ji(e,t),Rt(e,t,n.children,l),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function Dn(e){e.flags|=4}function _s(e,t,l,n,a){var i;if((i=(e.mode&32)!==0)&&(i=l===null?Om(t,n):Om(t,n)&&(n.src!==l.src||n.srcSet!==l.srcSet)),i){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Bh())e.flags|=8192;else throw Ua=To,Wc}else e.flags&=-16777217}function nh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Dm(t))if(Bh())e.flags|=8192;else throw Ua=To,Wc}function qo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ji():536870912,e.lanes|=t,Ai|=t)}function Eu(e,t){if(!Ue)switch(e.tailMode){case"visible":break;case"collapsed":for(var l=e.tail,n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null;break;default:for(t=e.tail,l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&1206910976,n|=a.flags&1206910976,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function zv(e,t,l){var n=t.pendingProps;switch(Xc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Cn(zt),yn(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(bi(t)?Dn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Qc())),it(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Dn(t),i!==null?(it(t),nh(t,i)):(it(t),_s(t,a,null,n,l))):i?i!==e.memoizedState?(Dn(t),it(t),nh(t,i)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Dn(t),it(t),_s(t,a,e,n,l)),null;case 27:if(gt(t),l=Pt.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Dn(t);else{if(!n){if(t.stateNode===null)throw Error(f(166));return it(t),t.subtreeFlags&=-33554433,null}e=yl.current,bi(t)?kf(t):(e=Nm(a,n,l),t.stateNode=e,Dn(t))}return it(t),t.subtreeFlags&=-33554433,null;case 5:if(gt(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Dn(t);else{if(!n){if(t.stateNode===null)throw Error(f(166));return it(t),t.subtreeFlags&=-33554433,null}if(i=yl.current,bi(t))kf(t);else{var r=ku(Pt.current);switch(i){case 1:i=r.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=r.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=r.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?r.createElement("select",{is:n.is}):r.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?r.createElement(a,{is:n.is}):r.createElement(a)}}i[yt]=t,i[bt]=n;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)i.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=i;e:switch(Vt(i,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Dn(t)}}return it(t),t.subtreeFlags&=-33554433,_s(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Dn(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(f(166));if(e=Pt.current,bi(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,a=kt,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||lm(e.nodeValue,l)),e||$n(t,!0)}else e=ku(e).createTextNode(n),e[yt]=t,t.stateNode=e}return it(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=bi(t),l!==null){if(e===null){if(!n)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[yt]=t}else Ma(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else l=Qc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(fl(t),t):(fl(t),null);if((t.flags&128)!==0)throw Error(f(558))}return it(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=bi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(f(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(f(317));a[yt]=t}else Ma(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),a=!1}else a=Qc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(fl(t),t):(fl(t),null)}return fl(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),qo(t,t.updateQueue),it(t),null);case 4:return yn(),e===null&&gr(t.stateNode.containerInfo),t.flags|=67108864,it(t),null;case 10:return Cn(t.type),it(t),null;case 19:if(is(t),n=t.memoizedState,n===null)return it(t),null;if(a=(t.flags&128)!==0,i=n.rendering,i===null)if(a)Eu(n,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=wo(e),i!==null){for(t.flags|=128,Eu(n,!1),e=i.updateQueue,t.updateQueue=e,qo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Af(l,e),l=l.sibling;return pu(t,Gt.current&1|2),Ue&&wn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ht()>Po&&(t.flags|=128,a=!0,Eu(n,!1),t.lanes=4194304)}else{if(!a)if(e=wo(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,qo(t,e),Eu(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!i.alternate&&!Ue)return it(t),null}else 2*Ht()-n.renderingStartTime>Po&&l!==536870912&&(t.flags|=128,a=!0,Eu(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}if(n.tail!==null){e=n.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Ht(),e.sibling=null,i=Gt.current,i=a?i&1|2:i&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!l||Ue?pu(t,i):(l=i,Je(qt,t),Je(Gt,l),Kt===null&&(Kt=t)),Ue&&wn(t,n.treeForkCount),e}return it(t),null;case 22:case 23:return fl(t),ns(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),l=t.updateQueue,l!==null&&qo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&St(_a),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Cn(zt),it(t),null;case 25:return null;case 30:return t.flags|=33554432,it(t),null}throw Error(f(156,t.tag))}function Cv(e,t){switch(Xc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(zt),yn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gt(t),null;case 31:if(t.memoizedState!==null){if(fl(t),t.alternate===null)throw Error(f(340));Ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));Ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return is(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return yn(),null;case 10:return Cn(t.type),null;case 22:case 23:return fl(t),ns(),e!==null&&St(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cn(zt),null;case 25:return null;default:return null}}function ah(e,t){switch(Xc(t),t.tag){case 3:Cn(zt),yn();break;case 26:case 27:case 5:gt(t);break;case 4:yn();break;case 31:t.memoizedState!==null&&fl(t);break;case 13:fl(t);break;case 19:is(t);break;case 10:Cn(t.type);break;case 22:case 23:fl(t),ns(),e!==null&&St(_a);break;case 24:Cn(zt)}}function ju(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&e)===e){n=void 0;var i=l.create,r=l.inst;n=i(),r.destroy=n}l=l.next}while(l!==a)}}catch(m){Ie(t,t.return,m)}}function na(e,t,l){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){var r=n.inst,m=r.destroy;if(m!==void 0){r.destroy=void 0,a=t;var T=l,_=m;try{_()}catch(q){Ie(a,T,q)}}}n=n.next}while(n!==i)}}catch(q){Ie(t,t.return,q)}}function ih(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{$f(t,l)}catch(n){Ie(e,e.return,n)}}}function uh(e,t,l){l.props=La(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Ie(e,t,n)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:var a=e.stateNode,i=Nn(e.memoizedProps,a);(a.ref===null||a.ref.name!==i)&&(a.ref=hm(i)),n=a.ref;break;case 7:if(e.stateNode===null){var r=new vl(e);b(e.child,!1,by,r,void 0,void 0),e.stateNode=r}n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(m){Ie(e,t,m)}}function Xt(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){Ie(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){Ie(e,t,a)}else l.current=null}function Go(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l<t.length;l++)pm(e.stateNode,t[l])}function oh(e){for(var t=e.return;t!==null&&(Us(t)&&pm(e.stateNode,t.stateNode),!ks(t));)t=t.return}function wu(e){for(var t=e.return;t!==null&&(Us(t)&&py(e.stateNode,t.stateNode),!ks(t));)t=t.return}function ks(e){return e.tag===5||e.tag===3||e.tag===27}function Us(e){return e&&e.tag===7&&e.stateNode!==null}function Bs(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){Ie(e,e.return,a)}}function Hs(e,t,l){try{var n=e.stateNode;ey(n,e.type,l,t),n[bt]=t}catch(a){Ie(e,e.return,a)}}function ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ra(e.type)||e.tag===4}function Ls(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ch(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&&ra(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 Ys(e,t,l,n){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(a),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=He)),Go(e,n),Be=!0;else if(a!==4&&(a===27&&(Go(e,n),n=null,ra(e.type)&&(l=e.stateNode,t=null)),e=e.child,e!==null))for(Ys(e,t,l,n),e=e.sibling;e!==null;)Ys(e,t,l,n),e=e.sibling}function Xo(e,t,l,n){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?l.insertBefore(a,t):l.appendChild(a),Go(e,n),Be=!0;else if(a!==4&&(a===27&&(Go(e,n),n=null,ra(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Xo(e,t,l,n),e=e.sibling;e!==null;)Xo(e,t,l,n),e=e.sibling}function sh(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Vt(t,n,l),t[yt]=e,t[bt]=l}catch(i){Ie(e,e.return,i)}}var Vo=!1,dl=null;function rh(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Vo=!0)}var sn=null;function fh(){var e=sn;return sn=null,e}var ll=0;function wi(e,t,l,n,a){return ll=0,dh(e.child,t,l,n,a)}function dh(e,t,l,n,a){for(var i=!1;e!==null;){if(e.tag===5){var r=e.stateNode;if(n!==null){var m=Nr(r);n.push(m),m.view&&(i=!0)}else i||Nr(r).view&&(i=!0);Vo=!0,fm(r,ll===0?t:t+"_"+ll,l),ll++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&a||dh(e.child,t,l,n,a)&&(i=!0));e=e.sibling}return i}function rn(e,t){for(;e!==null;)e.tag===5?dm(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||rn(e.child,t)),e=e.sibling}function Qo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Qo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(f(544));var l=t.name;t=En(t.default,t.share),t!=="none"&&(wi(e,l,t,null,!1)||rn(e.child,!1))}e=e.sibling}}function qs(e,t){if(e.tag===30){var l=e.stateNode,n=e.memoizedProps,a=Nn(n,l),i=En(n.default,l.paired?n.share:n.enter);i!=="none"?wi(e,a,i,null,!1)?(Qo(e),l.paired||t||_i(e,n.onEnter)):rn(e.child,!1):Qo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)qs(e,t),e=e.sibling;else Qo(e)}function Gs(e){if(dl!==null&&dl.size!==0){var t=dl;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var l=e.memoizedProps,n=l.name;if(n!=null&&n!=="auto"){var a=t.get(n);if(a!==void 0){var i=En(l.default,l.share);if(i!=="none"&&(wi(e,n,i,null,!1)?(i=e.stateNode,a.paired=i,i.paired=a,_i(e,l.onShare)):rn(e.child,!1)),t.delete(n),t.size===0)break}}}Gs(e)}e=e.sibling}}}function Xs(e){if(e.tag===30){var t=e.memoizedProps,l=Nn(t,e.stateNode),n=dl!==null?dl.get(l):void 0,a=En(t.default,n!==void 0?t.share:t.exit);a!=="none"&&(wi(e,l,a,null,!1)?n!==void 0?(a=e.stateNode,n.paired=a,a.paired=n,dl.delete(l),_i(e,t.onShare)):_i(e,t.onExit):rn(e.child,!1)),dl!==null&&Gs(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Xs(e),e=e.sibling;else dl!==null&&Gs(e)}function hh(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,l=Nn(t,e.stateNode);t=En(t.default,t.update),e.flags&=-5,t!=="none"&&wi(e,l,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&hh(e);e=e.sibling}}function Vs(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,rn(e.child,!1))}Vs(e)}e=e.sibling}}function Zo(e){if(e.tag===30)e.stateNode.paired=null,rn(e.child,!1),Vs(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Zo(e),e=e.sibling;else Vs(e)}function mh(e){for(e=e.child;e!==null;)e.tag===30?rn(e.child,!1):(e.subtreeFlags&33554432)!==0&&mh(e),e=e.sibling}function Qs(e,t,l,n,a,i,r){for(var m=!1;t!==null;){if(t.tag===5){var T=t.stateNode;if(i!==null&&ll<i.length){var _=i[ll],q=Nr(T);(_.view||q.view)&&(m=!0);var Z;if(Z=(e.flags&4)===0)if(q.clip)Z=!0;else{Z=_.rect;var O=q.rect;Z=Z.y!==O.y||Z.x!==O.x||Z.height!==O.height||Z.width!==O.width}Z&&(e.flags|=4),q.abs?q=!_.abs:(_=_.rect,q=q.rect,q=_.height!==q.height||_.width!==q.width),q&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&fm(T,ll===0?l:l+"_"+ll,a),m&&(e.flags&4)!==0||(sn===null&&(sn=[]),sn.push(T,ll===0?n:n+"_"+ll,t.memoizedProps)),ll++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&r?e.flags|=t.flags&32:Qs(e,t.child,l,n,a,i,r)&&(m=!0));t=t.sibling}return m}function gh(e,t){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,n=e.stateNode,a=Nn(l,n),i=En(l.default,l.update),r;r=e.memoizedState,e.memoizedState=null,n=e;var m=e.child;ll=0,a=Qs(n,m,a,a,i,r,!1),(e.flags&4)!==0&&a&&_i(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&gh(e);e=e.sibling}}var Ut=!1,$e=!1,fn=!1,Zs=!1,vh=typeof WeakSet=="function"?WeakSet:Set,Bt=null,dn=!1,zu=!1,Ko=!1,Ks=!1;function Mv(e,t,l){if(e=e.containerInfo,br=Vi,e=xf(e),Rc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var m=0,T=-1,_=-1,q=0,Z=0,O=e,H=null;t:for(;;){for(var I;O!==n||i!==0&&O.nodeType!==3||(T=m+i),O!==r||a!==0&&O.nodeType!==3||(_=m+a),O.nodeType===3&&(m+=O.nodeValue.length),(I=O.firstChild)!==null;)H=O,O=I;for(;;){if(O===e)break t;if(H===n&&++q===i&&(T=m),H===r&&++Z===a&&(_=m),(I=O.nextSibling)!==null)break;O=H,H=O.parentNode}O=I}n=T===-1||_===-1?null:{start:T,end:_}}else n=null}n=n||{start:0,end:0}}else n=null;for(pr={focusedElem:e,selectionRange:n},Vi=!1,l=(l&335544064)===l,Bt=t,t=l?9270:1024;Bt!==null;){if(e=Bt,l&&(n=e.deletions,n!==null))for(i=0;i<n.length;i++)l&&Xs(n[i]);if(e.alternate===null&&(e.flags&2)!==0)l&&rh(e),$o(l);else{if(e.tag===22){if(n=e.alternate,e.memoizedState!==null){n!==null&&n.memoizedState===null&&l&&Xs(n),$o(l);continue}else if(n!==null&&n.memoizedState!==null){l&&rh(e),$o(l);continue}}n=e.child,(e.subtreeFlags&t)!==0&&n!==null?(n.return=e,Bt=n):(l&&hh(e),$o(l))}}dl=null}function $o(e){for(;Bt!==null;){var t=Bt,l=e,n=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((a&1024)!==0&&n!==null){l=void 0,a=n.memoizedProps,n=n.memoizedState;var i=t.stateNode;try{var r=La(t.type,a);l=i.getSnapshotBeforeUpdate(r,n),i.__reactInternalSnapshotBeforeUpdate=l}catch(m){Ie(t,t.return,m)}}break;case 3:if((a&1024)!==0){if(n=t.stateNode.containerInfo,l=n.nodeType,l===9)wr(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":wr(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:l&&n!==null&&(l=Nn(n.memoizedProps,n.stateNode),a=t.memoizedProps,a=En(a.default,a.update),a!=="none"&&wi(n,l,a,n.memoizedState=[],!0));break;default:if((a&1024)!==0)throw Error(f(163))}if(n=t.sibling,n!==null){n.return=t.return,Bt=n;break}Bt=t.return}}function yh(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:hn(e,l),n&4&&ju(5,l);break;case 1:if(hn(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(r){Ie(l,l.return,r)}else{var a=La(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){Ie(l,l.return,r)}}n&64&&ih(l),n&512&&cn(l,l.return);break;case 3:if(hn(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{$f(e,t)}catch(r){Ie(l,l.return,r)}}break;case 27:t===null&&n&4&&sh(l);case 26:case 5:hn(e,l),t===null&&n&4&&Bs(l),n&512&&cn(l,l.return);break;case 12:hn(e,l);break;case 31:hn(e,l),n&4&&Sh(e,l);break;case 13:hn(e,l),n&4&&Th(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=qv.bind(null,l),Ty(e,l))));break;case 22:if(n=l.memoizedState!==null||Ut,!n){var i=t!==null&&t.memoizedState!==null||$e;t=Ut,a=$e,Ut=n,($e=i)&&!a?(n=2,(l.subtreeFlags&8772)!==0&&(n|=1),Ql(e,l,n)):hn(e,l),Ut=t,$e=a}break;case 30:hn(e,l),n&512&&cn(l,l.return);break;case 7:n&512&&cn(l,l.return);default:hn(e,l)}}function $s(e,t){for(e=e.child;e!==null;)bh(e,t),e=e.sibling}function bh(e,t){switch(e.tag){case 5:case 26:try{var l=e.stateNode;if(t){var n=l.style;typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}else{var a=e.stateNode,i=e.memoizedProps.style,r=i!=null&&i.hasOwnProperty("display")?i.display:null;a.style.display=r==null||typeof r=="boolean"?"":(""+r).trim()}}catch(T){Ie(e,e.return,T)}Js(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Be=!0}catch(T){Ie(e,e.return,T)}break;case 18:try{var m=e.stateNode;t?rm(m,!0):rm(e.stateNode,!1)}catch(T){Ie(e,e.return,T)}break;case 22:case 23:e.memoizedState===null&&$s(e,t);break;default:$s(e,t)}}function Js(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var l=e,n=t;switch(l.tag){case 4:bh(l,n);break e;case 22:l.memoizedState===null&&Js(l,n);break e;default:Js(l,n)}}e=e.sibling}}function ph(e){var t=e.alternate;t!==null&&(e.alternate=null,ph(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bn(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 rt=null,nl=!1;function Xl(e,t,l){for(l=l.child;l!==null;)xh(e,t,l),l=l.sibling}function xh(e,t,l){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(_l,l)}catch{}switch(l.tag){case 26:$e||Xt(l,t),Xl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!$e&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$e||Xt(l,t),wu(l);var n=rt,a=nl;ra(l.type)&&(rt=l.stateNode,nl=!1),Xl(e,t,l),Em(l.stateNode,l.type,l.memoizedProps),rt=n,nl=a;break;case 5:$e||Xt(l,t),wu(l);case 6:if(l.tag===6&&wu(l),n=rt,a=nl,rt=null,Xl(e,t,l),rt=n,nl=a,rt!==null)if(nl)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(l.stateNode),Be=!0}catch(i){Ie(l,t,i)}else try{rt.removeChild(l.stateNode),Be=!0}catch(i){Ie(l,t,i)}break;case 18:rt!==null&&(nl?(e=rt,sm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Qi(e)):sm(rt,l.stateNode));break;case 4:n=rt,a=nl,rt=l.stateNode.containerInfo,nl=!0,Xl(e,t,l),rt=n,nl=a;break;case 0:case 11:case 14:case 15:na(2,l,t),$e||na(4,l,t),Xl(e,t,l);break;case 1:$e||(Xt(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&uh(l,t,n)),Xl(e,t,l);break;case 21:Xl(e,t,l);break;case 22:$e=(n=$e)||l.memoizedState!==null,Xl(e,t,l),$e=n;break;case 30:Xt(l,t),Xl(e,t,l);break;case 7:$e||Xt(l,t),Xl(e,t,l);break;default:Xl(e,t,l)}}function Sh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qi(e)}catch(l){Ie(t,t.return,l)}}}function Th(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qi(e)}catch(l){Ie(t,t.return,l)}}function Av(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vh),t;default:throw Error(f(435,e.tag))}}function Jo(e,t){var l=Av(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var a=Gv.bind(null,e,n);n.then(a,a)}})}function Wt(e,t,l){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],r=e,m=t,T=m;e:for(;T!==null;){switch(T.tag){case 27:if(ra(T.type)){rt=T.stateNode,nl=!1;break e}break;case 5:rt=T.stateNode,nl=!1;break e;case 3:case 4:rt=T.stateNode.containerInfo,nl=!0;break e}T=T.return}if(rt===null)throw Error(f(160));xh(r,m,i),rt=null,nl=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nh(t,e,l),t=t.sibling}var Vl=null;function Nh(e,t,l){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(var i=0;i<n.length;i++){var r=n[i];r.ref.impl=r.nextImpl}Wt(t,e,l),It(e),a&4&&(na(3,e,e.return),ju(3,e),na(5,e,e.return));break;case 1:Wt(t,e,l),It(e),a&512&&($e||n===null||Xt(n,n.return)),a&64&&Ut&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?t:l.concat(t))));break;case 26:if(i=Vl,Wt(t,e,l),It(e),a&512&&($e||n===null||Xt(n,n.return)),a&4)if(a=n!==null?n.memoizedState:null,l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null)if(Ut)e.stateNode=um(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,l=e.memoizedProps,a=i.ownerDocument||i;t:switch(t){case"title":n=a.getElementsByTagName("title")[0],(!n||n[Il]||n[yt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=a.createElement(t),a.head.insertBefore(n,a.querySelector("head > title"))),Vt(n,t,l),n[yt]=e,Tt(n),t=n;break e;case"link":if(i=Am("link","href",a).get(t+(l.href||""))){for(r=0;r<i.length;r++)if(n=i[r],n.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&n.getAttribute("rel")===(l.rel==null?null:l.rel)&&n.getAttribute("title")===(l.title==null?null:l.title)&&n.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){i.splice(r,1);break t}}n=a.createElement(t),Vt(n,t,l),a.head.appendChild(n);break;case"meta":if(i=Am("meta","content",a).get(t+(l.content||""))){for(r=0;r<i.length;r++)if(n=i[r],n.getAttribute("content")===(l.content==null?null:""+l.content)&&n.getAttribute("name")===(l.name==null?null:l.name)&&n.getAttribute("property")===(l.property==null?null:l.property)&&n.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&n.getAttribute("charset")===(l.charSet==null?null:l.charSet)){i.splice(r,1);break t}}n=a.createElement(t),Vt(n,t,l),a.head.appendChild(n);break;default:throw Error(f(468,t))}n[yt]=e,Tt(n),t=n}e.stateNode=t}else Ut||Rr(i,e.type,e.stateNode);else e.stateNode=Mm(i,l,e.memoizedProps);else a!==l?(a===null?(t=n.stateNode,t===null||$e||t.parentNode.removeChild(t)):a.count--,l===null?Ut||Rr(i,e.type,e.stateNode):Mm(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Hs(e,e.memoizedProps,n.memoizedProps);break;case 27:Wt(t,e,l),It(e),a&512&&($e||n===null||Xt(n,n.return)),n!==null&&a&4&&Hs(e,e.memoizedProps,n.memoizedProps);break;case 5:if(i=fn,fn=!1,Wt(t,e,l),fn=i,It(e),a&512&&($e||n===null||Xt(n,n.return)),e.flags&32){t=e.stateNode;try{Xn(t,""),Be=!0}catch(q){Ie(e,e.return,q)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Hs(e,t,n!==null?n.memoizedProps:t)),a&1024&&(Zs=!0);break;case 6:if(Wt(t,e,l),It(e),a&4){if(e.stateNode===null)throw Error(f(162));t=e.memoizedProps,l=e.stateNode;try{l.nodeValue=t,Be=!0}catch(q){Ie(e,e.return,q)}}break;case 3:if(Be=!1,rc=null,i=Vl,Vl=Uu(t.containerInfo),Wt(t,e,l),Vl=i,It(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(q){Ie(e,e.return,q)}Zs&&(Zs=!1,Eh(e)),Be=!1;break;case 4:a=fn,fn=Ut,n=ai(),i=Vl,Vl=Uu(e.stateNode.containerInfo),Wt(t,e,l),It(e),Vl=i,Be&&zu&&(Ko=!0),Be=n,fn=a;break;case 12:Wt(t,e,l),It(e);break;case 31:Wt(t,e,l),It(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Jo(e,t)));break;case 13:Wt(t,e,l),It(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Io=Ht()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Jo(e,t)));break;case 22:i=e.memoizedState!==null,r=n!==null&&n.memoizedState!==null;var m=Ut,T=$e,_=fn;Ut=m||i,fn=_||i,$e=T||r,Wt(t,e,l),$e=T,fn=_,Ut=m,It(e),a&8192&&(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,!i||n===null||r||Ut||$e||(t=r||$e,l=Ut,n=$e,Ut=i||Ut,$e=t,aa(e,2),Ut=l,$e=n),!i&&fn||$s(e,i)),a&4&&(t=e.updateQueue,t!==null&&(l=t.retryQueue,l!==null&&(t.retryQueue=null,Jo(e,l))));break;case 19:Wt(t,e,l),It(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Jo(e,t)));break;case 30:a&512&&($e||n===null||Xt(n,n.return)),a=ai(),i=zu,r=(l&335544064)===l,m=e.memoizedProps,zu=r&&En(m.default,m.update)!=="none",Wt(t,e,l),It(e),r&&n!==null&&Be&&(e.flags|=4),zu=i,Be=a;break;case 21:break;case 7:a&512&&($e||n===null||Xt(n,n.return)),n&&n.stateNode!==null&&(n.stateNode._fragmentFiber=e);default:Wt(t,e,l),It(e)}}function It(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(ch(n)){l=n;break}n=n.return}n=null;for(var a=e.return;a!==null;){if(Us(a)){var i=a.stateNode;n===null?n=[i]:n.push(i)}if(ks(a))break;a=a.return}var r=n;if(l==null)throw Error(f(160));switch(l.tag){case 27:var m=l.stateNode,T=Ls(e);Xo(e,T,m,r);break;case 5:var _=l.stateNode;l.flags&32&&(Xn(_,""),l.flags&=-33);var q=Ls(e);Xo(e,q,_,r);break;case 3:case 4:var Z=l.stateNode.containerInfo,O=Ls(e);Ys(e,O,Z,r);break;default:throw Error(f(161))}}catch(H){Ie(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eh(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Vi=!0,t.reset(),Vi=!1),e=e.sibling}}function zi(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)jh(t,e),t=t.sibling;else gh(t)}function jh(e,t){var l=e.alternate;if(l===null)qs(e,!1);else switch(e.tag){case 3:if(Ks=dn=!1,fh(),zi(t,e),!dn&&!Ko){if(e=sn,e!==null)for(var n=0;n<e.length;n+=3){l=e[n];var a=e[n+1];dm(l,e[n+2]),l=l.ownerDocument.documentElement,l!==null&&l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+a+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ks=!0}sn=null;break;case 5:zi(t,e);break;case 4:n=dn,dn=!1,zi(t,e),dn&&(Ko=!0),dn=n;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?qs(e,!1):zi(t,e));break;case 30:n=dn,a=fh(),dn=!1,zi(t,e),dn&&(e.flags|=4);var i=e.memoizedProps,r=e.stateNode;t=Nn(i,r),r=Nn(l.memoizedProps,r);var m=En(i.default,i.update);m==="none"?t=!1:(i=l.memoizedState,l.memoizedState=null,l=e.child,ll=0,t=Qs(e,l,t,r,m,i,!0),ll!==(i===null?0:i.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(_i(e,e.memoizedProps.onUpdate),sn=a):a!==null&&(a.push.apply(a,sn),sn=a),dn=(e.flags&32)!==0?!0:n;break;default:zi(t,e)}}function hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yh(e,t.alternate,t),t=t.sibling}function aa(e,t){for(e=e.child;e!==null;){var l=e,n=t;switch(l.tag){case 0:case 11:case 14:case 15:na(4,l,l.return),aa(l,n);break;case 1:Xt(l,l.return);var a=l.stateNode;typeof a.componentWillUnmount=="function"&&uh(l,l.return,a),aa(l,n);break;case 27:(n&2)!==0&&Em(l.stateNode,l.type,l.memoizedProps);case 5:Xt(l,l.return),l.tag!==5&&l.tag!==27||wu(l),aa(l,n);break;case 6:wu(l);break;case 26:Xt(l,l.return),a=l.stateNode,l.memoizedState!==null||a===null||$e||a.parentNode.removeChild(a),aa(l,n);break;case 22:l.memoizedState===null&&aa(l,n);break;case 30:Xt(l,l.return),aa(l,n);break;case 7:Xt(l,l.return);default:aa(l,n)}e=e.sibling}}function Ql(e,t,l){for(l=(t.subtreeFlags&8772)!==0?l:l&-2,t=t.child;t!==null;){var n=t.alternate,a=e,i=t,r=i.flags,m=(l&1)!==0;switch(i.tag){case 0:case 11:case 15:Ql(a,i,l),ju(4,i);break;case 1:if(Ql(a,i,l),n=i,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(q){Ie(n,n.return,q)}if(n=i,a=n.updateQueue,a!==null){var T=n.stateNode;try{var _=a.shared.hiddenCallbacks;if(_!==null)for(a.shared.hiddenCallbacks=null,a=0;a<_.length;a++)Kf(_[a],T)}catch(q){Ie(n,n.return,q)}}m&&r&64&&ih(i),cn(i,i.return);break;case 27:(l&2)!==0&&sh(i);case 5:i.tag!==5&&i.tag!==27||oh(i),Ql(a,i,l),m&&n===null&&r&4&&Bs(i),cn(i,i.return);break;case 6:oh(i);break;case 26:T=i.stateNode,i.memoizedState!==null||T===null||Ut||Rr(Uu(T.ownerDocument),i.type,T),Ql(a,i,l),m&&n===null&&r&4&&Bs(i),cn(i,i.return);break;case 12:Ql(a,i,l);break;case 31:Ql(a,i,l),m&&r&4&&Sh(a,i);break;case 13:Ql(a,i,l),m&&r&4&&Th(a,i);break;case 22:i.memoizedState===null&&Ql(a,i,l),cn(i,i.return);break;case 30:Ql(a,i,l),cn(i,i.return);break;case 7:cn(i,i.return);default:Ql(a,i,l)}t=t.sibling}}function Fs(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&du(l))}function Ws(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&du(e))}function zl(e,t,l,n){var a=(l&335544064)===l;if(t.subtreeFlags&(a?10262:10256))for(t=t.child;t!==null;)wh(e,t,l,n),t=t.sibling;else a&&mh(t)}function wh(e,t,l,n){var a=(l&335544064)===l;a&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Zo(t);var i=t.flags;switch(t.tag){case 0:case 11:case 15:zl(e,t,l,n),i&2048&&ju(9,t);break;case 1:zl(e,t,l,n);break;case 3:zl(e,t,l,n),a&&Ks&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),i&2048&&(i=null,t.alternate!==null&&(i=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==i&&(t.refCount++,i!=null&&du(i)));break;case 12:if(i&2048){zl(e,t,l,n),i=t.stateNode;try{var r=t.memoizedProps,m=r.id,T=r.onPostCommit;typeof T=="function"&&T(m,t.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(_){Ie(t,t.return,_)}}else zl(e,t,l,n);break;case 31:zl(e,t,l,n);break;case 13:zl(e,t,l,n);break;case 23:break;case 22:r=t.stateNode,m=t.alternate,t.memoizedState!==null?(a&&m!==null&&m.memoizedState===null&&Zo(m),r._visibility&2?zl(e,t,l,n):Cu(e,t)):(a&&m!==null&&m.memoizedState!==null&&Zo(t),r._visibility&2?zl(e,t,l,n):(r._visibility|=2,Ci(e,t,l,n,(t.subtreeFlags&10256)!==0||!1))),i&2048&&Fs(m,t);break;case 24:zl(e,t,l,n),i&2048&&Ws(t.alternate,t);break;case 30:a&&(i=t.alternate,i!==null&&(rn(i.child,!0),rn(t.child,!0))),zl(e,t,l,n);break;default:zl(e,t,l,n)}}function Ci(e,t,l,n,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,r=t,m=l,T=n,_=r.flags;switch(r.tag){case 0:case 11:case 15:Ci(i,r,m,T,a),ju(8,r);break;case 23:break;case 22:var q=r.stateNode;r.memoizedState!==null?q._visibility&2?Ci(i,r,m,T,a):Cu(i,r):(q._visibility|=2,Ci(i,r,m,T,a)),a&&_&2048&&Fs(r.alternate,r);break;case 24:Ci(i,r,m,T,a),a&&_&2048&&Ws(r.alternate,r);break;default:Ci(i,r,m,T,a)}t=t.sibling}}function Cu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,a=n.flags;switch(n.tag){case 22:Cu(l,n),a&2048&&Fs(n.alternate,n);break;case 24:Cu(l,n),a&2048&&Ws(n.alternate,n);break;default:Cu(l,n)}t=t.sibling}}var Ya=8192;function qa(e,t,l){if(e.subtreeFlags&Ya)for(e=e.child;e!==null;)zh(e,t,l),e=e.sibling}function zh(e,t,l){switch(e.tag){case 26:qa(e,t,l),e.flags&Ya&&(e.memoizedState!==null?Uy(l,Vl,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&_m(l,e)));break;case 5:qa(e,t,l),e.flags&Ya&&(e=e.stateNode,(t&335544128)===t&&_m(l,e));break;case 3:case 4:var n=Vl;Vl=Uu(e.stateNode.containerInfo),qa(e,t,l),Vl=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ya,Ya=16777216,qa(e,t,l),Ya=n):qa(e,t,l));break;case 30:if((e.flags&Ya)!==0&&(n=e.memoizedProps.name,n!=null&&n!=="auto")){var a=e.stateNode;a.paired=null,dl===null&&(dl=new Map),dl.set(n,a)}qa(e,t,l);break;default:qa(e,t,l)}}function Ch(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 Mu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];Bt=n,Ah(n,e)}Ch(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mh(e),e=e.sibling}function Mh(e){switch(e.tag){case 0:case 11:case 15:Mu(e),e.flags&2048&&na(9,e,e.return);break;case 3:Mu(e);break;case 12:Mu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fo(e)):Mu(e);break;default:Mu(e)}}function Fo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];Bt=n,Ah(n,e)}Ch(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:na(8,t,t.return),Fo(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Fo(t));break;default:Fo(t)}e=e.sibling}}function Ah(e,t){for(;Bt!==null;){var l=Bt;switch(l.tag){case 0:case 11:case 15:na(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:du(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,Bt=n;else e:for(l=e;Bt!==null;){n=Bt;var a=n.sibling,i=n.return;if(ph(n),n===l){Bt=null;break e}if(a!==null){a.return=i,Bt=a;break e}Bt=i}}}var Ov={getCacheForType:function(e){var t=Yt(zt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Yt(zt).controller.signal}},Dv=typeof WeakMap=="function"?WeakMap:Map,Ke=0,nt=null,Le=null,Xe=0,We=0,hl=null,ia=!1,Mi=!1,Is=!1,Rn=0,xt=0,ua=0,Ga=0,Wo=0,ml=0,Ai=0,Au=null,al=null,Ps=!1,Io=0,Oh=0,Po=1/0,ec=null,oa=null,mt=0,Zl=null,Xa=null,mn=0,er=0,tr=null,Dh=null,Oi=null,Di=null,Ri=null,Ou=0,tc=null;function gl(){return(Ke&2)!==0&&Xe!==0?Xe&-Xe:ye.T!==null?fr():ti()}function Rh(){if(ml===0)if((Xe&536870912)===0||Ue){var e=pl;pl<<=1,(pl&3932160)===0&&(pl=262144),ml=e}else ml=536870912;return e=qt.current,e!==null&&(e.flags|=32),ml}function _i(e,t){if(t!=null){var l=e.stateNode,n=l.ref;n===null&&(n=l.ref=hm(Nn(e.memoizedProps,l))),Di===null&&(Di=[]),Di.push(t.bind(null,n))}}function il(e,t,l){(e===nt&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(ki(e,0),ca(e,Xe,ml,!1)),Sa(e,l),((Ke&2)===0||e!==nt)&&(e===nt&&((Ke&2)===0&&(Ga|=l),xt===4&&ca(e,Xe,ml,!1)),gn(e))}function _h(e,t,l){if((Ke&6)!==0)throw Error(f(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||kl(e,t),a=n?kv(e,t):nr(e,t,!0),i=n;do{if(a===0){Mi&&!n&&ca(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!Rv(l)){a=nr(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var m=e;a=Au;var T=m.current.memoizedState.isDehydrated;if(T&&(ki(m,r).flags|=256),r=nr(m,r,!1),r!==2&&r!==6){if(Is&&!T){m.errorRecoveryDisabledLanes|=i,Ga|=i,a=4;break e}i=al,al=a,i!==null&&(al===null?al=i:al.push.apply(al,i))}a=r}if(i=!1,a!==2)continue}}if(a===1){ki(e,0),ca(e,t,0,!0);break}e:{switch(n=e,i=a,i){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ca(n,t,ml,!ia);break e;case 2:al=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(a=Io+300-Ht(),10<a)){if(ca(n,t,ml,!ia),xa(n,0,!0)!==0)break e;mn=t,n.timeoutHandle=Tr(kh.bind(null,n,l,al,ec,Ps,t,ml,Ga,Ai,ia,i,"Throttled",-0,0),a);break e}kh(n,l,al,ec,Ps,t,ml,Ga,Ai,ia,i,null,-0,0)}}break}while(!0);gn(e)}function kh(e,t,l,n,a,i,r,m,T,_,q,Z,O,H){e.timeoutHandle=-1;var I=t.subtreeFlags,ve=(i&335544064)===i;if(Z=null,(ve||I&8192||(I&16785408)===16785408)&&(Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:He},dl=null,zh(t,i,Z),ve&&(I=Z,ve=e.containerInfo,ve=(ve.nodeType===9?ve:ve.ownerDocument).__reactViewTransition,ve!=null&&(I.count++,I.waitingForViewTransition=!0,I=Lu.bind(I),ve.finished.then(I,I))),I=(i&62914560)===i?Io-Ht():(i&4194048)===i?Oh-Ht():0,I=By(Z,I),I!==null)){mn=i,e.cancelPendingCommit=I(Xh.bind(null,e,t,i,l,n,a,r,m,T,_,q,Z,null,O,H)),ca(e,i,r,!_);return}Xh(e,t,i,l,n,a,r,m,T,_,q,Z)}function Rv(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var a=l[n],i=a.getSnapshot;a=a.value;try{if(!rl(i(),a))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 ca(e,t,l,n){t=$i(e,t),t&=~Wo,t&=~Ga,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var a=t;0<a;){var i=31-Fe(a),r=1<<i;n[i]=-1,a&=~r}l!==0&&Se(e,l,t)}function lc(){return(Ke&6)===0?(Du(0),!1):!0}function lr(){if(Le!==null){if(We===0)var e=Le.return;else e=Le,zn=Aa=null,rs(e),Si=null,gu=0,e=Le;for(;e!==null;)ah(e.alternate,e),e=e.return;Le=null}}function ki(e,t){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,ny(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),mn=0,lr(),nt=e,Le=l=jn(e.current,null),Xe=t,We=0,hl=null,ia=!1,Mi=kl(e,t),Is=!1,Ai=ml=Wo=Ga=ua=xt=0,al=Au=null,Ps=!1,Rn=$i(e,t),so(),l}function Uh(e,t){De=null,ye.H=ko,t===xi||t===So?(t=Xf(),We=3):t===Wc?(t=Xf(),We=4):We=t===js?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hl=t,Le===null&&(xt=1,Uo(e,Nl(t,e.current)))}function Bh(){var e=qt.current;return e===null?!0:(Xe&4194048)===Xe?Kt===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===Kt:!1}function Hh(){var e=ye.H;return ye.H=ko,e===null?ko:e}function Lh(){var e=ye.A;return ye.A=Ov,e}function nc(){xt=4,ia||(Xe&4194048)!==Xe&&qt.current!==null||(Mi=!0),(ua&134217727)===0&&(Ga&134217727)===0||nt===null||ca(nt,Xe,ml,!1)}function nr(e,t,l){var n=Ke;Ke|=2;var a=Hh(),i=Lh();(nt!==e||Xe!==t)&&(ec=null,ki(e,t)),t=!1;var r=xt;e:do try{if(We!==0&&Le!==null){var m=Le,T=hl;switch(We){case 8:lr(),r=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var _=We;if(We=0,hl=null,Ui(e,m,T,_),l&&Mi){r=0;break e}break;default:_=We,We=0,hl=null,Ui(e,m,T,_)}}_v(),r=xt;break}catch(q){Uh(e,q)}while(!0);return t&&e.shellSuspendCounter++,zn=Aa=null,Ke=n,ye.H=a,ye.A=i,Le===null&&(nt=null,Xe=0,so()),r}function _v(){for(;Le!==null;)Yh(Le)}function kv(e,t){var l=Ke;Ke|=2;var n=Hh(),a=Lh();nt!==e||Xe!==t?(ec=null,Po=Ht()+500,ki(e,t)):Mi=kl(e,t);e:do try{if(We!==0&&Le!==null){t=Le;var i=hl;t:switch(We){case 1:We=0,hl=null,Ui(e,t,i,1);break;case 2:case 9:if(qf(i)){We=0,hl=null,qh(t);break}t=function(){We!==2&&We!==9||nt!==e||(We=7),gn(e)},i.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:qf(i)?(We=0,hl=null,qh(t)):(We=0,hl=null,Ui(e,t,i,7));break;case 5:var r=null;switch(Le.tag){case 26:r=Le.memoizedState;case 5:case 27:var m=Le;if(r?Dm(r):m.stateNode.complete){We=0,hl=null;var T=m.sibling;if(T!==null)Le=T;else{var _=m.return;_!==null?(Le=_,ac(_)):Le=null}break t}}We=0,hl=null,Ui(e,t,i,5);break;case 6:We=0,hl=null,Ui(e,t,i,6);break;case 8:lr(),xt=6;break e;default:throw Error(f(462))}}Uv();break}catch(q){Uh(e,q)}while(!0);return zn=Aa=null,ye.H=n,ye.A=a,Ke=l,Le!==null?0:(nt=null,Xe=0,so(),xt)}function Uv(){for(;Le!==null&&!Tc();)Yh(Le)}function Yh(e){var t=lh(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?ac(e):Le=t}function qh(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Jd(l,t,t.pendingProps,t.type,void 0,Xe);break;case 11:t=Jd(l,t,t.pendingProps,t.type.render,t.ref,Xe);break;case 5:rs(t);var n=t;n===kt&&(Ue?(vo(n),n.tag===5&&n.stateNode!=null&&(at=n.stateNode)):(vo(n),Ue=!0));default:ah(l,t),t=Le=Af(t,Rn),t=lh(l,t,Rn)}e.memoizedProps=e.pendingProps,t===null?ac(e):Le=t}function Ui(e,t,l,n){zn=Aa=null,rs(t),Si=null,gu=0;var a=t.return;try{if(Nv(e,a,t,l,Xe)){xt=1,Uo(e,Nl(l,e.current)),Le=null;return}}catch(i){if(a!==null)throw Le=a,i;xt=1,Uo(e,Nl(l,e.current)),Le=null;return}t.flags&32768?(Ue||n===1?e=!0:Mi||(Xe&536870912)!==0?e=!1:(ia=e=!0,(n===2||n===9||n===3||n===6)&&(n=qt.current,n!==null&&n.tag===13&&(n.flags|=16384))),Gh(t,e)):ac(t)}function ac(e){var t=e;do{if((t.flags&32768)!==0){Gh(t,ia);return}e=t.return;var l=zv(t.alternate,t,Rn);if(l!==null){Le=l;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);xt===0&&(xt=5)}function Gh(e,t){do{var l=Cv(e.alternate,e);if(l!==null){l.flags&=32767,Le=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=l}while(e!==null);xt=6,Le=null}function Xh(e,t,l,n,a,i,r,m,T,_,q,Z){e.cancelPendingCommit=null;do ic();while(mt!==0);if((Ke&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));e===nt&&(Le=nt=null,Xe=0),Xa=t,Zl=e,mn=l,tr=a,Dh=n,Bv(e,t,l,r,m,T,Z)}}function Bv(e,t,l,n,a,i,r){var m=t.lanes|t.childLanes;if(er=m,m|=Hc,ei(e,l,m,n,a,i),Di=null,(l&335544064)===l?(Ri=fv(e),n=10262):(Ri=null,n=10256),(t.subtreeFlags&n)!==0||(t.flags&n)!==0?(e.callbackNode=null,e.callbackPriority=0,Xv(Fa,function(){return or(),null})):(e.callbackNode=null,e.callbackPriority=0),Vo=!1,n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=ye.T,ye.T=null,a=ze.p,ze.p=2,i=Ke,Ke|=4;try{Mv(e,t,l)}finally{Ke=i,ze.p=a,ye.T=n}}mt=1,Vo?Oi=sy(r,e.containerInfo,Ri,ar,ir,Lv,ur,or,Hv):(ar(),ir(),ur())}function Hv(e){if(mt!==0){var t=Zl.onRecoverableError;t(e,{componentStack:null})}}function Lv(){mt===3&&(mt=0,jh(Xa,Zl),mt=4)}function ar(){if(mt===1){mt=0;var e=Zl,t=Xa,l=mn,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=ye.T,ye.T=null;var a=ze.p;ze.p=2;var i=Ke;Ke|=4;try{zu=Ko=!1,Nh(t,e,l),l=pr;var r=xf(e.containerInfo),m=l.focusedElem,T=l.selectionRange;if(r!==m&&m&&m.ownerDocument&&pf(m.ownerDocument.documentElement,m)){if(T!==null&&Rc(m)){var _=T.start,q=T.end;if(q===void 0&&(q=_),"selectionStart"in m)m.selectionStart=_,m.selectionEnd=Math.min(q,m.value.length);else{var Z=m.ownerDocument||document,O=Z&&Z.defaultView||window;if(O.getSelection){var H=O.getSelection(),I=m.textContent.length,ve=Math.min(T.start,I),Re=T.end===void 0?ve:Math.min(T.end,I);!H.extend&&ve>Re&&(r=Re,Re=ve,ve=r);var R=bf(m,ve),C=bf(m,Re);if(R&&C&&(H.rangeCount!==1||H.anchorNode!==R.node||H.anchorOffset!==R.offset||H.focusNode!==C.node||H.focusOffset!==C.offset)){var U=Z.createRange();U.setStart(R.node,R.offset),H.removeAllRanges(),ve>Re?(H.addRange(U),H.extend(C.node,C.offset)):(U.setEnd(C.node,C.offset),H.addRange(U))}}}}for(Z=[],H=m;H=H.parentNode;)H.nodeType===1&&Z.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<Z.length;m++){var V=Z[m];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Vi=!!br,pr=br=null}finally{Ke=i,ze.p=a,ye.T=n}}e.current=t,mt=2}}function ir(){if(mt===2){mt=0;var e=Zl,t=Xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=ye.T,ye.T=null;var n=ze.p;ze.p=2;var a=Ke;Ke|=4;try{yh(e,t.alternate,t)}finally{Ke=a,ze.p=n,ye.T=l}}mt=3}}function ur(){if(mt===4||mt===3){mt=0;var e=Oi;Oi=null,pa();var t=Zl,l=Xa,n=mn,a=Dh,i=(n&335544064)===n?10262:10256;if((l.subtreeFlags&i)!==0||(l.flags&i)!==0?mt=5:(mt=0,Xa=Zl=null,Vh(t,t.pendingLanes)),i=t.pendingLanes,i===0&&(oa=null),wt(n),l=l.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(_l,l,void 0,(l.current.flags&128)===128)}catch{}if(a!==null){l=ye.T,i=ze.p,ze.p=2,ye.T=null;try{for(var r=t.onRecoverableError,m=0;m<a.length;m++){var T=a[m];r(T.value,{componentStack:T.stack})}}finally{ye.T=l,ze.p=i}}if(a=Di,r=Ri,Ri=null,a!==null&&(Di=null,r===null&&(r=[]),e!==null))for(T=0;T<a.length;T++)l=(0,a[T])(r),l!==void 0&&e.finished.finally(l);(mn&3)!==0&&ic(),gn(t),i=t.pendingLanes,(n&261930)!==0&&(i&42)!==0?t===tc?Ou++:(Ou=0,tc=t):(Ou=0,tc=null),Du(0)}}function Vh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,du(t)))}function ic(){return Oi!==null&&(Oi.skipTransition(),Oi=null),ar(),ir(),ur(),or()}function or(){if(mt!==5)return!1;var e=Zl,t=er;er=0;var l=wt(mn),n=ye.T,a=ze.p;try{ze.p=32>l?32:l,ye.T=null,l=tr,tr=null;var i=Zl,r=mn;if(mt=0,Xa=Zl=null,mn=0,(Ke&6)!==0)throw Error(f(331));var m=Ke;if(Ke|=4,Mh(i.current),wh(i,i.current,r,l),Ke=m,Du(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(_l,i)}catch{}return!0}finally{ze.p=a,ye.T=n,Vh(e,t)}}function Qh(e,t,l){t=Nl(l,t),t=Es(e.stateNode,t,2),e=Pn(e,t,2),e!==null&&(Sa(e,2),gn(e))}function Ie(e,t,l){if(e.tag===3)Qh(e,e,l);else for(;t!==null;){if(t.tag===3){Qh(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(oa===null||!oa.has(n))){e=Nl(l,e),l=qd(2),n=Pn(t,l,2),n!==null&&(Gd(l,n,t,e),Sa(n,2),gn(n));break}}t=t.return}}function cr(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new Dv;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(l)||(Is=!0,a.add(l),e=Yv.bind(null,e,t,l),t.then(e,e))}function Yv(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,nt===e&&(Xe&l)===l&&((xt===4||xt===3&&(Xe&62914560)===Xe&&300>Ht()-Io)&&(Ke&2)===0?ki(e,0):Wo|=l,Ai===Xe&&(Ai=0)),gn(e)}function Zh(e,t){t===0&&(t=Ji()),e=za(e,t),e!==null&&(Sa(e,t),gn(e))}function qv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Zh(e,l)}function Gv(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(f(314))}n!==null&&n.delete(t),Zh(e,l)}function Xv(e,t){return Ja(e,t)}var Bi=null,Hi=null,sr=!1,uc=!1,rr=!1,sa=0;function gn(e){e!==Hi&&e.next===null&&(Hi===null?Bi=Hi=e:Hi=Hi.next=e),uc=!0,sr||(sr=!0,Qv())}function Du(e,t){if(!rr&&uc){rr=!0;do for(var l=!1,n=Bi;n!==null;){if(e!==0){var a=n.pendingLanes;if(a===0)var i=0;else{var r=n.suspendedLanes,m=n.pingedLanes;i=(1<<31-Fe(42|e)+1)-1,i&=a&~(r&~m),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Fh(n,i))}else i=Xe,i=xa(n,n===nt?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||kl(n,i)||(l=!0,Fh(n,i));n=n.next}while(l);rr=!1}}function Vv(){Kh()}function Kh(){uc=sr=!1;var e=0;sa!==0&&ly()&&(e=sa);for(var t=Ht(),l=null,n=Bi;n!==null;){var a=n.next,i=$h(n,t);i===0?(n.next=null,l===null?Bi=a:l.next=a,a===null&&(Hi=l)):(l=n,(e!==0||(i&3)!==0)&&(uc=!0)),n=a}mt!==0&&mt!==5||Du(e),sa!==0&&(sa=0)}function $h(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var r=31-Fe(i),m=1<<r,T=a[r];T===-1?((m&l)===0||(m&n)!==0)&&(a[r]=Iu(m,t)):T<=t&&(e.expiredLanes|=m),i&=~m}if(t=nt,l=Xe,l=xa(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&bl(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||kl(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&bl(n),wt(l)){case 2:case 8:l=Bn;break;case 32:l=Fa;break;case 268435456:l=Ee;break;default:l=Fa}return n=Jh.bind(null,e),l=Ja(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&bl(n),e.callbackPriority=2,e.callbackNode=null,2}function Jh(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ic()&&e.callbackNode!==l)return null;var n=Xe;return n=xa(e,e===nt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(_h(e,n,t),$h(e,Ht()),e.callbackNode!=null&&e.callbackNode===l?Jh.bind(null,e):null)}function Fh(e,t){if(ic())return null;_h(e,t,!0)}function Qv(){ay(function(){(Ke&6)!==0?Ja(jt,Vv):Kh()})}function fr(){if(sa===0){var e=Ra;e===0&&(e=ft,ft<<=1,(ft&261888)===0&&(ft=256)),sa=e}return sa}function Wh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:oi(e)}function Zv(e,t,l,n,a){if(t==="submit"&&l&&l.stateNode===a){var i=Wh((a[bt]||null).action),r=n.submitter;r&&(t=(t=r[bt]||null)?Wh(t.formAction):r.getAttribute("formAction"),t!==null&&(i=t,r=null));var m=new tt("action","action",null,n,a);e.push({event:m,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(sa!==0){var T=new FormData(a,r);ps(l,{pending:!0,data:T,method:a.method,action:i},null,T)}}else typeof i=="function"&&(m.preventDefault(),T=new FormData(a,r),ps(l,{pending:!0,data:T,method:a.method,action:i},i,T))},currentTarget:a}]})}}for(var dr=0;dr<Bc.length;dr++){var hr=Bc[dr],Kv=hr.toLowerCase(),$v=hr[0].toUpperCase()+hr.slice(1);Gl(Kv,"on"+$v)}Gl(Nf,"onAnimationEnd"),Gl(Ef,"onAnimationIteration"),Gl(jf,"onAnimationStart"),Gl("dblclick","onDoubleClick"),Gl("focusin","onFocus"),Gl("focusout","onBlur"),Gl(nv,"onTransitionRun"),Gl(av,"onTransitionStart"),Gl(iv,"onTransitionCancel"),Gl(wf,"onTransitionEnd"),tn("onMouseEnter",["mouseout","mouseover"]),tn("onMouseLeave",["mouseout","mouseover"]),tn("onPointerEnter",["pointerout","pointerover"]),tn("onPointerLeave",["pointerout","pointerover"]),en("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),en("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),en("onBeforeInput",["compositionend","keypress","textInput","paste"]),en("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),en("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ru="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(" "),Jv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ru));function Ih(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var r=n.length-1;0<=r;r--){var m=n[r],T=m.instance,_=m.currentTarget;if(m=m.listener,T!==i&&a.isPropagationStopped())break e;i=m,a.currentTarget=_;try{i(a)}catch(q){co(q)}a.currentTarget=null,i=T}else for(r=0;r<n.length;r++){if(m=n[r],T=m.instance,_=m.currentTarget,m=m.listener,T!==i&&a.isPropagationStopped())break e;i=m,a.currentTarget=_;try{i(a)}catch(q){co(q)}a.currentTarget=null,i=T}}}}function Ye(e,t){var l=t[li];l===void 0&&(l=t[li]=new Set);var n=e+"__bubble";l.has(n)||(Ph(t,e,2,!1),l.add(n))}function mr(e,t,l){var n=0;t&&(n|=4),Ph(l,e,n,t)}var oc="_reactListening"+Math.random().toString(36).slice(2);function gr(e){if(!e[oc]){e[oc]=!0,Pu.forEach(function(l){l!=="selectionchange"&&(Jv.has(l)||mr(l,!1,e),mr(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oc]||(t[oc]=!0,mr("selectionchange",!1,t))}}function Ph(e,t,l,n){switch(Gm(t)){case 2:var a=qy;break;case 8:a=Gy;break;default:a=kr}l=a.bind(null,t,l,e),a=void 0,!si||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,l,{capture:!0,passive:a}):e.addEventListener(t,l,!0):a!==void 0?e.addEventListener(t,l,{passive:a}):e.addEventListener(t,l,!1)}function vr(e,t,l,n,a){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var r=n.tag;if(r===3||r===4){var m=n.stateNode.containerInfo;if(m===a)break;if(r===4)for(r=n.return;r!==null;){var T=r.tag;if((T===3||T===4)&&r.stateNode.containerInfo===a)return;r=r.return}for(;m!==null;){if(r=Pl(m),r===null)return;if(T=r.tag,T===5||T===6||T===26||T===27){n=i=r;continue e}m=m.parentNode}}n=n.return}nu(function(){var _=i,q=tu(l),Z=[];e:{var O=zf.get(e);if(O!==void 0){var H=tt,I=e;switch(e){case"keypress":if(B(l)===0)break e;case"keydown":case"keyup":H=Rg;break;case"focusin":I="focus",H=Zt;break;case"focusout":I="blur",H=Zt;break;case"beforeblur":case"afterblur":H=Zt;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=we;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=ht;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Hg;break;case Nf:case Ef:case jf:H=uo;break;case wf:H=Yg;break;case"scroll":case"scrollend":H=Tn;break;case"wheel":H=Gg;break;case"copy":case"cut":case"paste":H=wg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=nf;break;case"submit":H=Ug;break;case"toggle":case"beforetoggle":H=Vg}var ve=(t&4)!==0,Re=!ve&&(e==="scroll"||e==="scrollend"),R=ve?O!==null?O+"Capture":null:O;ve=[];for(var C=_,U;C!==null;){var V=C;if(U=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||U===null||R===null||(V=Vn(C,R),V!=null&&ve.push(_u(C,V,U))),Re)break;C=C.return}0<ve.length&&(O=new H(O,I,null,l,q),Z.push({event:O,listeners:ve}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",H&&l!==ln&&(I=l.relatedTarget||l.fromElement)&&(Pl(I)||I[xl]))break e;(O||H)&&(I=q.window===q?q:(H=q.ownerDocument)?H.defaultView||H.parentWindow:window,O?(H=l.relatedTarget||l.toElement,O=_,H=H?Pl(H):null,H!==null&&(Re=y(H),ve=H.tag,H!==Re||ve!==5&&ve!==27&&ve!==6)&&(H=null)):(O=null,H=_),O!==H&&(ve=we,V="onMouseLeave",R="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ve=nf,V="onPointerLeave",R="onPointerEnter",C="pointer"),Re=O==null?I:Ea(O),U=H==null?I:Ea(H),I=new ve(V,C+"leave",O,l,q),I.target=Re,I.relatedTarget=U,V=null,Pl(q)===_&&(ve=new ve(R,C+"enter",H,l,q),ve.target=U,ve.relatedTarget=Re,V=ve),Re=V,ve=O&&H?ae(O,H,Fv):null,O!==null&&em(Z,I,O,ve,!1),H!==null&&Re!==null&&em(Z,Re,H,ve,!0)))}e:{if(O=_?Ea(_):window,H=O.nodeName&&O.nodeName.toLowerCase(),H==="select"||H==="input"&&O.type==="file")var se=df;else if(rf(O))if(hf)se=ev;else{se=Ig;var Ve=Wg}else H=O.nodeName,!H||H.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?_&&Dt(_.elementType)&&(se=df):se=Pg;if(se&&(se=se(e,_))){ff(Z,se,l,q);break e}Ve&&Ve(e,O,_)}switch(Ve=_?Ea(_):window,e){case"focusin":(rf(Ve)||Ve.contentEditable==="true")&&(di=Ve,_c=_,su=null);break;case"focusout":su=_c=di=null;break;case"mousedown":kc=!0;break;case"contextmenu":case"mouseup":case"dragend":kc=!1,Sf(Z,l,q);break;case"selectionchange":if(lv)break;case"keydown":case"keyup":Sf(Z,l,q)}var pe;if(Mc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else fi?cf(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(af&&l.locale!=="ko"&&(fi||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&fi&&(pe=M()):(c=q,v="value"in c?c.value:c.textContent,fi=!0)),Ve=cc(_,Ce),0<Ve.length&&(Ce=new lf(Ce,e,null,l,q),Z.push({event:Ce,listeners:Ve}),pe?Ce.data=pe:(pe=sf(l),pe!==null&&(Ce.data=pe)))),(pe=Zg?Kg(e,l):$g(e,l))&&(Ce=cc(_,"onBeforeInput"),0<Ce.length&&(Ve=new lf("onBeforeInput","beforeinput",null,l,q),Z.push({event:Ve,listeners:Ce}),Ve.data=pe)),Zv(Z,e,_,l,q)}Ih(Z,t)})}function _u(e,t,l){return{instance:e,listener:t,currentTarget:l}}function cc(e,t){for(var l=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=Vn(e,l),a!=null&&n.unshift(_u(e,a,i)),a=Vn(e,t),a!=null&&n.push(_u(e,a,i))),e.tag===3)return n;e=e.return}return[]}function Fv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function em(e,t,l,n,a){for(var i=t._reactName,r=[];l!==null&&l!==n;){var m=l,T=m.alternate,_=m.stateNode;if(m=m.tag,T!==null&&T===n)break;m!==5&&m!==26&&m!==27||_===null||(T=_,a?(_=Vn(l,i),_!=null&&r.unshift(_u(l,_,T))):a||(_=Vn(l,i),_!=null&&r.push(_u(l,_,T)))),l=l.return}r.length!==0&&e.push({event:t,listeners:r})}var Wv=/\r\n?/g,Iv=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(Wv,`
49
- `).replace(Iv,"")}function lm(e,t){return t=tm(t),tm(e)===t}function Pe(e,t,l,n,a,i){switch(l){case"children":if(typeof n=="string")t==="body"||t==="textarea"&&n===""||Xn(e,n);else if(typeof n=="number"||typeof n=="bigint")t!=="body"&&Xn(e,""+n);else return;break;case"className":qn(e,"class",n);break;case"tabIndex":qn(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":qn(e,l,n);break;case"style":eu(e,n,i);return;case"data":if(t!=="object"){qn(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=oi(n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"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 i=="function"&&(l==="formAction"?(t!=="input"&&Pe(e,t,"name",a.name,a,null),Pe(e,t,"formEncType",a.formEncType,a,null),Pe(e,t,"formMethod",a.formMethod,a,null),Pe(e,t,"formTarget",a.formTarget,a,null)):(Pe(e,t,"encType",a.encType,a,null),Pe(e,t,"method",a.method,a,null),Pe(e,t,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=oi(n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=He);return;case"onScroll":n!=null&&Ye("scroll",e);return;case"onScrollEnd":n!=null&&Ye("scrollend",e);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(f(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(f(60));(i!=null?i.__html:void 0)!==l&&(e.innerHTML=l)}}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}l=oi(n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);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(l,n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),pn(e,"popover",n);break;case"xlinkActuate":Hl(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Hl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Hl(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Hl(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Hl(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Hl(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Hl(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Hl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Hl(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":pn(e,"is",n);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=zc.get(l)||l,pn(e,l,n);else return}Be=!0}function yr(e,t,l,n,a,i){switch(l){case"style":eu(e,n,i);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(f(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(f(60));(i!=null?i.__html:void 0)!==l&&(e.innerHTML=l)}}break;case"children":if(typeof n=="string")Xn(e,n);else if(typeof n=="number"||typeof n=="bigint")Xn(e,""+n);else return;break;case"onScroll":n!=null&&Ye("scroll",e);return;case"onScrollEnd":n!=null&&Ye("scrollend",e);return;case"onClick":n!=null&&(e.onclick=He);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!eo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),i=l.slice(2,a?l.length-7:void 0),t=e[bt]||null,t=t!=null?t[l]:null,typeof t=="function"&&e.removeEventListener(i,t,a),typeof n=="function")){typeof t!="function"&&t!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(i,n,a);break e}Be=!0,l in e?e[l]=n:n===!0?e.setAttribute(l,""):pn(e,l,n)}return}Be=!0}function Vt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var n=!1,a=!1,i;for(i in l)if(l.hasOwnProperty(i)){var r=l[i];if(r!=null)switch(i){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Pe(e,t,i,r,l,null)}}a&&Pe(e,t,"srcSet",l.srcSet,l,null),n&&Pe(e,t,"src",l.src,l,null);return;case"input":Ye("invalid",e);var m=i=r=a=null,T=null,_=null;for(n in l)if(l.hasOwnProperty(n)){var q=l[n];if(q!=null)switch(n){case"name":a=q;break;case"type":r=q;break;case"checked":T=q;break;case"defaultChecked":_=q;break;case"value":i=q;break;case"defaultValue":m=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(f(137,t));break;default:Pe(e,t,n,q,l,null)}}Gn(e,i,m,T,_,r,a,!1);return;case"select":Ye("invalid",e),n=r=i=null;for(a in l)if(l.hasOwnProperty(a)&&(m=l[a],m!=null))switch(a){case"value":i=m;break;case"defaultValue":r=m;break;case"multiple":n=m;default:Pe(e,t,a,m,l,null)}t=i,l=r,e.multiple=!!n,t!=null?xn(e,!!n,t,!1):l!=null&&xn(e,!!n,l,!0);return;case"textarea":Ye("invalid",e),i=a=n=null;for(r in l)if(l.hasOwnProperty(r)&&(m=l[r],m!=null))switch(r){case"value":n=m;break;case"defaultValue":a=m;break;case"children":i=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(f(91));break;default:Pe(e,t,r,m,l,null)}ao(e,n,a,i);return;case"option":for(T in l)if(l.hasOwnProperty(T)&&(n=l[T],n!=null))switch(T){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Pe(e,t,T,n,l,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(n=0;n<Ru.length;n++)Ye(Ru[n],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in l)if(l.hasOwnProperty(_)&&(n=l[_],n!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Pe(e,t,_,n,l,null)}return;default:if(Dt(t)){for(q in l)l.hasOwnProperty(q)&&(n=l[q],n!==void 0&&yr(e,t,q,n,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(n=l[m],n!=null&&Pe(e,t,m,n,l,null))}var Pv={};function ey(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,r=null,m=null,T=null,_=null,q=null;for(H in l){var Z=l[H];if(l.hasOwnProperty(H)&&Z!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":T=Z;default:n.hasOwnProperty(H)||Pe(e,t,H,null,n,Z)}}for(var O in n){var H=n[O];if(Z=l[O],n.hasOwnProperty(O)&&(H!=null||Z!=null))switch(O){case"type":H!==Z&&(Be=!0),i=H;break;case"name":H!==Z&&(Be=!0),a=H;break;case"checked":H!==Z&&(Be=!0),_=H;break;case"defaultChecked":H!==Z&&(Be=!0),q=H;break;case"value":H!==Z&&(Be=!0),r=H;break;case"defaultValue":H!==Z&&(Be=!0),m=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(f(137,t));break;default:H!==Z&&Pe(e,t,O,H,n,Z)}}Ii(e,r,m,T,_,q,i,a);return;case"select":H=r=m=O=null;for(i in l)if(T=l[i],l.hasOwnProperty(i)&&T!=null)switch(i){case"value":break;case"multiple":H=T;default:n.hasOwnProperty(i)||Pe(e,t,i,null,n,T)}for(a in n)if(i=n[a],T=l[a],n.hasOwnProperty(a)&&(i!=null||T!=null))switch(a){case"value":i!==T&&(Be=!0),O=i;break;case"defaultValue":i!==T&&(Be=!0),m=i;break;case"multiple":i!==T&&(Be=!0),r=i;default:i!==T&&Pe(e,t,a,i,n,T)}t=m,l=r,n=H,O!=null?xn(e,!!l,O,!1):!!n!=!!l&&(t!=null?xn(e,!!l,t,!0):xn(e,!!l,l?[]:"",!1));return;case"textarea":H=O=null;for(m in l)if(a=l[m],l.hasOwnProperty(m)&&a!=null&&!n.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Pe(e,t,m,null,n,a)}for(r in n)if(a=n[r],i=l[r],n.hasOwnProperty(r)&&(a!=null||i!=null))switch(r){case"value":a!==i&&(Be=!0),O=a;break;case"defaultValue":a!==i&&(Be=!0),H=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(f(91));break;default:a!==i&&Pe(e,t,r,a,n,i)}no(e,O,H);return;case"option":for(var I in l)if(O=l[I],l.hasOwnProperty(I)&&O!=null&&!n.hasOwnProperty(I))switch(I){case"selected":e.selected=!1;break;default:Pe(e,t,I,null,n,O)}for(T in n)if(O=n[T],H=l[T],n.hasOwnProperty(T)&&O!==H&&(O!=null||H!=null))switch(T){case"selected":O!==H&&(Be=!0),e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Pe(e,t,T,O,n,H)}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 ve in l)O=l[ve],l.hasOwnProperty(ve)&&O!=null&&!n.hasOwnProperty(ve)&&Pe(e,t,ve,null,n,O);for(_ in n)if(O=n[_],H=l[_],n.hasOwnProperty(_)&&O!==H&&(O!=null||H!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(f(137,t));break;default:Pe(e,t,_,O,n,H)}return;default:if(Dt(t)){for(var Re in l)O=l[Re],l.hasOwnProperty(Re)&&O!==void 0&&!n.hasOwnProperty(Re)&&yr(e,t,Re,void 0,n,O);for(q in n)O=n[q],H=l[q],!n.hasOwnProperty(q)||O===H||O===void 0&&H===void 0||yr(e,t,q,O,n,H);return}}for(var R in l)O=l[R],l.hasOwnProperty(R)&&O!=null&&!n.hasOwnProperty(R)&&Pe(e,t,R,null,n,O);for(Z in n)O=n[Z],H=l[Z],!n.hasOwnProperty(Z)||O===H||O==null&&H==null||Pe(e,t,Z,O,n,H)}function nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ty(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],i=a.transferSize,r=a.initiatorType,m=a.duration;if(i&&m&&nm(r)){for(r=0,m=a.responseEnd,n+=1;n<l.length;n++){var T=l[n],_=T.startTime;if(_>m)break;var q=T.transferSize,Z=T.initiatorType;q&&nm(Z)&&(T=T.responseEnd,r+=q*(T<m?1:(m-_)/(T-_)))}if(--n,t+=8*(i+r)/(a.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 br=null,pr=null;function ku(e){return e.nodeType===9?e:e.ownerDocument}function am(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 im(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 um(e,t,l,n){return l=ku(l).createElement(e),l[yt]=n,l[bt]=t,Vt(l,e,t),Tt(l),l}function xr(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 Sr=null;function ly(){var e=window.event;return e&&e.type==="popstate"?e===Sr?!1:(Sr=e,!0):(Sr=null,!1)}var Tr=typeof setTimeout=="function"?setTimeout:void 0,ny=typeof clearTimeout=="function"?clearTimeout:void 0,om=typeof Promise=="function"?Promise:void 0,cm=typeof requestAnimationFrame=="function"?requestAnimationFrame:Tr,ay=typeof queueMicrotask=="function"?queueMicrotask:typeof om<"u"?function(e){return om.resolve(null).then(e).catch(iy)}:Tr;function iy(e){setTimeout(function(){throw e})}function ra(e){return e==="head"}function sm(e,t){var l=t,n=0;do{var a=l.nextSibling;if(e.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(a),Qi(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Ar(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ar(l);for(var i=l.firstChild;i;){var r=i.nextSibling,m=i.nodeName;i[Il]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=r}}else l==="body"&&Ar(e.ownerDocument.body);l=a}while(l);Qi(t)}function rm(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function fm(e,t,l){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,l!=null&&(e.style.viewTransitionClass=l),l=getComputedStyle(e),l.display==="inline"){if(t=e.getClientRects(),t.length===1)var n=1;else for(var a=n=0;a<t.length;a++){var i=t[a];0<i.width&&0<i.height&&n++}n===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+l.paddingTop,e.marginBottom="-"+l.paddingBottom)}}function dm(e,t){e=e.style,t=t.style;var l=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=l==null||typeof l=="boolean"?"":(""+l).trim(),l=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=l==null||typeof l=="boolean"?"":(""+l).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(l=t.display,e.display=l==null||typeof l=="boolean"?"":l,l=t.margin,l!=null?e.margin=l:(l=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=l==null||typeof l=="boolean"?"":l,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function uy(e,t,l){return l=l.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=l.innerHeight&&e.left<=l.innerWidth}}function Nr(e){var t=e.getBoundingClientRect(),l=getComputedStyle(e);return uy(t,l,e)}function oy(e){return e.documentElement.clientHeight}function cy(e){this.addEventListener("load",e),this.addEventListener("error",e)}function sy(e,t,l,n,a,i,r,m,T){var _=t.nodeType===9?t:t.ownerDocument;try{var q=_.startViewTransition({update:function(){var O=_.defaultView,H=O.navigation&&O.navigation.transition,I=_.fonts.status;n();var ve=[];if(I==="loaded"&&(oy(_),_.fonts.status==="loading"&&ve.push(_.fonts.ready)),I=ve.length,e!==null)for(var Re=e.suspenseyImages,R=0,C=0;C<Re.length;C++){var U=Re[C];if(!U.complete){var V=U.getBoundingClientRect();if(0<V.bottom&&0<V.right&&V.top<O.innerHeight&&V.left<O.innerWidth){if(R+=Rm(U),R>fc){ve.length=I;break}U=new Promise(cy.bind(U)),ve.push(U)}}}if(0<ve.length)return O=Promise.race([Promise.all(ve),new Promise(function(se){return setTimeout(se,500)})]).then(a,a),(H?Promise.allSettled([H.finished,O]):O).then(i,i);if(a(),H)return H.finished.then(i,i);i()},types:l});_.__reactViewTransition=q;var Z=[];return q.ready.then(function(){for(var O=_.documentElement.getAnimations({subtree:!0}),H=0;H<O.length;H++){var I=O[H],ve=I.effect,Re=ve.pseudoElement;if(Re!=null&&Re.startsWith("::view-transition")){Z.push(I),I=ve.getKeyframes();for(var R=Re=void 0,C=!0,U=0;U<I.length;U++){var V=I[U],se=V.width;if(Re===void 0)Re=se;else if(Re!==se){C=!1;break}if(se=V.height,R===void 0)R=se;else if(R!==se){C=!1;break}delete V.width,delete V.height,V.transform==="none"&&delete V.transform}C&&Re!==void 0&&R!==void 0&&(ve.setKeyframes(I),C=getComputedStyle(ve.target,ve.pseudoElement),C.width!==Re||C.height!==R)&&(C=I[0],C.width=Re,C.height=R,C=I[I.length-1],C.width=Re,C.height=R,ve.setKeyframes(I))}}r()},function(O){_.__reactViewTransition===q&&(_.__reactViewTransition=null);try{if(typeof O=="object"&&O!==null)switch(O.name){case"InvalidStateError":(O.message==="View transition was skipped because document visibility state is hidden."||O.message==="Skipping view transition because document visibility state has become hidden."||O.message==="Skipping view transition because viewport size changed."||O.message==="Transition was aborted because of invalid state")&&(O=null)}O!==null&&T(O)}finally{n(),a(),r()}}),q.finished.finally(function(){for(var O=0;O<Z.length;O++)Z[O].cancel();_.__reactViewTransition===q&&(_.__reactViewTransition=null),m()}),q}catch{return n(),a(),r(),null}}function Va(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Va.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:oe({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Va.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,l=e.getAnimations({subtree:!0}),n=[],a=0;a<l.length;a++){var i=l[a].effect;i!==null&&i.target===e&&i.pseudoElement===t&&n.push(l[a])}return n},Va.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function hm(e){return{name:e,group:new Va("group",e),imagePair:new Va("image-pair",e),old:new Va("old",e),new:new Va("new",e)}}function vl(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}vl.prototype.addEventListener=function(e,t,l){var n=null,a=null;if(!(l!=null&&typeof l!="boolean"&&(n=l.signal||null,n!==null&&n.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var i=this._eventListeners;if(gm(i,e,t,l)===-1){var r=this,m=t;l!=null&&typeof l!="boolean"&&l.once===!0&&(m=function(T){r.removeEventListener(e,t,l),typeof t=="function"?t.call(this,T):t.handleEvent(T)}),n!==null&&(a=r.removeEventListener.bind(r,e,t,l),n.addEventListener("abort",a,{once:!0}),a=n.removeEventListener.bind(n,"abort",a)),n=Li(l),i.push({type:e,listener:t,optionsOrUseCapture:l,attachedListener:m,cleanup:a}),b(this._fragmentFiber.child,!1,ry,e,m,n)}this._eventListeners=i}};function ry(e,t,l,n){return K(e).addEventListener(t,l,n),!1}vl.prototype.removeEventListener=function(e,t,l){var n=this._eventListeners;if(n!==null&&(t=gm(n,e,t,l),t!==-1)){var a=n[t];l=a.attachedListener;var i=a.cleanup;a=Li(a.optionsOrUseCapture),b(this._fragmentFiber.child,!1,fy,e,l,a),n.splice(t,1),i!==null&&i()}};function fy(e,t,l,n){return K(e).removeEventListener(t,l,n),!1}function Li(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function mm(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function gm(e,t,l,n){if(e.length===0)return-1;n=mm(n);for(var a=0;a<e.length;a++){var i=e[a];if(i.type===t&&i.listener===l&&mm(i.optionsOrUseCapture)===n)return a}return-1}vl.prototype.dispatchEvent=function(e){var t=N(this._fragmentFiber);if(t===null)return!0;t=K(t);var l=this._eventListeners;if(l!==null&&0<l.length||!e.bubbles){var n=t.nodeType===9?t.createComment(""):document.createTextNode("");if(l)for(var a=0;a<l.length;a++){var i=l[a];n.addEventListener(i.type,i.attachedListener,Li(i.optionsOrUseCapture))}if(t.appendChild(n),e=n.dispatchEvent(e),l)for(a=0;a<l.length;a++)i=l[a],n.removeEventListener(i.type,i.attachedListener,Li(i.optionsOrUseCapture));return t.removeChild(n),e}return t.dispatchEvent(e)},vl.prototype.focus=function(e){b(this._fragmentFiber.child,!0,vm,e,void 0,void 0)};function vm(e,t){return e.tag===6?!1:(e=K(e),Ny(e,t))}vl.prototype.focusLast=function(e){var t=[];b(this._fragmentFiber.child,!0,Er,t,void 0,void 0);for(var l=t.length-1;0<=l&&!vm(t[l],e);l--);};function Er(e,t){return t.push(e),!1}vl.prototype.blur=function(){var e=N(this._fragmentFiber);e!==null&&(e=K(e),e=ku(e).activeElement,e!==null&&b(this._fragmentFiber.child,!1,dy,e,void 0,void 0))};function dy(e,t){return e.tag===6?!1:(e=K(e),e===t||e.contains(t)?(t.blur(),!0):!1)}vl.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),b(this._fragmentFiber.child,!1,hy,e,void 0,void 0)};function hy(e,t){return e.tag===6||(e=K(e),t.observe(e)),!1}vl.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),b(this._fragmentFiber.child,!1,my,e,void 0,void 0);for(var l=t=0;l<Kl.length;l++){var n=Kl[l];n.fragmentInstance===this&&n.observer===e?e.unobserve(n.instance):Kl[t++]=n}Kl.length=t}};function my(e,t){return e.tag===6||(e=K(e),t.unobserve(e)),!1}var Kl=[],jr=!1;function gy(e,t,l){Kl.push({fragmentInstance:e,observer:t,instance:l}),jr||(jr=!0,Ey(function(){jr=!1;var n=Kl;Kl=[];for(var a=0;a<n.length;a++){var i=n[a];i.observer.unobserve(i.instance)}}))}vl.prototype.getClientRects=function(){var e=[];return b(this._fragmentFiber.child,!1,vy,e,void 0,void 0),e};function vy(e,t){if(e.tag===6){e=e.stateNode;var l=e.ownerDocument.createRange();l.selectNodeContents(e),t.push.apply(t,l.getClientRects())}else e=K(e),t.push.apply(t,e.getClientRects());return!1}vl.prototype.getRootNode=function(e){var t=N(this._fragmentFiber);return t===null?this:K(t).getRootNode(e)},vl.prototype.compareDocumentPosition=function(e){var t=N(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];b(this._fragmentFiber.child,!1,Er,l,void 0,void 0);var n=K(t);if(l.length===0){if(l=n,Y(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(l=t)}t=this._fragmentFiber;var a=n=l.compareDocumentPosition(e);return l===e?a=Node.DOCUMENT_POSITION_CONTAINS:n&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=E(t)[1],l===null?a=Node.DOCUMENT_POSITION_PRECEDING:(e=K(l).compareDocumentPosition(e),a=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),a|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=K(l[0]),a=K(l[l.length-1]);var i=Y(this._fragmentFiber)?t.parentElement:n;if(i==null)return Node.DOCUMENT_POSITION_DISCONNECTED;n=i.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,i=i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY;var r=t.compareDocumentPosition(e),m=a.compareDocumentPosition(e),T=r&Node.DOCUMENT_POSITION_CONTAINED_BY||m&Node.DOCUMENT_POSITION_CONTAINED_BY;return m=n&&i&&r&Node.DOCUMENT_POSITION_FOLLOWING&&m&Node.DOCUMENT_POSITION_PRECEDING,t=n&&t===e||i&&a===e||T||m?Node.DOCUMENT_POSITION_CONTAINED_BY:!n&&t===e||!i&&a===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:r,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||yy(t,this._fragmentFiber,l[0],l[l.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function yy(e,t,l,n,a){var i=Pl(a);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(l=!!i)e:{for(;i!==null;){if(i.tag===7&&(i===t||i.alternate===t)){l=!0;break e}i=i.return}l=!1}return l}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(i===null)return i=a.ownerDocument,a===i||a===i.documentElement||a===i.body;e:{for(i=t,t=N(t);i!==null;){if(!(i.tag!==5&&i.tag!==3&&i.tag!==27||i!==t&&i.alternate!==t)){i=!0;break e}i=i.return}i=!1}return i}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!i)&&!(t=i===l)&&(t=ae(l,i,fe),t===null?t=!1:(b(t,!0,be,i,l),i=Te,Te=null,t=i!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!i)&&!(t=i===n)&&(t=ae(n,i,fe),t===null?t=!1:(b(t,!0,Q,i,n),i=Te,re=Te=null,t=i!==null)),t):!1}function ym(e,t){var l=e.ownerDocument.createRange();l.selectNodeContents(e),e=l.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}vl.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(f(566));var t=[];b(this._fragmentFiber.child,!1,Er,t,void 0,void 0);var l=e!==!1;if(t.length===0){var n=E(this._fragmentFiber);if(n=l?n[1]||n[0]||N(this._fragmentFiber):n[0]||n[1],n===null)return;if(n.tag===6){e=K(n),ym(e,l);return}if(n=K(n),n.nodeType!==9){if(n.nodeType===11){l="host"in n?n.host:null,l!==null&&l.scrollIntoView(e);return}n.scrollIntoView(e)}}for(n=l?t.length-1:0;n!==(l?-1:t.length);){var a=t[n];a.tag===6?(a=K(a),ym(a,l)):K(a).scrollIntoView(e),n+=l?-1:1}};function by(e,t){return e=K(e),bm(e,t),!1}function bm(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function pm(e,t){var l=t._eventListeners;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n];e.addEventListener(a.type,a.attachedListener,Li(a.optionsOrUseCapture))}e.nodeType!==3&&(l=t._observers,l!==null&&l.forEach(function(i){for(var r=0,m=0;m<Kl.length;m++){var T=Kl[m];(T.fragmentInstance!==t||T.observer!==i||T.instance!==e)&&(Kl[r++]=T)}Kl.length=r,i.observe(e)}),bm(e,t))}function py(e,t){var l=t._eventListeners;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n];e.removeEventListener(a.type,a.attachedListener,Li(a.optionsOrUseCapture))}e.nodeType!==3&&(l=t._observers,l!==null&&l.forEach(function(i){typeof i.rootMargin=="string"?gy(t,i,e):i.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function wr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":wr(l),bn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function xy(e,t,l,n){for(;e.nodeType===1;){var a=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Il])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Cl(e.nextSibling),e===null)break}return null}function Sy(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Cl(e.nextSibling),e===null))return null;return e}function xm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cl(e.nextSibling),e===null))return null;return e}function zr(e){return e.data==="$?"||e.data==="$~"}function Cr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ty(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Cl(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 Mr=null;function Sm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Cl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Tm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Ny(e,t){function l(){n=!0}if(e.ownerDocument.activeElement===e)return!0;var n=!1;try{e.ownerDocument.addEventListener("focus",l,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",l,!0)}return n}function Ey(e){cm(function(){cm(function(t){return e(t)})})}function Nm(e,t,l){switch(t=ku(l),e){case"html":if(e=t.documentElement,!e)throw Error(f(452));return e;case"head":if(e=t.head,!e)throw Error(f(453));return e;case"body":if(e=t.body,!e)throw Error(f(454));return e;default:throw Error(f(451))}}function Em(e,t,l){for(var n in l){var a=l[n];l.hasOwnProperty(n)&&a!=null&&Pe(e,t,n,null,Pv,a)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===He&&(e.onclick=null),bn(e)}function Ar(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bn(e)}var Ml=new Map,jm=new Set;function Uu(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var _n=ze.d;ze.d={f:jy,r:wy,D:zy,C:Cy,L:My,m:Ay,X:Dy,S:Oy,M:Ry};function jy(){var e=_n.f(),t=lc();return e||t}function wy(e){var t=Yn(e);t!==null&&t.tag===5&&t.type==="form"?zd(t):_n.r(e)}var Yi=typeof document>"u"?null:document;function wm(e,t,l){var n=Yi;if(n&&typeof t=="string"&&t){var a=Jt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),jm.has(a)||(jm.add(a),e={rel:e,crossOrigin:l,href:t},n.querySelector(a)===null&&(t=n.createElement("link"),Vt(t,"link",e),Tt(t),n.head.appendChild(t)))}}function zy(e){_n.D(e),wm("dns-prefetch",e,null)}function Cy(e,t){_n.C(e,t),wm("preconnect",e,t)}function My(e,t,l){_n.L(e,t,l);var n=Yi;if(n&&e&&t){var a='link[rel="preload"][as="'+Jt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+Jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+Jt(l.imageSizes)+'"]')):a+='[href="'+Jt(e)+'"]';var i=a;switch(t){case"style":i=qi(e);break;case"script":i=Gi(e)}if(!(Ml.has(i)||(e=oe({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ml.set(i,e),n.querySelector(a)!==null||t==="style"&&n.querySelector(Bu(i))||t==="script"&&n.querySelector(Hu(i))))){var r=n.createElement("link");Vt(r,"link",e),t==="style"&&(r[Ln]=!0,r.onload=r.onerror=function(){Bl(r)}),Tt(r),n.head.appendChild(r)}}}function Ay(e,t){_n.m(e,t);var l=Yi;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Jt(n)+'"][href="'+Jt(e)+'"]',i=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Gi(e)}if(!Ml.has(i)&&(e=oe({rel:"modulepreload",href:e},t),Ml.set(i,e),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Hu(i)))return}n=l.createElement("link"),Vt(n,"link",e),Tt(n),l.head.appendChild(n)}}}function Oy(e,t,l){_n.S(e,t,l);var n=Yi;if(n&&e){var a=Lt(n).hoistableStyles,i=qi(e);t=t||"default";var r=a.get(i);if(!r){var m={loading:0,preload:null};if(r=n.querySelector(Bu(i)))m.loading=5;else{e=oe({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ml.get(i))&&Or(e,l);var T=r=n.createElement("link");Tt(T),Vt(T,"link",e),T._p=new Promise(function(_,q){T.onload=_,T.onerror=q}),T.addEventListener("load",function(){m.loading|=1}),T.addEventListener("error",function(){m.loading|=2}),m.loading|=4,sc(r,t,n)}r={type:"stylesheet",instance:r,count:1,state:m},a.set(i,r)}}}function Dy(e,t){_n.X(e,t);var l=Yi;if(l&&e){var n=Lt(l).hoistableScripts,a=Gi(e),i=n.get(a);i||(i=l.querySelector(Hu(a)),i||(e=oe({src:e,async:!0},t),(t=Ml.get(a))&&Dr(e,t),i=l.createElement("script"),Tt(i),Vt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function Ry(e,t){_n.M(e,t);var l=Yi;if(l&&e){var n=Lt(l).hoistableScripts,a=Gi(e),i=n.get(a);i||(i=l.querySelector(Hu(a)),i||(e=oe({src:e,async:!0,type:"module"},t),(t=Ml.get(a))&&Dr(e,t),i=l.createElement("script"),Tt(i),Vt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(a,i))}}function zm(e,t,l,n){var a=(a=Pt.current)?Uu(a):null;if(!a)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=qi(l.href),t=Lt(a).hoistableStyles,n=t.get(l),n||(n={type:"style",instance:null,count:0,state:null},t.set(l,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=qi(l.href);var i=Lt(a).hoistableStyles,r=i.get(e);if(r||(a=a.ownerDocument||a,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,r),(i=a.querySelector(Bu(e)))?i._p||(r.instance=i,r.state.loading=5):(i=Ml.get(e),i||(i={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ml.set(e,i)),_y(a,e,i,r.state))),t&&n===null)throw Error(f(528,""));return r}if(t&&n!==null)throw Error(f(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Gi(l),t=Lt(a).hoistableScripts,n=t.get(l),n||(n={type:"script",instance:null,count:0,state:null},t.set(l,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function qi(e){return'href="'+Jt(e)+'"'}function Bu(e){return'link[rel="stylesheet"]['+e+"]"}function Cm(e){return oe({},e,{"data-precedence":e.precedence,precedence:null})}function _y(e,t,l,n){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ln]!==!0){n.loading=1;return}}else t=e.createElement("link"),t[Ln]=!0,t.onload=t.onerror=Bl.bind(null,t),Vt(t,"link",l),Tt(t),e.head.appendChild(t);n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2})}function Gi(e){return'[src="'+Jt(e)+'"]'}function Hu(e){return"script[async]"+e}function Mm(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Jt(l.href)+'"]');if(n)return t.instance=n,Tt(n),n;var a=oe({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Tt(n),Vt(n,"style",a),sc(n,l.precedence,e),t.instance=n;case"stylesheet":a=qi(l.href);var i=e.querySelector(Bu(a));if(i)return t.state.loading|=4,t.instance=i,Tt(i),i;n=Cm(l),(a=Ml.get(a))&&Or(n,a),i=(e.ownerDocument||e).createElement("link"),Tt(i);var r=i;return r._p=new Promise(function(m,T){r.onload=m,r.onerror=T}),Vt(i,"link",n),t.state.loading|=4,sc(i,l.precedence,e),t.instance=i;case"script":return i=Gi(l.src),(a=e.querySelector(Hu(i)))?(t.instance=a,Tt(a),a):(n=l,(a=Ml.get(i))&&(n=oe({},l),Dr(n,a)),e=e.ownerDocument||e,a=e.createElement("script"),Tt(a),Vt(a,"link",n),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,sc(n,l.precedence,e));return t.instance}function sc(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,i=a,r=0;r<n.length;r++){var m=n[r];if(m.dataset.precedence===t)i=m;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Or(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Dr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rc=null;function Am(e,t,l){if(rc===null){var n=new Map,a=rc=new Map;a.set(l,n)}else a=rc,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),a=0;a<l.length;a++){var i=l[a];if(!(i[Il]||i[yt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var r=i.getAttribute(t)||"";r=e+r;var m=n.get(r);m?m.push(i):n.set(r,[i])}}return n}function Rr(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function ky(e,t,l){if(l===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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 Om(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Dm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Rm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function _m(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Rm(t),e.suspenseyImages.push(t)),e=Hy.bind(e),t.decode().then(e,e))}function Uy(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=qi(n.href),i=t.querySelector(Bu(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Tt(i);return}i=t.ownerDocument||t,n=Cm(n),(a=Ml.get(a))&&Or(n,a),i=i.createElement("link"),Tt(i);var r=i;r._p=new Promise(function(m,T){r.onload=m,r.onerror=T}),Vt(i,"link",n),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Lu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var fc=0;function By(e,t){return e.stylesheets&&e.count===0&&hc(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&hc(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&fc===0&&(fc=62500*ty());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hc(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>fc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function km(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Lu(){this.count--,km(this)}function Hy(){this.imgCount--,km(this)}var dc=null;function hc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dc=new Map,t.forEach(Ly,e),dc=null,Lu.call(e))}function Ly(e,t){if(!(t.state.loading&4)){var l=dc.get(e);if(l)var n=l.get(null);else{l=new Map,dc.set(e,l);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var r=a[i];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(l.set(r.dataset.precedence,r),n=r)}n&&l.set(null,n)}a=t.instance,r=a.getAttribute("data-precedence"),i=l.get(r)||n,i===n&&l.set(null,a),l.set(r,a),this.count++,n=Lu.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Xi={$$typeof:ne,Provider:null,Consumer:null,_currentValue:Ol,_currentValue2:Ol,_threadCount:0};function Yy(e,t,l,n,a,i,r,m,T){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=Pa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pa(0),this.hiddenUpdates=Pa(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.transitionTypes=null,this.incompleteTransitions=new Map}function Um(e,t,l,n,a,i,r,m,T,_,q,Z){return e=new Yy(e,t,l,r,T,_,q,Z,m),t=1,i===!0&&(t|=24),i=tl(3,null,null,t),e.current=i,i.stateNode=e,t=$c(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:l,cache:t},Ic(i),e}function Bm(e){return e?(e=gi,e):gi}function Hm(e,t,l,n,a,i){a=Bm(a),n.context===null?n.context=a:n.pendingContext=a,n=In(t),n.payload={element:l},i=i===void 0?null:i,i!==null&&(n.callback=i),l=Pn(e,n,t),l!==null&&(il(l,e,t),vu(l,e,t))}function Lm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function _r(e,t){Lm(e,t),(e=e.alternate)&&Lm(e,t)}function Ym(e){if(e.tag===13||e.tag===31){var t=za(e,67108864);t!==null&&il(t,e,67108864),_r(e,67108864)}}function qm(e){if(e.tag===13||e.tag===31){var t=gl();t=Fl(t);var l=za(e,t);l!==null&&il(l,e,t),_r(e,t)}}var Vi=!0;function qy(e,t,l,n){var a=ye.T;ye.T=null;var i=ze.p;try{ze.p=2,kr(e,t,l,n)}finally{ze.p=i,ye.T=a}}function Gy(e,t,l,n){var a=ye.T;ye.T=null;var i=ze.p;try{ze.p=8,kr(e,t,l,n)}finally{ze.p=i,ye.T=a}}function kr(e,t,l,n){if(Vi){var a=Ur(n);if(a===null)vr(e,t,n,mc,l),Xm(e,n);else if(Vy(a,e,t,l,n))n.stopPropagation();else if(Xm(e,n),t&4&&-1<Xy.indexOf(e)){for(;a!==null;){var i=Yn(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var r=et(i.pendingLanes);if(r!==0){var m=i;for(m.pendingLanes|=2,m.entangledLanes|=2;r;){var T=1<<31-Fe(r);m.entanglements[1]|=T,r&=~T}gn(i),(Ke&6)===0&&(Po=Ht()+500,Du(0))}}break;case 31:case 13:m=za(i,2),m!==null&&il(m,i,2),lc(),_r(i,2)}if(i=Ur(n),i===null&&vr(e,t,n,mc,l),i===a)break;a=i}a!==null&&n.stopPropagation()}else vr(e,t,n,null,l)}}function Ur(e){return e=tu(e),Br(e)}var mc=null;function Br(e){if(mc=null,e=Pl(e),e!==null){var t=y(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=z(t),e!==null)return e;e=null}else if(l===31){if(e=D(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mc=e,null}function Gm(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ki()){case jt:return 2;case Bn:return 8;case Fa:case Wu:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var Hr=!1,fa=null,da=null,ha=null,Yu=new Map,qu=new Map,ma=[],Xy="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 Xm(e,t){switch(e){case"focusin":case"focusout":fa=null;break;case"dragenter":case"dragleave":da=null;break;case"mouseover":case"mouseout":ha=null;break;case"pointerover":case"pointerout":Yu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qu.delete(t.pointerId)}}function Gu(e,t,l,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Yn(t),t!==null&&Ym(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Vy(e,t,l,n,a){switch(t){case"focusin":return fa=Gu(fa,e,t,l,n,a),!0;case"dragenter":return da=Gu(da,e,t,l,n,a),!0;case"mouseover":return ha=Gu(ha,e,t,l,n,a),!0;case"pointerover":var i=a.pointerId;return Yu.set(i,Gu(Yu.get(i)||null,e,t,l,n,a)),!0;case"gotpointercapture":return i=a.pointerId,qu.set(i,Gu(qu.get(i)||null,e,t,l,n,a)),!0}return!1}function Vm(e){var t=Pl(e.target);if(t!==null){var l=y(t);if(l!==null){if(t=l.tag,t===13){if(t=z(l),t!==null){e.blockedOn=t,vt(e.priority,function(){qm(l)});return}}else if(t===31){if(t=D(l),t!==null){e.blockedOn=t,vt(e.priority,function(){qm(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Ur(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);ln=n,l.target.dispatchEvent(n),ln=null}else return t=Yn(l),t!==null&&Ym(t),e.blockedOn=l,!1;t.shift()}return!0}function Qm(e,t,l){gc(e)&&l.delete(t)}function Qy(){Hr=!1,fa!==null&&gc(fa)&&(fa=null),da!==null&&gc(da)&&(da=null),ha!==null&&gc(ha)&&(ha=null),Yu.forEach(Qm),qu.forEach(Qm)}function vc(e,t){e.blockedOn===t&&(e.blockedOn=null,Hr||(Hr=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,Qy)))}var yc=null;function Zm(e){yc!==e&&(yc=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){yc===e&&(yc=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],a=e[t+2];if(typeof n!="function"){if(Br(n||l)===null)continue;break}var i=Yn(l);i!==null&&(e.splice(t,3),t-=3,ps(i,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Qi(e){function t(T){return vc(T,e)}fa!==null&&vc(fa,e),da!==null&&vc(da,e),ha!==null&&vc(ha,e),Yu.forEach(t),qu.forEach(t);for(var l=0;l<ma.length;l++){var n=ma[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ma.length&&(l=ma[0],l.blockedOn===null);)Vm(l),l.blockedOn===null&&ma.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],i=l[n+1],r=a[bt]||null;if(typeof i=="function")r||Zm(l);else if(r){var m=null;if(i&&i.hasAttribute("formAction")){if(a=i,r=i[bt]||null)m=r.formAction;else if(Br(a)!==null)continue}else m=r.action;typeof m=="function"?l[n+1]=m:(l.splice(n,3),n-=3),Zm(l)}}}function Km(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(r){return a=r})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Lr(e){this._internalRoot=e}bc.prototype.render=Lr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var l=t.current,n=gl();Hm(l,n,e,t,null,null)},bc.prototype.unmount=Lr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hm(e.current,2,null,e,null,null),lc(),t[xl]=null}};function bc(e){this._internalRoot=e}bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ti();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ma.length&&t!==0&&t<ma[l].priority;l++);ma.splice(l,0,e),l===0&&Vm(e)}};var $m=d.version;if($m!=="19.3.0")throw Error(f(527,$m,"19.3.0"));ze.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=S(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var Zy={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ye,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{_l=pc.inject(Zy),ct=pc}catch{}}return Vu.createRoot=function(e,t){if(!g(e))throw Error(f(299));var l=!1,n="",a=Bd,i=Hd,r=Ld;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Um(e,1,!1,null,null,l,n,null,a,i,r,Km),e[xl]=t.current,gr(e),new Lr(t)},Vu.hydrateRoot=function(e,t,l){if(!g(e))throw Error(f(299));var n=!1,a="",i=Bd,r=Hd,m=Ld,T=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(r=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.formState!==void 0&&(T=l.formState)),t=Um(e,1,!0,t,l??null,n,a,T,i,r,m,Km),t.context=Bm(null),l=t.current,n=gl(),n=Fl(n),a=In(n),a.callback=null,Pn(l,a,n),l=n,t.current.lanes=l,Sa(t,l),gn(t),e[xl]=t.current,gr(e),new bc(t)},Vu.version="19.3.0",Vu}var ag;function l0(){if(ag)return qr.exports;ag=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(d){console.error(d)}}return u(),qr.exports=t0(),qr.exports}var n0=l0(),A=Pr();const vg=Math.random().toString(36).slice(2);async function Qu(u){const d=await u.json().catch(()=>({}));if(!u.ok)throw Object.assign(new Error(d.error??u.statusText),{status:u.status,body:d});return d}const Oe={board:()=>fetch("/api/board").then(u=>Qu(u)),saveBoard:(u,d)=>fetch("/api/board",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...u,clientId:vg,...d?{label:d}:{}})}).then(h=>Qu(h)),post:(u,d)=>fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(h=>Qu(h)),put:(u,d)=>fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(h=>Qu(h)),get:u=>fetch(u).then(d=>Qu(d))};function a0(u){let d=null,h=!1;const f=()=>{d=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`),d.onmessage=g=>{try{u(JSON.parse(g.data))}catch{}},d.onclose=()=>{h||setTimeout(f,1e3)}};return f(),()=>{h=!0,d==null||d.close()}}const i0={select:"M5 3l13 8-6 1.5L9.5 19z",hand:"M8 12V6.5a1.5 1.5 0 0 1 3 0V11m0-5.5V5a1.5 1.5 0 0 1 3 0v6m0-4.5a1.5 1.5 0 0 1 3 0V13a7 7 0 0 1-7 7h-.5a6 6 0 0 1-5-2.7L3.3 14a1.5 1.5 0 0 1 2.4-1.8L8 15",board:"M4 5h16v14H4zM4 9h16",title:"M5 6h14M12 6v13M9 19h6",sticky:"M5 4h14v10l-5 6H5zM14 20v-6h5",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM20 20l-4-4",undo:"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3",redo:"M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3",play:"M8 5l11 7-11 7z",edit:"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4",trash:"M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3",copy:"M8 8h11v11H8zM5 16V5h11",plus:"M12 5v14M5 12h14",close:"M6 6l12 12M18 6L6 18",chevronDown:"M6 9l6 6 6-6",chevronRight:"M9 6l6 6-6 6",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",fit:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5",focus:"M9 4H4v5M15 4h5v5M9 20H4v-5M15 20h5v-5M9 9h6v6H9z",layers:"M12 3l9 5-9 5-9-5zM3 13l9 5 9-5",comment:"M4 5h16v11H9l-5 4z",front:"M8 8h12v12H8zM4 4h12v4M4 4v12h4",back:"M4 4h12v12H4zM8 16v4h12V8h-4",page:"M6 3h9l4 4v14H6zM15 3v4h4",more:"M5 12h.01M12 12h.01M19 12h.01",moon:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",panel:"M4 5h16v14H4zM15 5v14",check:"M5 12l5 5 9-10",warn:"M12 4l9 16H3zM12 10v4M12 17h.01",rect:"M4 6h16v12H4z",oval:"M12 19c4.4 0 8-3.1 8-7s-3.6-7-8-7-8 3.1-8 7 3.6 7 8 7z",line:"M5 19L19 5",arrow:"M5 19L19 5M10 5h9v9",pen:"M4 20l1-4L16.5 4.5l3 3L8 19zM14 7l3 3",image:"M4 5h16v14H4zM4 15l4-4 4 4 3-3 5 5M15 9h.01",grid:"M4 4h16v16H4zM4 12h16M12 4v16",system:"M4 5h16v11H4zM9 20h6M12 16v4",link:"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"};function he({name:u,size:d=18,...h}){return o.jsx("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...h,children:o.jsx("path",{d:i0[u]})})}const vn=(u,d,h)=>u===1?`1 ${d}`:`${u} ${h}`,ig=u=>vn(u,"variant","variants"),s={app:{title:"Easel",loadFailed:"Couldn't load:",retry:"Try again",loadingBoards:"Loading boards…",loading:"Loading…",emptyPage:"This page is empty",drawBoard:"Draw board",defaultAuthor:"Me",tokensAside:"Design tokens",assetsAside:"Assets",announceBoard:(u,d,h)=>`${u} selected, ${d}/${h}. Enter to edit`},templates:{blank:"Blank",mobile:"Mobile screen",desktop:"Desktop screen",doc:"Document"},tools:{select:"Select",hand:"Hand",board:"Draw board",title:"Title",sticky:"Note",rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen"},toolbar:{aria:"Tools",leftPanel:"Left panel",leftPanelTitle:u=>`Left panel (${u}\\)`,canvasTools:"Canvas tools",shapes:"Shapes",tool:(u,d)=>`${u} (${d})`,shapeToolTitle:(u,d)=>`${u} (${d}) · Shift for square or circle`,insertImage:"Insert image",insertImageTitle:"Insert image (you can also paste onto the canvas)",undo:"Undo",redo:"Redo",undoTitle:(u,d)=>u?`Undo: ${u} (${d}Z)`:`Undo (${d}Z)`,redoTitle:(u,d)=>u?`Redo: ${u} (⇧${d}Z)`:`Redo (⇧${d}Z)`,newBoard:"New board",newBoardTitle:"New board (choose a template)",editing:u=>`Editing ${u}`,stopEditing:"Stop editing",stopEditingTitle:"Stop editing (Esc)",themeTitle:"Design system theme (used by swatches, token check and AI)",theme:"Theme",themeOption:u=>`Theme: ${u}`,snapshot:"Snapshot (git)",snapshotTitle:"Snapshot: save the design folder as a git commit",erroredBoards:"Boards with errors",erroredBoardsN:u=>`Boards with errors ${u}`,errors:u=>`Errors ${u}`,zoomOut:"Zoom out",zoomOutTitle:u=>`Zoom out (${u}-)`,zoomIn:"Zoom in",zoomInTitle:u=>`Zoom in (${u}+)`,zoom100:"Zoom to 100%",zoom100Title:u=>`Zoom to 100% (${u}0)`,fitAll:"Fit all",fitAllTitle:"Fit all (⇧1)",aiChat:"AI chat",aiChatTitle:u=>`AI chat (${u}J)`,guides:"Show layout guides",guidesTitle:"Show layout guides (⌃G)",appearance:u=>`Appearance: ${u==="system"?"System":u==="light"?"Light":"Dark"}`,appearanceTitle:u=>`Appearance: ${u==="system"?"Follow system":u==="light"?"Light":"Dark"} (click to change)`,minimap:"Minimap",minimapTitle:"Minimap (M)"},tabs:{left:"Left panel",boards:"Boards",assets:"Assets",tokens:"Tokens",right:"Right panel",properties:"Properties",ai:"AI"},boardList:{aria:"Pages and boards",pages:"Pages",addPage:"Add page",singlePage:"Viewing everything as one page. Use + to split it into pages.",pageTabTitle:"Drag to reorder · right-click to rename or delete",boards:u=>`Boards ${u}`,searchPlaceholder:"Find boards (⌘K)",search:"Find boards",noMatch:u=>`No boards match "${u}"`,emptyPage:"No boards on this page. Draw one with Board (B) in the toolbar.",fileMissing:"File missing"},minimap:{aria:"Minimap: click to move there"},boardOptions:{aria:"Board options",heading:"Board",renameTitle:"Rename (F2)",renameFileTitle:"Rename file",width:"Width",height:"Height",radius:"Radius",interactive:"Interactive (Play)",frameless:"Frameless",fill:"Fill window (page-style)",launch:"Open as launch screen",page:"Page",focus:"Focus view",focusTitle:"Focus view (F)",front:"Bring to front",frontTitle:"Bring to front (⌘])",back:"Send to back",backTitle:"Send to back (⌘[)",duplicate:"Duplicate",duplicateTitle:"Duplicate (⌘D)",delete:"Delete",deleteTitle:"Delete (Delete)",selectedN:u=>`${vn(u,"board","boards")} selected`,frontTitleMod:u=>`Bring to front (${u}])`,backTitleMod:u=>`Send to back (${u}[)`,goToSelected:"Go to selected boards",goToSelectedTitle:"Go to selected boards (⇧2)",deleteTitleKey:"Delete (⌫)"},focus:{aria:u=>`${u} focus view`,prev:"Previous board",next:"Next board",pageStyle:" · page-style",close:"Close"},play:{back:"Back",forward:"Forward",viewOnCanvas:"View on canvas",closeTitle:"Close (Esc)",close:"Close"},canvas:{aria:"Design canvas",board:(u,d,h,f)=>`Board ${u}${d?" (selected)":""}${h?" editing":""}${f?" playing":""}`,interactive:"Interactive (Play)",editMode:"Edit mode",editTitle:"Edit (E · double-click)",fileMissing:u=>`File missing · ${u}`,playing:"▶ Playing · Esc",boardSize:"Board size",titleMaxWidth:"Max width",stickySize:"Sticky note size",deleteNote:"Delete note"},editMode:{fileChanged:"File changed, select again"},elementDrag:{moveAria:"Move element (Alt: into the hovered box)",moveTitle:"Drag to move · hold Alt to drop into the hovered box",width:"Width",height:"Height",size:"Size"},layers:{collapse:"Collapse",expand:"Expand",title:"Layers",hint:"Drop an item on another to move it in front of that item. Shift+click to select several (for wrapping). Click the list, then use ↑↓ to move and ←→ to collapse or expand."},properties:{title:"Properties",tokenColors:{text:"Text",secondaryText:"Secondary text",background:"Background",surface:"Surface",divider:"Divider",accent:"Accent",error:"Error"},fields:{width:"Width",height:"Height",fontSize:"Font size",fontWeight:"Weight",color:"Color",background:"Background",radius:"Radius",flexDirection:"Flex direction",alignItems:"Align items",justifyContent:"Justify content",flexWrap:"Wrap",flexGrow:"Grow",alignSelf:"Align self",lineHeight:"Line height",textAlign:"Text align",border:"Border",boxShadow:"Shadow",opacity:"Opacity"},alignButtons:{left:"Align left",hcenter:"Align center",right:"Align right",top:"Align top",vcenter:"Align middle",bottom:"Align bottom"},columns:"Columns",rows:"Rows",align:"Align",replaceImage:"Replace image…",wrapTitle:"Select consecutive siblings with the same parent first",wrapFlex:"Wrap in flex",wrapGrid:"Wrap in grid",duplicate:"Duplicate",delete:"Delete",offToken:u=>`Off tokens: ${u}`,none:"none",contrastTitle:"Contrast with background (4.5 or more for body text, 3 or more for large text)",contrast:"Contrast",largeTextOnly:"Large text only",tooLow:"Too low"},shapes:{stickyColors:{yellow:"Yellow",orange:"Orange",pink:"Pink",purple:"Purple",blue:"Blue",green:"Green",gray:"Gray",white:"White"},shapeSize:"Shape size",drawShape:"Draw shape",kinds:{rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen",image:"Image"},none:"None",options:"Shape options",strokeColor:"Stroke color",fill:"Fill",weight:"Weight",strokeWeight:"Stroke weight",front:"Bring to front",back:"Send to back",deleteShape:"Delete shape",deleteTitle:"Delete (⌫)"},notes:{options:"Note options",title:"Title",sticky:"Sticky note",fontSize:"Font size",defaultSuffix:" (default)",textStyle:"Text style",bold:"Bold",italic:"Italic",color:"Color",stickyColor:u=>`${u} sticky note`,maxWidth:"Max width",maxHeight:"Max height",width:"Width",height:"Height",titleHint:"Text shrinks once it passes the max width or height (0 means no limit).",stickyHint:"With a height set, overflowing text scrolls (0 fits the content).",deleteNote:"Delete note",deleteTitle:"Delete (⌫)"},guides:{aria:"Layout guides",heading:(u,d)=>`Layout guides ${u}/${d}`,types:{columns:"Columns",rows:"Rows",grid:"Grid"},add:{columns:"Add column guide",rows:"Add row guide",grid:"Add grid guide"},empty:"Add up to 6 column, row or grid guides. They show only on the canvas and never go into the screen HTML. Hide all: ⌃G",color:"Guide color",show:"Show",hide:"Hide",deleteGuide:"Delete guide",delete:"Delete",cell:"Cell",count:"Count",gutter:"Gutter",margin:"Margin",cellSize:"Cell size",align:"Align",alignAria:"Guide alignment",stretch:"Stretch",left:"Left",top:"Top",center:"Center",right:"Right",bottom:"Bottom"},dialog:{menu:"Menu",cancel:"Cancel",ok:"OK",deleteBoardsTitle:(u,d)=>u>1?`Delete ${u} boards?`:`Delete board "${d}"?`,deleteBoardsBody:"The HTML files are deleted too. A copy stays in the trash (docs/design/.trash), and Undo (⌘Z) brings them back right away.",delete:"Delete",renameBoardTitle:"Rename board",name:"Name",rename:"Rename",renameFileTitle:"Rename file",fileName:"File name",renameFileRefs:u=>`Links or iframes pointing to this file: ${u}`,renameFileNoRefs:"No links or iframes point to this file.",renameFileExtra:u=>`Also update ${vn(u,"reference","references")} to the new name`,newPageTitle:"New page",newPageName:u=>`Page ${u}`,create:"Create",renamePageTitle:"Rename page",deletePageTitle:u=>`Delete page "${u}"?`,deletePageBody:u=>`Its ${vn(u,"board","boards")} and notes aren't deleted; they move to the first page. You can undo with ⌘Z.`,authorTitle:"Comment author",save:"Save",snapshotTitle:"Save snapshot",snapshotLabel:"Message",snapshotMessage:u=>`docs(design): design snapshot ${u}`,snapshotHint:"Commits only the design folder. The author comes from your git config, and nothing else you staged is included.",commit:"Commit"},toast:{saveFailed:u=>`Save failed: ${u}`,undoRedoDone:(u,d)=>`${u==="undo"?"Undo":"Redo"}: ${d}`,nothingToUndo:"Nothing to undo",nothingToRedo:"Nothing to redo",undoAction:"Undo",textOnly:"Only elements that contain just text (and line breaks) can be edited in place",moved:"Moved",movedFrozen:"Moved (kept the size of the original spot)",copiedElement:(u,d)=>`Copied <${u}> — paste it into another board while editing with ${d}V`,nothingCopied:"No element copied. Select an element while editing and press ⌘C",pasted:(u,d)=>`Pasted <${d}> from ${u}`,imageReplaced:u=>`Replaced the image with ${u}`,boardCreated:u=>`Created board ${u}`,boardCreateFailed:u=>`Couldn't create the board: ${u}`,boardsDeleted:u=>`Deleted ${vn(u,"board","boards")}`,duplicated:u=>`Duplicated as ${u}`,renamed:"Renamed",fileRenamed:(u,d)=>`Renamed to ${u}${d?" (references updated)":""}`,notesMax:u=>`You can have up to ${u} notes`,noteDeleted:"Note deleted",shapeDeleted:"Shape deleted",imageReadFailed:"Couldn't read the image",importOnly:u=>`${u}: only HTML or images can be imported`,imported:u=>`Imported ${vn(u,"board","boards")}`,pagesMax:"You can have up to 40 pages",pageDeleted:"Page deleted",copied:"Copied",elementDeleted:"Element deleted",wrapped:u=>`Wrapped in ${u}`,theme:u=>`Theme: ${u}`,tokensSaved:"Tokens saved",nothingChanged:"Nothing changed",snapshot:u=>`Snapshot ${u}`,cleanedUp:u=>`Cleaned up ${vn(u,"board","boards")}`,uploaded:u=>`Uploaded ${u}`,tweaksSaved:"Saved tweaks to source",blockFlow:"Vertical alignment doesn't apply in block flow. Try changing the parent to flex"},history:{boardOptions:"Board options",front:"Bring to front",back:"Send to back",moveBoard:"Move board",resizeBoard:"Resize board",addTitle:"Add title",addNote:"Add note",deleteNote:"Delete note",duplicateNote:"Duplicate note",moveNote:"Move note",editNote:"Edit note",noteStyle:"Note style",addShape:"Add shape",deleteShape:"Delete shape",moveShape:"Move shape",resizeShape:"Resize shape",shapeStyle:"Shape style",shapeFront:"Bring shape to front",shapeBack:"Send shape to back",addImage:"Add image",launchPage:"Launch page",moveToPage:"Move to page",launchScreen:"Set launch screen",changeTheme:"Change theme",cleanMissing:"Clean up boards with missing files",editGuide:"Edit layout guide",addGuide:"Add layout guide",deleteGuide:"Delete layout guide",saveTokens:"Save tokens",registerTokens:"Register tokens"},defaults:{newTitle:"New title",note:"Note",pastedImage:"pasted-image.png"},menu:{newBoard:"New board",drawWithB:"B to draw",rename:"Rename",moveUp:"Move up",moveDown:"Move down",unsetLaunchPage:"Unset launch page",setLaunchPage:"Set as launch page",moveSelectedToPage:u=>`Move ${vn(u,"selected board","selected boards")} to this page`,delete:"Delete",edit:"Edit",stopEditing:"Stop editing",playInPlace:"Play in place",stopPlay:"Stop Play",playFullScreen:"Play full screen",askReview:"Ask AI for a review",focusView:"Focus view",askAI:"Ask AI",askFixErrors:"Ask AI to fix errors",goToBoard:"Go to board",renameFile:"Rename file…",duplicate:"Duplicate",front:"Bring to front",back:"Send to back",deleteBoards:u=>`Delete ${u} boards`,title:"Title",note:"Note",duplicateInFront:"Duplicate in front",newBoardHere:"New board here",mobileFrameHere:"Mobile screen frame here",titleHere:"Title here",noteHere:"Note here",selectAll:"Select all on this page",fitAll:"Fit all",zoom100:"Zoom to 100%",undo:"Undo",redo:"Redo",element:"Element",editText:"Edit text",selectParent:"Select parent",elementToAI:"Send this element to AI",copy:"Copy",pasteAfter:"Paste after",replaceImage:"Replace image…",copyForAI:"Copy description for AI",shape:"Shape",snapshot:"Snapshot",notGit:"The design folder isn't inside a git repository",snapshotStatus:(u,d)=>`Snapshot · ${u} · ${vn(d,"changed file","changed files")}`,snapshotNow:"Save snapshot now (git commit)…",nothingChanged:"Nothing changed",fileMissing:"File is missing",askFixAll:"Ask AI to fix all",cleanMissing:u=>`Clean up ${vn(u,"board","boards")} with missing files`},prompts:{fixErrors:u=>`Fix these errors:
50
- ${u}`,error:"Error",review:"Review this screen: point out accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens), with fixes in priority order. Don't edit anything; only suggest.",fixComment:"Fix only that spot, as this comment says",fixTokens:u=>`Replace off-token values with tokens (verify with check_tokens):
51
- ${u}`,fixA11y:u=>`Fix the accessibility issues (keep the visible size; enlarge touch targets with padding):
52
- ${u}`,line:"Line "},checks:{tokenCheck:u=>`Token check · ${u}`,noOffToken:"No off-token values",a11y:"Accessibility",a11yOk:"No touch target, contrast or label issues",askFix:"Ask AI to fix",notVisible:"Checks run when the board is visible on screen.",pickInEdit:u=>`Select ${u} in edit mode`,line:u=>`Line ${u}`,more:u=>`+${u} more`,colorNotInTokens:"Color not in tokens",tokenFontSizes:u=>`Token font sizes: ${u}`,tokenRadii:u=>`Token radius: ${u}`,notMultipleOf4:"Not a multiple of 4",tokenWeights:u=>`Token weights: ${u}`,smallTarget:(u,d,h,f)=>`<${u}> touch target ${d}×${h} (under ${f})`,noName:u=>`<${u}> has no name (aria-label, text or label)`,noAlt:'<img> has no alt (use alt="" if decorative)',lowContrast:(u,d,h)=>`Contrast ${u}:1 (needs ${d}) "${h}"`},tokens:{import:"Import tokens (tokens.json or Figma variables JSON)",importFailed:u=>`Couldn't import: ${u}`,theme:"Theme",addTheme:"Add theme (copy current theme)",newTheme:"New theme",newThemeN:u=>`New theme ${u}`,activeTheme:"Active theme",themeName:"Theme name",importedTheme:"Imported",colors:u=>`Colors ${u}`,addColor:"Add color",colorN:u=>`Color ${u}`,colorOf:u=>`${u} color`,colorName:"Color name",remove:u=>`Remove ${u}`,fontSizes:"Font sizes",fontWeights:"Font weights",radii:"Radius",spacing:"Spacing",touchTarget:"Touch target",minTouchTarget:"Minimum touch target",saveTitle:"Save to docs/design/tokens.json",save:"Save",register:"Register tokens",registeredHint:"Properties panel swatches, token check and AI (get_tokens) use the selected theme's values.",defaultHint:"These are the defaults from the table in docs/design/README.md. Registering saves them to tokens.json.",noColors:"Couldn't find any color values"},tweaks:{revert:"Revert",save:"Save to source",hint:"Applied right away as CSS variables. Saving changes only the values in the board-tweaks JSON."},inspector:{shotFailed:u=>`Failed: ${u}`,pickBoard:"Select a board to see its options here.",hintDraw:"Draw board",hintTitle:"Title",hintNote:"Note",hintDoubleClick:"Double-click or",hintEdit:"Edit",hintFocus:"Focus view",hintRightClick:"Right-click for menu",hintFind:"Find boards",editModeHint:"Edit mode · click to select, Shift for several, Esc for parent",viewModeHint:"View mode · double-click to edit",more:u=>`+${u} more`,copy:"Copy",copied:"Copied",parent:"Parent",capturing:"Capturing…",screenshot:"Screenshot",boardScreenshot:"Board screenshot"},comments:{title:"Comments",placeholderElement:u=>`Comment on the selected element (${u})`,placeholderBoard:"Comment on the board",add:"Comment",authorTitle:"Change comment author name",author:u=>`Author: ${u}`,replyPlaceholder:u=>`Reply as ${u} (⌘Enter)`,reply:"Reply",replyResolve:"Reply and resolve",reopen:"Reopen",resolve:"Resolve",sendToAI:"Send to AI",sendToAITitle:"Send to AI to fix only where this comment points"},assets:{uploading:"Uploading…",upload:"Upload (images and fonts; drag and drop works too)",loading:"Loading…",empty:"No assets yet. Uploaded images are saved to docs/design/assets/ and used in screens as ../assets/name.",copyPath:" · click to copy path",file:"File",pickImage:"Choose image",pickLabel:", use this image",close:"Close"},chat:{aria:"AI chat",agent:"Agent",notInstalled:" (not installed)",continuing:"Continuing conversation",newChat:"New chat",intro:u=>`Sends the selected boards and elements, plus the boards visible on screen, to ${u} as context. The agent edits the source HTML directly, and the canvas redraws right away.`,suggestions:[{label:"AI review: accessibility, contrast, hierarchy",text:"Review the selected screen: accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens). Only suggest changes in priority order; don't edit anything.",n:1},{label:"3 variants of this screen",text:"Make 3 variants of the selected screen in different directions (each with a different layout, hierarchy and emphasis).",n:3},{label:"Shorten the selected button text",text:"Shorten the selected button text",n:1},{label:"Make a new empty-state screen",text:"Make a new empty-state screen",n:1}],notFound:u=>`Couldn't find the ${u} command. Install it, sign in, then reopen.`,running:"Running",cancelled:"Cancelled",madeVariants:u=>`Made ${ig(u)} side by side · View`,thinking:"Thinking…",chipElement:u=>`Element <${u}>`,chipElementText:(u,d)=>`Element <${u}> ${d}`,chipBoards:u=>`${u} boards`,chipVisible:u=>`Visible boards ${u}`,chipComment:u=>`Comment "${u}"`,variants:ig,tooBig:u=>`${u}: larger than 15MB`,refLink:"Reference link",placeholderRunning:"Running… (Esc to cancel)",placeholder:"What should change? (Enter to send · Shift+Enter for a new line)",input:"Message to AI",attach:"Attach file or image",attachTitle:"Attach file or image (drag and drop or paste works too)",addLink:"Add reference link",variantsTitle:"Copies the selected board and makes different variants side by side",variantsDisabledTitle:"Select one board to use this",variantsAria:"Number of variants",cancel:"Cancel",send:"Send",chipRemoveTitle:"Click to remove",chipAddTitle:"Click to attach",remove:u=>`Remove ${u}`}},Jr=[{id:"yellow",label:s.shapes.stickyColors.yellow,bg:"#FFF1A8"},{id:"orange",label:s.shapes.stickyColors.orange,bg:"#FFD9BC"},{id:"pink",label:s.shapes.stickyColors.pink,bg:"#FFD6E2"},{id:"purple",label:s.shapes.stickyColors.purple,bg:"#E5DAFF"},{id:"blue",label:s.shapes.stickyColors.blue,bg:"#D2E4FF"},{id:"green",label:s.shapes.stickyColors.green,bg:"#D5F0D3"},{id:"gray",label:s.shapes.stickyColors.gray,bg:"#ECEBE7"},{id:"white",label:s.shapes.stickyColors.white,bg:"#FFFFFF"}],u0=u=>{var d;return((d=Jr.find(h=>h.id===u))==null?void 0:d.bg)??Jr[0].bg},ug=200,og=6,o0=["#111111","#6B6B6B","#C94F0C","#B42318","#1E7A4C","#2F6FDE","#FFFFFF","none"];function yg({s:u,id:d}){var S;const h=u.strokeWidth??4,f=u.stroke??"#111111",g=u.fill??"none",y=h,z=Math.max(1,u.w),D=Math.max(1,u.h),j=(u.points??[]).map(([p,b])=>`${p},${b}`).join(" ");return o.jsxs("svg",{width:z+y*2,height:D+y*2,viewBox:`${-y} ${-y} ${z+y*2} ${D+y*2}`,style:{position:"absolute",left:-y,top:-y,overflow:"visible"},children:[u.kind==="arrow"&&o.jsx("defs",{children:o.jsx("marker",{id:`ah-${d}`,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:o.jsx("path",{d:"M0 0L10 5L0 10z",fill:f})})}),u.kind==="rect"&&o.jsx("rect",{x:0,y:0,width:z,height:D,rx:8,fill:g,stroke:f,strokeWidth:h}),u.kind==="oval"&&o.jsx("ellipse",{cx:z/2,cy:D/2,rx:z/2,ry:D/2,fill:g,stroke:f,strokeWidth:h}),(u.kind==="line"||u.kind==="arrow")&&o.jsx("polyline",{points:j,fill:"none",stroke:f,strokeWidth:h,strokeLinecap:"round",markerEnd:u.kind==="arrow"?`url(#ah-${d})`:void 0}),u.kind==="pen"&&o.jsx("polyline",{points:j,fill:"none",stroke:f,strokeWidth:h,strokeLinecap:"round",strokeLinejoin:"round"}),u.kind==="image"&&o.jsx("image",{href:(S=u.src)==null?void 0:S.replace(/^\.\.\//,"/"),x:0,y:0,width:z,height:D,preserveAspectRatio:"xMidYMid slice"})]})}function c0(u){const d=A.useRef(null),h=(g,y)=>z=>{z.button!==0||!u.interactive||(z.stopPropagation(),u.onSelect(g),d.current={id:g,mode:y,sx:z.clientX,sy:z.clientY,o:u.shapes[g],moved:!1},z.currentTarget.setPointerCapture(z.pointerId))},f=(g,y=!1)=>{const z=d.current;if(!z)return;const D=(g.clientX-z.sx)/u.zoom,j=(g.clientY-z.sy)/u.zoom;if(!z.moved&&Math.abs(D)+Math.abs(j)<2/u.zoom){y&&(d.current=null);return}if(z.moved=!0,z.mode==="move")u.onChange(z.id,{x:Math.round(z.o.x+D),y:Math.round(z.o.y+j)},y);else{const S=Math.max(8,z.o.w+D),p=Math.max(8,z.o.h+j),b=S/Math.max(1,z.o.w),N=p/Math.max(1,z.o.h),Y={w:Math.round(S),h:Math.round(p)};z.o.points&&(Y.points=z.o.points.map(([E,k])=>[Math.round(E*b),Math.round(k*N)])),u.onChange(z.id,Y,y)}y&&(d.current=null)};return o.jsx(o.Fragment,{children:u.ids.map(g=>{const y=u.shapes[g],z=u.selected===g;return o.jsxs("div",{className:`shape ${z?"selected":""}`,"data-shape":g,style:{left:y.x,top:y.y,width:Math.max(1,y.w),height:Math.max(1,y.h),pointerEvents:u.interactive?"auto":"none"},onPointerDown:h(g,"move"),onPointerMove:D=>f(D),onPointerUp:D=>f(D,!0),onContextMenu:D=>{D.preventDefault(),D.stopPropagation(),u.onSelect(g),u.onContext(g,D)},children:[o.jsx(yg,{s:y,id:g}),z&&o.jsx("div",{className:"shape-resize",role:"slider","aria-label":s.shapes.shapeSize,"aria-valuetext":`${y.w} × ${y.h}`,style:{width:12/u.zoom,height:12/u.zoom,right:-6/u.zoom,bottom:-6/u.zoom,borderWidth:1.5/u.zoom},onPointerDown:h(g,"resize"),onPointerMove:D=>f(D),onPointerUp:D=>f(D,!0)})]},g)})})}function s0({tool:u,view:d,onDone:h}){const[f,g]=A.useState(null),y=A.useRef(null),z=j=>{const S=j.currentTarget.getBoundingClientRect();return{x:(j.clientX-S.left-d.x)/d.zoom,y:(j.clientY-S.top-d.y)/d.zoom}},D=(j,S,p,b,N,Y)=>{if(Y&&(u==="rect"||u==="oval")){const re=Math.max(Math.abs(p-j),Math.abs(b-S));p=j+Math.sign(p-j||1)*re,b=S+Math.sign(b-S||1)*re}if(u==="pen"){const re=N.map(ae=>ae[0]),be=N.map(ae=>ae[1]),Q=Math.min(...re),fe=Math.min(...be);return{kind:"pen",x:Q,y:fe,w:Math.max(...re)-Q,h:Math.max(...be)-fe,points:N.map(([ae,oe])=>[Math.round(ae-Q),Math.round(oe-fe)])}}const E=Math.min(j,p),k=Math.min(S,b),K=Math.abs(p-j),Te=Math.abs(b-S);return u==="line"||u==="arrow"?{kind:u,x:E,y:k,w:K,h:Te,points:[[Math.round(j-E),Math.round(S-k)],[Math.round(p-E),Math.round(b-k)]]}:{kind:u,x:E,y:k,w:K,h:Te}};return o.jsx("div",{className:"shape-drawer","aria-label":s.shapes.drawShape,onPointerDown:j=>{if(j.button!==0)return;j.currentTarget.setPointerCapture(j.pointerId);const S=z(j);y.current={x0:S.x,y0:S.y,pts:[[S.x,S.y]]}},onPointerMove:j=>{const S=y.current;if(!S)return;const p=z(j);u==="pen"&&S.pts.push([p.x,p.y]),g(D(S.x0,S.y0,p.x,p.y,S.pts,j.shiftKey))},onPointerUp:j=>{const S=y.current;if(y.current=null,g(null),!S)return;const p=z(j);let b=D(S.x0,S.y0,p.x,p.y,S.pts,j.shiftKey);if(b.w<4&&b.h<4){if(u==="pen")return;b=u==="line"||u==="arrow"?{kind:u,x:S.x0,y:S.y0,w:200,h:0,points:[[0,0],[200,0]]}:{kind:u,x:S.x0,y:S.y0,w:200,h:140}}h({...b,x:Math.round(b.x),y:Math.round(b.y),w:Math.round(b.w),h:Math.round(b.h)})},children:f&&o.jsx("div",{className:"world",style:{transform:`translate(${d.x}px, ${d.y}px) scale(${d.zoom})`,pointerEvents:"none"},children:o.jsx("div",{className:"shape",style:{left:f.x,top:f.y,width:Math.max(1,f.w),height:Math.max(1,f.h)},children:o.jsx(yg,{s:{...f,strokeWidth:4},id:"draft"})})})})}function r0({shape:u,onPatch:d,onDelete:h,onFront:f,onBack:g}){const y=s.shapes.kinds,z=({value:D,onPick:j,allowNone:S})=>o.jsx("span",{className:"swatches",children:o0.filter(p=>S||p!=="none").map(p=>o.jsx("button",{className:`swatch ${D===p?"on":""} ${p==="none"?"none":""}`,title:p==="none"?s.shapes.none:p,"aria-label":p==="none"?s.shapes.none:p,style:{background:p==="none"?void 0:p},onClick:()=>j(p)},p))});return o.jsxs("section",{className:"board-opts","aria-label":s.shapes.options,children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:y[u.kind]})}),u.kind!=="image"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:s.shapes.strokeColor}),o.jsx(z,{value:u.stroke??"#111111",onPick:D=>d({stroke:D})})]}),(u.kind==="rect"||u.kind==="oval")&&o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:s.shapes.fill}),o.jsx(z,{value:u.fill??"none",onPick:D=>d({fill:D}),allowNone:!0})]}),o.jsxs("label",{className:"field-row",children:[o.jsx("span",{children:s.shapes.weight}),o.jsx("input",{type:"range",min:1,max:24,value:u.strokeWidth??4,onChange:D=>d({strokeWidth:Number(D.target.value)}),"aria-label":s.shapes.strokeWeight})]})]}),o.jsxs("div",{className:"muted small",children:[u.w," × ",u.h," · (",u.x,", ",u.y,")"]}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"icon-btn","aria-label":s.shapes.front,title:s.shapes.front,onClick:f,children:o.jsx(he,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":s.shapes.back,title:s.shapes.back,onClick:g,children:o.jsx(he,{name:"back"})}),o.jsx("button",{className:"icon-btn danger","aria-label":s.shapes.deleteShape,title:s.shapes.deleteTitle,onClick:h,children:o.jsx(he,{name:"trash"})})]})]})}function f0({note:u,onPatch:d,onDelete:h}){const f=u.kind==="title",g=f?72:22;return o.jsxs("section",{className:"board-opts","aria-label":s.notes.options,children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:f?s.notes.title:s.notes.sticky})}),o.jsxs("label",{className:"field-row",children:[o.jsx("span",{children:s.notes.fontSize}),o.jsx("select",{value:u.size??g,onChange:y=>d({size:Number(y.target.value)===g?void 0:Number(y.target.value)}),"aria-label":s.notes.fontSize,children:(f?[32,48,56,72,96,128]:[14,18,22,28,36]).map(y=>o.jsxs("option",{value:y,children:[y,"px",y===g?s.notes.defaultSuffix:""]},y))})]}),o.jsxs("div",{className:"btn-row",role:"group","aria-label":s.notes.textStyle,children:[o.jsx("button",{className:`icon-btn ${u.bold??f?"on":""}`,"aria-pressed":!!(u.bold??f),"aria-label":s.notes.bold,title:s.notes.bold,onClick:()=>d({bold:!(u.bold??f)}),children:o.jsx("strong",{children:"B"})}),o.jsx("button",{className:`icon-btn ${u.italic?"on":""}`,"aria-pressed":!!u.italic,"aria-label":s.notes.italic,title:s.notes.italic,onClick:()=>d({italic:!u.italic||void 0}),children:o.jsx("em",{children:"I"})})]}),!f&&o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:s.notes.color}),o.jsx("span",{className:"swatches",children:Jr.map(y=>o.jsx("button",{className:`swatch ${(u.color??"yellow")===y.id?"on":""}`,title:y.label,"aria-label":s.notes.stickyColor(y.label),style:{background:y.bg},onClick:()=>d({color:y.id==="yellow"?void 0:y.id})},y.id))})]}),f?o.jsxs("div",{className:"grid2",children:[o.jsx(kn,{label:s.notes.maxWidth,value:u.maxW??2e3,onCommit:y=>d({maxW:y})}),o.jsx(kn,{label:s.notes.maxHeight,value:u.maxH??0,onCommit:y=>d({maxH:y||void 0})})]}):o.jsxs("div",{className:"grid2",children:[o.jsx(kn,{label:s.notes.width,value:u.w??400,onCommit:y=>d({w:y})}),o.jsx(kn,{label:s.notes.height,value:u.h??0,onCommit:y=>d({h:y||void 0})})]}),o.jsx("p",{className:"muted small",children:f?s.notes.titleHint:s.notes.stickyHint}),o.jsx("div",{className:"btn-row",children:o.jsx("button",{className:"icon-btn danger","aria-label":s.notes.deleteNote,title:s.notes.deleteTitle,onClick:h,children:o.jsx(he,{name:"trash"})})})]})}function kn({label:u,value:d,onCommit:h}){return o.jsxs("label",{className:"num",children:[o.jsx("span",{children:u}),o.jsx("input",{inputMode:"numeric",defaultValue:d,onBlur:f=>{const g=Math.max(0,Math.round(Number(f.target.value)));Number.isFinite(g)&&g!==d&&h(g)},onKeyDown:f=>!f.nativeEvent.isComposing&&f.key==="Enter"&&f.target.blur()},d)]})}const d0=u=>u==="grid"?{type:u,count:0,gutter:0,margin:0,align:"stretch",size:8,color:"#C94F0C"}:{type:u,count:u==="columns"?4:6,gutter:16,margin:20,align:"stretch",size:80,color:"#C94F0C"};function h0(u,d){const h=Math.max(1,Math.round(d.count));if(d.align==="stretch"){const z=(u-d.margin*2-d.gutter*(h-1))/h;return Array.from({length:h},(D,j)=>[d.margin+j*(z+d.gutter),z])}const f=h*d.size+(h-1)*d.gutter,g=d.align==="start"?d.margin:d.align==="end"?u-d.margin-f:(u-f)/2;return Array.from({length:h},(y,z)=>[g+z*(d.size+d.gutter),d.size])}function m0({guides:u,w:d,h}){return o.jsx("div",{className:"layout-guides","aria-hidden":"true",children:u.filter(f=>!f.hidden).map((f,g)=>f.type==="grid"?o.jsx("div",{className:"lg-grid",style:{backgroundImage:`linear-gradient(to right, ${f.color}55 1px, transparent 1px), linear-gradient(to bottom, ${f.color}55 1px, transparent 1px)`,backgroundSize:`${f.size}px ${f.size}px`}},g):h0(f.type==="columns"?d:h,f).map(([y,z],D)=>o.jsx("div",{className:"lg-track",style:f.type==="columns"?{left:y,top:0,width:z,height:h,background:`${f.color}1f`}:{top:y,left:0,height:z,width:d,background:`${f.color}1f`}},`${g}-${D}`)))})}function g0({guides:u,onChange:d}){const h=(g,y)=>d(u.map((z,D)=>D===g?{...z,...y}:z),s.history.editGuide),f=s.guides.types;return o.jsxs("section",{className:"board-opts guides-editor","aria-label":s.guides.aria,children:[o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:s.guides.heading(u.length,og)}),o.jsx("span",{className:"btn-row",children:["columns","rows","grid"].map(g=>o.jsx("button",{className:"icon-btn sm",disabled:u.length>=og,title:s.guides.add[g],"aria-label":s.guides.add[g],onClick:()=>d([...u,d0(g)],s.history.addGuide),children:o.jsx("span",{className:"small",children:f[g]})},g))})]}),u.length===0&&o.jsx("p",{className:"muted small",children:s.guides.empty}),u.map((g,y)=>o.jsxs("div",{className:"guide-row",children:[o.jsxs("div",{className:"guide-head",children:[o.jsx("strong",{children:f[g.type]}),o.jsx("input",{type:"color",value:g.color,onChange:z=>h(y,{color:z.target.value}),"aria-label":s.guides.color}),o.jsx("div",{className:"spacer"}),o.jsx("button",{className:"icon-btn sm","aria-label":g.hidden?s.guides.show:s.guides.hide,title:g.hidden?s.guides.show:s.guides.hide,onClick:()=>h(y,{hidden:!g.hidden||void 0}),children:o.jsx(he,{name:g.hidden?"close":"check",size:14})}),o.jsx("button",{className:"icon-btn sm danger","aria-label":s.guides.deleteGuide,title:s.guides.delete,onClick:()=>d(u.filter((z,D)=>D!==y),s.history.deleteGuide),children:o.jsx(he,{name:"trash",size:14})})]}),g.type==="grid"?o.jsx("div",{className:"grid2",children:o.jsx(kn,{label:s.guides.cell,value:g.size,onCommit:z=>h(y,{size:Math.max(2,z)})})}):o.jsxs("div",{className:"grid2",children:[o.jsx(kn,{label:s.guides.count,value:g.count,onCommit:z=>h(y,{count:Math.max(1,Math.min(48,z))})}),o.jsx(kn,{label:s.guides.gutter,value:g.gutter,onCommit:z=>h(y,{gutter:z})}),o.jsx(kn,{label:s.guides.margin,value:g.margin,onCommit:z=>h(y,{margin:z})}),g.align!=="stretch"&&o.jsx(kn,{label:s.guides.cellSize,value:g.size,onCommit:z=>h(y,{size:Math.max(1,z)})}),o.jsxs("label",{className:"field-row span2",children:[o.jsx("span",{children:s.guides.align}),o.jsxs("select",{value:g.align,onChange:z=>h(y,{align:z.target.value}),"aria-label":s.guides.alignAria,children:[o.jsx("option",{value:"stretch",children:s.guides.stretch}),o.jsx("option",{value:"start",children:g.type==="columns"?s.guides.left:s.guides.top}),o.jsx("option",{value:"center",children:s.guides.center}),o.jsx("option",{value:"end",children:g.type==="columns"?s.guides.right:s.guides.bottom})]})]})]})]},y))]})}const ef=.04,tf=4,v0=.25,y0=6;function b0(u){const d=A.useRef(null),[h,f]=A.useState({w:1200,h:800}),[g,y]=A.useState(!1),[z,D]=A.useState([]),[j,S]=A.useState(null),p=A.useRef(null),b=A.useRef(null);A.useLayoutEffect(()=>{const G=d.current,W=new ResizeObserver(()=>{var $;const ne={w:G.clientWidth,h:G.clientHeight};f(ne),($=u.onSize)==null||$.call(u,ne)});return W.observe(G),()=>W.disconnect()},[]),A.useEffect(()=>{const G=d.current,W=ne=>{ne.preventDefault();const $=G.getBoundingClientRect(),le=ne.clientX-$.left,ee=ne.clientY-$.top;ne.ctrlKey||ne.metaKey?u.setView(je=>{const L=Ju(je.zoom*Math.exp(-ne.deltaY*.0025),ef,tf),de=(le-je.x)/je.zoom,Ne=(ee-je.y)/je.zoom;return{zoom:L,x:le-de*L,y:ee-Ne*L}}):u.setView(je=>({...je,x:je.x-ne.deltaX,y:je.y-ne.deltaY}))};return G.addEventListener("wheel",W,{passive:!1}),()=>G.removeEventListener("wheel",W)},[u.setView]),A.useEffect(()=>{const G=ne=>{ne.code==="Space"&&!pg(ne)&&!ne.repeat&&(ne.preventDefault(),y(!0))},W=ne=>ne.code==="Space"&&y(!1);return window.addEventListener("keydown",G),window.addEventListener("keyup",W),()=>{window.removeEventListener("keydown",G),window.removeEventListener("keyup",W)}},[]);const{view:N}=u,Y=(G,W)=>{const ne=d.current.getBoundingClientRect();return{x:(G-ne.left-N.x)/N.zoom,y:(W-ne.top-N.y)/N.zoom}},E=G=>{p.current=G,S(G)},k=g||u.tool==="hand",K=G=>{if(G.target!==G.currentTarget&&G.button!==1)return;if(G.currentTarget.setPointerCapture(G.pointerId),G.button===1||k){b.current={kind:"pan",sx:G.clientX,sy:G.clientY,vx:N.x,vy:N.y};return}if(G.button!==0)return;const W=Y(G.clientX,G.clientY);if(u.tool==="title"||u.tool==="sticky"){u.onCreateNote(u.tool,{x:Math.round(W.x),y:Math.round(W.y)}),u.setTool("select");return}b.current={kind:u.tool==="board"?"draw":"marquee",sx:W.x,sy:W.y,additive:G.shiftKey,moved:!1}},Te=G=>{const W=b.current;if(!W)return;if(W.kind==="pan"){u.setView(le=>({...le,x:W.vx+G.clientX-W.sx,y:W.vy+G.clientY-W.sy}));return}const ne=Y(G.clientX,G.clientY),$={x:Math.min(W.sx,ne.x),y:Math.min(W.sy,ne.y),w:Math.abs(ne.x-W.sx),h:Math.abs(ne.y-W.sy)};($.w+$.h)*N.zoom>4&&(W.moved=!0),W.moved&&E($)},re=G=>{const W=b.current;if(b.current=null,!W||W.kind==="pan")return;const ne=p.current;if(E(null),W.kind==="draw"){const le=Y(G.clientX,G.clientY);u.onCreateBoard(W.moved&&ne&&ne.w>20&&ne.h>20?E0(ne):{x:Math.round(le.x),y:Math.round(le.y),w:390,h:844}),u.setTool("select");return}if(!W.moved||!ne){W.additive||(u.onSelect([],"replace"),u.onSelectNote(null));return}const $=u.visibleBoards.filter(le=>N0(u.board.boards[le],ne));u.onSelect($,W.additive?"add":"replace")},be=A.useRef(null),Q=(G,W)=>{const ne=u.selected.includes(W)?u.selected:[W],$={};for(const le of ne)$[le]={x:u.board.boards[le].x,y:u.board.boards[le].y};be.current={sx:G.clientX,sy:G.clientY,origins:$,moved:!1},G.currentTarget.setPointerCapture(G.pointerId)},fe=(G,W=!1)=>{const ne=be.current;if(!ne)return;let $=(G.clientX-ne.sx)/N.zoom,le=(G.clientY-ne.sy)/N.zoom;if(!ne.moved&&Math.abs($)+Math.abs(le)<3/N.zoom)return;ne.moved=!0;const ee=Object.keys(ne.origins),je=ee.map(X=>({...u.board.boards[X],x:ne.origins[X].x+$,y:ne.origins[X].y+le})),L=bg(je),de=u.visibleBoards.filter(X=>!ee.includes(X)).map(X=>u.board.boards[X]),Ne=y0/N.zoom,_e=[];if(!G.altKey){const X=cg([L.x,L.x+L.w/2,L.x+L.w],de.flatMap(P=>[P.x,P.x+P.w/2,P.x+P.w]),Ne),te=cg([L.y,L.y+L.h/2,L.y+L.h],de.flatMap(P=>[P.y,P.y+P.h/2,P.y+P.h]),Ne);if(X){$+=X.d;const P=de.filter(me=>[me.x,me.x+me.w/2,me.x+me.w].some(ke=>Math.abs(ke-X.at)<.5));_e.push({axis:"x",at:X.at,from:Math.min(L.y+((te==null?void 0:te.d)??0),...P.map(me=>me.y)),to:Math.max(L.y+L.h+((te==null?void 0:te.d)??0),...P.map(me=>me.y+me.h))})}if(te){le+=te.d;const P=de.filter(me=>[me.y,me.y+me.h/2,me.y+me.h].some(ke=>Math.abs(ke-te.at)<.5));_e.push({axis:"y",at:te.at,from:Math.min(L.x+((X==null?void 0:X.d)??0),...P.map(me=>me.x)),to:Math.max(L.x+L.w+((X==null?void 0:X.d)??0),...P.map(me=>me.x+me.w))})}}D(W?[]:_e);const w={};for(const X of ee)w[X]={x:Math.round(ne.origins[X].x+$),y:Math.round(ne.origins[X].y+le)};u.onMoveBoards(w,W)},ae=G=>{const W=be.current;W!=null&&W.moved&&fe(G,!0),be.current=null,D([])},oe=h.w/N.zoom,F=h.h/N.zoom,ce=-N.x/N.zoom,ue=-N.y/N.zoom,xe=G=>G.x+G.w>ce-200&&G.x<ce+oe+200&&G.y+G.h>ue-200&&G.y<ue+F+200,Qe=G=>{G.currentTarget.setPointerCapture(G.pointerId),b.current={kind:"pan",sx:G.clientX,sy:G.clientY,vx:N.x,vy:N.y}};return o.jsxs("div",{ref:d,className:`canvas tool-${k?"hand":u.tool}`,onPointerDown:K,onPointerMove:Te,onPointerUp:re,onAuxClick:G=>G.preventDefault(),onContextMenu:G=>{if(G.target!==G.currentTarget)return;G.preventDefault();const W=Y(G.clientX,G.clientY);u.onContext({type:"canvas",x:Math.round(W.x),y:Math.round(W.y)},G)},role:"application","aria-label":s.canvas.aria,children:[o.jsxs("div",{className:"world",style:{transform:`translate(${N.x}px, ${N.y}px) scale(${N.zoom})`},children:[u.visibleNotes.map(G=>o.jsx(T0,{note:u.board.notes[G],zoom:N.zoom,selected:u.selectedNote===G,onSelect:()=>u.onSelectNote(G),onMove:(W,ne)=>u.onMoveNote(G,W,ne),onDelete:()=>u.onDeleteNote(G),onContext:W=>u.onContext({type:"note",id:G},W)},G)),u.visibleBoards.map(G=>{var le;const W=u.board.boards[G],ne=xe(W)&&(N.zoom>=v0||u.editFile===G),$=u.selected.includes(G);return o.jsx(p0,{file:G,item:W,exists:u.files.includes(G),zoom:N.zoom,live:ne,selected:$,single:$&&u.selected.length===1,editing:u.editFile===G,playing:u.playing===G,near:xe(W),reloadKey:u.reloadKeys[G]??0,onPointerDownLabel:ee=>{if(ee.button===0){if(ee.stopPropagation(),ee.shiftKey){u.onSelect([G],"toggle");return}$||u.onSelect([G],"replace"),Q(ee,G)}},onPointerMoveLabel:ee=>fe(ee),onPointerUpLabel:ae,onSelect:ee=>u.onSelect([G],ee.shiftKey?"toggle":"replace"),onResize:(ee,je)=>u.onMoveBoards({[G]:ee},je),onPlay:()=>u.onPlay(G),onEdit:()=>u.onEdit(u.editFile===G?null:G),onRename:()=>u.onRename(G),onContext:ee=>u.onContext({type:"board",file:G},ee),overlay:(le=u.renderBoardOverlay)==null?void 0:le.call(u,G),iframeRef:ee=>{var je;return(je=u.iframeRef)==null?void 0:je.call(u,G,ee)}},G)}),u.worldLayer,z.map((G,W)=>G.axis==="x"?o.jsx("div",{className:"guide",style:{left:G.at,top:G.from,width:1/N.zoom,height:G.to-G.from}},W):o.jsx("div",{className:"guide",style:{left:G.from,top:G.at,height:1/N.zoom,width:G.to-G.from}},W)),j&&o.jsx("div",{className:u.tool==="board"?"draft-board":"marquee",style:{left:j.x,top:j.y,width:j.w,height:j.h,borderWidth:1/N.zoom},children:u.tool==="board"&&o.jsxs("span",{style:{transform:`scale(${1/N.zoom})`},children:[Math.round(j.w)," × ",Math.round(j.h)]})})]}),g&&o.jsx("div",{className:"pan-capture",onPointerDown:Qe,onPointerMove:Te,onPointerUp:()=>b.current=null})]})}function p0(u){const{item:d,zoom:h}=u,f=Fr(h),g=d.title??u.file,y=D=>{D.preventDefault(),D.stopPropagation(),u.onContext(D)},z=D=>D.stopPropagation();return o.jsxs("div",{className:`board ${u.selected?"selected":""} ${u.editing?"editing":""} ${u.playing?"playing":""} ${d.frameless?"frameless":""} ${d.is_interactive?"interactive":""}`,style:{left:d.x,top:d.y,width:d.w,height:d.h},"data-file":u.file,role:"group","aria-label":s.canvas.board(g,!!u.selected,!!u.editing,!!u.playing),children:[o.jsxs("div",{className:"board-label",style:{transform:`scale(${1/h})`,width:d.w*h},onPointerDown:u.onPointerDownLabel,onPointerMove:u.onPointerMoveLabel,onPointerUp:u.onPointerUpLabel,onContextMenu:y,title:`${g} · ${u.file}`,children:[d.is_interactive&&o.jsx("span",{className:"dot","aria-label":s.canvas.interactive}),o.jsx("span",{className:"board-title",onDoubleClick:D=>{D.stopPropagation(),u.onRename()},children:g}),d.w*h>=160&&g!==u.file&&o.jsx("span",{className:"board-file",children:u.file}),d.w*h>=110&&o.jsxs("span",{className:"board-btns",children:[d.is_interactive&&o.jsx("button",{className:"icon-btn sm","aria-label":"Play",title:"Play",onPointerDown:z,onClick:D=>{D.stopPropagation(),u.onPlay()},children:o.jsx(he,{name:"play",size:14})}),o.jsx("button",{className:`icon-btn sm ${u.editing?"on":""}`,"aria-label":s.canvas.editMode,title:s.canvas.editTitle,onPointerDown:z,onClick:D=>{D.stopPropagation(),u.onEdit()},children:o.jsx(he,{name:"edit",size:14})})]})]}),o.jsxs("div",{className:"board-frame",style:{borderRadius:d.radius??0},onDoubleClick:D=>{u.editing||(D.stopPropagation(),u.onEdit())},onPointerDown:D=>{D.button===0&&!u.editing&&!u.playing&&(D.stopPropagation(),u.onSelect(D))},onContextMenu:D=>!u.editing&&!u.playing&&y(D),children:[u.exists?u.live?o.jsx(S0,{reloadKey:u.reloadKey,iframeRef:u.iframeRef,src:`/screens/${u.file}`,title:g,editing:u.editing||!!u.playing}):o.jsxs("div",{className:"board-placeholder",style:{fontSize:Math.min(64,14/h)},children:[u.near&&o.jsx(x0,{file:u.file,v:u.reloadKey}),o.jsx("span",{children:g})]}):o.jsx("div",{className:"board-missing",children:s.canvas.fileMissing(u.file)}),u.playing&&o.jsx("div",{className:"playing-badge",style:{transform:`scale(${1/Math.max(h,.25)})`},children:s.canvas.playing}),u.overlay]}),u.single&&o.jsx("div",{className:"board-resize",role:"slider","aria-label":s.canvas.boardSize,"aria-valuetext":`${d.w} × ${d.h}`,style:{width:12/h,height:12/h,right:-6/h,bottom:-6/h,borderWidth:1.5/h},onPointerDown:D=>{D.button===0&&(D.stopPropagation(),f.start(D,{x:d.w,y:d.h},(j,S)=>u.onResize({w:Ju(Math.round(j.x),40,8e3),h:Ju(Math.round(j.y),40,8e3)},S)))},onPointerMove:f.move,onPointerUp:f.end})]})}function x0({file:u,v:d}){const[h,f]=A.useState(!0);return h?o.jsx("img",{className:"board-thumb",src:`/api/thumb?f=${encodeURIComponent(u)}&v=${d}`,alt:"",loading:"lazy",decoding:"async",draggable:!1,onError:()=>f(!1),onLoad:g=>g.currentTarget.classList.add("loaded")}):null}function S0(u){const d=A.useRef(null),h=A.useRef(!0);return A.useEffect(()=>{if(h.current){h.current=!1;return}const f=d.current,g=f==null?void 0:f.contentWindow;if(!f||!g)return;const y=g.document,z=[];y.querySelectorAll("*").forEach((p,b)=>{(p.scrollTop||p.scrollLeft)&&z.push([b,p.scrollTop,p.scrollLeft])});const D=g.scrollX,j=g.scrollY,S=()=>{f.removeEventListener("load",S);const p=f.contentWindow;p.scrollTo(D,j);const b=p.document.querySelectorAll("*");for(const[N,Y,E]of z){const k=b[N];k&&(k.scrollTop=Y,k.scrollLeft=E)}f.dispatchEvent(new CustomEvent("dc-reloaded"))};f.addEventListener("load",S),g.location.reload()},[u.reloadKey]),o.jsx("iframe",{ref:f=>{d.current=f,u.iframeRef(f)},src:u.src,title:u.title,style:{pointerEvents:u.editing?"auto":"none"}})}function T0(u){const{note:d}=u,h=Fr(u.zoom),[f,g]=A.useState(!1),y=A.useRef(null);A.useEffect(()=>{if(f&&y.current){y.current.focus();const k=document.createRange();k.selectNodeContents(y.current);const K=getSelection();K==null||K.removeAllRanges(),K==null||K.addRange(k)}},[f]);const z=A.useRef(!1),D=A.useRef(!1),j=k=>{g(!1);const K=k.innerText;K!==d.text&&u.onMove({text:K},!0)},S=d.size??(d.kind==="title"?72:22),[p,b]=A.useState(S);A.useLayoutEffect(()=>{const k=y.current;if(!k||d.kind!=="title"||f)return b(S);let K=S;k.style.fontSize=`${K}px`;const Te=d.maxW??4e3,re=d.maxH||1/0;for(let be=0;be<40&&K>12&&(k.scrollWidth>Te+1||k.scrollHeight>re+1);be++)K=Math.max(12,Math.floor(K*.92)),k.style.fontSize=`${K}px`;b(K)},[d.text,S,d.maxW,d.maxH,d.kind,f]);const N=Fr(u.zoom),Y=d.kind==="title"?{left:d.x,top:d.y,maxWidth:d.maxW??4e3,maxHeight:d.maxH||void 0}:{left:d.x,top:d.y,width:d.w??320,height:d.h||void 0,background:u0(d.color)},E={fontSize:p,fontWeight:d.bold??d.kind==="title"?700:400,fontStyle:d.italic?"italic":void 0};return o.jsxs("div",{className:`note note-${d.kind} ${u.selected?"selected":""}`,style:Y,onPointerDown:k=>{f||k.button!==0||(k.stopPropagation(),u.onSelect(),h.start(k,{x:d.x,y:d.y},(K,Te)=>u.onMove({x:Math.round(K.x),y:Math.round(K.y)},Te)))},onPointerMove:h.move,onPointerUp:h.end,onDoubleClick:k=>{k.stopPropagation(),g(!0)},onContextMenu:k=>{k.preventDefault(),k.stopPropagation(),u.onSelect(),u.onContext(k)},children:[o.jsx("div",{ref:y,className:"note-text",style:E,contentEditable:f,suppressContentEditableWarning:!0,onCompositionStart:()=>z.current=!0,onCompositionEnd:k=>{z.current=!1,D.current&&(D.current=!1,j(k.currentTarget))},onBlur:k=>{z.current?D.current=!0:j(k.currentTarget)},onKeyDown:k=>{k.nativeEvent.isComposing||k.key==="Escape"&&k.currentTarget.blur()},children:d.text}),u.selected&&!f&&o.jsx("div",{className:"note-resize",role:"slider","aria-label":d.kind==="title"?s.canvas.titleMaxWidth:s.canvas.stickySize,style:{width:12/u.zoom,height:12/u.zoom,right:-6/u.zoom,bottom:-6/u.zoom,borderWidth:1.5/u.zoom},onPointerDown:k=>{if(k.button!==0)return;k.stopPropagation();const K=k.currentTarget.parentElement.getBoundingClientRect(),Te=K.width/u.zoom,re=K.height/u.zoom;N.start(k,{x:Te,y:re},(be,Q)=>u.onMove(d.kind==="title"?{maxW:Math.max(80,Math.round(be.x))}:{w:Math.max(80,Math.round(be.x)),h:Math.max(60,Math.round(be.y))},Q))},onPointerMove:N.move,onPointerUp:N.end}),u.selected&&!f&&o.jsx("button",{className:"note-del icon-btn","aria-label":s.canvas.deleteNote,style:{transform:`scale(${1/u.zoom})`},onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),u.onDelete()},children:o.jsx(he,{name:"close",size:14})})]})}function Fr(u){const d=A.useRef(null);return{start(h,f,g){d.current={sx:h.clientX,sy:h.clientY,ox:f.x,oy:f.y,cb:g,moved:!1},h.currentTarget.setPointerCapture(h.pointerId)},move(h){const f=d.current;if(!f)return;const g=(h.clientX-f.sx)/u,y=(h.clientY-f.sy)/u;!f.moved&&Math.abs(g)+Math.abs(y)<2/u||(f.moved=!0,f.cb({x:f.ox+g,y:f.oy+y},!1))},end(h){const f=d.current;d.current=null,!(!f||!f.moved)&&f.cb({x:f.ox+(h.clientX-f.sx)/u,y:f.oy+(h.clientY-f.sy)/u},!0)}}}function cg(u,d,h){let f=null;for(const g of u)for(const y of d){const z=y-g;Math.abs(z)<=h&&(!f||Math.abs(z)<Math.abs(f.d))&&(f={d:z,at:y})}return f}const bg=u=>{const d=Math.min(...u.map(f=>f.x)),h=Math.min(...u.map(f=>f.y));return{x:d,y:h,w:Math.max(...u.map(f=>f.x+f.w))-d,h:Math.max(...u.map(f=>f.y+f.h))-h}},N0=(u,d)=>u.x<d.x+d.w&&u.x+u.w>d.x&&u.y<d.y+d.h&&u.y+u.h>d.y,E0=u=>({x:Math.round(u.x),y:Math.round(u.y),w:Math.round(u.w),h:Math.round(u.h)});function Ju(u,d,h){return Math.min(h,Math.max(d,u))}function pg(u){const d=u.target;return d?d.tagName==="INPUT"?!/^(checkbox|radio|button|range|color)$/.test(d.type):d.isContentEditable||/^(TEXTAREA|SELECT)$/.test(d.tagName):!1}function Zu(u,d,h=60){if(!u.length)return{x:0,y:0,zoom:1};(d.w<100||d.h<100)&&(d={w:window.innerWidth,h:Math.max(200,window.innerHeight-48)}),h=Math.min(h,d.w*.08,d.h*.08);const f=bg(u),g=Ju(Math.min((d.w-h*2)/f.w,(d.h-h*2)/f.h),ef,tf);return{zoom:g,x:h-f.x*g+(d.w-h*2-f.w*g)/2,y:h-f.y*g+(d.h-h*2-f.h*g)/2}}function j0(u){const[d,h]=A.useState(null),f=A.useCallback(()=>Oe.get("/api/assets").then(g=>h(g.assets)).catch(()=>h([])),[]);return A.useEffect(()=>{f()},[f,u]),{list:d,reload:f}}async function Wr(u){const d=[];for(const h of Array.from(u)){const f=await new Promise(g=>{const y=new FileReader;y.onload=()=>g(String(y.result).split(",")[1]??""),y.readAsDataURL(h)});d.push(await Oe.post("/api/assets",{name:h.name,data:f}))}return d}const w0=u=>u>1024*1024?`${(u/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(u/1024))}KB`;function xg(u){const{list:d,reload:h}=j0(u.version),[f,g]=A.useState(!1),[y,z]=A.useState(!1),D=async S=>{var p;g(!0);try{const b=await Wr(S);await h(),(p=u.onUploaded)==null||p.call(u,b)}catch(b){u.onError(b.message)}finally{g(!1)}},j=(d??[]).filter(S=>!u.only||S.kind===u.only);return o.jsxs("div",{className:`assets ${y?"over":""}`,onDragOver:S=>{S.preventDefault(),z(!0)},onDragLeave:()=>z(!1),onDrop:S=>{S.preventDefault(),z(!1),S.dataTransfer.files.length&&D(S.dataTransfer.files)},children:[o.jsxs("label",{className:"upload",children:[o.jsx(he,{name:"plus",size:14})," ",f?s.assets.uploading:s.assets.upload,o.jsx("input",{type:"file",hidden:!0,multiple:!0,accept:"image/*,.woff,.woff2,.ttf,.otf",onChange:S=>S.target.files&&void D(S.target.files)})]}),d==null?o.jsxs("p",{className:"empty",children:[o.jsx("span",{className:"spinner","aria-hidden":"true"})," ",s.assets.loading]}):j.length===0?o.jsx("p",{className:"empty",children:s.assets.empty}):o.jsx("ul",{className:"asset-grid",children:j.map(S=>o.jsx("li",{children:o.jsxs("button",{className:"asset",title:`${S.ref} · ${w0(S.size)}${u.onPick?"":s.assets.copyPath}`,"aria-label":`${S.name}${u.pickLabel??""}`,onClick:()=>u.onPick?u.onPick(S):void navigator.clipboard.writeText(S.ref).catch(()=>{}),children:[S.kind==="image"?o.jsx("img",{src:S.url,alt:"",loading:"lazy"}):o.jsx("span",{className:"asset-font",children:S.kind==="font"?"Aa":s.assets.file}),o.jsx("span",{className:"asset-name",children:S.name})]})},S.name))})]})}function z0({open:u,version:d,onClose:h,onPick:f,onError:g}){return A.useEffect(()=>{if(!u)return;const y=z=>z.key==="Escape"&&h();return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[u,h]),u?o.jsx("div",{className:"dialog-backdrop",onPointerDown:y=>y.target===y.currentTarget&&h(),children:o.jsxs("div",{className:"dialog wide",role:"dialog","aria-modal":"true","aria-label":s.assets.pickImage,children:[o.jsx("h2",{children:s.assets.pickImage}),o.jsx(xg,{version:d,only:"image",pickLabel:s.assets.pickLabel,onPick:f,onError:g,onUploaded:y=>y[0]&&y[0].kind==="image"&&f(y[0])}),o.jsx("div",{className:"dialog-actions",children:o.jsx("button",{onClick:h,children:s.assets.close})})]})}):null}const sg={claude:"Claude Code",codex:"Codex"};function C0(u){const[d,h]=A.useState([]),[f,g]=A.useState(()=>{try{return localStorage.getItem("design-canvas:agent")??"claude"}catch{return"claude"}}),[y,z]=A.useState([]),[D,j]=A.useState(null),[S,p]=A.useState({}),[b,N]=A.useState(!0),[Y,E]=A.useState(!0),[k,K]=A.useState(!0),[Te,re]=A.useState(1),[be,Q]=A.useState(null),[fe,ae]=A.useState(null),oe=A.useRef(null),F=A.useRef(null),ce=A.useRef(null);ce.current=D,A.useEffect(()=>{Oe.get("/api/agents").then(L=>h(L.agents)).catch(()=>{})},[]),A.useEffect(()=>{try{localStorage.setItem("design-canvas:agent",f)}catch{}},[f]);const ue=A.useRef(new Set),xe=A.useRef(new Map),Qe=A.useRef(()=>{});A.useEffect(()=>u.subscribe((L,de)=>{if(!ue.current.has(L)){xe.current.set(L,[...xe.current.get(L)??[],de]);return}Qe.current(L,de)}),[u.subscribe]),Qe.current=(L,de)=>{z(Ne=>{const _e=Ne.findIndex(me=>me.role==="ai"&&me.id===L);if(_e<0)return Ne;const w={...Ne[_e]},X=[...w.parts],te=X[X.length-1];de.kind==="delta"?(te==null?void 0:te.t)==="text"?X[X.length-1]={t:"text",text:te.text+de.text}:X.push({t:"text",text:de.text}):de.kind==="break"?(te==null?void 0:te.t)==="text"&&te.text&&X.push({t:"text",text:""}):de.kind==="text"?X.push({t:"text",text:de.text}):de.kind==="tool"?X.push({t:"tool",name:de.name,detail:de.detail}):de.kind==="error"?X.push({t:"error",text:de.text}):de.kind==="done"?w.cost=de.cost:de.kind==="start"?w.variants=de.variants:de.kind==="end"?w.status=de.status:de.kind==="session"&&p(me=>({...me,[w.agent]:de.id})),w.parts=X.filter(me=>me.t!=="text"||me.text);const P=[...Ne];return P[_e]=w,P}),de.kind==="end"&&j(Ne=>Ne===L?null:Ne)},A.useEffect(()=>{const L=oe.current;L&&L.scrollHeight-L.scrollTop-L.clientHeight<160&&(L.scrollTop=L.scrollHeight)},[y]);const G=b?u.selection:null,W=Y?u.boards:[],ne=W.length===1||!W.length&&!!G,$=async()=>{const L=u.draft.trim();if(!L||D)return;ae(null);const de=[...G?[s.chat.chipElement(G.tag)]:[],...W.map(Ne=>u.titleOf(Ne)),...k&&u.visibleCount?[s.chat.chipVisible(u.visibleCount)]:[],...u.attach.comments.map(Ne=>s.chat.chipComment(Ne.text.slice(0,16))),...u.attach.refs.map(Ne=>Ne.name??Ne.value),...Te>1?[s.chat.variants(Te)]:[]];try{const Ne=await Oe.post("/api/chat",{agent:f,text:L,resume:S[f],variants:ne?Te:0,attach:{selection:!!G,boards:W,visible:k,comments:u.attach.comments.map(_e=>_e.id),refs:u.attach.refs}});z(_e=>[..._e,{role:"user",text:L,chips:de},{role:"ai",id:Ne.id,agent:f,parts:[],status:"running"}]),j(Ne.id),ue.current.add(Ne.id);for(const _e of xe.current.get(Ne.id)??[])Qe.current(Ne.id,_e);xe.current.delete(Ne.id),u.setDraft(""),u.setAttach(()=>({comments:[],refs:[]})),re(1),Ne.variants.length&&u.onLocate(Ne.variants)}catch(Ne){ae(Ne.message)}},le=()=>D&&Oe.post("/api/chat/cancel",{id:D}).catch(()=>{}),ee=async L=>{for(const de of Array.from(L)){if(de.size>15*1024*1024){ae(s.chat.tooBig(de.name));continue}const Ne=await new Promise(_e=>{const w=new FileReader;w.onload=()=>_e(String(w.result).split(",")[1]??""),w.readAsDataURL(de)});try{const _e=await Oe.post("/api/refs",{name:de.name||s.defaults.pastedImage,data:Ne});u.setAttach(w=>({...w,refs:[...w.refs,_e]}))}catch(_e){ae(_e.message)}}},je=d.find(L=>L.id===f);return o.jsxs("section",{className:"chat","aria-label":s.chat.aria,children:[o.jsxs("div",{className:"chat-head",children:[o.jsxs("label",{className:"agent-pick",children:[o.jsx("span",{className:"sr-only",children:s.chat.agent}),o.jsx("select",{value:f,onChange:L=>g(L.target.value),disabled:!!D,"aria-label":s.chat.agent,children:(d.length?d:[{id:"claude",label:"Claude Code",ok:!0},{id:"codex",label:"Codex",ok:!0}]).map(L=>o.jsxs("option",{value:L.id,children:[L.label,L.ok?"":s.chat.notInstalled]},L.id))})]}),S[f]&&o.jsx("span",{className:"muted small",children:s.chat.continuing}),o.jsx("div",{className:"spacer"}),o.jsx("button",{className:"icon-btn sm","aria-label":s.chat.newChat,title:s.chat.newChat,disabled:!!D||!y.length&&!S[f],onClick:()=>{z([]),p({})},children:o.jsx(he,{name:"plus",size:14})})]}),o.jsx("div",{className:"chat-list",ref:oe,"aria-live":"polite",children:y.length===0?o.jsxs("div",{className:"chat-empty",children:[o.jsx(he,{name:"comment",size:28}),o.jsx("p",{children:s.chat.intro(sg[f]??f)}),o.jsx("div",{className:"chat-suggest",children:s.chat.suggestions.map(L=>o.jsx("button",{onClick:()=>{u.setDraft(L.text),re(L.n)},children:L.label},L.label))}),je&&!je.ok&&o.jsx("p",{className:"warn",children:s.chat.notFound(je.label)})]}):y.map((L,de)=>{var Ne;return L.role==="user"?o.jsxs("div",{className:"msg user",children:[L.chips.length>0&&o.jsx("div",{className:"chips",children:L.chips.map((_e,w)=>o.jsx("span",{className:"chip",children:_e},w))}),o.jsx("div",{className:"bubble",children:L.text})]},de):o.jsxs("div",{className:`msg ai ${L.status}`,children:[o.jsxs("div",{className:"msg-head",children:[o.jsx("strong",{children:sg[L.agent]??L.agent}),L.status==="running"&&o.jsx("span",{className:"spinner","aria-label":s.chat.running}),L.status==="cancelled"&&o.jsx("span",{className:"muted",children:s.chat.cancelled}),L.status==="done"&&L.cost!=null&&o.jsxs("span",{className:"muted small",children:["$",L.cost.toFixed(3)]})]}),(Ne=L.variants)!=null&&Ne.length?o.jsx("button",{className:"link",onClick:()=>u.onLocate(L.variants),children:s.chat.madeVariants(L.variants.length)}):null,L.parts.map((_e,w)=>_e.t==="text"?o.jsx("div",{className:"ai-text",children:_e.text},w):_e.t==="tool"?o.jsxs("div",{className:"ai-tool",children:[o.jsx(he,{name:"edit",size:12}),o.jsx("span",{children:_e.name}),_e.detail&&o.jsx("code",{children:_e.detail})]},w):o.jsxs("div",{className:"ai-error",children:[o.jsx(he,{name:"warn",size:14})," ",_e.text]},w)),L.status==="running"&&!L.parts.length&&o.jsx("div",{className:"muted",children:s.chat.thinking})]},de)})}),o.jsxs("div",{className:"composer",onDragOver:L=>L.preventDefault(),onDrop:L=>{L.preventDefault(),L.dataTransfer.files.length&&ee(L.dataTransfer.files)},children:[o.jsxs("div",{className:"chips",children:[u.selection&&o.jsx(Ku,{on:b,onToggle:()=>N(L=>!L),icon:"select",label:s.chat.chipElementText(u.selection.tag,u.selection.text.slice(0,14))}),u.boards.length>0&&o.jsx(Ku,{on:Y,onToggle:()=>E(L=>!L),icon:"board",label:u.boards.length===1?u.titleOf(u.boards[0]):s.chat.chipBoards(u.boards.length)}),u.visibleCount>0&&o.jsx(Ku,{on:k,onToggle:()=>K(L=>!L),icon:"fit",label:s.chat.chipVisible(u.visibleCount)}),u.attach.comments.map(L=>o.jsx(Ku,{on:!0,icon:"comment",label:s.chat.chipComment(L.text.slice(0,14)),onRemove:()=>u.setAttach(de=>({...de,comments:de.comments.filter(Ne=>Ne.id!==L.id)}))},L.id)),u.attach.refs.map((L,de)=>o.jsx(Ku,{on:!0,icon:L.kind==="url"?"link":"page",label:L.name??L.value,onRemove:()=>u.setAttach(Ne=>({...Ne,refs:Ne.refs.filter((_e,w)=>w!==de)}))},de))]}),be!=null&&o.jsx("div",{className:"url-row",children:o.jsx("input",{autoFocus:!0,value:be,placeholder:"https://","aria-label":s.chat.refLink,onChange:L=>Q(L.target.value),onKeyDown:L=>{L.nativeEvent.isComposing||(L.key==="Enter"&&/^https?:\/\/\S+$/.test(be.trim())&&(u.setAttach(de=>({...de,refs:[...de.refs,{kind:"url",value:be.trim()}]})),Q(null)),L.key==="Escape"&&Q(null))}})}),o.jsx("textarea",{ref:u.inputRef,value:u.draft,rows:3,placeholder:D?s.chat.placeholderRunning:s.chat.placeholder,"aria-label":s.chat.input,onChange:L=>u.setDraft(L.target.value),onPaste:L=>{const de=Array.from(L.clipboardData.files);de.length&&(L.preventDefault(),ee(de))},onKeyDown:L=>{L.nativeEvent.isComposing||L.keyCode===229||(L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),$()),L.key==="Escape"&&(D?le():L.target.blur()))}}),fe&&o.jsx("p",{className:"warn small",children:fe}),o.jsxs("div",{className:"composer-bar",children:[o.jsx("button",{className:"icon-btn sm","aria-label":s.chat.attach,title:s.chat.attachTitle,onClick:()=>{var L;return(L=F.current)==null?void 0:L.click()},children:o.jsx(he,{name:"plus",size:14})}),o.jsx("button",{className:"icon-btn sm","aria-label":s.chat.addLink,title:s.chat.addLink,onClick:()=>Q(""),children:o.jsx(he,{name:"link",size:14})}),o.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,accept:"image/*,.pdf,.md,.txt,.html,.csv,.json",onChange:L=>L.target.files&&void ee(L.target.files)}),o.jsx("label",{className:"variants",title:ne?s.chat.variantsTitle:s.chat.variantsDisabledTitle,children:o.jsxs("select",{value:Te,disabled:!ne||!!D,onChange:L=>re(Number(L.target.value)),"aria-label":s.chat.variantsAria,children:[o.jsx("option",{value:1,children:s.chat.variants(1)}),o.jsx("option",{value:2,children:s.chat.variants(2)}),o.jsx("option",{value:3,children:s.chat.variants(3)}),o.jsx("option",{value:4,children:s.chat.variants(4)})]})}),o.jsx("div",{className:"spacer"}),D?o.jsxs("button",{className:"danger",onClick:le,children:[o.jsx(he,{name:"close",size:14})," ",s.chat.cancel]}):o.jsx("button",{className:"primary",disabled:!u.draft.trim(),onClick:()=>void $(),children:s.chat.send})]})]})]})}function Ku({on:u,onToggle:d,onRemove:h,icon:f,label:g}){return o.jsxs("span",{className:`chip ${u?"on":"off"}`,children:[o.jsxs("button",{className:"chip-main",onClick:d,disabled:!d,"aria-pressed":d?u:void 0,title:d?u?s.chat.chipRemoveTitle:s.chat.chipAddTitle:void 0,children:[o.jsx(he,{name:f,size:12}),o.jsx("span",{children:g})]}),h&&o.jsx("button",{className:"chip-x","aria-label":s.chat.remove(g),onClick:h,children:o.jsx(he,{name:"close",size:12})})]})}function ul(u){const d=u.ownerDocument,h=[];let f=u;for(;f&&f!==d.body;){const g=f.parentElement;if(!g)return null;h.unshift(Array.prototype.indexOf.call(g.children,f)),f=g}return f===d.body?h.join("/"):null}function Al(u,d){let h=u.body;if(!d)return h;for(const f of d.split("/"))if(h=(h==null?void 0:h.children[Number(f)])??null,!h)return null;return h}function Un(u){const d=u.getBoundingClientRect();return{x:d.left,y:d.top,w:d.width,h:d.height}}const M0=["width","height","padding","margin","gap","font-size","font-weight","color","background-color","border-radius","display","flex-direction","align-items","justify-content","line-height","text-align","border","box-shadow","opacity","flex-wrap","flex-grow","align-self","grid-template-columns","grid-template-rows","position","background-image"];function A0(u){const d=u.ownerDocument.defaultView.getComputedStyle(u),h={};for(const f of M0)h[f]=d.getPropertyValue(f);return h}function O0(u){const d={},h=u.style;if(!h)return d;for(let f=0;f<h.length;f++)d[h[f]]=h.getPropertyValue(h[f]);return d}function D0(u,d,h,f){const g=f.replace(/\s+/g," ").trim().slice(0,40);return`${u} ${d} ${g?`"${g}" `:""}(${h})`}function R0(u){const[d,h]=A.useState(null);return A.useEffect(()=>{Oe.get("/api/tokens").then(h).catch(()=>{})},[u]),d}const Sg=u=>Object.entries((u==null?void 0:u.themes[u.active])??{}).map(([d,h])=>({name:d,value:h}));function Sc(u){const d=u.trim().toLowerCase();let h=d.match(/^#([0-9a-f]{3,8})$/);if(h){let f=h[1];return f.length<=4&&(f=[...f].map(g=>g+g).join("")),[parseInt(f.slice(0,2),16),parseInt(f.slice(2,4),16),parseInt(f.slice(4,6),16),f.length===8?parseInt(f.slice(6),16)/255:1]}return h=d.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+))?\s*\)$/),h?[Number(h[1]),Number(h[2]),Number(h[3]),h[4]==null?1:Number(h[4])]:d==="transparent"?[0,0,0,0]:null}const rg=([u,d,h])=>{const f=g=>{const y=g/255;return y<=.03928?y/12.92:((y+.055)/1.055)**2.4};return .2126*f(u)+.7152*f(d)+.0722*f(h)};function Tg(u,d){const h=Sc(u),f=Sc(d);if(!h||!f)return null;const[g,y]=[rg(h),rg(f)].sort((z,D)=>D-z);return(g+.05)/(y+.05)}const Ir=u=>{const d=Sc(u);return d&&d[3]===1?"#"+d.slice(0,3).map(h=>Math.round(h).toString(16).padStart(2,"0")).join("").toUpperCase():null};function _0(u,d,h){if(!h||!d)return null;const f=new Set(Sg(h).map(y=>Ir(y.value)));if(/^(color|background|background-color|border-color)$/.test(u)){const y=Ir(d);if(y&&!f.has(y))return s.checks.colorNotInTokens}const g=[...d.matchAll(/(-?\d+(?:\.\d+)?)px/g)].map(y=>Number(y[1]));return u==="font-size"&&g.some(y=>!h.fontSizes.includes(y))?s.checks.tokenFontSizes(h.fontSizes.join("·")):u==="border-radius"&&g.some(y=>!h.radii.includes(y)&&y<999)?s.checks.tokenRadii(h.radii.join("·")):/^(gap|padding|margin)/.test(u)&&g.some(y=>y%4!==0)?s.checks.notMultipleOf4:u==="font-weight"&&/^\d+$/.test(d)&&!h.fontWeights.includes(Number(d))?s.checks.tokenWeights(h.fontWeights.join("·")):null}function k0(u,d=48){var S,p;const h=u.defaultView,f=[],g=b=>{for(let N=b;N&&N.nodeType===1;N=N.parentElement){const Y=h.getComputedStyle(N),E=Sc(Y.backgroundColor);if(Y.backgroundImage!=="none")return"";if(E&&E[3]>.5)return Y.backgroundColor}return"rgb(255,255,255)"},y=b=>{const N=b.getBoundingClientRect(),Y=h.getComputedStyle(b);return N.width>0&&N.height>0&&Y.visibility!=="hidden"&&Y.display!=="none"},z=u.body.querySelectorAll("a[href], button, input:not([type=hidden]), select, textarea, [role=button], [role=tab], [onclick]");for(const b of Array.from(z)){if(!y(b))continue;const N=ul(b);if(N==null)continue;const Y=b.getBoundingClientRect();Y.width<d&&Y.height<d&&f.push({path:N,kind:"target",message:s.checks.smallTarget(b.tagName.toLowerCase(),Math.round(Y.width),Math.round(Y.height),d)});const E=(b.getAttribute("aria-label")||b.getAttribute("title")||b.getAttribute("placeholder")||b.innerText||((S=b.querySelector("img[alt]"))==null?void 0:S.getAttribute("alt"))||"").trim(),k=b.getAttribute("aria-labelledby")||b.id&&u.querySelector(`label[for="${b.id}"]`)||b.closest("label");!E&&!k&&f.push({path:N,kind:"label",message:s.checks.noName(b.tagName.toLowerCase())})}for(const b of Array.from(u.body.querySelectorAll("img")))if(!b.hasAttribute("alt")&&y(b)){const N=ul(b);N!=null&&f.push({path:N,kind:"label",message:s.checks.noAlt})}const D=u.createTreeWalker(u.body,NodeFilter.SHOW_TEXT),j=new Set;for(let b=D.nextNode();b;b=D.nextNode()){const N=b.parentElement;if(!N||j.has(N)||!((p=b.textContent)!=null&&p.trim())||/^(SCRIPT|STYLE)$/.test(N.tagName)||!y(N))continue;j.add(N);const Y=h.getComputedStyle(N),E=g(N);if(!E)continue;const k=Tg(Y.color,E);if(k==null)continue;const K=parseFloat(Y.fontSize),re=K>=24||K>=18.66&&Number(Y.fontWeight)>=700?3:4.5;if(k<re){const be=ul(N);be!=null&&f.push({path:be,kind:"contrast",message:s.checks.lowContrast(k.toFixed(2),re,b.textContent.trim().slice(0,16))})}}return f}function U0({tokens:u,onSave:d}){const[h,f]=A.useState(u);A.useEffect(()=>f(u),[u]);const g=h.themes[h.active]??{},y=JSON.stringify(h)!==JSON.stringify(u)||!u.registered,z=j=>f({...h,themes:{...h.themes,[h.active]:j}}),D=(j,S)=>o.jsxs("label",{className:"field-row tok-list",children:[o.jsx("span",{children:S}),o.jsx("input",{defaultValue:h[j].join(", "),"aria-label":S,onBlur:p=>f({...h,[j]:p.target.value.split(/[,\s]+/).map(Number).filter(b=>Number.isFinite(b))})},h[j].join())]});return o.jsxs("div",{className:"tokens",children:[o.jsxs("label",{className:"upload small",children:[o.jsx(he,{name:"plus",size:14})," ",s.tokens.import,o.jsx("input",{type:"file",hidden:!0,accept:".json,application/json",onChange:async j=>{var p;const S=(p=j.target.files)==null?void 0:p[0];if(S)try{f(B0(JSON.parse(await S.text()),h))}catch(b){alert(s.tokens.importFailed(b.message))}}})]}),o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:s.tokens.theme}),o.jsx("button",{className:"icon-btn sm","aria-label":s.tokens.addTheme,title:s.tokens.addTheme,onClick:()=>{let j=s.tokens.newTheme;for(let S=2;h.themes[j];S++)j=s.tokens.newThemeN(S);f({...h,themes:{...h.themes,[j]:{...g}},active:j})},children:o.jsx(he,{name:"plus",size:14})})]}),o.jsxs("div",{className:"theme-row",children:[o.jsx("select",{value:h.active,onChange:j=>f({...h,active:j.target.value}),"aria-label":s.tokens.activeTheme,children:Object.keys(h.themes).map(j=>o.jsx("option",{children:j},j))}),o.jsx("input",{defaultValue:h.active,"aria-label":s.tokens.themeName,onBlur:j=>{const S=j.target.value.trim();if(!S||S===h.active||h.themes[S])return;const{[h.active]:p,...b}=h.themes;f({...h,themes:{...b,[S]:p},active:S})}},h.active)]}),o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:s.tokens.colors(Object.keys(g).length)}),o.jsx("button",{className:"icon-btn sm","aria-label":s.tokens.addColor,title:s.tokens.addColor,onClick:()=>z({...g,[s.tokens.colorN(Object.keys(g).length+1)]:"#111111"}),children:o.jsx(he,{name:"plus",size:14})})]}),o.jsx("ul",{className:"tok-colors",children:Object.entries(g).map(([j,S])=>{var p;return o.jsxs("li",{children:[o.jsx("input",{type:"color",value:((p=Ir(S))==null?void 0:p.toLowerCase())??"#000000","aria-label":s.tokens.colorOf(j),onChange:b=>z({...g,[j]:b.target.value.toUpperCase()})}),o.jsx("input",{defaultValue:j,"aria-label":s.tokens.colorName,onBlur:b=>{const N=b.target.value.trim();!N||N===j||g[N]||z(Object.fromEntries(Object.entries(g).map(([Y,E])=>Y===j?[N,E]:[Y,E])))}}),o.jsx("code",{children:S}),o.jsx("button",{className:"icon-btn sm danger","aria-label":s.tokens.remove(j),onClick:()=>z(Object.fromEntries(Object.entries(g).filter(([b])=>b!==j))),children:o.jsx(he,{name:"close",size:12})})]},j)})}),D("fontSizes",s.tokens.fontSizes),D("fontWeights",s.tokens.fontWeights),D("radii",s.tokens.radii),D("spacing",s.tokens.spacing),o.jsxs("label",{className:"field-row tok-list",children:[o.jsx("span",{children:s.tokens.touchTarget}),o.jsx("input",{type:"number",value:h.minTarget,onChange:j=>f({...h,minTarget:Number(j.target.value)||48}),"aria-label":s.tokens.minTouchTarget})]}),o.jsx("button",{className:"primary",disabled:!y,title:s.tokens.saveTitle,onClick:()=>d(h,u.registered?s.history.saveTokens:s.history.registerTokens),children:u.registered?s.tokens.save:s.tokens.register}),o.jsx("p",{className:"muted small",children:u.registered?s.tokens.registeredHint:s.tokens.defaultHint})]})}function B0(u,d){const h=u;if(h&&typeof h=="object"&&h.themes&&typeof h.themes=="object")return{...d,...h,active:h.active??Object.keys(h.themes)[0]};const f={},g=(y,z)=>{if(typeof y=="string"&&/^#|^rgb/i.test(y))f[z]=y.toUpperCase();else if(y&&typeof y=="object"){const D=y.value??y.$value;if(typeof D=="string")g(D,z);else for(const[j,S]of Object.entries(y))g(S,z?`${z} ${j}`:j)}};if(g(u,""),!Object.keys(f).length)throw new Error(s.tokens.noColors);return{...d,themes:{...d.themes,[s.tokens.importedTheme]:f},active:s.tokens.importedTheme}}function fg({title:u,items:d,empty:h,onPick:f,onAskAI:g}){return o.jsxs("section",{className:"board-opts","aria-label":u,children:[o.jsxs("div",{className:"sec-head",children:[o.jsxs("span",{children:[u," ",d?d.length:""]}),g&&d&&d.length>0&&o.jsx("button",{className:"link",onClick:g,children:s.checks.askFix})]}),d==null?o.jsx("p",{className:"muted small",children:s.checks.notVisible}):d.length===0?o.jsxs("p",{className:"ok-line",children:[o.jsx(he,{name:"check",size:14})," ",h]}):o.jsxs("ul",{className:"check-list",children:[d.slice(0,30).map((y,z)=>o.jsx("li",{children:o.jsxs("button",{className:"check-item",disabled:!y.path,onClick:()=>y.path&&f(y.path),title:y.path?s.checks.pickInEdit(y.path):s.checks.line(y.line),children:[o.jsx(he,{name:"warn",size:12}),o.jsx("span",{children:y.message}),o.jsx("code",{children:y.path??s.checks.line(y.line)})]})},z)),d.length>30&&o.jsx("li",{className:"muted small",children:s.checks.more(d.length-30)})]})]})}function xc(u){const d=u==null?void 0:u.getElementById("board-tweaks");if(!d)return null;try{return JSON.parse(d.textContent??"")}catch{return null}}function dg(u,d,h){const f=h.type==="boolean"?h.value?"1":"0":String(h.value)+(h.type==="number"&&h.unit?h.unit:"");h.var&&u.documentElement.style.setProperty(h.var,f),u.documentElement.setAttribute(`data-tweak-${d}`,h.type==="boolean"?h.value?"on":"off":String(h.value))}function H0({doc:u,onSave:d}){const[h,f]=A.useState(()=>xc(u)),[g,y]=A.useState(()=>JSON.stringify(xc(u)));if(A.useEffect(()=>{const j=xc(u);f(j),y(JSON.stringify(j))},[u]),!h)return null;const z=(j,S)=>{const p={...h,[j]:{...h[j],value:S}};f(p),u&&dg(u,j,p[j])},D=JSON.stringify(h)!==g;return o.jsxs("section",{className:"board-opts","aria-label":"Tweaks",children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:"Tweaks"})}),Object.entries(h).map(([j,S])=>o.jsx("label",{className:S.type==="boolean"?"check":"field-row",children:S.type==="boolean"?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"checkbox",checked:!!S.value,onChange:p=>z(j,p.target.checked)}),S.label??j]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{children:S.label??j}),S.type==="color"?o.jsx("input",{type:"color",value:String(S.value),onChange:p=>z(j,p.target.value.toUpperCase()),"aria-label":S.label??j}):S.type==="enum"?o.jsx("select",{value:String(S.value),onChange:p=>z(j,p.target.value),"aria-label":S.label??j,children:(S.options??[]).map(p=>o.jsx("option",{children:p},p))}):o.jsxs("span",{className:"tw-num",children:[o.jsx("input",{type:"range",min:S.min??0,max:S.max??100,step:S.step??1,value:Number(S.value),onChange:p=>z(j,Number(p.target.value)),"aria-label":S.label??j}),o.jsxs("code",{children:[String(S.value),S.unit??""]})]})]})},j)),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{disabled:!D,onClick:()=>{const j=JSON.parse(g);if(f(j),u)for(const[S,p]of Object.entries(j))dg(u,S,p)},children:s.tweaks.revert}),o.jsx("button",{className:"primary",disabled:!D,onClick:()=>void d(Object.fromEntries(Object.entries(h).map(([j,S])=>[j,S.value]))).then(()=>y(JSON.stringify(h))),children:s.tweaks.save})]}),o.jsx("p",{className:"muted small",children:s.tweaks.hint})]})}const L0=u=>u.includes("/")?u.slice(0,u.lastIndexOf("/")):"",$u=u=>`${Math.round(u)}px`;function Y0(u,d,h,f,g){const y=d.style.pointerEvents;d.style.pointerEvents="none";const z=u.elementFromPoint(h,f);if(d.style.pointerEvents=y,!z||z===u.documentElement||d.contains(z))return null;const D=u.defaultView,j=be=>{const Q=D.getComputedStyle(be);return/flex/.test(Q.display)&&!Q.flexDirection.startsWith("column")},S=/^(img|input|br|hr|textarea|select|svg|path|video|iframe)$/i,p=be=>{const Q=be===u.body?"":ul(be);if(Q==null)return null;const fe=j(be),ae=Array.from(be.children).filter(ue=>{var xe;return ue!==d&&!((xe=ue.hasAttribute)!=null&&xe.call(ue,"data-dc-probe"))});let oe=ae.length;for(let ue=0;ue<ae.length;ue++){const xe=Un(ae[ue]);if(fe?h<xe.x+xe.w/2:f<xe.y+xe.h/2){oe=ue;break}}const F=Un(be);let ce;if(oe<ae.length){const ue=Un(ae[oe]);ce=fe?{x:ue.x-1,y:ue.y,w:2,h:ue.h}:{x:ue.x,y:ue.y-1,w:ue.w,h:2}}else if(ae.length){const ue=Un(ae[ae.length-1]);ce=fe?{x:ue.x+ue.w,y:ue.y,w:2,h:ue.h}:{x:ue.x,y:ue.y+ue.h,w:ue.w,h:2}}else ce={x:F.x,y:F.y+F.h-2,w:F.w,h:2};return{toParentPath:Q,index:oe,freeze:[],line:ce}};if(z.contains(d)||z===u.body)return p(z===u.body?u.body:z);if(g&&!S.test(z.tagName))return p(z);const b=z.parentElement,N=b===u.body?"":ul(b);if(N==null)return null;const Y=j(b),E=Un(z),k=Y?h>E.x+E.w/2:f>E.y+E.h/2,Te=Array.from(b.children).filter(be=>be!==d).indexOf(z)+(k?1:0),re=Y?{x:k?E.x+E.w:E.x-1,y:E.y,w:2,h:E.h}:{x:E.x,y:k?E.y+E.h:E.y-1,w:E.w,h:2};return{toParentPath:N,index:Te,freeze:[],line:re}}function q0(u,d,h){const f=d.parentElement;if(!f||f===u.body)return[];const g=ul(f);if(g==null||g===h)return[];const y=u.defaultView.getComputedStyle(f);if(!/flex|grid/.test(y.display))return[];const z=[],D=(p,b)=>{const N=ul(p),Y=p.style,E=p.getBoundingClientRect(),k={};for(const K of b)Y.getPropertyValue(K)||(k[K]=$u(K==="width"?E.width:E.height));N!=null&&Object.keys(k).length&&z.push({path:N,props:k})};D(f,["width","height"]);const j=y.display.includes("grid"),S=!y.flexDirection.startsWith("column");for(const p of Array.from(f.children))p!==d&&D(p,j?["width","height"]:S?["width"]:["height"]);return z}function G0(u){const[d,h]=A.useState(null),[f,g]=A.useState(null),y=A.useRef(null),z=1/Math.max(u.zoom,.25),D=N=>Y=>{if(Y.button!==0)return;Y.stopPropagation(),Y.preventDefault();const E=Al(u.doc,u.path);if(!E)return;const k=u.doc.defaultView.getComputedStyle(E),K=k.position==="absolute"||k.position==="fixed",Te=E.getBoundingClientRect();y.current={kind:N,sx:Y.clientX,sy:Y.clientY,el:E,abs:K,left:parseFloat(k.left)||0,top:parseFloat(k.top)||0,w:Te.width,h:Te.height,plan:null,moved:!1},Y.currentTarget.setPointerCapture(Y.pointerId)},j=N=>{var K,Te;const Y=y.current;if(!Y)return;const E=(N.clientX-Y.sx)/u.zoom,k=(N.clientY-Y.sy)/u.zoom;if(!(!Y.moved&&Math.abs(E)+Math.abs(k)<3)){if(Y.moved=!0,Y.kind==="move"){if(Y.abs){Y.el.style.left=$u(Y.left+E),Y.el.style.top=$u(Y.top+k);return}g({...u.rect,x:u.rect.x+E,y:u.rect.y+k});const re=(Te=(K=u.doc.defaultView)==null?void 0:K.frameElement)==null?void 0:Te.getBoundingClientRect(),be=re?re.width/(u.doc.defaultView.innerWidth||re.width):u.zoom,Q=re?(N.clientX-re.left)/be:u.rect.x+E,fe=re?(N.clientY-re.top)/be:u.rect.y+k,ae=Y0(u.doc,Y.el,Q,fe,N.altKey);Y.plan=ae?{toParentPath:ae.toParentPath,index:ae.index,freeze:[]}:null,h((ae==null?void 0:ae.line)??null);return}Y.kind!=="s"&&(Y.el.style.width=$u(Math.max(8,Y.w+E))),Y.kind!=="e"&&(Y.el.style.height=$u(Math.max(8,Y.h+k)))}},S=N=>{const Y=y.current;if(y.current=null,h(null),g(null),!Y||!Y.moved)return;const E=(N.clientX-Y.sx)/u.zoom,k=(N.clientY-Y.sy)/u.zoom;if(Y.kind==="move"){if(Y.abs)return u.onPosition(Math.round(Y.left+E),Math.round(Y.top+k));if(!Y.plan||Y.plan.toParentPath===L0(u.path)&&Y.plan.index===Array.from(Y.el.parentElement.children).indexOf(Y.el))return;u.onMove({...Y.plan,freeze:q0(u.doc,Y.el,Y.plan.toParentPath)});return}u.onResize(Math.round(Y.kind==="s"?Y.w:Math.max(8,Y.w+E)),Math.round(Y.kind==="e"?Y.h:Math.max(8,Y.h+k)))},p=u.rect,b=10*z;return o.jsxs(o.Fragment,{children:[f&&o.jsx("div",{className:"drag-ghost",style:{left:f.x,top:f.y,width:f.w,height:f.h}}),d&&o.jsx("div",{className:"drop-line",style:{left:d.x,top:d.y,width:Math.max(d.w,2*z),height:Math.max(d.h,2*z)}}),o.jsx("button",{className:"el-move","aria-label":s.elementDrag.moveAria,title:s.elementDrag.moveTitle,style:{left:Math.max(0,p.x),top:p.y>=22*z?p.y-22*z:Math.max(0,p.y),transform:`scale(${z})`,transformOrigin:p.y>=22*z?"0 100%":"0 0"},onPointerDown:D("move"),onPointerMove:j,onPointerUp:S,children:o.jsx(he,{name:"hand",size:12})}),["e","s","se"].map(N=>o.jsx("div",{className:`el-resize ${N}`,role:"slider","aria-label":N==="e"?s.elementDrag.width:N==="s"?s.elementDrag.height:s.elementDrag.size,"aria-valuetext":`${Math.round(p.w)} × ${Math.round(p.h)}`,style:{left:N==="s"?p.x+p.w/2-b/2:p.x+p.w-b/2,top:N==="e"?p.y+p.h/2-b/2:p.y+p.h-b/2,width:b,height:b,borderWidth:1.5*z},onPointerDown:D(N),onPointerMove:j,onPointerUp:S},N))]})}function X0(u,d,h,f){const g=Al(u,d),y=g==null?void 0:g.parentElement;if(!g||!y)return null;const z=u.defaultView.getComputedStyle(y),D=/flex/.test(z.display),j=D&&z.flexDirection.startsWith("column"),S=f==="left"||f==="hcenter"||f==="right",p=f==="left"||f==="top"?"start":f==="right"||f==="bottom"?"end":"center",b={start:"flex-start",center:"center",end:"flex-end"}[p],N=(Y,E)=>({op:"setStyle",path:d,hash:h,prop:Y,value:E});return D&&(S?j:!j)?[N("align-self",b)]:S?p==="start"?[N("margin-left","0"),N("margin-right","auto")]:p==="end"?[N("margin-left","auto"),N("margin-right","0")]:[N("margin-left","auto"),N("margin-right","auto")]:D?p==="start"?[N("margin-top","0"),N("margin-bottom","auto")]:p==="end"?[N("margin-top","auto"),N("margin-bottom","0")]:[N("margin-top","auto"),N("margin-bottom","auto")]:null}function V0(u){const[d,h]=A.useState(""),[f,g]=A.useState(null),[y,z]=A.useState(!1),[D,j]=A.useState(!1),[S,p]=A.useState(null),[b,N]=A.useState(""),Y=async(Q,fe=!1)=>{b.trim()&&(await Oe.post("/api/comments",{action:"reply",id:Q,text:b,author:u.author,resolve:fe}),N(""),p(null))},E=Q=>new Date(Q).toLocaleString("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),k=u.selection,K=u.comments.filter(Q=>!u.file||Q.file===u.file),Te=async()=>{k&&(await navigator.clipboard.writeText(D0(k.file,k.path,k.tag,k.text)).catch(()=>{}),j(!0),setTimeout(()=>j(!1),1200))},re=async()=>{if(u.file){z(!0);try{const Q=await Oe.post("/api/screenshot",{file:u.file,path:k==null?void 0:k.path});g(Q.path)}catch(Q){g(s.inspector.shotFailed(Q.message))}finally{z(!1)}}},be=async()=>{!u.file||!d.trim()||(await Oe.post("/api/comments",{file:u.file,path:(k==null?void 0:k.file)===u.file?k.path:"",text:d,author:u.author}),h(""))};return o.jsx("aside",{className:"inspector",children:u.file?o.jsxs(o.Fragment,{children:[o.jsxs("section",{children:[o.jsx("h3",{children:u.file}),o.jsx("p",{className:"muted",children:u.editing?s.inspector.editModeHint:s.inspector.viewModeHint}),u.error&&o.jsx("p",{className:"warn",children:u.error}),k&&k.file===u.file&&o.jsxs("div",{className:"sel",children:[o.jsxs("div",{children:[o.jsxs("code",{children:["<",k.tag,">"]})," ",o.jsx("code",{children:k.path})," ",u.multi>1&&o.jsx("span",{className:"muted",children:s.inspector.more(u.multi-1)})]}),k.text&&o.jsxs("div",{className:"sel-text",children:["“",k.text.slice(0,120),"”"]}),o.jsxs("div",{className:"row",children:[o.jsx("button",{onClick:Te,children:D?s.inspector.copied:s.inspector.copy}),k.path.includes("/")&&o.jsx("button",{onClick:()=>u.onSelectPath(k.path.slice(0,k.path.lastIndexOf("/"))),children:s.inspector.parent}),o.jsx("button",{onClick:re,disabled:y,children:y?s.inspector.capturing:s.inspector.screenshot})]})]}),!k&&o.jsx("div",{className:"row",children:o.jsx("button",{onClick:re,disabled:y,children:y?s.inspector.capturing:s.inspector.boardScreenshot})}),f&&o.jsx("p",{className:"muted small",children:f})]}),u.children,o.jsxs("section",{children:[o.jsxs("h3",{children:[s.comments.title," ",K.filter(Q=>!Q.resolved).length>0&&o.jsx("span",{className:"muted",children:K.filter(Q=>!Q.resolved).length})]}),o.jsx("textarea",{value:d,placeholder:(k==null?void 0:k.file)===u.file?s.comments.placeholderElement(k.path):s.comments.placeholderBoard,onChange:Q=>h(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&(Q.metaKey||Q.ctrlKey)&&be()}}),o.jsxs("div",{className:"row",children:[o.jsx("button",{onClick:be,disabled:!d.trim(),children:s.comments.add}),o.jsx("button",{className:"link",onClick:u.onAuthor,title:s.comments.authorTitle,children:s.comments.author(u.author)})]}),o.jsx("ul",{className:"comments",children:K.map(Q=>o.jsxs("li",{className:Q.resolved?"resolved":"",children:[o.jsxs("div",{className:"c-head",children:[o.jsx("strong",{children:Q.author}),Q.path&&o.jsx("button",{className:"link",onClick:()=>u.onSelectPath(Q.path),children:Q.path}),o.jsx("span",{className:"muted",children:new Date(Q.createdAt).toLocaleString("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),o.jsx("div",{children:Q.text}),(Q.replies??[]).length>0&&o.jsx("ul",{className:"replies",children:Q.replies.map(fe=>o.jsxs("li",{children:[o.jsxs("div",{className:"c-head",children:[o.jsx("strong",{children:fe.author}),o.jsx("span",{className:"muted",children:E(fe.createdAt)})]}),o.jsx("div",{children:fe.text})]},fe.id))}),S===Q.id&&o.jsxs("div",{className:"reply-box",children:[o.jsx("textarea",{autoFocus:!0,value:b,placeholder:s.comments.replyPlaceholder(u.author),"aria-label":s.comments.reply,onChange:fe=>N(fe.target.value),onKeyDown:fe=>{fe.nativeEvent.isComposing||(fe.key==="Enter"&&(fe.metaKey||fe.ctrlKey)&&Y(Q.id),fe.key==="Escape"&&p(null))}}),o.jsxs("div",{className:"row",children:[o.jsx("button",{onClick:()=>void Y(Q.id),disabled:!b.trim(),children:s.comments.reply}),o.jsx("button",{onClick:()=>void Y(Q.id,!0),disabled:!b.trim(),children:s.comments.replyResolve})]})]}),o.jsxs("div",{className:"row",children:[S!==Q.id&&o.jsx("button",{className:"link",onClick:()=>p(Q.id),children:s.comments.reply}),o.jsx("button",{className:"link",onClick:()=>Oe.post("/api/comments",{action:"resolve",id:Q.id,resolved:!Q.resolved}),children:Q.resolved?s.comments.reopen:s.comments.resolve}),!Q.resolved&&u.onAskAI&&o.jsx("button",{className:"link",onClick:()=>u.onAskAI(Q),title:s.comments.sendToAITitle,children:s.comments.sendToAI})]})]},Q.id))})]})]}):A.Children.toArray(u.children).length?u.children:o.jsxs("div",{className:"inspector-empty",children:[o.jsx("p",{className:"muted",children:s.inspector.pickBoard}),o.jsxs("ul",{className:"muted",children:[o.jsxs("li",{children:[o.jsx("kbd",{children:"B"})," ",s.inspector.hintDraw," · ",o.jsx("kbd",{children:"T"})," ",s.inspector.hintTitle," · ",o.jsx("kbd",{children:"N"})," ",s.inspector.hintNote]}),o.jsxs("li",{children:[s.inspector.hintDoubleClick," ",o.jsx("kbd",{children:"E"})," ",s.inspector.hintEdit," · ",o.jsx("kbd",{children:"F"})," ",s.inspector.hintFocus]}),o.jsxs("li",{children:[s.inspector.hintRightClick," · ",o.jsx("kbd",{children:"⌘K"})," ",s.inspector.hintFind]})]})]})})}const Zr=u=>u.includes("/")?u.slice(0,u.lastIndexOf("/")):"",hg=u=>Number(u.split("/").pop());function Q0(u){var be;const[d,h]=A.useState([]),[f,g]=A.useState({0:!0}),[y,z]=A.useState(null),[D,j]=A.useState(null),[S,p]=A.useState(null);A.useEffect(()=>{Oe.get(`/api/outline?f=${encodeURIComponent(u.file)}`).then(Q=>h(Q.tree)).catch(()=>h([]))},[u.file,u.version]),A.useEffect(()=>{const Q={};for(const fe of u.selected){const ae=fe.split("/");for(let oe=1;oe<ae.length;oe++)Q[ae.slice(0,oe).join("/")]=!0}Object.keys(Q).length&&g(fe=>({...fe,...Q}))},[u.selected.join("|")]);const b=Q=>{if(!y||y===Q||Q.startsWith(y+"/"))return;const fe=Zr(Q);let ae=hg(Q);Zr(y)===fe&&hg(y)<ae&&(ae-=1),u.onMove(y,fe,ae)},N=[],Y=new Map,E=Q=>{for(const fe of Q)N.push(fe),Y.set(fe.path,fe),fe.children.length&&f[fe.path]&&E(fe.children)};E(d);const k=S??u.selected[u.selected.length-1]??((be=N[0])==null?void 0:be.path)??null,K=Q=>{Q==null||!Y.has(Q)||(p(Q),u.onSelect(Q,!1))},Te=Q=>{if(!k)return;const fe=N.findIndex(ce=>ce.path===k),ae=Y.get(k),F={ArrowDown:()=>{var ce;return K((ce=N[fe+1])==null?void 0:ce.path)},ArrowUp:()=>{var ce;return K((ce=N[fe-1])==null?void 0:ce.path)},ArrowRight:()=>ae!=null&&ae.children.length?f[k]?K(ae.children[0].path):g(ce=>({...ce,[k]:!0})):void 0,ArrowLeft:()=>ae!=null&&ae.children.length&&f[k]?g(ce=>({...ce,[k]:!1})):K(k.includes("/")?Zr(k):null),Home:()=>{var ce;return K((ce=N[0])==null?void 0:ce.path)},End:()=>{var ce;return K((ce=N[N.length-1])==null?void 0:ce.path)},Enter:()=>K(k)," ":()=>K(k)}[Q.key];F&&(Q.preventDefault(),Q.stopPropagation(),F())},re=(Q,fe)=>{const ae=Q.children.length>0,oe=f[Q.path];return o.jsxs("li",{children:[o.jsxs("div",{role:"treeitem","aria-selected":u.selected.includes(Q.path),"aria-expanded":ae?!!oe:void 0,"aria-level":fe+1,className:`layer ${u.selected.includes(Q.path)?"on":""} ${D===Q.path?"over":""} ${k===Q.path?"kbd-focus":""}`,style:{paddingLeft:4+fe*12},draggable:!0,onDragStart:F=>{z(Q.path),F.dataTransfer.effectAllowed="move"},onDragEnd:()=>{z(null),j(null)},onDragOver:F=>{y&&(F.preventDefault(),j(Q.path))},onDragLeave:()=>j(F=>F===Q.path?null:F),onDrop:F=>{F.preventDefault(),b(Q.path),j(null)},onClick:F=>{p(Q.path),u.onSelect(Q.path,F.shiftKey)},children:[o.jsx("button",{className:"twisty",tabIndex:-1,"aria-label":oe?s.layers.collapse:s.layers.expand,style:{visibility:ae?"visible":"hidden"},onClick:F=>{F.stopPropagation(),g(ce=>({...ce,[Q.path]:!oe}))},children:oe?"▾":"▸"}),o.jsx("code",{children:Q.tag}),Q.cls&&o.jsxs("span",{className:"muted",children:[".",Q.cls]}),Q.text&&o.jsx("span",{className:"layer-text",children:Q.text})]}),ae&&oe&&o.jsx("ul",{children:Q.children.map(F=>re(F,fe+1))})]},Q.path)};return o.jsxs("section",{className:"layers",children:[o.jsx("h3",{children:s.layers.title}),o.jsx("p",{className:"muted small",children:s.layers.hint}),o.jsx("ul",{className:"layer-tree",role:"tree","aria-label":s.layers.title,tabIndex:0,onKeyDown:Te,children:d.map(Q=>re(Q,0))})]})}const Z0=A.forwardRef(function(d,h){var b;const[f,g]=A.useState(""),[y,z]=A.useState(null),[D,j]=A.useState(null),S=(b=d.pages[0])==null?void 0:b.id,p=A.useMemo(()=>{const N=f.trim().toLowerCase();return d.board.order.filter(Y=>{const E=d.board.boards[Y];return E?N?Y.toLowerCase().includes(N)||(E.title??"").toLowerCase().includes(N):!d.pages.length||(E.page??S)===d.currentPage:!1})},[f,d.board,d.pages,d.currentPage,S]);return o.jsxs("aside",{className:"left","aria-label":s.boardList.aria,children:[d.header,o.jsxs("section",{className:"left-pages",children:[o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:s.boardList.pages}),o.jsx("button",{className:"icon-btn sm","aria-label":s.boardList.addPage,title:s.boardList.addPage,onClick:d.onAddPage,children:o.jsx(he,{name:"plus",size:14})})]}),d.pages.length===0?o.jsx("p",{className:"empty",children:s.boardList.singlePage}):o.jsx("ul",{role:"tablist","aria-label":s.boardList.pages,children:d.pages.map((N,Y)=>o.jsx("li",{draggable:!!d.onMovePage,onDragStart:E=>{z(N.id),E.dataTransfer.effectAllowed="move"},onDragOver:E=>{y&&(E.preventDefault(),j(Y))},onDragEnd:()=>{z(null),j(null)},onDrop:E=>{var K;E.preventDefault();const k=d.pages.findIndex(Te=>Te.id===y);y&&k!==Y&&((K=d.onMovePage)==null||K.call(d,y,Y)),z(null),j(null)},children:o.jsxs("button",{role:"tab",title:s.boardList.pageTabTitle,"aria-selected":N.id===d.currentPage,className:`row ${N.id===d.currentPage?"on":""} ${D===Y&&y!==N.id?"drop-before":""}`,onClick:()=>d.onPage(N.id),onContextMenu:E=>{E.preventDefault(),d.onPageMenu(N.id,E)},children:[o.jsx(he,{name:"page",size:14}),o.jsx("span",{className:"row-text",children:N.name}),o.jsx("span",{className:"row-count",children:Object.values(d.board.boards).filter(E=>(E.page??S)===N.id).length})]})},N.id))})]}),o.jsxs("section",{className:"left-boards",children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:s.boardList.boards(p.length)})}),o.jsxs("label",{className:"search",children:[o.jsx(he,{name:"search",size:14}),o.jsx("input",{ref:h,value:f,placeholder:s.boardList.searchPlaceholder,"aria-label":s.boardList.search,onChange:N=>g(N.target.value),onKeyDown:N=>{N.nativeEvent.isComposing||(N.key==="Enter"&&p[0]&&d.onPick(p[0],!1),N.key==="Escape"&&(g(""),N.target.blur()))}})]}),p.length===0?o.jsx("p",{className:"empty",children:f?s.boardList.noMatch(f):s.boardList.emptyPage}):o.jsx("ul",{className:"board-list",children:p.map(N=>{const Y=d.board.boards[N];return o.jsx("li",{children:o.jsxs("button",{className:`row ${d.selected.includes(N)?"on":""}`,onClick:E=>d.onPick(N,E.shiftKey||E.metaKey),onContextMenu:E=>{E.preventDefault(),d.onBoardMenu(N,E)},title:N,children:[o.jsx(he,{name:"board",size:14}),o.jsx("span",{className:"row-text",children:Y.title??N}),d.missing.includes(N)&&o.jsx(he,{name:"warn",size:14,className:"warn-icon","aria-label":s.boardList.fileMissing})]})},N)})})]})]})});function K0({rects:u,selected:d,view:h,size:f,onJump:g}){const D=A.useMemo(()=>{if(!u.length)return{x:0,y:0,w:1,h:1};const E=Math.min(...u.map(K=>K.x)),k=Math.min(...u.map(K=>K.y));return{x:E,y:k,w:Math.max(...u.map(K=>K.x+K.w))-E,h:Math.max(...u.map(K=>K.y+K.h))-k}},[u]),j=Math.min(200/D.w,130/D.h),S=(200-D.w*j)/2,p=(130-D.h*j)/2,b={x:(-h.x/h.zoom-D.x)*j+S,y:(-h.y/h.zoom-D.y)*j+p,w:f.w/h.zoom*j,h:f.h/h.zoom*j},N=A.useRef(!1),Y=E=>{const k=E.currentTarget.getBoundingClientRect(),K=k.width/200;g(((E.clientX-k.left)/K-S)/j+D.x,((E.clientY-k.top)/K-p)/j+D.y)};return o.jsx("div",{className:"minimap",role:"img","aria-label":s.minimap.aria,onPointerDown:E=>{N.current=!0,E.currentTarget.setPointerCapture(E.pointerId),Y(E)},onPointerMove:E=>N.current&&Y(E),onPointerUp:()=>N.current=!1,children:o.jsxs("svg",{width:200,height:130,children:[u.map(E=>o.jsx("rect",{x:(E.x-D.x)*j+S,y:(E.y-D.y)*j+p,width:Math.max(1,E.w*j),height:Math.max(1,E.h*j),className:d.includes(E.file)?"mm-sel":"mm-board"},E.file)),o.jsx("rect",{x:b.x,y:b.y,width:b.w,height:b.h,className:"mm-view"})]})})}function $0(u){const d=u.item,h=(f,g,y,z)=>o.jsx(J0,{label:g,value:d[f]??0,min:y,max:z,onCommit:D=>u.onPatch({[f]:D})},f+u.file+(d[f]??""));return o.jsxs("section",{className:"board-opts","aria-label":s.boardOptions.aria,children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:s.boardOptions.heading})}),o.jsxs("button",{className:"title-btn",onClick:u.onRename,title:s.boardOptions.renameTitle,children:[o.jsx("strong",{children:d.title??u.file}),o.jsx(he,{name:"edit",size:14})]}),o.jsx("button",{className:"link file-btn",onClick:u.onRenameFile,title:s.boardOptions.renameFileTitle,children:u.file}),o.jsxs("div",{className:"grid2",children:[h("x","X"),h("y","Y"),h("w",s.boardOptions.width,40,8e3),h("h",s.boardOptions.height,40,8e3),h("radius",s.boardOptions.radius,0,200)]}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:!!d.is_interactive,onChange:f=>u.onPatch({is_interactive:f.target.checked||void 0})}),s.boardOptions.interactive]}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:!!d.frameless,onChange:f=>u.onPatch({frameless:f.target.checked||void 0})}),s.boardOptions.frameless]}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:d.expand==="fill",onChange:f=>u.onPatch({expand:f.target.checked?"fill":void 0})}),s.boardOptions.fill]}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:u.isLaunch,onChange:f=>u.onLaunch(f.target.checked)}),s.boardOptions.launch]}),u.pages.length>0&&o.jsxs("label",{className:"field-row",children:[o.jsx("span",{children:s.boardOptions.page}),o.jsx("select",{value:d.page??u.pages[0].id,onChange:f=>u.onPatch({page:f.target.value}),children:u.pages.map(f=>o.jsx("option",{value:f.id,children:f.name},f.id))})]}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.focus,title:s.boardOptions.focusTitle,onClick:u.onFocus,children:o.jsx(he,{name:"focus"})}),o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.front,title:s.boardOptions.frontTitle,onClick:u.onFront,children:o.jsx(he,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.back,title:s.boardOptions.backTitle,onClick:u.onBack,children:o.jsx(he,{name:"back"})}),o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.duplicate,title:s.boardOptions.duplicateTitle,onClick:u.onDuplicate,children:o.jsx(he,{name:"copy"})}),o.jsx("button",{className:"icon-btn danger","aria-label":s.boardOptions.delete,title:s.boardOptions.deleteTitle,onClick:u.onDelete,children:o.jsx(he,{name:"trash"})})]})]})}function J0({label:u,value:d,min:h,max:f,onCommit:g}){const[y,z]=A.useState(String(d));A.useEffect(()=>z(String(d)),[d]);const D=()=>{let j=Math.round(Number(y));if(!Number.isFinite(j))return z(String(d));h!=null&&(j=Math.max(h,j)),f!=null&&(j=Math.min(f,j)),j!==d&&g(j),z(String(j))};return o.jsxs("label",{className:"num",children:[o.jsx("span",{children:u}),o.jsx("input",{inputMode:"numeric",value:y,onChange:j=>z(j.target.value),onBlur:D,onKeyDown:j=>{if(!j.nativeEvent.isComposing&&(j.key==="Enter"&&j.target.blur(),j.key==="ArrowUp"||j.key==="ArrowDown")){j.preventDefault();const S=Number(y)+(j.key==="ArrowUp"?1:-1)*(j.shiftKey?10:1);z(String(S))}}})]})}function F0({board:u,file:d,onClose:h,onNav:f}){const g=u.boards[d],y=A.useRef(null),[z,D]=A.useState(1),j=u.order.filter(b=>u.boards[b]),S=j.indexOf(d);if(A.useEffect(()=>{const b=N=>{N.key==="Escape"&&h(),N.key==="ArrowRight"&&j[S+1]&&f(j[S+1]),N.key==="ArrowLeft"&&j[S-1]&&f(j[S-1])};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[d,h,f,S,j]),A.useEffect(()=>{const b=()=>{const N=y.current;!N||!g||D(Math.min(1,(N.clientWidth-48)/g.w,(N.clientHeight-48)/g.h))};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[g]),!g)return null;const p=g.expand==="fill";return o.jsxs("div",{className:"focus",role:"dialog","aria-modal":"true","aria-label":s.focus.aria(g.title??d),children:[o.jsxs("div",{className:"focus-bar",children:[o.jsx("button",{className:"icon-btn","aria-label":s.focus.prev,disabled:!j[S-1],onClick:()=>f(j[S-1]),children:o.jsx(he,{name:"chevronRight",style:{transform:"rotate(180deg)"}})}),o.jsx("button",{className:"icon-btn","aria-label":s.focus.next,disabled:!j[S+1],onClick:()=>f(j[S+1]),children:o.jsx(he,{name:"chevronRight"})}),o.jsx("strong",{children:g.title??d}),o.jsxs("span",{className:"muted",children:[d,p?s.focus.pageStyle:` · ${g.w}×${g.h} · ${Math.round(z*100)}%`]}),o.jsx("div",{className:"spacer"}),o.jsxs("button",{onClick:h,children:[s.focus.close," ",o.jsx("kbd",{children:"Esc"})]})]}),o.jsx("div",{ref:y,className:`focus-stage ${p?"fill":""}`,children:p?o.jsx("iframe",{src:`/screens/${d}`,title:g.title??d,className:"focus-fill"}):o.jsx("div",{className:"focus-frame",style:{width:g.w*z,height:g.h*z,borderRadius:(g.radius??0)*z},children:o.jsx("iframe",{src:`/screens/${d}`,title:g.title??d,style:{width:g.w,height:g.h,transform:`scale(${z})`,transformOrigin:"0 0"}})})})]})}function W0({board:u,file:d,onClose:h,onLocate:f}){const g=A.useRef(null),[y,z]=A.useState(d),D=u.boards[y]??u.boards[d],j=()=>{var N,Y,E;const S=(N=g.current)==null?void 0:N.contentDocument;S==null||S.addEventListener("click",k=>{var re,be;const K=(be=(re=k.target)==null?void 0:re.closest)==null?void 0:be.call(re,"a[href]");if(!K)return;const Te=new URL(K.href,S.baseURI);Te.origin!==location.origin&&(k.preventDefault(),window.open(Te.href,"_blank","noopener"))});const b=(((E=(Y=g.current)==null?void 0:Y.contentWindow)==null?void 0:E.location.pathname)??"").match(/^\/screens\/(.+)$/);b&&z(decodeURIComponent(b[1]))};return A.useEffect(()=>{const S=p=>p.key==="Escape"&&h();return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[h]),o.jsxs("div",{className:"play",onPointerDown:S=>S.target===S.currentTarget&&h(),children:[o.jsxs("div",{className:"play-bar",children:[o.jsx("button",{onClick:()=>{var S,p;return(p=(S=g.current)==null?void 0:S.contentWindow)==null?void 0:p.history.back()},title:s.play.back,children:"←"}),o.jsx("button",{onClick:()=>{var S,p;return(p=(S=g.current)==null?void 0:S.contentWindow)==null?void 0:p.history.forward()},title:s.play.forward,children:"→"}),o.jsx("strong",{children:(D==null?void 0:D.title)??y}),o.jsx("span",{className:"muted",children:y}),o.jsx("div",{className:"spacer"}),o.jsx("button",{onClick:()=>{f(y),h()},children:s.play.viewOnCanvas}),o.jsx("button",{onClick:h,title:s.play.closeTitle,children:s.play.close})]}),o.jsx("iframe",{ref:g,className:"play-frame",src:`/screens/${d}`,title:"Play",onLoad:j,style:{width:Math.min((D==null?void 0:D.w)??390,window.innerWidth-32)}})]})}const Ng=[{name:s.properties.tokenColors.text,value:"#111111"},{name:s.properties.tokenColors.secondaryText,value:"#6B6B6B"},{name:s.properties.tokenColors.background,value:"#FFFFFF"},{name:s.properties.tokenColors.surface,value:"#F5F5F3"},{name:s.properties.tokenColors.divider,value:"#E8E8E6"},{name:s.properties.tokenColors.accent,value:"#C94F0C"},{name:s.properties.tokenColors.error,value:"#B42318"}],I0=[{prop:"width",label:s.properties.fields.width},{prop:"height",label:s.properties.fields.height},{prop:"padding",label:"padding"},{prop:"margin",label:"margin"},{prop:"gap",label:"gap"},{prop:"font-size",label:s.properties.fields.fontSize},{prop:"font-weight",label:s.properties.fields.fontWeight,options:["","400","600","700"]},{prop:"color",label:s.properties.fields.color,color:!0},{prop:"background",label:s.properties.fields.background,color:!0},{prop:"border-radius",label:s.properties.fields.radius},{prop:"display",label:"display",options:["","block","flex","grid","inline-flex","none"]},{prop:"flex-direction",label:s.properties.fields.flexDirection,options:["","row","column"]},{prop:"align-items",label:s.properties.fields.alignItems,options:["","flex-start","center","flex-end","stretch","baseline"]},{prop:"justify-content",label:s.properties.fields.justifyContent,options:["","flex-start","center","flex-end","space-between"]},{prop:"flex-wrap",label:s.properties.fields.flexWrap,options:["","nowrap","wrap"]},{prop:"flex-grow",label:s.properties.fields.flexGrow,options:["","0","1"]},{prop:"align-self",label:s.properties.fields.alignSelf,options:["","auto","flex-start","center","flex-end","stretch"]},{prop:"line-height",label:s.properties.fields.lineHeight},{prop:"text-align",label:s.properties.fields.textAlign,options:["","left","center","right"]},{prop:"border",label:s.properties.fields.border},{prop:"box-shadow",label:s.properties.fields.boxShadow},{prop:"opacity",label:s.properties.fields.opacity}];function mg(u){if(!u||u==="none")return null;const d=u.match(/^\s*repeat\(\s*(\d+)\s*,/);if(d)return Number(d[1]);let h=0,f=0,g=!1;for(const y of u)y==="("&&h++,y===")"&&h--,/\s/.test(y)&&h===0?g=!1:g||(g=!0,f++);return f||null}const P0=u=>`repeat(${u}, minmax(0, 1fr))`,eb=[{dir:"left",label:s.properties.alignButtons.left,glyph:"⇤"},{dir:"hcenter",label:s.properties.alignButtons.hcenter,glyph:"↔"},{dir:"right",label:s.properties.alignButtons.right,glyph:"⇥"},{dir:"top",label:s.properties.alignButtons.top,glyph:"⤒"},{dir:"vcenter",label:s.properties.alignButtons.vcenter,glyph:"↕"},{dir:"bottom",label:s.properties.alignButtons.bottom,glyph:"⤓"}],tb={a:["href"],img:["src","alt"],input:["placeholder"],button:["aria-label"]};function lb(u){const d=u.selection,h=tb[d.tag]??[];return o.jsxs("section",{className:"props",children:[o.jsx("h3",{children:s.properties.title}),I0.map(f=>o.jsx(Kr,{label:f.label,value:u.inline[f.prop]??(f.prop==="background"?u.inline["background-color"]??"":""),placeholder:d.styles[f.prop==="background"?"background-color":f.prop]??"",options:f.options,color:f.color,swatches:f.color?u.tokens?Sg(u.tokens):Ng:void 0,chips:nb(f.prop,u.tokens),warn:_0(f.prop,u.inline[f.prop]??(f.prop==="background"?u.inline["background-color"]??"":""),u.tokens),ratio:f.prop==="color"?Tg(u.inline.color||d.styles.color||"",u.bg):null,onCommit:g=>u.onStyle(f.prop,g)},f.prop+d.path+d.hash)),(u.inline.display??d.styles.display??"").includes("grid")&&["grid-template-columns","grid-template-rows"].map(f=>o.jsx(Kr,{label:f.endsWith("columns")?s.properties.columns:s.properties.rows,value:String(mg(u.inline[f])??""),placeholder:String(mg(d.styles[f])??""),onCommit:g=>u.onStyle(f,/^\d+$/.test(g)&&Number(g)>0?P0(Math.min(24,Number(g))):g)},f+d.path+d.hash)),h.map(f=>o.jsx(Kr,{label:f,value:u.attrs[f]??"",placeholder:"",onCommit:g=>u.onAttr(f,g===""?null:g)},f+d.path+d.hash)),o.jsx("div",{className:"align-row",role:"group","aria-label":s.properties.align,children:eb.map(f=>o.jsx("button",{className:"icon-btn sm","aria-label":f.label,title:f.label,onClick:()=>u.onAlign(f.dir),children:o.jsx("span",{className:"glyph",children:f.glyph})},f.dir))}),u.onReplaceImage&&o.jsx("button",{onClick:u.onReplaceImage,children:s.properties.replaceImage}),o.jsxs("div",{className:"row",children:[o.jsx("button",{onClick:()=>u.onWrap("flex"),disabled:!u.canWrap,title:s.properties.wrapTitle,children:s.properties.wrapFlex}),o.jsx("button",{onClick:()=>u.onWrap("grid"),disabled:!u.canWrap,children:s.properties.wrapGrid})]}),o.jsxs("div",{className:"row",children:[o.jsx("button",{onClick:u.onDuplicate,children:s.properties.duplicate}),o.jsx("button",{onClick:u.onDelete,children:s.properties.delete})]})]})}function nb(u,d){if(d){if(u==="font-size")return d.fontSizes.map(h=>`${h}px`);if(u==="border-radius")return d.radii.map(h=>`${h}px`);if(u==="gap"||u==="padding")return d.spacing.filter(h=>h&&h<=24).map(h=>`${h}px`)}}function Kr(u){const[d,h]=A.useState(u.value);A.useEffect(()=>h(u.value),[u.value]);const f=(g=d)=>{g.trim()!==u.value.trim()&&u.onCommit(g.trim())};return o.jsxs("label",{className:"field",children:[o.jsxs("span",{children:[u.label,u.warn&&o.jsxs("span",{className:"tok-warn",title:u.warn,"aria-label":s.properties.offToken(u.warn),children:[" ","⚠"]})]}),u.options?o.jsx("select",{value:d,onChange:g=>{h(g.target.value),f(g.target.value)},children:u.options.map(g=>o.jsx("option",{value:g,children:g||`(${u.placeholder||s.properties.none})`},g))}):o.jsx("input",{value:d,placeholder:u.placeholder,onChange:g=>h(g.target.value),onBlur:()=>f(),onKeyDown:g=>{g.nativeEvent.isComposing||(g.key==="Enter"&&g.currentTarget.blur(),g.key==="Escape"&&(h(u.value),g.currentTarget.blur()))}}),u.ratio!=null&&o.jsxs("span",{className:`ratio ${u.ratio>=4.5?"ok":u.ratio>=3?"mid":"bad"}`,title:s.properties.contrastTitle,children:[s.properties.contrast," ",u.ratio.toFixed(2),":1 · ",u.ratio>=7?"AAA":u.ratio>=4.5?"AA":u.ratio>=3?s.properties.largeTextOnly:s.properties.tooLow]}),u.chips&&o.jsx("span",{className:"chips-row",children:u.chips.map(g=>o.jsx("button",{className:`tchip ${d===g?"on":""}`,onClick:y=>{y.preventDefault(),h(g),f(g)},children:g.replace("px","")},g))}),u.color&&o.jsx("span",{className:"swatches",children:(u.swatches??Ng).map(g=>o.jsx("button",{className:`swatch ${d.toUpperCase()===g.value?"on":""}`,title:`${g.name} ${g.value}`,style:{background:g.value},onClick:y=>{y.preventDefault(),h(g.value),f(g.value)}},g.value))})]})}const Eg=A.createContext(()=>{}),ab=()=>A.useContext(Eg);function ib({children:u}){const[d,h]=A.useState([]),f=A.useCallback(g=>{const y=Date.now()+Math.random();h(z=>[...z.slice(-3),{...g,id:y}]),setTimeout(()=>h(z=>z.filter(D=>D.id!==y)),g.tone==="error"?6e3:3200)},[]);return o.jsxs(Eg.Provider,{value:f,children:[u,o.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:d.map(g=>o.jsxs("div",{className:`toast ${g.tone??"info"}`,children:[g.tone==="error"?o.jsx(he,{name:"warn"}):g.tone==="ok"?o.jsx(he,{name:"check"}):null,o.jsx("span",{children:g.text}),g.action&&o.jsx("button",{className:"toast-action",onClick:()=>{g.action.run(),h(y=>y.filter(z=>z.id!==g.id))},children:g.action.label})]},g.id))})]})}function ub({menu:u,onClose:d}){const h=A.useRef(null),[f,g]=A.useState({x:0,y:0}),[y,z]=A.useState(-1);if(A.useLayoutEffect(()=>{if(!u||!h.current)return;const S=h.current.getBoundingClientRect();g({x:Math.min(u.x,window.innerWidth-S.width-8),y:Math.min(u.y,window.innerHeight-S.height-8)}),z(-1),h.current.focus()},[u]),A.useEffect(()=>{if(!u)return;const S=p=>{h.current&&p.target instanceof Node&&h.current.contains(p.target)||d()};return window.addEventListener("pointerdown",S,!0),window.addEventListener("blur",d),()=>{window.removeEventListener("pointerdown",S,!0),window.removeEventListener("blur",d)}},[u,d]),!u)return null;const D=u.items,j=D.map((S,p)=>S!=="sep"&&!S.disabled?p:-1).filter(S=>S>=0);return o.jsxs("div",{ref:h,className:"menu",role:"menu",tabIndex:-1,"aria-label":u.title??s.dialog.menu,style:{left:f.x,top:f.y},onKeyDown:S=>{if(S.key==="Escape")d();else if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const p=j.indexOf(y),b=S.key==="ArrowDown"?j[(p+1)%j.length]:j[(p-1+j.length)%j.length];z(b)}else if(S.key==="Enter"&&y>=0){const p=D[y];p!=="sep"&&(d(),p.run())}},children:[u.title&&o.jsx("div",{className:"menu-title",children:u.title}),D.map((S,p)=>S==="sep"?o.jsx("div",{className:"menu-sep",role:"separator"},p):o.jsxs("button",{role:"menuitem",className:`menu-item ${y===p?"active":""} ${S.danger?"danger":""}`,disabled:S.disabled,onMouseEnter:()=>z(p),onClick:()=>{d(),S.run()},children:[o.jsx("span",{className:"menu-icon",children:S.icon&&o.jsx(he,{name:S.icon,size:16})}),o.jsx("span",{className:"menu-label",children:S.label}),S.shortcut&&o.jsx("kbd",{children:S.shortcut})]},p))]})}function ob({state:u,onClose:d}){const[h,f]=A.useState(""),[g,y]=A.useState(!1),z=A.useRef(null),D=A.useRef(null);if(A.useEffect(()=>{var p;u&&(u.kind==="prompt"?(f(u.value),y(((p=u.extra)==null?void 0:p.checked)??!1),setTimeout(()=>{var b;return(b=z.current)==null?void 0:b.select()},0)):setTimeout(()=>{var b;return(b=D.current)==null?void 0:b.focus()},0))},[u]),!u)return null;const j=()=>{u.kind==="prompt"?u.resolve(null):u.resolve(!1),d()},S=()=>{u.kind==="prompt"?u.resolve({value:h,extra:g}):u.resolve(!0),d()};return o.jsx("div",{className:"dialog-backdrop",onPointerDown:p=>p.target===p.currentTarget&&j(),children:o.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-label":u.title,onKeyDown:p=>{p.key==="Escape"&&j(),p.key==="Enter"&&!p.nativeEvent.isComposing&&S()},children:[o.jsx("h2",{children:u.title}),u.kind==="prompt"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"dialog-field",children:[u.label&&o.jsx("span",{children:u.label}),o.jsx("input",{ref:z,value:h,onChange:p=>f(p.target.value)})]}),u.hint&&o.jsx("p",{className:"muted",children:u.hint}),u.extra&&o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:g,onChange:p=>y(p.target.checked)}),u.extra.label]})]}):o.jsx("p",{children:u.body}),o.jsxs("div",{className:"dialog-actions",children:[o.jsx("button",{onClick:j,children:s.dialog.cancel}),o.jsx("button",{ref:D,className:u.kind==="confirm"&&u.danger?"danger primary":"primary",onClick:S,children:u.ok})]})]})})}function cb(){const[u,d]=A.useState(null);return{state:u,close:()=>d(null),prompt:g=>new Promise(y=>d({kind:"prompt",value:g.value??"",ok:g.ok??s.dialog.ok,...g,resolve:y})),confirm:g=>new Promise(y=>d({kind:"confirm",ok:g.ok??s.dialog.ok,...g,resolve:y}))}}function sb(u,d,h){const[f,g]=A.useState({hover:null,paths:[],rects:[],selection:null,error:null}),y=A.useRef([]);y.current=f.paths;const z=A.useRef(h);z.current=h;const D=A.useCallback(()=>{var p;if(!u)return;const S=(p=d(u))==null?void 0:p.contentDocument;S&&g(b=>{const N=b.paths.map(Y=>Al(S,Y));return N.some(Y=>!Y)?{...b,paths:[],rects:[],selection:null,error:s.editMode.fileChanged}:{...b,rects:N.map(Y=>Un(Y))}})},[u,d]),j=A.useCallback(async S=>{var Y;if(!u)return;const p=(Y=d(u))==null?void 0:Y.contentDocument,b=p?S.map(E=>Al(p,E)):[];if(!p||!S.length||b.some(E=>!E)){g(E=>({...E,paths:[],rects:[],selection:null})),await Oe.put("/api/selection",{file:null}).catch(()=>{});return}const N=S[S.length-1];g(E=>({...E,paths:S,rects:b.map(k=>Un(k)),error:null}));try{const{selection:E}=await Oe.put("/api/selection",{file:u,path:N,paths:S,styles:A0(Al(p,N)),...rb(Al(p,N))});g(k=>k.paths===S||k.paths.join()===S.join()?{...k,selection:E}:k)}catch(E){g(k=>({...k,selection:null,error:String(E.message)}))}},[u,d]);return A.useEffect(()=>{g({hover:null,paths:[],rects:[],selection:null,error:null})},[u]),A.useEffect(()=>{var Y;if(!u)return;const S=d(u);if(!S)return;let p=()=>{};const b=()=>{p();const E=S.contentDocument,k=S.contentWindow;if(!E||!k)return;const K=F=>{const ce=F.target;return ce&&ce.nodeType===1&&ce!==E.body&&ce!==E.documentElement?ce:null},Te=F=>{const ce=K(F),ue=ce?ul(ce):null;g(xe=>{var Qe;return ue==null?{...xe,hover:null}:((Qe=xe.hover)==null?void 0:Qe.path)===ue?xe:{...xe,hover:{path:ue,rect:Un(ce)}}})},re=()=>g(F=>({...F,hover:null})),be=F=>{F.preventDefault(),F.stopPropagation();const ce=K(F),ue=ce?ul(ce):null;if(ue==null)return;const xe=y.current;j(F.shiftKey?xe.includes(ue)?xe.filter(Qe=>Qe!==ue):[...xe,ue]:[ue])},Q=F=>{var xe,Qe;F.preventDefault();const ce=K(F),ue=ce?ul(ce):null;ce&&ue!=null&&((Qe=(xe=z.current)==null?void 0:xe.onTextEdit)==null||Qe.call(xe,ce,ue))},fe=F=>{var G,W;F.preventDefault();const ce=K(F),ue=ce?ul(ce):null;if(ue==null)return;y.current.includes(ue)||j([ue]);const xe=S.getBoundingClientRect(),Qe=xe.width/(S.offsetWidth||xe.width);(W=(G=z.current)==null?void 0:G.onContext)==null||W.call(G,ue,{clientX:xe.left+F.clientX*Qe,clientY:xe.top+F.clientY*Qe})},ae=F=>{var ce;if(!(F.isComposing||(ce=F.target)!=null&&ce.isContentEditable)){if(F.key==="Escape"){const ue=y.current;if(ue.length){const xe=ue[ue.length-1],Qe=xe.includes("/")?xe.slice(0,xe.lastIndexOf("/")):null;j(Qe==null?[]:[Qe]);return}}window.dispatchEvent(new KeyboardEvent("keydown",{key:F.key,code:F.code,metaKey:F.metaKey,ctrlKey:F.ctrlKey,shiftKey:F.shiftKey,altKey:F.altKey})),(/^(Arrow|Delete|Backspace)/.test(F.key)||(F.metaKey||F.ctrlKey)&&/^[zydcvg]$/i.test(F.key))&&F.preventDefault()}},oe=()=>D();E.addEventListener("mousemove",Te,!0),E.addEventListener("mouseleave",re,!0),E.addEventListener("click",be,!0),E.addEventListener("dblclick",Q,!0),E.addEventListener("contextmenu",fe,!0),E.addEventListener("keydown",ae,!0),k.addEventListener("scroll",oe,!0),p=()=>{E.removeEventListener("mousemove",Te,!0),E.removeEventListener("mouseleave",re,!0),E.removeEventListener("click",be,!0),E.removeEventListener("dblclick",Q,!0),E.removeEventListener("contextmenu",fe,!0),E.removeEventListener("keydown",ae,!0),k.removeEventListener("scroll",oe,!0)}},N=()=>{b(),y.current.length&&j(y.current)};return((Y=S.contentDocument)==null?void 0:Y.readyState)==="complete"&&b(),S.addEventListener("load",N),()=>{S.removeEventListener("load",N),p()}},[u,d,j,D]),{state:f,select:j,refresh:D,setError:S=>g(p=>({...p,error:S}))}}function rb(u){var y,z,D;const d=u.tagName.toLowerCase(),h=u.getAttribute("role"),f=d==="img"||d==="picture"||(z=(y=u.style)==null?void 0:y.backgroundImage)!=null&&z.includes("url(")?"image":d==="button"||h==="button"?"button":d==="a"?"link":/^(input|textarea|select)$/.test(d)?"input":d==="svg"?"icon":!u.children.length&&((D=u.textContent)!=null&&D.trim())?"text":"container",g=(u.getAttribute("aria-label")||u.getAttribute("alt")||u.getAttribute("title")||u.getAttribute("placeholder")||u.textContent||"").trim().replace(/\s+/g," ").slice(0,60);return{kind:f,label:g}}const fb=400,ot=navigator.platform.includes("Mac")?"⌘":"Ctrl+",jg=u=>`design-canvas:${u}`;function db(u){try{return JSON.parse(localStorage.getItem(jg(u))??"{}")}catch{return{}}}const hb=[{id:"blank",label:s.templates.blank,size:"390×844",w:390,h:844},{id:"mobile",label:s.templates.mobile,size:"390×844",w:390,h:844},{id:"desktop",label:s.templates.desktop,size:"1440×900",w:1440,h:900},{id:"doc",label:s.templates.doc,size:"800×1000",w:800,h:1e3}],$r=[{id:"select",icon:"select",label:s.tools.select,key:"V"},{id:"hand",icon:"hand",label:s.tools.hand,key:"H"},{id:"board",icon:"board",label:s.tools.board,key:"B"},{id:"title",icon:"title",label:s.tools.title,key:"T"},{id:"sticky",icon:"sticky",label:s.tools.sticky,key:"N"},{id:"rect",icon:"rect",label:s.tools.rect,key:"R"},{id:"oval",icon:"oval",label:s.tools.oval,key:"O"},{id:"line",icon:"line",label:s.tools.line,key:"L"},{id:"arrow",icon:"arrow",label:s.tools.arrow,key:"A"},{id:"pen",icon:"pen",label:s.tools.pen,key:"P"}],mb=["rect","oval","line","arrow","pen"];function gb(){var lu,ci,nu,Vn,Sl,si,Qn;const[u,d]=A.useState(null),[h,f]=A.useState(null),[g,y]=A.useState({x:0,y:0,zoom:.1}),[z,D]=A.useState(null),[j,S]=A.useState("select"),[p,b]=A.useState([]),[N,Y]=A.useState(null),[E,k]=A.useState(null),[K,Te]=A.useState(null),[re,be]=A.useState(null),[Q,fe]=A.useState(""),[ae,oe]=A.useState(null),[F,ce]=A.useState(!0),[ue,xe]=A.useState(!0),[Qe,G]=A.useState(null),[W,ne]=A.useState({canUndo:!1,canRedo:!1,undo:[],redo:[]}),[$,le]=A.useState({}),[ee,je]=A.useState(null),[L,de]=A.useState(null),[Ne,_e]=A.useState([]),[w,X]=A.useState("inspect"),[te,P]=A.useState(""),[me,ke]=A.useState({comments:[],refs:[]}),[qe,ye]=A.useState({}),ze=A.useRef(new Set),Ol=A.useCallback(c=>(ze.current.add(c),()=>void ze.current.delete(c)),[]),Qa=A.useRef(null),$l=A.useRef(0),[Ot,St]=A.useState("boards"),[Je,yl]=A.useState(0),[Jl,Pt]=A.useState(null),[Et,Dl]=A.useState(null),[yn,Za]=A.useState(0),gt=R0(yn),[va,Zi]=A.useState(()=>{try{return localStorage.getItem("design-canvas:author")??""}catch{return""}});A.useEffect(()=>{va||Oe.get("/api/me").then(c=>c.name&&Zi(c.name)).catch(()=>{})},[]);const[Rl,ya]=A.useState(null),[Ka,Fu]=A.useState(null),$a=A.useRef(null),[ba,Ja]=A.useState(!0),[bl,Tc]=A.useState(()=>{try{return localStorage.getItem("design-canvas:theme")||"system"}catch{return"system"}});A.useEffect(()=>{bl==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",bl);try{localStorage.setItem("design-canvas:theme",bl)}catch{}},[bl]);const[pa,Ht]=A.useState(null),Ki=A.useRef(!1),jt=A.useRef(new Map),[Bn,Fa]=A.useState(0),Wu=A.useRef(null),Ee=ab(),ol=cb(),Nc=A.useCallback(c=>jt.current.get(c)??null,[Bn]),_l=A.useRef(null),ct=A.useRef(null);ct.current=h;const el=A.useRef(null),Fe=A.useCallback(async()=>{try{const c=await Oe.board();d(c),f(c.board),je(null)}catch(c){je(String(c.message))}},[]),Wa=A.useCallback(()=>Oe.get("/api/comments").then(c=>_e(c.comments)).catch(()=>{}),[]),Hn=A.useCallback(()=>Oe.get("/api/history").then(ne).catch(()=>{}),[]),Ia=A.useCallback(()=>Oe.get("/api/errors").then(c=>ye(c.errors)).catch(()=>{}),[]);A.useEffect(()=>{Fe(),Wa(),Hn(),Ia()},[Fe,Wa,Hn,Ia]),A.useEffect(()=>{const c=new Map,v=M=>{const B=c.get(M);window.clearTimeout(B.t),B.t=window.setTimeout(()=>void Oe.put("/api/errors",{file:M,errors:B.list}).catch(()=>{}),200)},x=M=>{const B=M.data;if(!B||B.type!=="dc-error"||typeof B.file!="string")return;if(B.start)return void c.set(B.file,{list:[],loaded:!1});const J=c.get(B.file)??{list:[],loaded:!0};if(c.set(B.file,J),B.loaded)return J.loaded=!0,v(B.file);J.list.length<20&&!J.list.some(ge=>ge.message===B.message)&&J.list.push({kind:B.kind,message:B.message,line:B.line}),J.loaded&&v(B.file)};return window.addEventListener("message",x),()=>window.removeEventListener("message",x)},[]);const ft=A.useCallback((c,v)=>{const x=ct.current;if(!x)return;const M=c(x);if(ct.current=M,f(M),!v)return;el.current&&window.clearTimeout(el.current);const B=()=>($l.current++,Oe.saveBoard(ct.current,v==="draft"?void 0:v).catch(J=>Ee({tone:"error",text:s.toast.saveFailed(J.message)})).finally(()=>$l.current--));v==="draft"?el.current=window.setTimeout(()=>{el.current=null,B()},fb):B()},[Ee]),pl=A.useCallback(async c=>{try{const v=await Oe.post(`/api/history/${c}`,{});v.label?Ee({text:s.toast.undoRedoDone(c,v.label)}):Ee({text:c==="undo"?s.toast.nothingToUndo:s.toast.nothingToRedo}),await Fe()}catch(v){Ee({tone:"error",text:String(v.message)})}Hn()},[Ee,Fe,Hn]),dt={label:s.toast.undoAction,run:()=>void pl("undo")},et=A.useCallback(async c=>{var v;if(!E)return!1;try{return await Oe.post("/api/edit",{file:E,...c}),!0}catch(x){return(v=_l.current)==null||v.setError(String(x.message)),Ee({tone:"error",text:String(x.message)}),!1}},[E,Ee]),xa=A.useCallback((c,v)=>{var ql,an,we;if(Array.from(c.children).some(Ge=>Ge.tagName!=="BR")){(ql=_l.current)==null||ql.setError(s.toast.textOnly);return}const x=c.innerText??"";c.contentEditable="true",c.focus();const M=c.ownerDocument,B=M.createRange();B.selectNodeContents(c),(an=M.getSelection())==null||an.removeAllRanges(),(we=M.getSelection())==null||we.addRange(B);let J=!1;const ge=async()=>{c.removeEventListener("keydown",ie),c.contentEditable="false";const Ge=(c.innerText??"").replace(/\n$/,"");if(J||Ge===x){J&&(c.innerText=x);return}const{hash:ht}=await Oe.get(`/api/element?f=${encodeURIComponent(E)}&path=${encodeURIComponent(v)}`);await et({op:"setText",path:v,hash:ht,text:Ge})||(c.innerText=x)},ie=Ge=>{Ge.isComposing||Ge.keyCode===229||(Ge.key==="Enter"&&!Ge.shiftKey?(Ge.preventDefault(),c.blur()):Ge.key==="Escape"&&(J=!0,c.blur()))};let Ae=!1,tt=!1;const st=()=>Ae=!0,Tn=()=>{Ae=!1,tt&&Ll()},Ll=()=>{c.removeEventListener("compositionstart",st),c.removeEventListener("compositionend",Tn),c.removeEventListener("blur",Yl),ge()},Yl=()=>{Ae?tt=!0:Ll()};c.addEventListener("compositionstart",st),c.addEventListener("compositionend",Tn),c.addEventListener("keydown",ie),c.addEventListener("blur",Yl)},[E,et]),kl=(c,v)=>Oe.get(`/api/element?f=${encodeURIComponent(c)}&path=${encodeURIComponent(v)}`).then(x=>x.hash),$i=async(c,v)=>{var M;if(!E)return;const x=await kl(E,c);await et({op:"move",path:c,hash:x,...v})&&((M=_l.current)==null||M.select([vb(c,v.toParentPath,v.index)]),Ee({text:v.freeze.length?s.toast.movedFrozen:s.toast.moved,action:dt}))},Iu=async()=>{var x;const c=Se.state.selection;if(!E||!c)return;const{source:v}=await Oe.get(`/api/element?f=${encodeURIComponent(E)}&path=${encodeURIComponent(c.path)}&full=1`);try{localStorage.setItem("design-canvas:clip",JSON.stringify({source:v,file:E,path:c.path,tag:c.tag}))}catch{}await((x=navigator.clipboard)==null?void 0:x.writeText(v).catch(()=>{})),Ee({tone:"ok",text:s.toast.copiedElement(c.tag,ot)})},Ji=async()=>{if(!E)return;let c=null;try{c=JSON.parse(localStorage.getItem("design-canvas:clip")??"null")}catch{c=null}if(!c)return Ee({text:s.toast.nothingCopied});const v=Se.state.selection,x=(v==null?void 0:v.file)===E?v.path:"";if(await et({op:"insert",path:x,hash:x?v.hash:void 0,position:"after",html:c.source})&&(Ee({tone:"ok",text:s.toast.pasted(c.file,c.tag),action:dt}),x)){const M=x.split("/");M[M.length-1]=String(Number(M[M.length-1])+1),setTimeout(()=>{var B;return void((B=_l.current)==null?void 0:B.select([M.join("/")]))},600)}},Pa=(c,v)=>Pt(()=>async x=>{if(Pt(null),!E)return;const M=await kl(E,c);(v?await et({op:"setAttr",path:c,hash:M,name:"src",value:x.ref}):await et({op:"setStyle",path:c,hash:M,prop:"background-image",value:`url("${x.ref}")`}))&&Ee({tone:"ok",text:s.toast.imageReplaced(x.name),action:dt})}),Sa=A.useCallback((c,v)=>{var x;return(x=ei.current)==null?void 0:x.call(ei,c,v)},[]),ei=A.useRef(null),Se=sb(E,Nc,{onTextEdit:xa,onContext:Sa});_l.current=Se,A.useEffect(()=>a0(c=>{if(c.type==="file-changed")le(v=>({...v,[c.file]:(v[c.file]??0)+1})),c.kind!=="change"&&Fe();else if(c.type==="board-changed"&&c.source!==vg)Fe();else if(c.type==="comments-changed")Wa();else if(c.type==="history-changed")Hn();else if(c.type==="errors-changed")Ia();else if(c.type==="assets-changed")yl(v=>v+1);else if(c.type==="tokens-changed")Za(v=>v+1);else if(c.type==="chat")for(const v of ze.current)v(c.id,c.ev)}),[Fe,Wa,Hn,Ia]);const ut=(h==null?void 0:h.pages)??[],$t=((lu=ut.find(c=>c.id===z))==null?void 0:lu.id)??((ci=ut[0])==null?void 0:ci.id)??null,Fl=A.useCallback(c=>!ut.length||(c.page??ut[0].id)===$t,[ut,$t]),wt=A.useMemo(()=>h?h.order.filter(c=>h.boards[c]&&Fl(h.boards[c])):[],[h,Fl]),ti=A.useMemo(()=>h?Object.keys(h.notes).filter(c=>Fl(h.notes[c])):[],[h,Fl]),vt=L??{w:window.innerWidth,h:window.innerHeight-48};A.useEffect(()=>{if(Ki.current||!h||!L)return;Ki.current=!0;const c=db(h.title);c.left!=null?ce(c.left):window.innerWidth<1e3&&ce(!1),c.minimap!=null&&xe(c.minimap);const v=h.launch;v!=null&&v.page?D(v.page):c.page&&D(c.page),(v==null?void 0:v.view)==="focused"&&v.file&&h.boards[v.file]&&oe(v.file),c.view&&!(v!=null&&v.page)?y(c.view):y(Zu(Object.values(h.boards),L))},[h,L]),A.useEffect(()=>{if(!h||!Ki.current)return;const c=window.setTimeout(()=>{try{localStorage.setItem(jg(h.title),JSON.stringify({view:g,page:$t,left:F,minimap:ue}))}catch{}},300);return()=>window.clearTimeout(c)},[g,$t,F,ue,h==null?void 0:h.title]),A.useEffect(()=>{if(!h)return;const c=window.setTimeout(()=>{var ge;const v=-g.x/g.zoom,x=-g.y/g.zoom,M=vt.w/g.zoom,B=vt.h/g.zoom,J=ae?[ae]:wt.filter(ie=>{const Ae=h.boards[ie];return Ae.x<v+M&&Ae.x+Ae.w>v&&Ae.y<x+B&&Ae.y+Ae.h>x});Oe.put("/api/context",{mode:K?"play":ae?"focus":E?"edit":"canvas",page:$t,pageName:((ge=ut.find(ie=>ie.id===$t))==null?void 0:ge.name)??null,visibleArtboards:J,selectedArtboards:p,dirty:$l.current>0||!!el.current}).catch(()=>{})},300);return()=>window.clearTimeout(c)},[g,$t,p,E,ae,K,wt,vt.w,vt.h]),A.useEffect(()=>{!pa||!h||!pa.every(c=>h.boards[c])||(b(pa),y(Zu(pa.map(c=>h.boards[c]),vt,80)),Ht(null))},[pa,h]);const Ul=c=>({x:c.x,y:c.y,w:c.w??c.maxW??400,h:c.kind==="title"?90:200}),yt=()=>{h&&y(Zu([...wt.map(c=>h.boards[c]),...ti.map(c=>Ul(h.notes[c]))],vt))},bt=c=>{!h||!c.length||y(Zu(c.map(v=>h.boards[v]).filter(Boolean),vt,80))},xl=c=>y(v=>{const x=Ju(v.zoom*c,ef,tf),M=vt.w/2,B=vt.h/2;return{zoom:x,x:M-(M-v.x)/v.zoom*x,y:B-(B-v.y)/v.zoom*x}}),li=c=>xl(c/g.zoom),Wl=(c,v="replace")=>{b(x=>v==="replace"?c:v==="add"?[...new Set([...x,...c])]:c.reduce((M,B)=>M.includes(B)?M.filter(J=>J!==B):[...M,B],x)),c.length&&Y(null),Dl(null)},Ta=()=>ut.length&&$t?{page:$t}:{},Na=async(c,v="blank")=>{try{const{file:x}=await Oe.post("/api/boards/create",{...c,template:v,...Ta()});await Fe(),b([x]),S("select"),Ee({tone:"ok",text:s.toast.boardCreated(x),action:dt})}catch(x){Ee({tone:"error",text:s.toast.boardCreateFailed(x.message)})}},Il=async c=>{if(!c.length||!h)return;const v=c.map(M=>{var B;return((B=h.boards[M])==null?void 0:B.title)??M});if(await ol.confirm({title:s.dialog.deleteBoardsTitle(c.length,v[0]),body:s.dialog.deleteBoardsBody,ok:s.dialog.delete,danger:!0}))try{await Oe.post("/api/boards/delete",{files:c}),E&&c.includes(E)&&k(null),b([]),await Fe(),Ee({text:s.toast.boardsDeleted(c.length),action:dt})}catch(M){Ee({tone:"error",text:String(M.message)})}},Ln=async c=>{try{const v=await Oe.post("/api/boards/duplicate",{file:c});await Fe(),b([v.file]),Ee({tone:"ok",text:s.toast.duplicated(v.file),action:dt})}catch(v){Ee({tone:"error",text:String(v.message)})}},bn=async c=>{var M;const v=(M=ct.current)==null?void 0:M.boards[c];if(!v)return;const x=await ol.prompt({title:s.dialog.renameBoardTitle,label:s.dialog.name,value:v.title??c.replace(/\.html$/,""),ok:s.dialog.rename});if(!(!x||x.value.trim()===(v.title??"")))try{await Oe.post("/api/boards/rename",{file:c,title:x.value.trim()}),await Fe(),Ee({tone:"ok",text:s.toast.renamed,action:dt})}catch(B){Ee({tone:"error",text:String(B.message)})}},Pl=async c=>{const{refs:v}=await Oe.get(`/api/boards/refs?file=${encodeURIComponent(c)}`).catch(()=>({refs:[]})),x=await ol.prompt({title:s.dialog.renameFileTitle,label:s.dialog.fileName,value:c,hint:v.length?s.dialog.renameFileRefs(v.map(B=>B.file).join(", ")):s.dialog.renameFileNoRefs,ok:s.dialog.rename,extra:v.length?{label:s.dialog.renameFileExtra(v.reduce((B,J)=>B+(J.count??1),0)),checked:!0}:void 0});if(!x)return;let M=x.value.trim();if(M.endsWith(".html")||(M+=".html"),M!==c)try{await Oe.post("/api/boards/rename",{file:c,newFile:M,updateRefs:x.extra}),E===c&&k(M),b([M]),await Fe(),Ee({tone:"ok",text:s.toast.fileRenamed(M,!!x.extra),action:dt})}catch(B){Ee({tone:"error",text:String(B.message)})}},Yn=c=>{const v=(vt.w/2-g.x)/g.zoom,x=(vt.h/2-g.y)/g.zoom;Na({x:Math.round(v-c.w/2),y:Math.round(x-c.h/2),w:c.w,h:c.h},c.id).then(()=>y(Zu([{x:v-c.w/2,y:x-c.h/2,w:c.w,h:c.h}],vt,80)))},Ea=c=>G({x:c.clientX,y:c.clientY,title:s.menu.newBoard,items:hb.map(v=>({label:`${v.label} · ${v.size}`,icon:v.id==="doc"?"page":"board",shortcut:v.id==="blank"?s.menu.drawWithB:void 0,run:()=>Yn(v)}))}),Lt=(c,v)=>{X("chat"),v!=null&&v.length&&b(v),c!=null&&P(c),setTimeout(()=>{var x;return(x=Qa.current)==null?void 0:x.focus()},0)},Tt=c=>Lt(s.prompts.fixErrors(c.map(v=>`- ${v}: ${(qe[v]??[{message:u!=null&&u.missing.includes(v)?s.menu.fileMissing:s.prompts.error}])[0].message}`).join(`
53
- `)),c.filter(v=>h==null?void 0:h.boards[v])),Bl=(c,v)=>ft(x=>{const M=x.order.filter(J=>!c.includes(J)),B=x.order.filter(J=>c.includes(J));return{...x,order:v==="front"?[...M,...B]:[...B,...M]}},v==="front"?s.history.front:s.history.back),Pu=(c,v,x=s.history.boardOptions)=>ft(M=>{const B={...M.boards[c],...v};for(const J of Object.keys(B))B[J]===void 0&&delete B[J];return{...M,boards:{...M.boards,[c]:B}}},x),eo=(c,v)=>ft(x=>({...x,boards:{...x.boards,...Object.fromEntries(p.map(M=>[M,{...x.boards[M],x:x.boards[M].x+c,y:x.boards[M].y+v}]))}}),s.history.moveBoard),en=()=>{var v;let c="";do c=`n${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((v=ct.current)!=null&&v.notes[c]);return c},tn=(c,v)=>{var J;if(Object.keys(((J=ct.current)==null?void 0:J.notes)??{}).length>=ug)return Ee({tone:"error",text:s.toast.notesMax(ug)});const x=en(),M=Math.round(v.x),B=Math.round(v.y);ft(ge=>({...ge,notes:{...ge.notes,[x]:c==="title"?{kind:c,x:M,y:B,text:s.defaults.newTitle,maxW:2e3,...Ta()}:{kind:c,x:M,y:B,text:s.defaults.note,w:400,...Ta()}}}),c==="title"?s.history.addTitle:s.history.addNote),Y(x),b([]),S("select")},ni=c=>{ft(v=>{const{[c]:x,...M}=v.notes;return{...v,notes:M}},s.history.deleteNote),Y(null),Ee({text:s.toast.noteDeleted,action:dt})},cl=(h==null?void 0:h.shapes)??{},Fi=A.useMemo(()=>Object.keys(cl).filter(c=>Fl(cl[c])).sort((c,v)=>(cl[c].z??0)-(cl[v].z??0)||(c<v?-1:1)),[cl,Fl]),to=(c,v=s.history.addShape)=>{var B,J,ge;let x="";do x=`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((J=(B=ct.current)==null?void 0:B.shapes)!=null&&J[x]);const M=Math.max(0,...Object.values(((ge=ct.current)==null?void 0:ge.shapes)??{}).map(ie=>ie.z??0))+1;return ft(ie=>({...ie,shapes:{...ie.shapes??{},[x]:{...c,z:M,...Ta()}}}),v),Dl(x),b([]),Y(null),S("select"),x},Be=(c,v,x)=>ft(M=>({...M,shapes:{...M.shapes??{},[c]:{...M.shapes[c],...v}}}),x),ai=c=>{ft(v=>{const{[c]:x,...M}=v.shapes??{};return{...v,shapes:M}},s.history.deleteShape),Dl(null),Ee({text:s.toast.shapeDeleted,action:dt})},pn=(c,v)=>{var M;const x=Object.values(((M=ct.current)==null?void 0:M.shapes)??{}).map(B=>B.z??0);Be(c,{z:v==="front"?Math.max(0,...x)+1:Math.min(0,...x)-1},v==="front"?s.history.shapeFront:s.history.shapeBack)},qn=(c,v)=>{const x=new Image;x.onload=()=>{const M=Math.min(1,600/Math.max(x.naturalWidth,x.naturalHeight)),B=Math.round(x.naturalWidth*M)||300,J=Math.round(x.naturalHeight*M)||200,ge=v??{x:(vt.w/2-g.x)/g.zoom-B/2,y:(vt.h/2-g.y)/g.zoom-J/2};to({kind:"image",x:Math.round(ge.x),y:Math.round(ge.y),w:B,h:J,src:c.ref},s.history.addImage)},x.onerror=()=>Ee({tone:"error",text:s.toast.imageReadFailed}),x.src=c.url};A.useEffect(()=>{const c=async v=>{var M,B,J;if(E||(B=(M=v.target)==null?void 0:M.closest)!=null&&B.call(M,"input,textarea,[contenteditable=true]"))return;const x=Array.from(((J=v.clipboardData)==null?void 0:J.files)??[]).filter(ge=>ge.type.startsWith("image/"));if(x.length){v.preventDefault();try{const[ge]=await Wr(x.map(ie=>ie.name?ie:new File([ie],s.defaults.pastedImage,{type:ie.type})));qn(ge)}catch(ge){Ee({tone:"error",text:String(ge.message)})}}};return window.addEventListener("paste",c),()=>window.removeEventListener("paste",c)});const Hl=async(c,v)=>{var B,J;let x=Math.round(v.x);const M=[];for(const ge of c)try{if(/\.html?$/i.test(ge.name)){const ie=await ge.text(),Ae=ie.match(/<meta[^>]+name=["']board-size["'][^>]+content=["'](\d+)x(\d+)/i),tt=Ae?Number(Ae[1]):390,st=Ae?Number(Ae[2]):844,Tn=((J=(B=ie.match(/<title>([^<]*)<\/title>/i))==null?void 0:B[1])==null?void 0:J.trim())||ge.name.replace(/\.html?$/i,""),Ll=ge.name.toLowerCase().replace(/\.htm$/,".html").replace(/[^a-z0-9._-]+/g,"-"),Yl=await Oe.post("/api/boards/create",{file:Ll,html:ie,title:Tn,x,y:Math.round(v.y),w:tt,h:st,...Ta()});M.push(Yl.file),x+=tt+80}else if(ge.type.startsWith("image/")){const[ie]=await Wr([ge]);qn(ie,{x,y:v.y}),x+=400}else Ee({tone:"error",text:s.toast.importOnly(ge.name)})}catch(ie){Ee({tone:"error",text:`${ge.name}: ${ie.message}`})}M.length&&(await Fe(),Ht(M),Ee({tone:"ok",text:s.toast.imported(M.length),action:dt}))},_t=async(c,v)=>{try{const x=await Oe.post("/api/pages",c);return await Fe(),v&&Ee({tone:"ok",text:v,action:dt}),x}catch(x){return Ee({tone:"error",text:String(x.message)}),null}},lo=async()=>{if(ut.length>=40)return Ee({tone:"error",text:s.toast.pagesMax});const c=await ol.prompt({title:s.dialog.newPageTitle,label:s.dialog.name,value:s.dialog.newPageName(Math.max(ut.length,1)+1),ok:s.dialog.create});if(!(c!=null&&c.value.trim()))return;const v=await _t({action:"add",name:c.value.trim()});v!=null&&v.id&&D(v.id)},Ec=async c=>{const v=ut.find(M=>M.id===c),x=await ol.prompt({title:s.dialog.renamePageTitle,label:s.dialog.name,value:(v==null?void 0:v.name)??"",ok:s.dialog.rename});!(x!=null&&x.value.trim())||x.value.trim()===(v==null?void 0:v.name)||await _t({action:"rename",id:c,name:x.value.trim()})},Wi=async c=>{const v=ut.find(M=>M.id===c),x=Object.values((h==null?void 0:h.boards)??{}).filter(M=>{var B;return(M.page??((B=ut[0])==null?void 0:B.id))===c}).length;await ol.confirm({title:s.dialog.deletePageTitle((v==null?void 0:v.name)??""),body:s.dialog.deletePageBody(x),ok:s.dialog.delete,danger:!0})&&($t===c&&D(null),await _t({action:"delete",id:c},s.toast.pageDeleted))},ii=(c,v)=>void _t({action:"move",id:c,index:v}),jc=(c,v)=>{var M,B;const x=ut.findIndex(J=>J.id===c);G({x:v.clientX,y:v.clientY,title:(M=ut[x])==null?void 0:M.name,items:[{label:s.menu.rename,icon:"edit",run:()=>void Ec(c)},{label:s.menu.moveUp,icon:"chevronDown",disabled:x<=0,run:()=>ii(c,x-1)},{label:s.menu.moveDown,icon:"chevronDown",disabled:x>=ut.length-1,run:()=>ii(c,x+1)},{label:((B=h==null?void 0:h.launch)==null?void 0:B.page)===c?s.menu.unsetLaunchPage:s.menu.setLaunchPage,icon:"page",run:()=>ft(J=>{var ge;return{...J,launch:{...J.launch??{view:"canvas"},page:((ge=J.launch)==null?void 0:ge.page)===c?void 0:c}}},s.history.launchPage)},...p.length?[{label:s.menu.moveSelectedToPage(p.length),icon:"page",run:()=>ft(J=>({...J,boards:{...J.boards,...Object.fromEntries(p.map(ge=>{var ie;return[ge,{...J.boards[ge],page:c===((ie=ut[0])==null?void 0:ie.id)?void 0:c}]}))}}),s.history.moveToPage)}]:[],"sep",{label:s.menu.delete,icon:"trash",danger:!0,disabled:ut.length<=1,run:()=>void Wi(c)}]})},Jt=c=>{const v=h.boards[c],x=p.includes(c)?p:[c],M=x.length>1;return[{label:E===c?s.menu.stopEditing:s.menu.edit,icon:"edit",shortcut:"E",disabled:M,run:()=>k(E===c?null:c)},{label:re===c?s.menu.stopPlay:s.menu.playInPlace,icon:"play",shortcut:"P",disabled:M||!(v!=null&&v.is_interactive),run:()=>re===c?Gn():be(c)},{label:s.menu.playFullScreen,icon:"play",disabled:M||!(v!=null&&v.is_interactive),run:()=>Te(c)},{label:s.menu.askReview,icon:"comment",run:()=>Lt(s.prompts.review,x)},{label:s.menu.focusView,icon:"focus",shortcut:"F",disabled:M,run:()=>oe(c)},{label:s.menu.askAI,icon:"comment",shortcut:`${ot}J`,run:()=>Lt(void 0,x)},...qe[c]||u!=null&&u.missing.includes(c)?[{label:s.menu.askFixErrors,icon:"warn",run:()=>Tt([c])}]:[],{label:s.menu.goToBoard,icon:"fit",shortcut:"⇧2",run:()=>bt(x)},"sep",{label:s.menu.rename,icon:"title",shortcut:"F2",disabled:M,run:()=>void bn(c)},{label:s.menu.renameFile,icon:"link",disabled:M,run:()=>void Pl(c)},{label:s.menu.duplicate,icon:"copy",shortcut:`${ot}D`,disabled:M,run:()=>void Ln(c)},"sep",{label:s.menu.front,icon:"front",shortcut:`${ot}]`,run:()=>Bl(x,"front")},{label:s.menu.back,icon:"back",shortcut:`${ot}[`,run:()=>Bl(x,"back")},"sep",{label:M?s.menu.deleteBoards(x.length):s.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>void Il(x)}]},Ii=(c,v)=>{var x,M;h&&(c.type==="board"?(p.includes(c.file)||Wl([c.file]),G({x:v.clientX,y:v.clientY,title:((x=h.boards[c.file])==null?void 0:x.title)??c.file,items:Jt(c.file)})):c.type==="note"?(Y(c.id),G({x:v.clientX,y:v.clientY,title:((M=h.notes[c.id])==null?void 0:M.kind)==="title"?s.menu.title:s.menu.note,items:[{label:s.menu.duplicateInFront,icon:"copy",shortcut:`${ot}D`,run:()=>{const B=h.notes[c.id],J=en();ft(ge=>({...ge,notes:{...ge.notes,[J]:{...B,x:B.x+40,y:B.y+40}}}),s.history.duplicateNote),Y(J)}},"sep",{label:s.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>ni(c.id)}]})):G({x:v.clientX,y:v.clientY,items:[{label:s.menu.newBoardHere,icon:"board",shortcut:"B",run:()=>void Na({x:Math.round(c.x),y:Math.round(c.y),w:390,h:844})},{label:s.menu.mobileFrameHere,icon:"board",run:()=>void Na({x:Math.round(c.x),y:Math.round(c.y)},"mobile")},{label:s.menu.titleHere,icon:"title",shortcut:"T",run:()=>tn("title",c)},{label:s.menu.noteHere,icon:"sticky",shortcut:"N",run:()=>tn("sticky",c)},"sep",{label:s.menu.selectAll,icon:"select",shortcut:`${ot}A`,run:()=>Wl(wt)},{label:s.menu.fitAll,icon:"fit",shortcut:"⇧1",run:yt},{label:s.menu.zoom100,icon:"search",shortcut:`${ot}0`,run:()=>li(1)},"sep",{label:s.menu.undo,icon:"undo",shortcut:`${ot}Z`,disabled:!W.canUndo,run:()=>void pl("undo")},{label:s.menu.redo,icon:"redo",shortcut:`⇧${ot}Z`,disabled:!W.canRedo,run:()=>void pl("redo")}]}))};ei.current=(c,v)=>{var J;if(!E)return;const x=()=>Oe.get(`/api/element?f=${encodeURIComponent(E)}&path=${encodeURIComponent(c)}`).then(ge=>ge.hash),M=(J=jt.current.get(E))!=null&&J.contentDocument?Al(jt.current.get(E).contentDocument,c):null,B=c.includes("/")?c.slice(0,c.lastIndexOf("/")):null;G({x:v.clientX,y:v.clientY,title:M?`<${M.tagName.toLowerCase()}>`:s.menu.element,items:[{label:s.menu.editText,icon:"edit",disabled:!M||M.children.length>0,run:()=>M&&xa(M,c)},{label:s.menu.selectParent,icon:"layers",shortcut:"Esc",disabled:B==null,run:()=>B!=null&&void Se.select([B])},{label:s.menu.elementToAI,icon:"comment",run:()=>Lt()},{label:s.menu.copy,icon:"copy",shortcut:`${ot}C`,run:()=>void Iu()},{label:s.menu.pasteAfter,icon:"copy",shortcut:`${ot}V`,run:()=>void Ji()},...(M==null?void 0:M.tagName)==="IMG"?[{label:s.menu.replaceImage,icon:"page",run:()=>Pa(c,!0)}]:[],{label:s.menu.copyForAI,icon:"copy",run:()=>void navigator.clipboard.writeText(`${E} ${c} <${M==null?void 0:M.tagName.toLowerCase()}> "${((M==null?void 0:M.textContent)??"").trim().slice(0,60)}"`).then(()=>Ee({tone:"ok",text:s.toast.copied}))},"sep",{label:s.menu.duplicate,icon:"copy",shortcut:`${ot}D`,run:async()=>void et({op:"duplicate",path:c,hash:await x()})},{label:s.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:async()=>{await et({op:"delete",path:c,hash:await x()})&&(Se.select([]),Ee({text:s.toast.elementDeleted,action:dt}))}}]})};const Gn=()=>{var x,M;const c=re;be(null),(M=(x=document.activeElement)==null?void 0:x.blur)==null||M.call(x);const v=document.querySelector(".canvas");v&&(v.tabIndex=-1,v.focus({preventScroll:!0})),c&&le(B=>({...B,[c]:(B[c]??0)+1}))};A.useEffect(()=>{if(!re)return;const c=jt.current.get(re);if(!c)return;const v=B=>B.key==="Escape"&&ui.current();let x=null;const M=()=>{x==null||x.removeEventListener("keydown",v,!0),x=c.contentDocument,x==null||x.addEventListener("keydown",v,!0)};return M(),c.addEventListener("load",M),()=>{c.removeEventListener("load",M),x==null||x.removeEventListener("keydown",v,!0)}},[re,Bn]);const ui=A.useRef(()=>{});ui.current=Gn;const[xn,no]=A.useState(!0),ao=()=>{const c=F||xn;ce(!c),no(!c)},Xn=c=>{const v=[".toolbar",".left",".canvas",".right"].map(J=>document.querySelector(J)).filter(Boolean),x=v.findIndex(J=>J.contains(document.activeElement)),M=v[(x+(c?-1:1)+v.length)%v.length],B=M.matches(".canvas")?M:M.querySelector("button:not([disabled]), input, select, textarea, [tabindex]");M.matches(".canvas")&&(M.tabIndex=-1),(B??M).focus()},wc=async c=>{if(!E)return;const v=[...Se.state.paths].sort((M,B)=>Number(M.split("/").pop())-Number(B.split("/").pop())),x=await Promise.all(v.map(M=>kl(E,M)));await et({op:"wrap",paths:v,hashes:x,display:c})&&(Se.select([v[0]]),Ee({tone:"ok",text:s.toast.wrapped(c),action:dt}))},Pi=async(c,v)=>{try{await Oe.put("/api/tokens",{...c,label:v}),Za(x=>x+1),Ee({tone:"ok",text:v===s.history.changeTheme?s.toast.theme(c.active):s.toast.tokensSaved,action:dt})}catch(x){Ee({tone:"error",text:String(x.message)})}},eu=(c,v)=>{$a.current={file:c,path:v},E!==c?k(c):Se.select([v])};A.useEffect(()=>{var x;const c=$a.current;if(!c||E!==c.file||!((x=jt.current.get(c.file))!=null&&x.contentDocument))return;const v=window.setTimeout(()=>{$a.current=null,Se.select([c.path])},300);return()=>window.clearTimeout(v)},[E,Bn]);const Dt=E??(p.length===1?p[0]:null);A.useEffect(()=>{if(!Dt)return ya(null);Oe.get(`/api/lint?f=${encodeURIComponent(Dt)}`).then(c=>ya(c.files[Dt]??[])).catch(()=>ya(null))},[Dt,$[Dt??""],yn]),A.useEffect(()=>{if(!Dt)return Fu(null);const c=()=>{var M;const x=(M=jt.current.get(Dt))==null?void 0:M.contentDocument;Fu((x==null?void 0:x.readyState)==="complete"?k0(x,(gt==null?void 0:gt.minTarget)??48):null)},v=window.setTimeout(c,600);return()=>window.clearTimeout(v)},[Dt,Bn,$[Dt??""],gt==null?void 0:gt.minTarget,g.zoom>=.25]);const zc=async c=>{const v=await Oe.get("/api/snapshots").catch(()=>null);if(!(v!=null&&v.git))return G({x:c.clientX,y:c.clientY,title:s.menu.snapshot,items:[{label:s.menu.notGit,disabled:!0,run:()=>{}}]});G({x:c.clientX,y:c.clientY,title:s.menu.snapshotStatus(v.branch??"",v.changed),items:[{label:v.changed?s.menu.snapshotNow:s.menu.nothingChanged,icon:"check",disabled:!v.changed,run:async()=>{const x=await ol.prompt({title:s.dialog.snapshotTitle,label:s.dialog.snapshotLabel,value:s.dialog.snapshotMessage(new Date().toLocaleDateString("en-CA")),hint:s.dialog.snapshotHint,ok:s.dialog.commit});if(x)try{const M=await Oe.post("/api/snapshot",{message:x.value});Ee({tone:"ok",text:M.nothing?s.toast.nothingChanged:s.toast.snapshot(M.hash??"")})}catch(M){Ee({tone:"error",text:String(M.message)})}}},"sep",...v.snapshots.slice(0,10).map(x=>({label:`${x.hash} ${x.subject.slice(0,40)} · ${x.when}`,disabled:!0,run:()=>{}}))]})},io=A.useRef(()=>{});io.current=c=>{var Ae,tt,st,Tn,Ll,Yl,ql,an;if(!h||ol.state||ae||K||pg(c)||c.isComposing)return;const v=c.metaKey||c.ctrlKey,x=c.key.toLowerCase(),M=p.length===1?p[0]:null,B=we=>{c.preventDefault(),we()};if(v&&x==="z")return B(()=>void pl(c.shiftKey?"redo":"undo"));if(v&&x==="y")return B(()=>void pl("redo"));if(v&&x==="j")return B(()=>w==="chat"?X("inspect"):Lt());if(v&&x==="k")return B(()=>{ce(!0),setTimeout(()=>{var we;return(we=Wu.current)==null?void 0:we.focus()},0)});if(v&&x==="a"&&!E)return B(()=>Wl(wt));if(v&&x==="a"&&E){const we=(Ae=jt.current.get(E))==null?void 0:Ae.contentDocument,Ge=(tt=Se.state.selection)==null?void 0:tt.path,ht=we&&(Ge?(st=Al(we,Ge))==null?void 0:st.parentElement:we.body.firstElementChild),sl=ht?Array.from(ht.children).filter(Zt=>!/^(SCRIPT|STYLE)$/.test(Zt.tagName)).map(Zt=>ul(Zt)).filter(Zt=>Zt!=null):[];return B(()=>sl.length&&void Se.select(sl))}if(v&&x==="c"&&E&&Se.state.selection)return B(()=>void Iu());if(v&&x==="v"&&E)return B(()=>void Ji());if(v&&x==="d"&&E&&Se.state.selection){const we=Se.state.selection;return B(()=>void et({op:"duplicate",path:we.path,hash:we.hash}))}if(v&&x==="d"&&M&&!E)return B(()=>void Ln(M));if(v&&c.key==="]"&&p.length)return B(()=>Bl(p,"front"));if(v&&c.key==="["&&p.length)return B(()=>Bl(p,"back"));if(v&&c.key==="0")return B(()=>li(1));if(v&&c.key==="1")return B(yt);if(v&&(c.key==="="||c.key==="+"))return B(()=>xl(1.25));if(v&&c.key==="-")return B(()=>xl(.8));if(v&&c.key==="\\")return B(()=>ao());if(c.ctrlKey&&!c.metaKey&&x==="g")return B(()=>Ja(we=>!we));if(v&&x==="g"&&E&&Se.state.paths.length>=2)return B(()=>void wc("flex"));if(v)return;if(c.shiftKey&&c.code==="Digit1")return B(yt);if(c.shiftKey&&c.code==="Digit2")return B(()=>bt(p));if(c.key==="Escape"){if(re)return B(()=>Gn());if(E)return B(()=>k(null));if(j!=="select")return B(()=>S("select"));b([]),Y(null),Dl(null);return}if(c.key==="F6")return B(()=>Xn(c.shiftKey));const J=document.activeElement,ge=!J||J===document.body||!!((Tn=J.closest)!=null&&Tn.call(J,".canvas"))||J.tagName==="IFRAME";if(c.key==="Tab"&&ge&&!E&&wt.length){const we=p.length?wt.indexOf(p[p.length-1]):-1,Ge=wt[(we+(c.shiftKey?-1:1)+wt.length)%wt.length];return B(()=>{var ht;Wl([Ge]),bt([Ge]),fe(s.app.announceBoard(((ht=h.boards[Ge])==null?void 0:ht.title)??Ge,wt.indexOf(Ge)+1,wt.length))})}if(c.key==="Enter"&&!E&&p.length===1&&ge)return B(()=>k(p[0]));if(c.key==="Enter"&&E&&Se.state.selection){const we=(Ll=jt.current.get(E))==null?void 0:Ll.contentDocument,Ge=we&&Al(we,Se.state.selection.path),ht=c.shiftKey?Ge==null?void 0:Ge.parentElement:Ge==null?void 0:Ge.firstElementChild,sl=ht&&ht!==(we==null?void 0:we.body)?ul(ht):null;return sl!=null?B(()=>void Se.select([sl])):void 0}if(x==="p"&&!E&&!v&&p.length===1&&((Yl=h.boards[p[0]])!=null&&Yl.is_interactive))return B(()=>re===p[0]?Gn():be(p[0]));if((c.key==="Delete"||c.key==="Backspace")&&Et&&!E)return B(()=>ai(Et));if(c.key==="Delete"||c.key==="Backspace"){if(E&&Se.state.selection){const we=Se.state.selection;return B(async()=>{await et({op:"delete",path:we.path,hash:we.hash})&&(Se.select([]),Ee({text:s.toast.elementDeleted,action:dt}))})}return N?B(()=>ni(N)):p.length&&!E?B(()=>void Il(p)):void 0}if(c.key.startsWith("Arrow")&&E&&Se.state.selection){const we=Se.state.selection,Ge=(ql=jt.current.get(E))==null?void 0:ql.contentDocument,ht=Ge&&Al(Ge,we.path);if(!ht)return;if(c.altKey&&(c.key==="ArrowUp"||c.key==="ArrowDown")){const ri=we.path.includes("/")?we.path.slice(0,we.path.lastIndexOf("/")):"",uo=Number(we.path.split("/").pop()),au=c.key==="ArrowUp"?uo-1:uo+1;return au<0||au>=(((an=ht.parentElement)==null?void 0:an.children.length)??0)?B(()=>{}):B(()=>void $i(we.path,{toParentPath:ri,index:au,freeze:[]}))}const sl=c.key==="ArrowDown"||c.key==="ArrowRight"?ht.nextElementSibling:ht.previousElementSibling,Zt=c.key==="ArrowLeft"&&c.shiftKey?ht.parentElement:c.key==="ArrowRight"&&c.shiftKey?ht.firstElementChild:sl;if(Zt&&Zt!==Ge.body){const ri=ul(Zt);if(ri!=null)return B(()=>void Se.select([ri]))}return B(()=>{})}if(c.key.startsWith("Arrow")&&!E&&(Et||N)){const we=c.altKey?100:c.shiftKey?10:1,Ge=c.key==="ArrowLeft"?-we:c.key==="ArrowRight"?we:0,ht=c.key==="ArrowUp"?-we:c.key==="ArrowDown"?we:0;if(Et)return B(()=>Be(Et,{x:cl[Et].x+Ge,y:cl[Et].y+ht},s.history.moveShape));const sl=h.notes[N];return B(()=>ft(Zt=>({...Zt,notes:{...Zt.notes,[N]:{...sl,x:sl.x+Ge,y:sl.y+ht}}}),s.history.moveNote))}if(c.key.startsWith("Arrow")&&p.length&&!E){const we=c.altKey?100:c.shiftKey?10:1;return B(()=>eo(c.key==="ArrowLeft"?-we:c.key==="ArrowRight"?we:0,c.key==="ArrowUp"?-we:c.key==="ArrowDown"?we:0))}if(c.key==="F2"&&M)return B(()=>void bn(M));if(x==="f"&&M)return B(()=>oe(M));if(x==="e"&&M)return B(()=>k(E===M?null:M));if(x==="m")return B(()=>xe(we=>!we));const ie=$r.find(we=>we.key.toLowerCase()===x);if(ie&&!E)return B(()=>S(ie.id))},A.useEffect(()=>{const c=v=>io.current(v);return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[]);const oi=c=>{var J,ge;const v=Ne.filter(ie=>ie.file===c&&!ie.resolved),x=(J=jt.current.get(c))==null?void 0:J.contentDocument,M=E===c,B=ba?(((ge=h==null?void 0:h.guides)==null?void 0:ge[c])??[]).filter(ie=>!ie.hidden):[];return!M&&!v.length&&!B.length?null:o.jsxs("div",{className:"overlay",children:[B.length>0&&h&&o.jsx(m0,{guides:B,w:h.boards[c].w,h:h.boards[c].h}),M&&Se.state.hover&&!Se.state.paths.includes(Se.state.hover.path)&&o.jsx(gg,{r:Se.state.hover.rect,cls:"hover"}),M&&Se.state.rects.map((ie,Ae)=>o.jsx(gg,{r:ie,cls:"sel"},Ae)),M&&x&&Se.state.paths.length===1&&Se.state.rects[0]&&o.jsx(G0,{doc:x,path:Se.state.paths[0],rect:Se.state.rects[0],zoom:g.zoom,onMove:ie=>void $i(Se.state.paths[0],ie),onPosition:async(ie,Ae)=>{const tt=Se.state.paths[0],st=await kl(c,tt);await et({op:"batch",ops:[{op:"setStyle",path:tt,hash:st,prop:"left",value:`${ie}px`},{op:"setStyle",path:tt,hash:st,prop:"top",value:`${Ae}px`}]})},onResize:async(ie,Ae)=>{const tt=Se.state.paths[0],st=await kl(c,tt);await et({op:"batch",ops:[{op:"setStyle",path:tt,hash:st,prop:"width",value:`${ie}px`},{op:"setStyle",path:tt,hash:st,prop:"height",value:`${Ae}px`}]})}}),v.map((ie,Ae)=>{const tt=x&&ie.path?Al(x,ie.path):null,st=tt?Un(tt):null;return o.jsx("div",{className:"pin",title:ie.text,style:st?{left:st.x+st.w-12,top:st.y-12,transform:`scale(${1/Math.max(g.zoom,.25)})`}:{right:8,top:8+Ae*30,transform:`scale(${1/Math.max(g.zoom,.25)})`},children:Ae+1},ie.id)})]})};if(!h||!u)return o.jsx("div",{className:"loading",role:"status",children:ee?o.jsxs(o.Fragment,{children:[o.jsx(he,{name:"warn"})," ",s.app.loadFailed," ",ee,o.jsx("button",{onClick:()=>void Fe(),children:s.app.retry})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner","aria-hidden":"true"})," ",s.app.loadingBoards]})});const He=p.length===1?p[0]:null,ln=[...new Set([...u.missing,...Object.keys(qe)])],tu=(()=>{const c=-g.x/g.zoom,v=-g.y/g.zoom,x=vt.w/g.zoom,M=vt.h/g.zoom;return wt.filter(B=>{const J=h.boards[B];return J.x<c+x&&J.x+J.w>c&&J.y<v+M&&J.y+J.h>v}).length})(),nn=o.jsxs("div",{className:"left-tabs",role:"tablist","aria-label":s.tabs.left,children:[o.jsx("button",{role:"tab","aria-selected":Ot==="boards",className:Ot==="boards"?"on":"",onClick:()=>St("boards"),children:s.tabs.boards}),o.jsx("button",{role:"tab","aria-selected":Ot==="assets",className:Ot==="assets"?"on":"",onClick:()=>St("assets"),children:s.tabs.assets}),o.jsx("button",{role:"tab","aria-selected":Ot==="tokens",className:Ot==="tokens"?"on":"",onClick:()=>St("tokens"),children:s.tabs.tokens})]}),Sn=wt.map(c=>({file:c,...h.boards[c]}));return o.jsxs("div",{className:"app",children:[o.jsxs("header",{className:"toolbar",role:"toolbar","aria-label":s.toolbar.aria,children:[o.jsx("button",{className:`icon-btn ${F?"on":""}`,"aria-label":s.toolbar.leftPanel,"aria-pressed":F,title:s.toolbar.leftPanelTitle(ot),onClick:()=>ce(c=>!c),children:o.jsx(he,{name:"panel",style:{transform:"scaleX(-1)"}})}),o.jsx("strong",{className:"app-title",children:h.title}),o.jsx("div",{className:"tool-group",role:"radiogroup","aria-label":s.toolbar.canvasTools,children:$r.slice(0,5).map(c=>o.jsx("button",{role:"radio","aria-checked":j===c.id,"aria-label":s.toolbar.tool(c.label,c.key),title:s.toolbar.tool(c.label,c.key),className:`icon-btn ${j===c.id?"on":""}`,disabled:!!E&&c.id!=="select"&&c.id!=="hand",onClick:()=>S(c.id),children:o.jsx(he,{name:c.icon})},c.id))}),o.jsxs("div",{className:"tool-group",role:"radiogroup","aria-label":s.toolbar.shapes,children:[$r.slice(5).map(c=>o.jsx("button",{role:"radio","aria-checked":j===c.id,"aria-label":s.toolbar.tool(c.label,c.key),title:s.toolbar.shapeToolTitle(c.label,c.key),className:`icon-btn ${j===c.id?"on":""}`,disabled:!!E,onClick:()=>S(c.id),children:o.jsx(he,{name:c.icon})},c.id)),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.insertImage,title:s.toolbar.insertImageTitle,disabled:!!E,onClick:()=>Pt(()=>c=>{Pt(null),qn(c)}),children:o.jsx(he,{name:"image"})})]}),o.jsxs("div",{className:"tool-group",children:[o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.undo,title:s.toolbar.undoTitle(W.undo.length?W.undo[W.undo.length-1]:void 0,ot),disabled:!W.canUndo,onClick:()=>void pl("undo"),children:o.jsx(he,{name:"undo"})}),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.redo,title:s.toolbar.redoTitle(W.redo.length?W.redo[W.redo.length-1]:void 0,ot),disabled:!W.canRedo,onClick:()=>void pl("redo"),children:o.jsx(he,{name:"redo"})})]}),o.jsxs("button",{className:"new-board","aria-haspopup":"menu",title:s.toolbar.newBoardTitle,onClick:c=>{const v=c.currentTarget.getBoundingClientRect();Ea({clientX:v.left,clientY:v.bottom+4})},children:[o.jsx(he,{name:"plus",size:16})," ",s.toolbar.newBoard," ",o.jsx(he,{name:"chevronDown",size:14})]}),E&&o.jsxs("span",{className:"editing-chip",children:[o.jsx(he,{name:"edit",size:14})," ",s.toolbar.editing(((nu=h.boards[E])==null?void 0:nu.title)??E),o.jsx("button",{className:"icon-btn sm","aria-label":s.toolbar.stopEditing,title:s.toolbar.stopEditingTitle,onClick:()=>k(null),children:o.jsx(he,{name:"close",size:14})})]}),o.jsx("div",{className:"spacer"}),gt&&Object.keys(gt.themes).length>0&&o.jsxs("label",{className:"theme-pick",title:s.toolbar.themeTitle,children:[o.jsx("span",{className:"sr-only",children:s.toolbar.theme}),o.jsx("select",{value:gt.active,"aria-label":s.toolbar.theme,onChange:c=>void Pi({...gt,active:c.target.value},s.history.changeTheme),children:Object.keys(gt.themes).map(c=>o.jsx("option",{value:c,children:s.toolbar.themeOption(c)},c))})]}),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.snapshot,title:s.toolbar.snapshotTitle,"aria-haspopup":"menu",onClick:c=>{const v=c.currentTarget.getBoundingClientRect();zc({clientX:v.left,clientY:v.bottom+4})},children:o.jsx(he,{name:"layers"})}),ln.length>0&&o.jsxs("button",{className:"err-chip","aria-haspopup":"menu",title:s.toolbar.erroredBoards,onClick:c=>{const v=c.currentTarget.getBoundingClientRect();G({x:v.left,y:v.bottom+4,title:s.toolbar.erroredBoardsN(ln.length),items:[...ln.slice(0,12).map(x=>{var M,B,J;return{label:`${((M=h.boards[x])==null?void 0:M.title)??x} — ${(((J=(B=qe[x])==null?void 0:B[0])==null?void 0:J.message)??s.menu.fileMissing).slice(0,40)}`,icon:"warn",run:()=>{Wl([x]),bt([x])}}}),"sep",{label:s.menu.askFixAll,icon:"comment",run:()=>Tt(ln)},...u.missing.length?[{label:s.menu.cleanMissing(u.missing.length),icon:"trash",danger:!0,run:()=>{ft(x=>{const M={...x.boards};for(const B of u.missing)delete M[B];return{...x,boards:M,order:x.order.filter(B=>!u.missing.includes(B))}},s.history.cleanMissing),Ee({text:s.toast.cleanedUp(u.missing.length),action:dt})}}]:[]]})},children:[o.jsx(he,{name:"warn",size:14})," ",s.toolbar.errors(ln.length)]}),ee&&o.jsx("span",{className:"warn",children:ee}),o.jsxs("div",{className:"tool-group",children:[o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.zoomOut,title:s.toolbar.zoomOutTitle(ot),onClick:()=>xl(.8),children:o.jsx("span",{className:"glyph",children:"−"})}),o.jsxs("button",{className:"zoom","aria-label":s.toolbar.zoom100,title:s.toolbar.zoom100Title(ot),onClick:()=>li(1),children:[Math.round(g.zoom*100),"%"]}),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.zoomIn,title:s.toolbar.zoomInTitle(ot),onClick:()=>xl(1.25),children:o.jsx(he,{name:"plus"})}),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.fitAll,title:s.toolbar.fitAllTitle,onClick:yt,children:o.jsx(he,{name:"fit"})}),o.jsx("button",{className:`icon-btn ${w==="chat"?"on":""}`,"aria-label":s.toolbar.aiChat,"aria-pressed":w==="chat",title:s.toolbar.aiChatTitle(ot),onClick:()=>w==="chat"?X("inspect"):Lt(),children:o.jsx(he,{name:"comment"})}),o.jsx("button",{className:`icon-btn ${ba?"on":""}`,"aria-label":s.toolbar.guides,"aria-pressed":ba,title:s.toolbar.guidesTitle,onClick:()=>Ja(c=>!c),children:o.jsx(he,{name:"grid"})}),o.jsx("button",{className:"icon-btn","aria-label":s.toolbar.appearance(bl),title:s.toolbar.appearanceTitle(bl),onClick:()=>Tc(c=>c==="system"?"light":c==="light"?"dark":"system"),children:o.jsx(he,{name:bl==="system"?"system":bl==="light"?"sun":"moon"})}),o.jsx("button",{className:`icon-btn ${ue?"on":""}`,"aria-label":s.toolbar.minimap,"aria-pressed":ue,title:s.toolbar.minimapTitle,onClick:()=>xe(c=>!c),children:o.jsx(he,{name:"map"})})]})]}),o.jsxs("div",{className:"main",children:[F&&(Ot==="tokens"?o.jsxs("aside",{className:"left","aria-label":s.app.tokensAside,children:[nn,gt?o.jsx(U0,{tokens:gt,onSave:(c,v)=>void Pi(c,v)}):o.jsx("p",{className:"empty",children:s.app.loading})]}):Ot==="assets"?o.jsxs("aside",{className:"left","aria-label":s.app.assetsAside,children:[nn,o.jsx(xg,{version:Je,onError:c=>Ee({tone:"error",text:c}),onUploaded:c=>Ee({tone:"ok",text:s.toast.uploaded(c.map(v=>v.name).join(", "))})})]}):o.jsx(Z0,{header:nn,ref:Wu,board:h,pages:ut,currentPage:$t,selected:p,missing:ln,onPage:D,onAddPage:()=>void lo(),onPageMenu:jc,onMovePage:ii,onPick:(c,v)=>{const x=h.boards[c];ut.length&&x&&(x.page??ut[0].id)!==$t&&D(x.page??ut[0].id),Wl([c],v?"toggle":"replace"),v||bt([c])},onBoardMenu:(c,v)=>{var x;p.includes(c)||Wl([c]),G({x:v.clientX,y:v.clientY,title:((x=h.boards[c])==null?void 0:x.title)??c,items:Jt(c)})}})),o.jsxs("div",{className:"canvas-wrap",onDragOver:c=>{Array.from(c.dataTransfer.items).some(v=>v.kind==="file")&&c.preventDefault()},onDrop:c=>{const v=Array.from(c.dataTransfer.files);if(!v.length)return;c.preventDefault();const x=c.currentTarget.getBoundingClientRect(),M={x:(c.clientX-x.left-g.x)/g.zoom,y:(c.clientY-x.top-g.y)/g.zoom};Hl(v,M)},children:[o.jsx(b0,{board:h,files:u.files,view:g,setView:y,tool:j,setTool:S,visibleBoards:wt,visibleNotes:ti,selected:p,selectedNote:N,editFile:E,reloadKeys:$,onSelect:Wl,onSelectNote:c=>{Y(c),c&&b([]),Dl(null)},onMoveBoards:(c,v)=>ft(x=>({...x,boards:{...x.boards,...Object.fromEntries(Object.entries(c).map(([M,B])=>[M,{...x.boards[M],...B,autoPlaced:void 0}]))}}),v?Object.values(c).some(x=>x.w!=null)?s.history.resizeBoard:s.history.moveBoard:void 0),onMoveNote:(c,v,x)=>ft(M=>({...M,notes:{...M.notes,[c]:{...M.notes[c],...v}}}),x?"text"in v?s.history.editNote:s.history.moveNote:void 0),onDeleteNote:ni,onPlay:c=>re===c?Gn():be(c),playing:re,onEdit:c=>{k(c),c&&b([c])},onRename:c=>void bn(c),onCreateBoard:c=>void Na(c),onCreateNote:tn,onContext:Ii,onSize:de,renderBoardOverlay:oi,worldLayer:o.jsx(c0,{shapes:cl,ids:Fi,zoom:g.zoom,selected:Et,interactive:j==="select"&&!E,onSelect:c=>{Dl(c),b([]),Y(null)},onChange:(c,v,x)=>Be(c,v,x?v.w!=null?s.history.resizeShape:s.history.moveShape:void 0),onContext:(c,v)=>G({x:v.clientX,y:v.clientY,title:s.menu.shape,items:[{label:s.menu.front,icon:"front",shortcut:`${ot}]`,run:()=>pn(c,"front")},{label:s.menu.back,icon:"back",shortcut:`${ot}[`,run:()=>pn(c,"back")},"sep",{label:s.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>ai(c)}]})}),iframeRef:(c,v)=>{v&&jt.current.get(c)!==v&&(jt.current.set(c,v),Fa(x=>x+1))}}),mb.includes(j)&&!E&&o.jsx(s0,{tool:j,view:g,onDone:c=>to(c)}),wt.length===0&&ti.length===0&&Fi.length===0&&o.jsxs("div",{className:"canvas-empty",children:[o.jsx(he,{name:"board",size:32}),o.jsx("p",{children:s.app.emptyPage}),o.jsxs("button",{className:"primary",onClick:()=>S("board"),children:[s.app.drawBoard," ",o.jsx("kbd",{children:"B"})]})]}),ue&&Sn.length>0&&o.jsx(K0,{rects:Sn,selected:p,view:g,size:vt,onJump:(c,v)=>y(x=>({...x,x:vt.w/2-c*x.zoom,y:vt.h/2-v*x.zoom}))})]}),o.jsxs("div",{className:"right",hidden:!xn,children:[o.jsxs("div",{className:"right-tabs",role:"tablist","aria-label":s.tabs.right,children:[o.jsx("button",{role:"tab","aria-selected":w==="inspect",className:w==="inspect"?"on":"",onClick:()=>X("inspect"),children:s.tabs.properties}),o.jsxs("button",{role:"tab","aria-selected":w==="chat",className:w==="chat"?"on":"",onClick:()=>Lt(),children:[s.tabs.ai," ",o.jsxs("kbd",{children:[ot,"J"]})]})]}),o.jsx("div",{className:"chat-wrap",hidden:w!=="chat",children:o.jsx(C0,{selection:E&&((Vn=Se.state.selection)==null?void 0:Vn.file)===E?Se.state.selection:null,boards:E?[E]:p,visibleCount:tu,titleOf:c=>{var v;return((v=h.boards[c])==null?void 0:v.title)??c},attach:me,setAttach:ke,draft:te,setDraft:P,subscribe:Ol,onLocate:Ht,inputRef:Qa})}),w==="inspect"&&o.jsxs(V0,{author:va||s.app.defaultAuthor,onAuthor:async()=>{const c=await ol.prompt({title:s.dialog.authorTitle,label:s.dialog.name,value:va,ok:s.dialog.save});if(c!=null&&c.value.trim()){Zi(c.value.trim());try{localStorage.setItem("design-canvas:author",c.value.trim())}catch{}}},onAskAI:c=>{ke(v=>({...v,comments:v.comments.some(x=>x.id===c.id)?v.comments:[...v.comments,{id:c.id,text:c.text,file:c.file}]})),Lt(te||s.prompts.fixComment,[c.file])},file:E??He,editing:!!E,selection:Se.state.selection,multi:Se.state.paths.length,error:Se.state.error,comments:Ne,onSelectPath:c=>E&&void Se.select([c]),children:[!E&&Et&&cl[Et]&&o.jsx(r0,{shape:cl[Et],onPatch:c=>Be(Et,c,s.history.shapeStyle),onDelete:()=>ai(Et),onFront:()=>pn(Et,"front"),onBack:()=>pn(Et,"back")}),!E&&N&&h.notes[N]&&o.jsx(f0,{note:h.notes[N],onPatch:c=>ft(v=>{const x={...v.notes[N],...c};for(const M of Object.keys(x))x[M]===void 0&&delete x[M];return{...v,notes:{...v.notes,[N]:x}}},s.history.noteStyle),onDelete:()=>ni(N)}),!E&&He&&h.boards[He]&&o.jsx(H0,{doc:xc((Sl=jt.current.get(He))==null?void 0:Sl.contentDocument)?jt.current.get(He).contentDocument:null,onSave:async c=>{try{await Oe.post("/api/edit",{file:He,op:"setTweaks",values:c}),Ee({tone:"ok",text:s.toast.tweaksSaved,action:dt})}catch(v){Ee({tone:"error",text:String(v.message)})}}},`${He}-${$[He]??0}-${Bn}`),Dt&&h.boards[Dt]&&o.jsxs(o.Fragment,{children:[o.jsx(fg,{title:s.checks.tokenCheck((gt==null?void 0:gt.active)??""),items:Rl,empty:s.checks.noOffToken,onPick:c=>eu(Dt,c),onAskAI:()=>Lt(s.prompts.fixTokens((Rl??[]).slice(0,12).map(c=>`- ${c.path??s.prompts.line+c.line}: ${c.message}`).join(`
54
- `)),[Dt])}),o.jsx(fg,{title:s.checks.a11y,items:Ka,empty:s.checks.a11yOk,onPick:c=>eu(Dt,c),onAskAI:()=>Lt(s.prompts.fixA11y((Ka??[]).slice(0,12).map(c=>`- ${c.path}: ${c.message}`).join(`
55
- `)),[Dt])})]}),!E&&He&&h.boards[He]&&o.jsx(g0,{guides:((si=h.guides)==null?void 0:si[He])??[],onChange:(c,v)=>ft(x=>({...x,guides:{...x.guides??{},[He]:c}}),v)}),!E&&He&&h.boards[He]&&o.jsx($0,{file:He,item:h.boards[He],pages:ut,isLaunch:((Qn=h.launch)==null?void 0:Qn.view)==="focused"&&h.launch.file===He,onPatch:c=>Pu(He,c),onRename:()=>void bn(He),onRenameFile:()=>void Pl(He),onFocus:()=>oe(He),onFront:()=>Bl([He],"front"),onBack:()=>Bl([He],"back"),onDuplicate:()=>void Ln(He),onDelete:()=>void Il([He]),onLaunch:c=>ft(v=>({...v,launch:c?{view:"focused",file:He}:{view:"canvas"}}),s.history.launchScreen)}),!E&&p.length>1&&o.jsxs("section",{className:"board-opts",children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:s.boardOptions.selectedN(p.length)})}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.front,title:s.boardOptions.frontTitleMod(ot),onClick:()=>Bl(p,"front"),children:o.jsx(he,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.back,title:s.boardOptions.backTitleMod(ot),onClick:()=>Bl(p,"back"),children:o.jsx(he,{name:"back"})}),o.jsx("button",{className:"icon-btn","aria-label":s.boardOptions.goToSelected,title:s.boardOptions.goToSelectedTitle,onClick:()=>bt(p),children:o.jsx(he,{name:"fit"})}),o.jsx("button",{className:"icon-btn danger","aria-label":s.boardOptions.delete,title:s.boardOptions.deleteTitleKey,onClick:()=>void Il(p),children:o.jsx(he,{name:"trash"})})]})]}),E&&Se.state.selection&&Se.state.selection.file===E&&(()=>{var B;const c=Se.state.selection,v=(B=jt.current.get(E))!=null&&B.contentDocument?Al(jt.current.get(E).contentDocument,c.path):null,x={};if(v)for(const J of Array.from(v.attributes))x[J.name]=J.value;const M=Se.state.paths;return o.jsx(lb,{tokens:gt,bg:(()=>{let J=v;const ge=v==null?void 0:v.ownerDocument.defaultView;for(;J&&ge;J=J.parentElement){const ie=ge.getComputedStyle(J).backgroundColor;if(ie&&!/rgba\(0, 0, 0, 0\)|transparent/.test(ie))return ie}return"rgb(255, 255, 255)"})(),onAlign:async J=>{var Ae;const ge=(Ae=jt.current.get(E))==null?void 0:Ae.contentDocument,ie=ge&&X0(ge,c.path,c.hash,J);if(!ie)return Ee({text:s.toast.blockFlow});await et({op:"batch",ops:ie})},onReplaceImage:c.tag==="img"||/url\(/.test(c.styles["background-image"]??"")?()=>Pa(c.path,c.tag==="img"):null,selection:c,inline:v?O0(v):{},attrs:x,canWrap:M.length>=2,onStyle:(J,ge)=>void et({op:"setStyle",path:c.path,hash:c.hash,prop:J,value:ge}),onAttr:(J,ge)=>void et({op:"setAttr",path:c.path,hash:c.hash,name:J,value:ge}),onDuplicate:()=>void et({op:"duplicate",path:c.path,hash:c.hash}),onDelete:async()=>{await et({op:"delete",path:c.path,hash:c.hash})&&Se.select([])},onWrap:async J=>{const ge=[...M].sort((Ae,tt)=>Number(Ae.split("/").pop())-Number(tt.split("/").pop())),ie=await Promise.all(ge.map(Ae=>Oe.get(`/api/element?f=${encodeURIComponent(E)}&path=${encodeURIComponent(Ae)}`).then(tt=>tt.hash)));await et({op:"wrap",paths:ge,hashes:ie,display:J})&&Se.select([ge[0]])}})})(),E&&o.jsx(Q0,{file:E,version:$[E]??0,selected:Se.state.paths,onSelect:(c,v)=>{const x=Se.state.paths;Se.select(v?x.includes(c)?x.filter(M=>M!==c):[...x,c]:[c])},onMove:async(c,v,x)=>{const{hash:M}=await Oe.get(`/api/element?f=${encodeURIComponent(E)}&path=${encodeURIComponent(c)}`);await et({op:"move",path:c,hash:M,toParentPath:v,index:x})&&Se.select([v?`${v}/${x}`:String(x)])}})]})]})]}),K&&o.jsx(W0,{board:h,file:K,onClose:()=>Te(null),onLocate:c=>{b([c]),bt([c])}}),ae&&h.boards[ae]&&o.jsx(F0,{board:h,file:ae,onClose:()=>{b([ae]),oe(null)},onNav:oe}),o.jsx(z0,{open:!!Jl,version:Je,onClose:()=>Pt(null),onPick:c=>Jl==null?void 0:Jl(c),onError:c=>Ee({tone:"error",text:c})}),o.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:Q}),o.jsx(ub,{menu:Qe,onClose:()=>G(null)}),o.jsx(ob,{state:ol.state,onClose:ol.close})]})}function vb(u,d,h){const f=u.split("/").map(Number),g=d===""?[]:d.split("/").map(Number),y=f.length-1;return g.length>y&&g.slice(0,y).every((z,D)=>z===f[D])&&g[y]>f[y]&&g[y]--,[...g,h].join("/")}function gg({r:u,cls:d}){return o.jsx("div",{className:`box ${d}`,style:{left:u.x,top:u.y,width:u.w,height:u.h}})}n0.createRoot(document.getElementById("root")).render(o.jsx(ib,{children:o.jsx(gb,{})}));