easel-canvas 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ var Rx=Object.defineProperty;var Dx=(n,o,i)=>o in n?Rx(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i;var jy=(n,o,i)=>Dx(n,typeof o!="symbol"?o+"":o,i);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))f(m);new MutationObserver(m=>{for(const p of m)if(p.type==="childList")for(const b of p.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&f(b)}).observe(document,{childList:!0,subtree:!0});function i(m){const p={};return m.integrity&&(p.integrity=m.integrity),m.referrerPolicy&&(p.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?p.credentials="include":m.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function f(m){if(m.ep)return;m.ep=!0;const p=i(m);fetch(m.href,p)}})();var cm={exports:{}},vu={};/**
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 Ny;function Bx(){if(Ny)return vu;Ny=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(f,m,p){var b=null;if(p!==void 0&&(b=""+p),m.key!==void 0&&(b=""+m.key),"key"in m){p={};for(var N in m)N!=="key"&&(p[N]=m[N])}else p=m;return m=p.ref,{$$typeof:n,type:f,key:b,ref:m!==void 0?m:null,props:p}}return vu.Fragment=o,vu.jsx=i,vu.jsxs=i,vu}var Sy;function Hx(){return Sy||(Sy=1,cm.exports=Bx()),cm.exports}var s=Hx(),rm={exports:{}},We={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ky;function Lx(){if(ky)return We;ky=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),b=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),E=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),k=Symbol.for("react.view_transition"),z=Symbol.iterator;function R(H){return H===null||typeof H!="object"?null:(H=z&&H[z]||H["@@iterator"],typeof H=="function"?H:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,V={};function M(H,se,ve){this.props=H,this.context=se,this.refs=V,this.updater=ve||K}M.prototype.isReactComponent={},M.prototype.setState=function(H,se){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,se,"setState")},M.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function X(){}X.prototype=M.prototype;function te(H,se,ve){this.props=H,this.context=se,this.refs=V,this.updater=ve||K}var ee=te.prototype=new X;ee.constructor=te,B(ee,M.prototype),ee.isPureReactComponent=!0;var ce=Array.isArray;function ie(){}var he={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function pe(H,se,ve){var Ce=ve.ref;return{$$typeof:n,type:H,key:se,ref:Ce!==void 0?Ce:null,props:ve}}function Oe(H,se){return pe(H.type,se,H.props)}function Ye(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function ue(H){var se={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(ve){return se[ve]})}var pt=/\/+/g;function Fe(H,se){return typeof H=="object"&&H!==null&&H.key!=null?ue(""+H.key):se.toString(36)}function me(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(ie,ie):(H.status="pending",H.then(function(se){H.status==="pending"&&(H.status="fulfilled",H.value=se)},function(se){H.status==="pending"&&(H.status="rejected",H.reason=se)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function Ae(H,se,ve,Ce,Qe){var de=typeof H;(de==="undefined"||de==="boolean")&&(H=null);var U=!1;if(H===null)U=!0;else switch(de){case"bigint":case"string":case"number":U=!0;break;case"object":switch(H.$$typeof){case n:case o:U=!0;break;case S:return U=H._init,Ae(U(H._payload),se,ve,Ce,Qe)}}if(U)return Qe=Qe(H),U=Ce===""?"."+Fe(H,0):Ce,ce(Qe)?(ve="",U!=null&&(ve=U.replace(pt,"$&/")+"/"),Ae(Qe,se,ve,"",function(Et){return Et})):Qe!=null&&(Ye(Qe)&&(Qe=Oe(Qe,ve+(Qe.key==null||H&&H.key===Qe.key?"":(""+Qe.key).replace(pt,"$&/")+"/")+U)),se.push(Qe)),1;U=0;var ae=Ce===""?".":Ce+":";if(ce(H))for(var ge=0;ge<H.length;ge++)Ce=H[ge],de=ae+Fe(Ce,ge),U+=Ae(Ce,se,ve,de,Qe);else if(ge=R(H),typeof ge=="function")for(H=ge.call(H),ge=0;!(Ce=H.next()).done;)Ce=Ce.value,de=ae+Fe(Ce,ge++),U+=Ae(Ce,se,ve,de,Qe);else if(de==="object"){if(typeof H.then=="function")return Ae(me(H),se,ve,Ce,Qe);throw se=String(H),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return U}function ze(H,se,ve){if(H==null)return H;var Ce=[],Qe=0;return Ae(H,Ce,"","",function(de){return se.call(ve,de,Qe++)}),Ce}function qe(H){if(H._status===-1){var se=H._result,ve=se();ve.then(function(Ce){(H._status===0||H._status===-1)&&(H._status=1,H._result=Ce,ve.status===void 0&&(ve.status="fulfilled",ve.value=Ce))},function(Ce){(H._status===0||H._status===-1)&&(H._status=2,H._result=Ce,ve.status===void 0&&(ve.status="rejected",ve.reason=Ce))}),H._status===-1&&(H._status=0,H._result=ve)}if(H._status===1)return H._result.default;throw H._result}var Ve=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)};function re(H){var se=he.T,ve={};ve.types=se!==null?se.types:null,he.T=ve;try{var Ce=H(),Qe=he.S;Qe!==null&&Qe(ve,Ce),typeof Ce=="object"&&Ce!==null&&typeof Ce.then=="function"&&Ce.then(ie,Ve)}catch(de){Ve(de)}finally{se!==null&&ve.types!==null&&(se.types=ve.types),he.T=se}}function Ne(H){var se=he.T;if(se!==null){var ve=se.types;ve===null?se.types=[H]:ve.indexOf(H)===-1&&ve.push(H)}else re(Ne.bind(null,H))}var at={map:ze,forEach:function(H,se,ve){ze(H,function(){se.apply(this,arguments)},ve)},count:function(H){var se=0;return ze(H,function(){se++}),se},toArray:function(H){return ze(H,function(se){return se})||[]},only:function(H){if(!Ye(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return We.Activity=w,We.Children=at,We.Component=M,We.Fragment=i,We.Profiler=m,We.PureComponent=te,We.StrictMode=f,We.Suspense=j,We.ViewTransition=k,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=he,We.__COMPILER_RUNTIME={__proto__:null,c:function(H){return he.H.useMemoCache(H)}},We.addTransitionType=Ne,We.cache=function(H){return function(){return H.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(H,se,ve){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Ce=B({},H.props),Qe=H.key;if(se!=null)for(de in se.key!==void 0&&(Qe=""+se.key),se)!fe.call(se,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&se.ref===void 0||(Ce[de]=se[de]);var de=arguments.length-2;if(de===1)Ce.children=ve;else if(1<de){for(var U=Array(de),ae=0;ae<de;ae++)U[ae]=arguments[ae+2];Ce.children=U}return pe(H.type,Qe,Ce)},We.createContext=function(H){return H={$$typeof:b,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:p,_context:H},H},We.createElement=function(H,se,ve){var Ce,Qe={},de=null;if(se!=null)for(Ce in se.key!==void 0&&(de=""+se.key),se)fe.call(se,Ce)&&Ce!=="key"&&Ce!=="__self"&&Ce!=="__source"&&(Qe[Ce]=se[Ce]);var U=arguments.length-2;if(U===1)Qe.children=ve;else if(1<U){for(var ae=Array(U),ge=0;ge<U;ge++)ae[ge]=arguments[ge+2];Qe.children=ae}if(H&&H.defaultProps)for(Ce in U=H.defaultProps,U)Qe[Ce]===void 0&&(Qe[Ce]=U[Ce]);return pe(H,de,Qe)},We.createRef=function(){return{current:null}},We.forwardRef=function(H){return{$$typeof:N,render:H}},We.isValidElement=Ye,We.lazy=function(H){return{$$typeof:S,_payload:{_status:-1,_result:H},_init:qe}},We.memo=function(H,se){return{$$typeof:E,type:H,compare:se===void 0?null:se}},We.startTransition=re,We.unstable_useCacheRefresh=function(){return he.H.useCacheRefresh()},We.use=function(H){return he.H.use(H)},We.useActionState=function(H,se,ve){return he.H.useActionState(H,se,ve)},We.useCallback=function(H,se){return he.H.useCallback(H,se)},We.useContext=function(H){return he.H.useContext(H)},We.useDebugValue=function(){},We.useDeferredValue=function(H,se){return he.H.useDeferredValue(H,se)},We.useEffect=function(H,se){return he.H.useEffect(H,se)},We.useEffectEvent=function(H){return he.H.useEffectEvent(H)},We.useId=function(){return he.H.useId()},We.useImperativeHandle=function(H,se,ve){return he.H.useImperativeHandle(H,se,ve)},We.useInsertionEffect=function(H,se){return he.H.useInsertionEffect(H,se)},We.useLayoutEffect=function(H,se){return he.H.useLayoutEffect(H,se)},We.useMemo=function(H,se){return he.H.useMemo(H,se)},We.useOptimistic=function(H,se){return he.H.useOptimistic(H,se)},We.useReducer=function(H,se,ve){return he.H.useReducer(H,se,ve)},We.useRef=function(H){return he.H.useRef(H)},We.useState=function(H){return he.H.useState(H)},We.useSyncExternalStore=function(H,se,ve){return he.H.useSyncExternalStore(H,se,ve)},We.useTransition=function(){return he.H.useTransition()},We.version="19.3.0",We}var Ty;function Ym(){return Ty||(Ty=1,rm.exports=Lx()),rm.exports}var v=Ym(),um={exports:{}},xu={},dm={exports:{}},fm={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Cy;function _x(){return Cy||(Cy=1,(function(n){function o(me,Ae){var ze=me.length;me.push(Ae);e:for(;0<ze;){var qe=ze-1>>>1,Ve=me[qe];if(0<m(Ve,Ae))me[qe]=Ae,me[ze]=Ve,ze=qe;else break e}}function i(me){return me.length===0?null:me[0]}function f(me){if(me.length===0)return null;var Ae=me[0],ze=me.pop();if(ze!==Ae){me[0]=ze;e:for(var qe=0,Ve=me.length,re=Ve>>>1;qe<re;){var Ne=2*(qe+1)-1,at=me[Ne],H=Ne+1,se=me[H];if(0>m(at,ze))H<Ve&&0>m(se,at)?(me[qe]=se,me[H]=ze,qe=H):(me[qe]=at,me[Ne]=ze,qe=Ne);else if(H<Ve&&0>m(se,ze))me[qe]=se,me[H]=ze,qe=H;else break e}}return Ae}function m(me,Ae){var ze=me.sortIndex-Ae.sortIndex;return ze!==0?ze:me.id-Ae.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;n.unstable_now=function(){return p.now()}}else{var b=Date,N=b.now();n.unstable_now=function(){return b.now()-N}}var j=[],E=[],S=1,w=null,k=3,z=!1,R=!1,K=!1,B=!1,V=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function te(me){for(var Ae=i(E);Ae!==null;){if(Ae.callback===null)f(E);else if(Ae.startTime<=me)f(E),Ae.sortIndex=Ae.expirationTime,o(j,Ae);else break;Ae=i(E)}}function ee(me){if(K=!1,te(me),!R)if(i(j)!==null)R=!0,ce||(ce=!0,Ye());else{var Ae=i(E);Ae!==null&&Fe(ee,Ae.startTime-me)}}var ce=!1,ie=-1,he=5,fe=-1;function pe(){return B?!0:!(n.unstable_now()-fe<he)}function Oe(){if(B=!1,ce){var me=n.unstable_now();fe=me;var Ae=!0;try{e:{R=!1,K&&(K=!1,M(ie),ie=-1),z=!0;var ze=k;try{t:{for(te(me),w=i(j);w!==null&&!(w.expirationTime>me&&pe());){var qe=w.callback;if(typeof qe=="function"){w.callback=null,k=w.priorityLevel;var Ve=qe(w.expirationTime<=me);if(me=n.unstable_now(),typeof Ve=="function"){w.callback=Ve,te(me),Ae=!0;break t}w===i(j)&&f(j),te(me)}else f(j);w=i(j)}if(w!==null)Ae=!0;else{var re=i(E);re!==null&&Fe(ee,re.startTime-me),Ae=!1}}break e}finally{w=null,k=ze,z=!1}Ae=void 0}}finally{Ae?Ye():ce=!1}}}var Ye;if(typeof X=="function")Ye=function(){X(Oe)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,pt=ue.port2;ue.port1.onmessage=Oe,Ye=function(){pt.postMessage(null)}}else Ye=function(){V(Oe,0)};function Fe(me,Ae){ie=V(function(){me(n.unstable_now())},Ae)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(me){me.callback=null},n.unstable_forceFrameRate=function(me){0>me||125<me?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<me?Math.floor(1e3/me):5},n.unstable_getCurrentPriorityLevel=function(){return k},n.unstable_next=function(me){switch(k){case 1:case 2:case 3:var Ae=3;break;default:Ae=k}var ze=k;k=Ae;try{return me()}finally{k=ze}},n.unstable_requestPaint=function(){B=!0},n.unstable_runWithPriority=function(me,Ae){switch(me){case 1:case 2:case 3:case 4:case 5:break;default:me=3}var ze=k;k=me;try{return Ae()}finally{k=ze}},n.unstable_scheduleCallback=function(me,Ae,ze){var qe=n.unstable_now();switch(typeof ze=="object"&&ze!==null?(ze=ze.delay,ze=typeof ze=="number"&&0<ze?qe+ze:qe):ze=qe,me){case 1:var Ve=-1;break;case 2:Ve=250;break;case 5:Ve=1073741823;break;case 4:Ve=1e4;break;default:Ve=5e3}return Ve=ze+Ve,me={id:S++,callback:Ae,priorityLevel:me,startTime:ze,expirationTime:Ve,sortIndex:-1},ze>qe?(me.sortIndex=ze,o(E,me),i(j)===null&&me===i(E)&&(K?(M(ie),ie=-1):K=!0,Fe(ee,ze-qe))):(me.sortIndex=Ve,o(j,me),R||z||(R=!0,ce||(ce=!0,Ye()))),me},n.unstable_shouldYield=pe,n.unstable_wrapCallback=function(me){var Ae=k;return function(){var ze=k;k=Ae;try{return me.apply(this,arguments)}finally{k=ze}}}})(fm)),fm}var Ey;function Ux(){return Ey||(Ey=1,dm.exports=_x()),dm.exports}var hm={exports:{}},ga={};/**
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 My;function qx(){if(My)return ga;My=1;var n=Ym();function o(S){var w="https://react.dev/errors/"+S;if(1<arguments.length){w+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)w+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+S+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var f={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},m=Symbol.for("react.portal"),p=Symbol.for("react.recoverable"),b=Symbol.for("react.optimistic_key");function N(S,w,k){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:z==null?null:z===b?b:""+z,children:S,containerInfo:w,implementation:k}}var j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function E(S,w){if(S==="font")return"";if(typeof w=="string")return w==="use-credentials"?w:""}return ga.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,ga.browser=function(S){return{$$typeof:p,_reason:S}},ga.createPortal=function(S,w){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!w||w.nodeType!==1&&w.nodeType!==9&&w.nodeType!==11)throw Error(o(299));return N(S,w,null,k)},ga.flushSync=function(S){var w=j.T,k=f.p;try{if(j.T=null,f.p=2,S)return S()}finally{j.T=w,f.p=k,f.d.f()}},ga.preconnect=function(S,w){typeof S=="string"&&(w?(w=w.crossOrigin,w=typeof w=="string"?w==="use-credentials"?w:"":void 0):w=null,f.d.C(S,w))},ga.prefetchDNS=function(S){typeof S=="string"&&f.d.D(S)},ga.preinit=function(S,w){if(typeof S=="string"&&w&&typeof w.as=="string"){var k=w.as,z=E(k,w.crossOrigin),R=typeof w.integrity=="string"?w.integrity:void 0,K=typeof w.fetchPriority=="string"?w.fetchPriority:void 0;k==="style"?f.d.S(S,typeof w.precedence=="string"?w.precedence:void 0,{crossOrigin:z,integrity:R,fetchPriority:K}):k==="script"&&f.d.X(S,{crossOrigin:z,integrity:R,fetchPriority:K,nonce:typeof w.nonce=="string"?w.nonce:void 0})}},ga.preinitModule=function(S,w){if(typeof S=="string")if(typeof w=="object"&&w!==null){if(w.as==null||w.as==="script"){var k=E(w.as,w.crossOrigin);f.d.M(S,{crossOrigin:k,integrity:typeof w.integrity=="string"?w.integrity:void 0,nonce:typeof w.nonce=="string"?w.nonce:void 0,fetchPriority:typeof w.fetchPriority=="string"?w.fetchPriority:void 0})}}else w==null&&f.d.M(S)},ga.preload=function(S,w){if(typeof S=="string"&&typeof w=="object"&&w!==null&&typeof w.as=="string"){var k=w.as,z=E(k,w.crossOrigin);f.d.L(S,k,{crossOrigin:z,integrity:typeof w.integrity=="string"?w.integrity:void 0,nonce:typeof w.nonce=="string"?w.nonce:void 0,type:typeof w.type=="string"?w.type:void 0,fetchPriority:typeof w.fetchPriority=="string"?w.fetchPriority:void 0,referrerPolicy:typeof w.referrerPolicy=="string"?w.referrerPolicy:void 0,imageSrcSet:typeof w.imageSrcSet=="string"?w.imageSrcSet:void 0,imageSizes:typeof w.imageSizes=="string"?w.imageSizes:void 0,media:typeof w.media=="string"?w.media:void 0})}},ga.preloadModule=function(S,w){if(typeof S=="string")if(w){var k=E(w.as,w.crossOrigin);f.d.m(S,{as:typeof w.as=="string"&&w.as!=="script"?w.as:void 0,crossOrigin:k,integrity:typeof w.integrity=="string"?w.integrity:void 0,nonce:typeof w.nonce=="string"?w.nonce:void 0,fetchPriority:typeof w.fetchPriority=="string"?w.fetchPriority:void 0})}else f.d.m(S)},ga.requestFormReset=function(S){f.d.r(S)},ga.unstable_batchedUpdates=function(S,w){return S(w)},ga.useFormState=function(S,w,k){return j.H.useFormState(S,w,k)},ga.useFormStatus=function(){return j.H.useHostTransitionStatus()},ga.version="19.3.0",ga}var Ay;function Cb(){if(Ay)return hm.exports;Ay=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),hm.exports=qx(),hm.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 $y;function Vx(){if($y)return xu;$y=1;var n=Ux(),o=Ym(),i=Cb();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function b(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 N(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(p(e)!==e)throw Error(f(188))}function E(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(f(188));return t!==e?null:e}for(var a=e,l=t;;){var r=a.return;if(r===null)break;var d=r.alternate;if(d===null){if(l=r.return,l!==null){a=l;continue}break}if(r.child===d.child){for(d=r.child;d;){if(d===a)return j(r),e;if(d===l)return j(r),t;d=d.sibling}throw Error(f(188))}if(a.return!==l.return)a=r,l=d;else{for(var y=!1,C=r.child;C;){if(C===a){y=!0,a=r,l=d;break}if(C===l){y=!0,l=r,a=d;break}C=C.sibling}if(!y){for(C=d.child;C;){if(C===a){y=!0,a=d,l=r;break}if(C===l){y=!0,l=d,a=r;break}C=C.sibling}if(!y)throw Error(f(189))}}if(a.alternate!==l)throw Error(f(190))}if(a.tag!==3)throw Error(f(188));return a.stateNode.current===a?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}function w(e,t,a,l,r,d){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,l,r,d)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&w(e.child,t,a,l,r,d))return!0;e=e.sibling}return!1}function k(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 z(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 R(e){var t=[null,null],a=k(e);return a===null||K(t,e,a.child,{foundSelf:!1}),t}function K(e,t,a,l){for(;a!==null;){if(a===t)l.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(l.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&K(e,t,a.child,l))return!0;a=a.sibling}return!1}function B(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 V=null,M=null;function X(e,t,a){return e===a?!0:e===t?(V=e,!0):!1}function te(e,t,a){return e===a?(M=e,!1):e===t?(M!==null&&(V=e),!0):!1}function ee(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 ce(e,t,a){for(var l=0,r=e;r;r=a(r))l++;r=0;for(var d=t;d;d=a(d))r++;for(;0<l-r;)e=a(e),l--;for(;0<r-l;)t=a(t),r--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var ie=Object.assign,he=Symbol.for("react.element"),fe=Symbol.for("react.transitional.element"),pe=Symbol.for("react.portal"),Oe=Symbol.for("react.fragment"),Ye=Symbol.for("react.strict_mode"),ue=Symbol.for("react.profiler"),pt=Symbol.for("react.consumer"),Fe=Symbol.for("react.context"),me=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),qe=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),Ne=Symbol.for("react.legacy_hidden"),at=Symbol.for("react.memo_cache_sentinel"),H=Symbol.for("react.view_transition"),se=Symbol.for("react.recoverable"),ve=Symbol.iterator;function Ce(e){return e===null||typeof e!="object"?null:(e=ve&&e[ve]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Qe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Oe:return"Fragment";case ue:return"Profiler";case Ye:return"StrictMode";case Ae:return"Suspense";case ze:return"SuspenseList";case re:return"Activity";case H:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case pe:return"Portal";case Fe:return e.displayName||"Context";case pt:return(e._context.displayName||"Context")+".Consumer";case me:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qe:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var U=Array.isArray,ae=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Et={pending:!1,data:null,method:null,action:null},Jt=[],Ht=-1;function Be(e){return{current:e}}function ot(e){0>Ht||(e.current=Jt[Ht],Jt[Ht]=null,Ht--)}function Pe(e,t){Ht++,Jt[Ht]=e.current,e.current=t}var on=Be(null),fn=Be(null),Nn=Be(null),It=Be(null);function xa(e,t){switch(Pe(Nn,t),Pe(fn,e),Pe(on,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$g(t),e=zg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ot(on),Pe(on,e)}function D(){ot(on),ot(fn),ot(Nn)}function Z(e){var t=e.memoizedState;t!==null&&(or._currentValue=t.memoizedState,Pe(It,e)),t=on.current;var a=zg(t,e.type);t!==a&&(Pe(fn,e),Pe(on,a))}function ne(e){fn.current===e&&(ot(on),ot(fn)),It.current===e&&(ot(It),or._currentValue=Et)}var Re,_e;function Je(e){if(Re===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Re=t&&t[1]||"",_e=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Re+e+_e}var it=!1;function Nt(e,t){if(!e||it)return"";it=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(Te){var q=Te}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(Te){q=Te}oe=!1;try{var P=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),oe=!0,new e}finally{oe&&(P!==void 0?Object.defineProperty(e.prototype,"props",P):delete e.prototype.props)}}}else{try{throw Error()}catch(Te){q=Te}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Te){if(Te&&q&&typeof Te.stack=="string")return[Te.stack,q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),y=d[0],C=d[1];if(y&&C){var O=y.split(`
44
+ `),Y=C.split(`
45
+ `);for(r=l=0;l<O.length&&!O[l].includes("DetermineComponentFrameRoot");)l++;for(;r<Y.length&&!Y[r].includes("DetermineComponentFrameRoot");)r++;if(l===O.length||r===Y.length)for(l=O.length-1,r=Y.length-1;1<=l&&0<=r&&O[l]!==Y[r];)r--;for(;1<=l&&0<=r;l--,r--)if(O[l]!==Y[r]){if(l!==1||r!==1)do if(l--,r--,0>r||O[l]!==Y[r]){var J=`
46
+ `+O[l].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=l&&0<=r);break}}}finally{it=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Je(a):""}function cn(e,t){switch(e.tag){case 26:case 27:case 5:return Je(e.type);case 16:return Je("Lazy");case 13:return e.child!==t&&t!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Nt(e.type,!1);case 11:return Nt(e.type.render,!1);case 1:return Nt(e.type,!0);case 31:return Je("Activity");case 30:return Je("ViewTransition");default:return""}}function Ft(e){try{var t="",a=null;do t+=cn(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var Qt=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,ct=n.unstable_cancelCallback,Sn=n.unstable_shouldYield,Lt=n.unstable_requestPaint,rt=n.unstable_now,bt=n.unstable_getCurrentPriorityLevel,Ea=n.unstable_ImmediatePriority,Dl=n.unstable_UserBlockingPriority,qt=n.unstable_NormalPriority,St=n.unstable_LowPriority,as=n.unstable_IdlePriority,fr=n.log,Ls=n.unstable_setDisableYieldValue,ml=null,hn=null;function wa(e){if(typeof fr=="function"&&Ls(e),hn&&typeof hn.setStrictMode=="function")try{hn.setStrictMode(ml,e)}catch{}}var Jn=Math.clz32?Math.clz32:pl,ls=Math.log,ss=Math.LN2;function pl(e){return e>>>=0,e===0?32:31-(ls(e)/ss|0)|0}var Oa=256,gl=262144,os=4194304;function _n(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 is(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var r=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var C=l&134217727;return C!==0?(l=C&~d,l!==0?r=_n(l):(y&=C,y!==0?r=_n(y):a||(a=C&~e,a!==0&&(r=_n(a))))):(C=l&~d,C!==0?r=_n(C):y!==0?r=_n(y):a||(a=l&~e,a!==0&&(r=_n(a)))),r===0?0:t!==0&&t!==r&&(t&d)===0&&(d=r&-r,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:r}function tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ri(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-Jn(a),r=1<<l;t|=e[l],a&=~r}return t}function Ot(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 ho(){var e=os;return os<<=1,(os&62914560)===0&&(os=4194304),e}function ac(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function $(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function I(e,t,a,l,r,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var C=e.entanglements,O=e.expirationTimes,Y=e.hiddenUpdates;for(a=y&~a;0<a;){var J=31-Jn(a),oe=1<<J;C[J]=0,O[J]=-1;var q=Y[J];if(q!==null)for(Y[J]=null,J=0;J<q.length;J++){var P=q[J];P!==null&&(P.lane&=-536870913)}a&=~oe}l!==0&&Le(e,l,0),d!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function Le(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Jn(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function we(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Jn(a),r=1<<l;r&t|e[l]&t&&(e[l]|=t),a&=~r}}function Me(e,t){var a=t&-t;return a=(a&42)!==0?1:nt(a),(a&(e.suspendedLanes|t))!==0?0:a}function nt(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 Ge(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kn(){var e=ge.p;return e!==0?e:(e=window.event,e===void 0?32:py(e.type))}function sa(e,t){var a=ge.p;try{return ge.p=e,t()}finally{ge.p=a}}var vt=Math.random().toString(36).slice(2),zn="__reactFiber$"+vt,da="__reactProps$"+vt,Ra="__reactContainer$"+vt,ui="__reactEvents$"+vt,hr="__reactListeners$"+vt,lc="__reactHandles$"+vt,mr="__reactResources$"+vt,nn="__reactMarker$"+vt,Qa="__reactLoad$"+vt;function di(e){delete e[zn],delete e[da],delete e[hr],delete e[lc]}function cs(e){var t;if(t=e[zn])return t;for(var a=e.parentNode;a;){if(t=a[Ra]||a[zn]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Qg(e);e!==null;){if(a=e[zn])return a;e=Qg(e)}return t}e=a,a=e.parentNode}return null}function mo(e){if(e=e[zn]||e[Ra]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function po(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function Bl(e){var t=e[mr];return t||(t=e[mr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Un(e){e[nn]=!0}function fi(e){e[Qa]=void 0}var Lu=new Set,pr={};function Hl(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(pr[e]=t,e=0;e<t.length;e++)Lu.add(t[e])}var hi=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]*$"),gr={},_u={};function sc(e){return Qt.call(_u,e)?!0:Qt.call(gr,e)?!1:hi.test(e)?_u[e]=!0:(gr[e]=!0,!1)}var ft=!1;function In(){var e=ft;return ft=!1,e}function Da(e,t,a){if(sc(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,a)}}function yl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,a)}}function bl(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,l)}}function Na(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function On(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var r=l.get,d=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(y){a=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pa(e){if(!e._valueTracker){var t=yr(e)?"checked":"value";e._valueTracker=On(e,t,""+e[t])}}function br(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=yr(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}var rs=/[\n"\\]/g;function Rn(e){return e.replace(rs,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function mi(e,t,a,l,r,d,y,C){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Na(t)):e.value!==""+Na(t)&&(e.value=""+Na(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?y==="number"&&e.value==t?oc(e,Na(e.value)):oc(e,Na(t)):a!=null?oc(e,Na(a)):l!=null&&e.removeAttribute("value"),r==null&&d!=null&&(e.defaultChecked=!!d),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+Na(C):e.removeAttribute("name")}function Ll(e,t,a,l,r,d,y,C){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Pa(e);return}a=a!=null?""+Na(a):"",t=t!=null?""+Na(t):a,C||t===e.value||(e.value=t),e.defaultValue=t}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=C?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Pa(e)}function oc(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function us(e,t,a,l){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Na(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,l&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function vr(e,t,a){if(t!=null&&(t=""+Na(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Na(a):""}function xr(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(f(92));if(U(l)){if(1<l.length)throw Error(f(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Na(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Pa(e)}function _s(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var pi=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 Uu(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||pi.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function go(e,t,a){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",ft=!0);for(var r in t)l=t[r],t.hasOwnProperty(r)&&a[r]!==l&&(Uu(e,r,l),ft=!0)}else for(var d in t)t.hasOwnProperty(d)&&Uu(e,d,t[d])}function Ja(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 yo=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"]]),ut=/^[\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 _l(e){return ut.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function vl(){}var ic=null;function gi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ye=null,Tn=null;function wr(e){var t=mo(e);if(t&&(e=t.stateNode)){var a=e[da]||null;e:switch(e=t.stateNode,t.type){case"input":if(mi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Rn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var r=l[da]||null;if(!r)throw Error(f(90));mi(l,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&br(l)}break e;case"textarea":vr(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&us(e,!!a.multiple,t,!1)}}}var Rt=!1;function jr(e,t,a){if(Rt)return e(t,a);Rt=!0;try{var l=e(t);return l}finally{if(Rt=!1,(ye!==null||Tn!==null)&&(Ud(),ye&&(t=ye,e=Tn,Tn=ye=null,wr(t),e)))for(t=0;t<e.length;t++)wr(e[t])}}function Ia(e,t){var a=e.stateNode;if(a===null)return null;var l=a[da]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(f(231,t,typeof a));return a}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Us=!1;if(Ba)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){Us=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{Us=!1}var ds=null,Nr=null,fs=null;function Sa(){if(fs)return fs;var e,t=Nr,a=t.length,l,r="value"in ds?ds.value:ds.textContent,d=r.length;for(e=0;e<a&&t[e]===r[e];e++);var y=a-e;for(l=1;l<=y&&t[a-l]===r[d-l];l++);return fs=r.slice(e,1<l?1-l:void 0)}function hs(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 an(){return!0}function Sr(){return!1}function Dn(e){function t(a,l,r,d,y){this._reactName=a,this._targetInst=r,this.type=l,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(a=e[C],this[C]=a?a(d):d[C]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?an:Sr,this.isPropagationStopped=Sr,this}return ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Dn(Bn),kt=ie({},Bn,{view:0,detail:0}),Wt=Dn(kt),xl,Wa,vo,Vs=ie({},kt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xo,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!==vo&&(vo&&e.type==="mousemove"?(xl=e.screenX-vo.screenX,Wa=e.screenY-vo.screenY):Wa=xl=0,vo=e),xl)},movementY:function(e){return"movementY"in e?e.movementY:Wa}}),kr=Dn(Vs),Ul=ie({},Vs,{dataTransfer:0}),$f=Dn(Ul),ql=ie({},kt,{relatedTarget:0}),wl=Dn(ql),zf=ie({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0}),qu=Dn(zf),Vu=ie({},Bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gu=Dn(Vu),Yu=ie({},Bn,{data:0}),cc=Dn(Yu),Tr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Of={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"},Cr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xu(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cr[e])?!!t[e]:!1}function xo(){return Xu}var Ha=ie({},kt,{key:function(e){if(e.key){var t=Tr[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=hs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Of[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xo,charCode:function(e){return e.type==="keypress"?hs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ku=Dn(Ha),Zu=ie({},Vs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rc=Dn(Zu),Fu=ie({},Bn,{submitter:0}),Rf=Dn(Fu),bn=ie({},kt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xo}),jl=Dn(bn),Cn=ie({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),mn=Dn(Cn),Qu=ie({},Vs,{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}),La=Dn(Qu),Pu=ie({},Bn,{newState:0,oldState:0,source:0}),Ju=Dn(Pu),Iu=[9,13,27,32],uc=Ba&&"CompositionEvent"in window,el=null;Ba&&"documentMode"in document&&(el=document.documentMode);var Se=Ba&&"TextEvent"in window&&!el,Er=Ba&&(!uc||el&&8<el&&11>=el),dc=" ",Ie=!1;function rn(e,t){switch(e){case"keyup":return Iu.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ms(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dt=!1;function Mr(e,t){switch(e){case"compositionend":return ms(t);case"keypress":return t.which!==32?null:(Ie=!0,dc);case"textInput":return e=t.data,e===dc&&Ie?null:e;default:return null}}function En(e,t){if(dt)return e==="compositionend"||!uc&&rn(e,t)?(e=Sa(),fs=Nr=ds=null,dt=!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 Er&&t.locale!=="ko"?null:t.data;default:return null}}var Df={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Df[e.type]:t==="textarea"}function tl(e,t,a,l){ye?Tn?Tn.push(l):Tn=[l]:ye=l,t=Kd(t,"onChange"),0<t.length&&(a=new qs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var yi=null,wo=null;function ed(e){kg(e,0)}function fc(e){var t=po(e);if(br(t))return e}function jo(e,t){if(e==="change")return t}var Vl=!1;if(Ba){var ps;if(Ba){var bi="oninput"in document;if(!bi){var nl=document.createElement("div");nl.setAttribute("oninput","return;"),bi=typeof nl.oninput=="function"}ps=bi}else ps=!1;Vl=ps&&(!document.documentMode||9<document.documentMode)}function No(){yi&&(yi.detachEvent("onpropertychange",vi),wo=yi=null)}function vi(e){if(e.propertyName==="value"&&fc(wo)){var t=[];tl(t,wo,e,gi(e)),jr(ed,t)}}function hc(e,t,a){e==="focusin"?(No(),yi=t,wo=a,yi.attachEvent("onpropertychange",vi)):e==="focusout"&&No()}function Ar(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fc(wo)}function mc(e,t){if(e==="click")return fc(t)}function td(e,t){if(e==="input"||e==="change")return fc(t)}function Bf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ma=typeof Object.is=="function"?Object.is:Bf;function _a(e,t){if(Ma(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var r=a[l];if(!Qt.call(t,r)||!Ma(e[r],t[r]))return!1}return!0}function gs(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 al(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ll(e,t){var a=al(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=al(a)}}function $r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$r(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function So(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=gs(e.document)}return t}function zr(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 Hf=Ba&&"documentMode"in document&&11>=document.documentMode,Nl=null,xi=null,ko=null,To=!1;function Or(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;To||Nl==null||Nl!==gs(l)||(l=Nl,"selectionStart"in l&&zr(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ko&&_a(ko,l)||(ko=l,l=Kd(xi,"onSelect"),0<l.length&&(t=new qs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Nl)))}function ka(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Co={animationend:ka("Animation","AnimationEnd"),animationiteration:ka("Animation","AnimationIteration"),animationstart:ka("Animation","AnimationStart"),transitionrun:ka("Transition","TransitionRun"),transitionstart:ka("Transition","TransitionStart"),transitioncancel:ka("Transition","TransitionCancel"),transitionend:ka("Transition","TransitionEnd")},Eo={},nd={};Ba&&(nd=document.createElement("div").style,"AnimationEvent"in window||(delete Co.animationend.animation,delete Co.animationiteration.animation,delete Co.animationstart.animation),"TransitionEvent"in window||delete Co.transitionend.transition);function ys(e){if(Eo[e])return Eo[e];if(!Co[e])return e;var t=Co[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in nd)return Eo[e]=t[a];return e}var pc=ys("animationend"),Mo=ys("animationiteration"),Gl=ys("animationstart"),ad=ys("transitionrun"),ld=ys("transitionstart"),sd=ys("transitioncancel"),wi=ys("transitionend"),ji=new Map,Ao="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(" ");Ao.push("scrollEnd");function sl(e,t){ji.set(e,t),Hl(t,[e])}var od=0;function Ta(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=es.identifierPrefix;var a=od++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function Rr(e){if(e==null||typeof e=="string")return e;var t=null,a=Pc;if(a!==null)for(var l=0;l<a.length;l++){var r=e[a[l]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Yl(e,t){return e=Rr(e),t=Rr(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var gc=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)},Ca=[],Gs=0,Ys=0;function Ni(){for(var e=Gs,t=Ys=Gs=0;t<e;){var a=Ca[t];Ca[t++]=null;var l=Ca[t];Ca[t++]=null;var r=Ca[t];Ca[t++]=null;var d=Ca[t];if(Ca[t++]=null,l!==null&&r!==null){var y=l.pending;y===null?r.next=r:(r.next=y.next,y.next=r),l.pending=r}d!==0&&bc(a,r,d)}}function yc(e,t,a,l){Ca[Gs++]=e,Ca[Gs++]=t,Ca[Gs++]=a,Ca[Gs++]=l,Ys|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function $o(e,t,a,l){return yc(e,t,a,l),Si(e)}function Sl(e,t){return yc(e,null,null,t),Si(e)}function bc(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var r=!1,d=e.return;d!==null;)d.childLanes|=a,l=d.alternate,l!==null&&(l.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(r=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,r&&t!==null&&(r=31-Jn(a),e=d.hiddenUpdates,l=e[r],l===null?e[r]=[t]:l.push(t),t.lane=a|536870912),d):null}function Si(e){if(50<iu)throw iu=0,_d=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Xs={};function vc(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,a,l){return new vc(e,t,a,l)}function zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ua(e,t){var a=e.alternate;return a===null?(a=qn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&1206910976,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function id(e,t){e.flags&=1206910978;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ki(e,t,a,l,r,d){var y=0;if(l=e,typeof l=="function")zo(l)&&(y=1);else if(typeof l=="string")y=wx(e,a,on.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case re:return e=qn(31,a,t,r),e.elementType=re,e.lanes=d,e;case Oe:return kl(a.children,r,d,t);case Ye:y=8,r|=24;break;case ue:return e=qn(12,a,t,r|2),e.elementType=ue,e.lanes=d,e;case Ae:return e=qn(13,a,t,r),e.elementType=Ae,e.lanes=d,e;case ze:return e=qn(19,a,t,r),e.elementType=ze,e.lanes=d,e;case Ne:case H:return e=r|32,e=qn(30,a,t,e),e.elementType=H,e.lanes=d,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Fe:y=10;break e;case pt:y=9;break e;case me:y=11;break e;case qe:y=14;break e;case Ve:y=16,l=null;break e}y=29,a=Error(f(130,e===null?"null":typeof e,"")),l=null}return t=qn(y,a,t,r),t.elementType=e,t.type=l,t.lanes=d,t}function kl(e,t,a,l){return e=qn(7,e,l,t),e.lanes=a,e}function Dr(e,t,a){return e=qn(6,e,null,t),e.lanes=a,e}function cd(e){var t=qn(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,a){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ci=new WeakMap;function qa(e,t){if(typeof e=="object"&&e!==null){var a=Ci.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ft(t)},Ci.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var Ks=[],Zs=0,Oo=null,Ro=0,Va=[],Wn=0,Xl=null,ea=1,Vn="";function bs(e,t){Ks[Zs++]=Ro,Ks[Zs++]=Oo,Oo=e,Ro=t}function xc(e,t,a){Va[Wn++]=ea,Va[Wn++]=Vn,Va[Wn++]=Xl,Xl=e;var l=ea;e=Vn;var r=32-Jn(l)-1;l&=~(1<<r),a+=1;var d=32-Jn(t)+r;if(30<d){var y=r-r%5;d=(l&(1<<y)-1).toString(32),l>>=y,r-=y,ea=1<<32-Jn(t)+r|a<<r|l,Vn=d+e}else ea=1<<d|a<<r|l,Vn=e}function fa(e){e.return!==null&&(bs(e,1),xc(e,1,0))}function Kl(e){for(;e===Oo;)Oo=Ks[--Zs],Ks[Zs]=null,Ro=Ks[--Zs],Ks[Zs]=null;for(;e===Xl;)Xl=Va[--Wn],Va[Wn]=null,Vn=Va[--Wn],Va[Wn]=null,ea=Va[--Wn],Va[Wn]=null}function vs(e,t){Va[Wn++]=ea,Va[Wn++]=Vn,Va[Wn++]=Xl,ea=t.id,Vn=t.overflow,Xl=e}var Mn=null,Vt=null,et=!1,Zl=null,pn=!1,xs=Error(f(519));function Gn(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mi(qa(t,e)),xs}function Do(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[zn]=e,t[da]=l,a){case"dialog":yt("cancel",t),yt("close",t);break;case"iframe":case"object":case"embed":yt("load",t);break;case"video":case"audio":for(a=0;a<ru.length;a++)yt(ru[a],t);break;case"source":yt("error",t);break;case"img":case"image":case"link":yt("error",t),yt("load",t);break;case"details":yt("toggle",t);break;case"input":yt("invalid",t),Ll(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":yt("invalid",t);break;case"textarea":yt("invalid",t),xr(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Mg(t.textContent,a)?(l.popover!=null&&(yt("beforetoggle",t),yt("toggle",t)),l.onScroll!=null&&yt("scroll",t),l.onScrollEnd!=null&&yt("scrollend",t),l.onClick!=null&&(t.onclick=vl),t=!0):t=!1,t||Gn(e,!0)}function Ei(e){for(Mn=e.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:pn=!1;return;case 27:case 3:pn=!0;return;default:Mn=Mn.return}}function Fs(e){if(e!==Mn)return!1;if(!et)return Ei(e),et=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Vh(e.type,e.memoizedProps)),a=!a),a&&Vt&&Gn(e),Ei(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Vt=Fg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Vt=Fg(e)}else t===27?(t=Vt,Wo(e.type)?(e=Jh,Jh=null,Vt=e):Vt=t):Vt=Mn?$l(e.stateNode.nextSibling):null;return!0}function Qs(){Vt=Mn=null,et=!1}function Br(){var e=Zl;return e!==null&&(Ka===null?Ka=e:Ka.push.apply(Ka,e),Zl=null),e}function Mi(e){Zl===null?Zl=[e]:Zl.push(e)}var wc=Be(null),Bo=null,Fl=null;function ol(e,t,a){Pe(wc,t._currentValue),t._currentValue=a}function Ql(e){e._currentValue=wc.current,ot(wc)}function jc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Nc(e,t,a,l){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var d=r.dependencies;if(d!==null){var y=r.child;d=d.firstContext;e:for(;d!==null;){var C=d;d=r;for(var O=0;O<t.length;O++)if(C.context===t[O]){d.lanes|=a,C=d.alternate,C!==null&&(C.lanes|=a),jc(d.return,a,e),l||(y=null);break e}d=C.next}}else if(r.tag===18){if(y=r.return,y===null)throw Error(f(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),jc(y,a,e),y=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=a,y=r.alternate,y!==null&&(y.lanes|=a),jc(r.return,a,e),y=r.child,y=y!==null?y.sibling:null):y=r.child;if(y!==null)y.return=r;else for(y=r;y!==null;){if(y===e){y=null;break}if(r=y.sibling,r!==null){r.return=y.return,y=r;break}y=y.return}r=y}}function Hn(e,t,a,l){e=null;for(var r=t,d=!1;r!==null;){if(!d){if((r.flags&524288)!==0)d=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var y=r.alternate;if(y===null)throw Error(f(387));if(y=y.memoizedProps,y!==null){var C=r.type;Ma(r.pendingProps.value,y.value)||(e!==null?e.push(C):e=[C])}}else if(r===It.current){if(y=r.alternate,y===null)throw Error(f(387));y.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(or):e=[or])}r=r.return}return e!==null&&Nc(t,e,a,l),t.flags|=262144,e!==null}function Ai(e){for(e=e.firstContext;e!==null;){if(!Ma(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ws(e){Bo=e,Fl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yn(e){return Hr(Bo,e)}function vn(e,t){return Bo===null&&ws(e),Hr(e,t)}function Hr(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Fl===null){if(e===null)throw Error(f(308));Fl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fl=Fl.next=t;return a}var Lr=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Lf=n.unstable_scheduleCallback,_f=n.unstable_NormalPriority,xn={$$typeof:Fe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sc(){return{controller:new Lr,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Lf(_f,function(){e.controller.abort()})}function _r(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];a.indexOf(l)===-1&&a.push(l)}}}var zi=null;function Uf(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oi=null,Ur=0,Ps=0,Js=null;function rd(e,t){if(Oi===null){var a=Oi=[];Ur=0,Ps=Oh(),Js={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Ur++,t.then(Ri,Ri),t}function Ri(){if(--Ur===0&&(zi=null,Oi!==null)){Js!==null&&(Js.status="fulfilled");var e=Oi;Oi=null,Ps=0,Js=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ud(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(l.status="rejected",l.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),l}var qr=ae.S;ae.S=function(e,t){if(lg=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rd(e,t),zi!==null)for(var a=er;a!==null;)_r(a,zi),a=a.next;if(a=e.types,a!==null){for(var l=er;l!==null;)_r(l,a),l=l.next;if(Ps!==0){l=zi,l===null&&(l=zi=[]);for(var r=0;r<a.length;r++){var d=a[r];l.indexOf(d)===-1&&l.push(d)}}}qr!==null&&qr(e,t)};var js=Be(null);function Di(){var e=js.current;return e!==null?e:en.pooledCache}function kc(e,t){t===null?Pe(js,js.current):Pe(js,t.pool)}function dd(){var e=Di();return e===null?null:{parent:xn._currentValue,pool:e}}var Is=Error(f(460)),Tc=Error(f(474)),Bi=Error(f(542)),Hi={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cc(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(vl,vl),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ho(e),e===void 0&&!("reason"in t)?Error(f(600)):e;default:if(typeof t.status=="string")t.then(vl,vl);else{if(e=en,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=l}},function(l){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ho(e),e}throw eo=t,Is}}function Ws(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(eo=a,Is):a}}var eo=null;function lt(){if(eo===null)throw Error(f(459));var e=eo;return eo=null,e}function Ho(e){if(e===Is||e===Bi)throw Error(f(483))}var Lo=null,_o=0;function Li(e){var t=_o;return _o+=1,Lo===null&&(Lo=[]),Cc(Lo,e,t)}function Ns(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Tt(e,t){throw t.$$typeof===he?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Xn(e){function t(G,_){if(e){var F=G.deletions;F===null?(G.deletions=[_],G.flags|=16):F.push(_)}}function a(G,_){if(!e)return null;for(;_!==null;)t(G,_),_=_.sibling;return null}function l(G){for(var _=new Map;G!==null;)G.key===null?_.set(G.index,G):_.set(G.key,G),G=G.sibling;return _}function r(G,_){return G=Ua(G,_),G.index=0,G.sibling=null,G}function d(G,_,F){return G.index=F,e?(F=G.alternate,F!==null?(F=F.index,F<_?(G.flags|=2,_):F):(G.flags|=134217730,_)):(G.flags|=1048576,_)}function y(G){return e&&G.alternate===null&&(G.flags|=134217730),G}function C(G,_,F,le){return _===null||_.tag!==6?(_=Dr(F,G.mode,le),_.return=G,_):(_=r(_,F),_.return=G,_)}function O(G,_,F,le){var De=F.type;return De===Oe?(G=J(G,_,F.props.children,le,F.key),Ns(G,F),G):_!==null&&(_.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Ve&&Ws(De)===_.type)?(_=r(_,F.props),Ns(_,F),_.return=G,_):(_=ki(F.type,F.key,F.props,null,G.mode,le),Ns(_,F),_.return=G,_)}function Y(G,_,F,le){return _===null||_.tag!==4||_.stateNode.containerInfo!==F.containerInfo||_.stateNode.implementation!==F.implementation?(_=Ti(F,G.mode,le),_.return=G,_):(_=r(_,F.children||[]),_.return=G,_)}function J(G,_,F,le,De){return _===null||_.tag!==7?(_=kl(F,G.mode,le,De),_.return=G,_):(_=r(_,F),_.return=G,_)}function oe(G,_,F){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Dr(""+_,G.mode,F),_.return=G,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case fe:return F=ki(_.type,_.key,_.props,null,G.mode,F),Ns(F,_),F.return=G,F;case pe:return _=Ti(_,G.mode,F),_.return=G,_;case Ve:return _=Ws(_),oe(G,_,F)}if(U(_)||Ce(_))return _=kl(_,G.mode,F,null),_.return=G,_;if(typeof _.then=="function")return oe(G,Li(_),F);if(_.$$typeof===Fe)return oe(G,vn(G,_),F);Tt(G,_)}return null}function q(G,_,F,le){var De=_!==null?_.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return De!==null?null:C(G,_,""+F,le);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case fe:return F.key===De?O(G,_,F,le):null;case pe:return F.key===De?Y(G,_,F,le):null;case Ve:return F=Ws(F),q(G,_,F,le)}if(U(F)||Ce(F))return De!==null?null:J(G,_,F,le,null);if(typeof F.then=="function")return q(G,_,Li(F),le);if(F.$$typeof===Fe)return q(G,_,vn(G,F),le);Tt(G,F)}return null}function P(G,_,F,le,De){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(F)||null,C(_,G,""+le,De);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case fe:return G=G.get(le.key===null?F:le.key)||null,O(_,G,le,De);case pe:return G=G.get(le.key===null?F:le.key)||null,Y(_,G,le,De);case Ve:return le=Ws(le),P(G,_,F,le,De)}if(U(le)||Ce(le))return G=G.get(F)||null,J(_,G,le,De,null);if(typeof le.then=="function")return P(G,_,F,Li(le),De);if(le.$$typeof===Fe)return P(G,_,F,vn(_,le),De);Tt(_,le)}return null}function Te(G,_,F,le){for(var De=null,wt=null,Ue=_,Ke=_=0,Qn=null;Ue!==null&&Ke<F.length;Ke++){Ue.index>Ke?(Qn=Ue,Ue=null):Qn=Ue.sibling;var Ct=q(G,Ue,F[Ke],le);if(Ct===null){Ue===null&&(Ue=Qn);break}e&&Ue&&Ct.alternate===null&&t(G,Ue),_=d(Ct,_,Ke),wt===null?De=Ct:wt.sibling=Ct,wt=Ct,Ue=Qn}if(Ke===F.length)return a(G,Ue),et&&bs(G,Ke),De;if(Ue===null){for(;Ke<F.length;Ke++)Ue=oe(G,F[Ke],le),Ue!==null&&(_=d(Ue,_,Ke),wt===null?De=Ue:wt.sibling=Ue,wt=Ue);return et&&bs(G,Ke),De}for(Ue=l(Ue);Ke<F.length;Ke++)Qn=P(Ue,G,Ke,F[Ke],le),Qn!==null&&(e&&(Ct=Qn.alternate,Ct!==null&&Ue.delete(Ct.key===null?Ke:Ct.key)),_=d(Qn,_,Ke),wt===null?De=Qn:wt.sibling=Qn,wt=Qn);return e&&Ue.forEach(function(li){return t(G,li)}),et&&bs(G,Ke),De}function He(G,_,F,le){if(F==null)throw Error(f(151));for(var De=null,wt=null,Ue=_,Ke=_=0,Qn=null,Ct=F.next();Ue!==null&&!Ct.done;Ke++,Ct=F.next()){Ue.index>Ke?(Qn=Ue,Ue=null):Qn=Ue.sibling;var li=q(G,Ue,Ct.value,le);if(li===null){Ue===null&&(Ue=Qn);break}e&&Ue&&li.alternate===null&&t(G,Ue),_=d(li,_,Ke),wt===null?De=li:wt.sibling=li,wt=li,Ue=Qn}if(Ct.done)return a(G,Ue),et&&bs(G,Ke),De;if(Ue===null){for(;!Ct.done;Ke++,Ct=F.next())Ct=oe(G,Ct.value,le),Ct!==null&&(_=d(Ct,_,Ke),wt===null?De=Ct:wt.sibling=Ct,wt=Ct);return et&&bs(G,Ke),De}for(Ue=l(Ue);!Ct.done;Ke++,Ct=F.next())Ct=P(Ue,G,Ke,Ct.value,le),Ct!==null&&(e&&(Qn=Ct.alternate,Qn!==null&&Ue.delete(Qn.key===null?Ke:Qn.key)),_=d(Ct,_,Ke),wt===null?De=Ct:wt.sibling=Ct,wt=Ct);return e&&Ue.forEach(function(Ox){return t(G,Ox)}),et&&bs(G,Ke),De}function st(G,_,F,le){if(typeof F=="object"&&F!==null&&F.type===Oe&&F.key===null&&F.props.ref===void 0&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case fe:e:{for(var De=F.key;_!==null;){if(_.key===De){if(De=F.type,De===Oe){if(_.tag===7){a(G,_.sibling),le=r(_,F.props.children),Ns(le,F),le.return=G,G=le;break e}}else if(_.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Ve&&Ws(De)===_.type){a(G,_.sibling),le=r(_,F.props),Ns(le,F),le.return=G,G=le;break e}a(G,_);break}else t(G,_);_=_.sibling}F.type===Oe?(le=kl(F.props.children,G.mode,le,F.key),Ns(le,F),le.return=G,G=le):(le=ki(F.type,F.key,F.props,null,G.mode,le),Ns(le,F),le.return=G,G=le)}return y(G);case pe:e:{for(De=F.key;_!==null;){if(_.key===De)if(_.tag===4&&_.stateNode.containerInfo===F.containerInfo&&_.stateNode.implementation===F.implementation){a(G,_.sibling),le=r(_,F.children||[]),le.return=G,G=le;break e}else{a(G,_);break}else t(G,_);_=_.sibling}le=Ti(F,G.mode,le),le.return=G,G=le}return y(G);case Ve:return F=Ws(F),st(G,_,F,le)}if(U(F))return Te(G,_,F,le);if(Ce(F)){if(De=Ce(F),typeof De!="function")throw Error(f(150));return F=De.call(F),He(G,_,F,le)}if(typeof F.then=="function")return st(G,_,Li(F),le);if(F.$$typeof===Fe)return st(G,_,vn(G,F),le);Tt(G,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,_!==null&&_.tag===6?(a(G,_.sibling),le=r(_,F),le.return=G,G=le):(a(G,_),le=Dr(F,G.mode,le),le.return=G,G=le),y(G)):a(G,_)}return function(G,_,F,le){try{_o=0;var De=st(G,_,F,le);return Lo=null,De}catch(Ue){if(Ue===Is||Ue===Bi)throw Ue;var wt=qn(29,Ue,null,G.mode);return wt.lanes=le,wt.return=G,wt}finally{}}}var wn=Xn(!0),Ss=Xn(!1),Tl=!1;function Uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ec(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 Cl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ks(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Bt&2)!==0){var r=l.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=Si(e),bc(e,null,a),t}return yc(e,l,t,a),Si(e)}function to(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,we(e,a)}}function Vr(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var r=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?r=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?r=d=t:d=d.next=t}else r=d=t;a={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Mc=!1;function qo(){if(Mc){var e=Js;if(e!==null)throw e}}function _i(e,t,a,l){Mc=!1;var r=e.updateQueue;Tl=!1;var d=r.firstBaseUpdate,y=r.lastBaseUpdate,C=r.shared.pending;if(C!==null){r.shared.pending=null;var O=C,Y=O.next;O.next=null,y===null?d=Y:y.next=Y,y=O;var J=e.alternate;J!==null&&(J=J.updateQueue,C=J.lastBaseUpdate,C!==y&&(C===null?J.firstBaseUpdate=Y:C.next=Y,J.lastBaseUpdate=O))}if(d!==null){var oe=r.baseState;y=0,J=Y=O=null,C=d;do{var q=C.lane&-536870913,P=q!==C.lane;if(P?(xt&q)===q:(l&q)===q){q!==0&&q===Ps&&(Mc=!0),J!==null&&(J=J.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Te=e,He=C;q=t;var st=a;switch(He.tag){case 1:if(Te=He.payload,typeof Te=="function"){oe=Te.call(st,oe,q);break e}oe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=He.payload,q=typeof Te=="function"?Te.call(st,oe,q):Te,q==null)break e;oe=ie({},oe,q);break e;case 2:Tl=!0}}q=C.callback,q!==null&&(e.flags|=64,P&&(e.flags|=8192),P=r.callbacks,P===null?r.callbacks=[q]:P.push(q))}else P={lane:q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},J===null?(Y=J=P,O=oe):J=J.next=P,y|=q;if(C=C.next,C===null){if(C=r.shared.pending,C===null)break;P=C,C=P.next,P.next=null,r.lastBaseUpdate=P,r.shared.pending=null}}while(!0);J===null&&(O=oe),r.baseState=O,r.firstBaseUpdate=Y,r.lastBaseUpdate=J,d===null&&(r.shared.lanes=0),Qo|=y,e.lanes=y,e.memoizedState=oe}}function Ui(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function hd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ui(a[e],t)}var il=Be(null),no=Be(0);function qf(e,t){e=co,Pe(no,e),Pe(il,t),co=e|t.baseLanes}function ao(){Pe(no,co),Pe(il,il.current)}function Ac(){co=no.current,ot(il),ot(no)}var Kn=Be(null),Zn=null;function oa(e){var t=e.alternate;Pe(Dt,Dt.current&1),Pe(Kn,e),Zn===null&&(t===null||il.current!==null||t.memoizedState!==null)&&(Zn=e)}function Vo(e){Pe(Dt,Dt.current),Pe(Kn,e),Zn===null&&(Zn=e)}function $c(e){e.tag===22?(Pe(Dt,Dt.current),Pe(Kn,e),Zn===null&&(Zn=e)):El()}function El(){Pe(Dt,Dt.current),Pe(Kn,Kn.current)}function ia(e){ot(Kn),Zn===e&&(Zn=null),ot(Dt)}var Dt=Be(0);function ta(e,t){Pe(Kn,Kn.current),Pe(Dt,t)}function qi(e){ot(Dt),ot(Kn),Zn===e&&(Zn=null)}function zc(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Qh(a)||Ph(a)))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 Pl=0,tt=null,_t=null,An=null,Go=!1,Ts=!1,Cs=!1,Vi=0,Yo=0,Gi=null,Wm=0;function un(){throw Error(f(321))}function Oc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ma(e[a],t[a]))return!1;return!0}function na(e,t,a,l,r,d){return Pl=d,tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ae.H=e===null||e.memoizedState===null?op:ip,Cs=!1,d=a(l,r),Cs=!1,Ts&&(d=Yr(t,a,l,r)),Gr(e),d}function Gr(e){ae.H=vd;var t=_t!==null&&_t.next!==null;if(Pl=0,An=_t=tt=null,Go=!1,Yo=0,Gi=null,t)throw Error(f(300));e===null||Fn||(e=e.dependencies,e!==null&&Ai(e)&&(Fn=!0))}function Yr(e,t,a,l){tt=e;var r=0;do{if(Ts&&(Gi=null),Yo=0,Ts=!1,25<=r)throw Error(f(301));if(r+=1,An=_t=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}ae.H=cv,d=t(a,l)}while(Ts);return d}function Rc(){var e=ae.H,t=e.useState()[0];return t=typeof t.then=="function"?Xo(t):t,e=e.useState()[0],(_t!==null?_t.memoizedState:null)!==e&&(tt.flags|=1024),t}function Dc(){var e=Vi!==0;return Vi=0,e}function Bc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Hc(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Pl=0,An=_t=tt=null,Ts=!1,Yo=Vi=0,Gi=null}function ca(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?tt.memoizedState=An=e:An=An.next=e,An}function gn(){if(_t===null){var e=tt.alternate;e=e!==null?e.memoizedState:null}else e=_t.next;var t=An===null?tt.memoizedState:An.next;if(t!==null)An=t,_t=e;else{if(e===null)throw tt.alternate===null?Error(f(467)):Error(f(310));_t=e,e={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},An===null?tt.memoizedState=An=e:An=An.next=e}return An}function Yi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xo(e){var t=Yo;return Yo+=1,Gi===null&&(Gi=[]),e=Cc(Gi,e,t),t=tt,(An===null?t.memoizedState:An.next)===null&&(t=t.alternate,ae.H=t===null||t.memoizedState===null?op:ip),e}function Xi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xo(e);if(e.$$typeof===se)return;if(e.$$typeof===Fe)return Yn(e)}throw Error(f(438,String(e)))}function Lc(e){var t=null,a=tt.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=tt.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Yi(),tt.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=at;return t.index++,a}function Ml(e,t){return typeof t=="function"?t(e):t}function Ki(e){var t=gn();return _c(t,_t,e)}function _c(e,t,a){var l=e.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=a;var r=e.baseQueue,d=l.pending;if(d!==null){if(r!==null){var y=r.next;r.next=d.next,d.next=y}t.baseQueue=r=d,l.pending=null}if(d=e.baseState,r===null)e.memoizedState=d;else{t=r.next;var C=y=null,O=null,Y=t,J=!1;do{var oe=Y.lane&-536870913;if(oe!==Y.lane?(xt&oe)===oe:(Pl&oe)===oe){var q=Y.revertLane;if(q===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),oe===Ps&&(J=!0);else if((Pl&q)===q){Y=Y.next,q===Ps&&(J=!0);continue}else oe={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},O===null?(C=O=oe,y=d):O=O.next=oe,tt.lanes|=q,Qo|=q;oe=Y.action,Cs&&a(d,oe),d=Y.hasEagerState?Y.eagerState:a(d,oe)}else q={lane:oe,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},O===null?(C=O=q,y=d):O=O.next=q,tt.lanes|=oe,Qo|=oe;Y=Y.next}while(Y!==null&&Y!==t);if(O===null?y=d:O.next=C,!Ma(d,e.memoizedState)&&(Fn=!0,J&&(a=Js,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=O,l.lastRenderedState=d}return r===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Uc(e){var t=gn(),a=t.queue;if(a===null)throw Error(f(311));a.lastRenderedReducer=e;var l=a.dispatch,r=a.pending,d=t.memoizedState;if(r!==null){a.pending=null;var y=r=r.next;do d=e(d,y.action),y=y.next;while(y!==r);Ma(d,t.memoizedState)||(Fn=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,l]}function Xr(e,t,a){var l=tt,r=gn(),d=et;if(d){if(a===void 0)throw Error(f(407));a=a()}else a=t();var y=!Ma((_t||r).memoizedState,a);if(y&&(r.memoizedState=a,Fn=!0),r=r.queue,Yt(Fr.bind(null,l,r,e),[e]),e=r.getSnapshot!==t||y||An!==null&&(An.memoizedState.tag&1)!==0,Ze(e?9:8,{destroy:void 0},Zr.bind(null,l,r,a,t),null),e){if(l.flags|=2048,en===null)throw Error(f(349));d||(Pl&127)!==0||Kr(l,t,a)}return a}function Kr(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=tt.updateQueue,t===null?(t=Yi(),tt.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Zr(e,t,a,l){t.value=a,t.getSnapshot=l,Qr(t)&&Pr(e)}function Fr(e,t,a){return a(function(){Qr(t)&&Pr(e)})}function Qr(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ma(e,a)}catch{return!0}}function Pr(e){var t=Sl(e,2);t!==null&&Za(t,e,2)}function qc(e){var t=ca();if(typeof e=="function"){var a=e;if(e=a(),Cs){wa(!0);try{a()}finally{wa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:e},t}function Jr(e,t,a,l){return e.baseState=a,_c(e,_t,typeof l=="function"?l:Ml)}function md(e,t,a,l,r){if(bd(e))throw Error(f(485));if(e=t.action,e!==null){var d={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};ae.T!==null?a(!0):d.isTransition=!1,l(d),a=t.pending,a===null?(d.next=t.pending=d,c(t,d)):(d.next=a.next,t.pending=a.next=d)}}function c(e,t){var a=t.action,l=t.payload,r=e.state;if(t.isTransition){var d=ae.T,y={};y.types=d!==null?d.types:null,ae.T=y;try{var C=a(r,l),O=ae.S;O!==null&&O(y,C),h(e,t,C)}catch(Y){x(e,t,Y)}finally{d!==null&&y.types!==null&&(d.types=y.types),ae.T=d}}else try{d=a(r,l),h(e,t,d)}catch(Y){x(e,t,Y)}}function h(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){g(e,t,l)},function(l){return x(e,t,l)}):g(e,t,a)}function g(e,t,a){t.status="fulfilled",t.value=a,T(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,c(e,a)))}function x(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,T(t),t=t.next;while(t!==l)}e.action=null}function T(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function A(e,t){return t}function L(e,t){if(et){var a=en.formState;if(a!==null){e:{var l=tt;if(et){if(Vt){t:{for(var r=Vt,d=pn;r.nodeType!==8;){if(!d){r=null;break t}if(r=$l(r.nextSibling),r===null){r=null;break t}}d=r.data,r=d==="F!"||d==="F"?r:null}if(r){Vt=$l(r.nextSibling),l=r.data==="F!";break e}}Gn(l)}l=!1}l&&(t=a[0])}}return a=ca(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:t},a.queue=l,a=ap.bind(null,tt,l),l.dispatch=a,l=qc(!1),d=Gf.bind(null,tt,!1,l.queue),l=ca(),r={state:t,dispatch:null,action:e,pending:null},l.queue=r,a=md.bind(null,tt,r,d,a),r.dispatch=a,l.memoizedState=e,[t,a,!1]}function W(e){var t=gn();return ke(t,_t,e)}function ke(e,t,a){if(t=_c(e,t,A)[0],e=Ki(Ml)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Xo(t)}catch(y){throw y===Is?Bi:y}else l=t;t=gn();var r=t.queue,d=r.dispatch;return a!==t.memoizedState&&(tt.flags|=2048,Ze(9,{destroy:void 0},Ee.bind(null,r,a),null)),[l,d,e]}function Ee(e,t){e.action=t}function $e(e){var t=gn(),a=_t;if(a!==null)return ke(t,a,e);gn(),t=t.memoizedState,a=gn();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Ze(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=tt.updateQueue,t===null&&(t=Yi(),tt.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function ln(){return gn().memoizedState}function je(e,t,a,l){var r=ca();tt.flags|=e,r.memoizedState=Ze(1|t,{destroy:void 0},a,l===void 0?null:l)}function Gt(e,t,a,l){var r=gn();l=l===void 0?null:l;var d=r.memoizedState.inst;_t!==null&&l!==null&&Oc(l,_t.memoizedState.deps)?r.memoizedState=Ze(t,d,a,l):(tt.flags|=e,r.memoizedState=Ze(1|t,d,a,l))}function Ln(e,t){je(8390656,8,e,t)}function Yt(e,t){Gt(2048,8,e,t)}function Es(e){tt.flags|=4;var t=tt.updateQueue;if(t===null)t=Yi(),tt.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Xe(e){var t=gn().memoizedState;return Es({ref:t,nextImpl:e}),function(){if((Bt&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function Pt(e,t){return Gt(4,2,e,t)}function ht(e,t){return Gt(4,4,e,t)}function ha(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function aa(e,t,a){a=a!=null?a.concat([e]):null,Gt(4,4,ha.bind(null,t,e),a)}function lo(){}function Mt(e,t){var a=gn();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Oc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function so(e,t){var a=gn();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Oc(t,l[1]))return l[0];if(l=e(),Cs){wa(!0);try{e()}finally{wa(!1)}}return a.memoizedState=[l,t],l}function Ga(e,t,a){return a===void 0||(Pl&1073741824)!==0&&(xt&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=og(),tt.lanes|=e,Qo|=e,a)}function Zi(e,t,a,l){return Ma(a,t)?a:il.current!==null?(e=Ga(e,a,l),Ma(e,t)||(Fn=!0),e):(Pl&106)===0||(Pl&1073741824)!==0&&(xt&261930)===0?(Fn=!0,e.memoizedState=a):(e=og(),tt.lanes|=e,Qo|=e,t)}function pd(e,t,a,l,r){var d=ge.p;ge.p=d!==0&&8>d?d:8;var y=ae.T,C={};C.types=y!==null?y.types:null,ae.T=C,Gf(e,!1,t,a);try{var O=r(),Y=ae.S;if(Y!==null&&Y(C,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var J=ud(O,l);Ir(e,t,J,dl(e))}else Ir(e,t,l,dl(e))}catch(oe){Ir(e,t,{then:function(){},status:"rejected",reason:oe},dl())}finally{ge.p=d,y!==null&&C.types!==null&&(y.types=C.types),ae.T=y}}function gd(){}function Fi(e,t,a,l){if(e.tag!==5)throw Error(f(476));var r=yd(e).queue;pd(e,r,t,Et,a===null?gd:function(){return ep(e),a(l)})}function yd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Et,baseState:Et,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:Et},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ep(e){var t=yd(e);t.next===null&&(t=e.alternate.memoizedState),Ir(e,t.next.queue,{},dl())}function Vf(){return Yn(or)}function tp(){return gn().memoizedState}function np(){return gn().memoizedState}function ov(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=dl();e=Cl(a);var l=ks(t,e,a);l!==null&&(Za(l,t,a),to(l,t,a)),t={cache:Sc()},e.payload=t;return}t=t.return}}function iv(e,t,a){var l=dl();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bd(e)?lp(t,a):(a=$o(e,t,a,l),a!==null&&(Za(a,e,l),sp(a,t,l)))}function ap(e,t,a){var l=dl();Ir(e,t,a,l)}function Ir(e,t,a,l){var r={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(bd(e))lp(t,r);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,C=d(y,a);if(r.hasEagerState=!0,r.eagerState=C,Ma(C,y))return yc(e,t,r,0),en===null&&Ni(),!1}catch{}finally{}if(a=$o(e,t,r,l),a!==null)return Za(a,e,l),sp(a,t,l),!0}return!1}function Gf(e,t,a,l){if(l={lane:2,revertLane:Oh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},bd(e)){if(t)throw Error(f(479))}else t=$o(e,a,l,2),t!==null&&Za(t,e,2)}function bd(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function lp(e,t){Ts=Go=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sp(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,we(e,a)}}var vd={readContext:Yn,use:Xi,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useLayoutEffect:un,useInsertionEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useSyncExternalStore:un,useId:un,useHostTransitionStatus:un,useFormState:un,useActionState:un,useOptimistic:un,useMemoCache:un,useCacheRefresh:un,useEffectEvent:un},op={readContext:Yn,use:Xi,useCallback:function(e,t){return ca().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:Ln,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,je(4194308,4,ha.bind(null,t,e),a)},useLayoutEffect:function(e,t){return je(4194308,4,e,t)},useInsertionEffect:function(e,t){je(4,2,e,t)},useMemo:function(e,t){var a=ca();t=t===void 0?null:t;var l=e();if(Cs){wa(!0);try{e()}finally{wa(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=ca();if(a!==void 0){var r=a(t);if(Cs){wa(!0);try{a(t)}finally{wa(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=iv.bind(null,tt,e),[l.memoizedState,e]},useRef:function(e){var t=ca();return e={current:e},t.memoizedState=e},useState:function(e){e=qc(e);var t=e.queue,a=ap.bind(null,tt,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:lo,useDeferredValue:function(e,t){var a=ca();return Ga(a,e,t)},useTransition:function(){var e=qc(!1);return e=pd.bind(null,tt,e.queue,!0,!1),ca().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=tt,r=ca();if(et){if(a===void 0)throw Error(f(407));a=a()}else{if(a=t(),en===null)throw Error(f(349));(xt&127)!==0||Kr(l,t,a)}r.memoizedState=a;var d={value:a,getSnapshot:t};return r.queue=d,Ln(Fr.bind(null,l,d,e),[e]),l.flags|=2048,Ze(9,{destroy:void 0},Zr.bind(null,l,d,a,t),null),a},useId:function(){var e=ca(),t=en.identifierPrefix;if(et){var a=Vn,l=ea;a=(l&~(1<<32-Jn(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Vi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Wm++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vf,useFormState:L,useActionState:L,useOptimistic:function(e){var t=ca();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Gf.bind(null,tt,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lc,useCacheRefresh:function(){return ca().memoizedState=ov.bind(null,tt)},useEffectEvent:function(e){var t=ca(),a={impl:e};return t.memoizedState=a,function(){if((Bt&2)!==0)throw Error(f(440));return a.impl.apply(void 0,arguments)}}},ip={readContext:Yn,use:Xi,useCallback:Mt,useContext:Yn,useEffect:Yt,useImperativeHandle:aa,useInsertionEffect:Pt,useLayoutEffect:ht,useMemo:so,useReducer:Ki,useRef:ln,useState:function(){return Ki(Ml)},useDebugValue:lo,useDeferredValue:function(e,t){var a=gn();return Zi(a,_t.memoizedState,e,t)},useTransition:function(){var e=Ki(Ml)[0],t=gn().memoizedState;return[typeof e=="boolean"?e:Xo(e),t]},useSyncExternalStore:Xr,useId:tp,useHostTransitionStatus:Vf,useFormState:W,useActionState:W,useOptimistic:function(e,t){var a=gn();return Jr(a,_t,e,t)},useMemoCache:Lc,useCacheRefresh:np,useEffectEvent:Xe},cv={readContext:Yn,use:Xi,useCallback:Mt,useContext:Yn,useEffect:Yt,useImperativeHandle:aa,useInsertionEffect:Pt,useLayoutEffect:ht,useMemo:so,useReducer:Uc,useRef:ln,useState:function(){return Uc(Ml)},useDebugValue:lo,useDeferredValue:function(e,t){var a=gn();return _t===null?Ga(a,e,t):Zi(a,_t.memoizedState,e,t)},useTransition:function(){var e=Uc(Ml)[0],t=gn().memoizedState;return[typeof e=="boolean"?e:Xo(e),t]},useSyncExternalStore:Xr,useId:tp,useHostTransitionStatus:Vf,useFormState:$e,useActionState:$e,useOptimistic:function(e,t){var a=gn();return _t!==null?Jr(a,_t,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lc,useCacheRefresh:np,useEffectEvent:Xe};function Yf(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:ie({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Xf={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=dl(),r=Cl(l);r.payload=t,a!=null&&(r.callback=a),t=ks(e,r,l),t!==null&&(Za(t,e,l),to(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=dl(),r=Cl(l);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=ks(e,r,l),t!==null&&(Za(t,e,l),to(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=dl(),l=Cl(a);l.tag=2,t!=null&&(l.callback=t),t=ks(e,l,a),t!==null&&(Za(t,e,a),to(t,e,a))}};function cp(e,t,a,l,r,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,y):t.prototype&&t.prototype.isPureReactComponent?!_a(a,l)||!_a(r,d):!0}function rp(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Xf.enqueueReplaceState(t,t.state,null)}function Qi(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=ie({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function up(e){gc(e)}function dp(e){console.error(e)}function fp(e){gc(e)}function xd(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function hp(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Kf(e,t,a){return a=Cl(a),a.tag=3,a.payload={element:null},a.callback=function(){xd(e,t)},a}function mp(e){return e=Cl(e),e.tag=3,e}function pp(e,t,a,l){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var d=l.value;e.payload=function(){return r(d)},e.callback=function(){hp(t,a,l)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){hp(t,a,l),typeof r!="function"&&(Po===null?Po=new Set([this]):Po.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})})}function rv(e,t,a,l,r){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Hn(t,a,r,!0),a=Kn.current,a!==null){switch(a.tag){case 31:case 13:case 19:return Zn===null?qd():a.alternate===null&&$n===0&&($n=3),a.flags&=-257,a.flags|=65536,a.lanes=r,l===Hi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Ah(e,l,r)),!1;case 22:return a.flags|=65536,l===Hi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Ah(e,l,r)),!1}throw Error(f(435,a.tag))}return Ah(e,l,r),qd(),!1}if(et)return t=Kn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,l!==xs&&(e=Error(f(422),{cause:l}),Mi(qa(e,a)))):(l!==xs&&(t=Error(f(423),{cause:l}),Mi(qa(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,l=qa(l,a),r=Kf(e.stateNode,l,r),Vr(e,r),$n!==4&&($n=2)),!1;var d=Error(f(520),{cause:l});if(d=qa(d,a),ou===null?ou=[d]:ou.push(d),$n!==4&&($n=2),t===null)return!0;l=qa(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Kf(a.stateNode,l,e),Vr(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Po===null||!Po.has(d))))return a.flags|=65536,r&=-r,a.lanes|=r,r=mp(r),pp(r,e,a,l),Vr(a,r),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Zf=Error(f(461)),Fn=!1;function la(e,t,a,l){t.child=e===null?Ss(t,null,a,l):wn(t,e.child,a,l)}function gp(e,t,a,l,r){a=a.render;var d=t.ref;if("ref"in l){var y={};for(var C in l)C!=="ref"&&(y[C]=l[C])}else y=l;return ws(t),l=na(e,t,a,y,d,r),C=Dc(),e!==null&&!Fn?(Bc(e,t,r),oo(e,t,r)):(et&&C&&fa(t),t.flags|=1,la(e,t,l,r),t.child)}function yp(e,t,a,l,r){if(e===null){var d=a.type;return typeof d=="function"&&!zo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,bp(e,t,d,l,r)):(e=ki(a.type,null,l,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!th(e,r)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:_a,a(y,l)&&e.ref===t.ref)return oo(e,t,r)}return t.flags|=1,e=Ua(d,l),e.ref=t.ref,e.return=t,t.child=e}function bp(e,t,a,l,r){if(e!==null){var d=e.memoizedProps;if(_a(d,l)&&e.ref===t.ref)if(Fn=!1,t.pendingProps=l=d,th(e,r))(e.flags&131072)!==0&&(Fn=!0);else return t.lanes=e.lanes,oo(e,t,r)}return Ff(e,t,a,l,r)}function vp(e,t,a,l){var r=l.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(l=t.child=e.child,r=0;l!==null;)r=r|l.lanes|l.childLanes,l=l.sibling;l=r&~d}else l=0,t.child=null;return xp(e,t,d,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&kc(t,d!==null?d.cachePool:null),d!==null?qf(t,d):ao(),$c(t);else return l=t.lanes=536870912,xp(e,t,d!==null?d.baseLanes|a:a,a,l)}else d!==null?(kc(t,d.cachePool),qf(t,d),El(),t.memoizedState=null):(e!==null&&kc(t,null),ao(),El());return la(e,t,r,a),t.child}function Wr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function xp(e,t,a,l,r){var d=Di();return d=d===null?null:{parent:xn._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&kc(t,null),ao(),$c(t),e!==null&&Hn(e,t,l,!0),t.childLanes=r,null}function wd(e,t){return t=jd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wp(e,t,a){return wn(t,e.child,null,a),e=wd(t,t.pendingProps),e.flags|=2,ia(t),t.memoizedState=null,e}function uv(e,t,a){var l=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(l.mode==="hidden")return e=wd(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Wr(null,e);if(Vo(t),(e=Vt)?(e=Zg(e,pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xl!==null?{id:ea,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=cd(e),a.return=t,t.child=a,Mn=t,Vt=null)):e=null,e===null)throw Gn(t);return t.lanes=536870912,null}return wd(t,l)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(Vo(t),r)if(t.flags&256)t.flags&=-257,t=wp(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(Fn||Hn(e,t,a,!1),r=(a&e.childLanes)!==0,Fn||r){if(il.current===null){if(l=en,l!==null&&(y=Me(l,a),y!==0&&y!==d.retryLane))throw d.retryLane=y,Sl(e,y),Za(l,e,y),Zf;qd()}t=wp(e,t,a)}else e=d.treeContext,Vt=$l(y.nextSibling),Mn=t,et=!0,Zl=null,pn=!1,e!==null&&vs(t,e),t=wd(t,l),t.flags|=134221824;return t}return e=Ua(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(f(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ff(e,t,a,l,r){return ws(t),a=na(e,t,a,l,void 0,r),l=Dc(),e!==null&&!Fn?(Bc(e,t,r),oo(e,t,r)):(et&&l&&fa(t),t.flags|=1,la(e,t,a,r),t.child)}function jp(e,t,a,l,r,d){return ws(t),t.updateQueue=null,a=Yr(t,l,a,r),Gr(e),l=Dc(),e!==null&&!Fn?(Bc(e,t,d),oo(e,t,d)):(et&&l&&fa(t),t.flags|=1,la(e,t,a,d),t.child)}function Np(e,t,a,l,r){if(ws(t),t.stateNode===null){var d=Xs,y=a.contextType;typeof y=="object"&&y!==null&&(d=Yn(y)),d=new a(l,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Xf,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=l,d.state=t.memoizedState,d.refs={},Uo(t),y=a.contextType,d.context=typeof y=="object"&&y!==null?Yn(y):Xs,d.state=t.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(Yf(t,a,y,l),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&Xf.enqueueReplaceState(d,d.state,null),_i(t,l,d,r),qo(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){d=t.stateNode;var C=t.memoizedProps,O=Qi(a,C);d.props=O;var Y=d.context,J=a.contextType;y=Xs,typeof J=="object"&&J!==null&&(y=Yn(J));var oe=a.getDerivedStateFromProps;J=typeof oe=="function"||typeof d.getSnapshotBeforeUpdate=="function",C=t.pendingProps!==C,J||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(C||Y!==y)&&rp(t,d,l,y),Tl=!1;var q=t.memoizedState;d.state=q,_i(t,l,d,r),qo(),Y=t.memoizedState,C||q!==Y||Tl?(typeof oe=="function"&&(Yf(t,a,oe,l),Y=t.memoizedState),(O=Tl||cp(t,a,O,l,q,Y,y))?(J||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=Y),d.props=l,d.state=Y,d.context=y,l=O):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{d=t.stateNode,Ec(e,t),y=t.memoizedProps,J=Qi(a,y),d.props=J,oe=t.pendingProps,q=d.context,Y=a.contextType,O=Xs,typeof Y=="object"&&Y!==null&&(O=Yn(Y)),C=a.getDerivedStateFromProps,(Y=typeof C=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==oe||q!==O)&&rp(t,d,l,O),Tl=!1,q=t.memoizedState,d.state=q,_i(t,l,d,r),qo();var P=t.memoizedState;y!==oe||q!==P||Tl||e!==null&&e.dependencies!==null&&Ai(e.dependencies)?(typeof C=="function"&&(Yf(t,a,C,l),P=t.memoizedState),(J=Tl||cp(t,a,J,l,q,P,O)||e!==null&&e.dependencies!==null&&Ai(e.dependencies))?(Y||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,P,O),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,P,O)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=P),d.props=l,d.state=P,d.context=O,l=J):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),l=!1)}return d=l,Vc(e,t),l=(t.flags&128)!==0,d||l?(d=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&l?(t.child=wn(t,e.child,null,r),t.child=wn(t,null,a,r)):la(e,t,a,r),t.memoizedState=d.state,e=t.child):e=oo(e,t,r),e}function Sp(e,t,a,l){return Qs(),t.flags|=256,la(e,t,a,l),t.child}var Qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pf(e){return{baseLanes:e,cachePool:dd()}}function Jf(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ul),e}function kp(e,t,a){var l=t.pendingProps,r=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(Dt.current&2)!==0),y&&(r=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(r?oa(t):El(),(e=Vt)?(e=Zg(e,pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xl!==null?{id:ea,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=cd(e),a.return=t,t.child=a,Mn=t,Vt=null)):e=null,e===null)throw Gn(t);return Ph(e)?t.lanes=32:t.lanes=536870912,null}return d=l.children,l=l.fallback,r?(El(),r=t.mode,d=jd({mode:"hidden",children:d},r),l=kl(l,r,a,null),d.return=t,l.return=t,d.sibling=l,t.child=d,l=t.child,l.memoizedState=Pf(a),l.childLanes=Jf(e,y,a),t.memoizedState=Qf,Wr(null,l)):(oa(t),If(t,d))}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(O!==null)return dv(e,t,d,y,l,O,C,a)}return r?(El(),r=l.fallback,d=t.mode,C=e.child,O=C.sibling,l=Ua(C,{mode:"hidden",children:l.children}),l.subtreeFlags=C.subtreeFlags&1206910976,O!==null?r=Ua(O,r):(r=kl(r,d,a,null),r.flags|=2),r.return=t,l.return=t,l.sibling=r,t.child=l,Wr(null,l),l=t.child,r=e.child.memoizedState,r===null?r=Pf(a):(d=r.cachePool,d!==null?(C=xn._currentValue,d=d.parent!==C?{parent:C,pool:C}:d):d=dd(),r={baseLanes:r.baseLanes|a,cachePool:d}),l.memoizedState=r,l.childLanes=Jf(e,y,a),t.memoizedState=Qf,Wr(e.child,l)):(oa(t),a=e.child,e=a.sibling,a=Ua(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=a,t.memoizedState=null,a)}function If(e,t){return t=jd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jd(e,t){return e=qn(22,e,null,t),e.lanes=0,e}function Nd(e,t,a){return wn(t,e.child,null,a),e=If(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dv(e,t,a,l,r,d,y,C){if(a)return t.flags&256?(oa(t),t.flags&=-257,Nd(e,t,C)):t.memoizedState!==null?(El(),t.child=e.child,t.flags|=128,null):(El(),d=r.fallback,y=t.mode,r=jd({mode:"visible",children:r.children},y),d=kl(d,y,C,null),d.flags|=2,r.return=t,d.return=t,r.sibling=d,t.child=r,wn(t,e.child,null,C),r=t.child,r.memoizedState=Pf(C),r.childLanes=Jf(e,l,C),t.memoizedState=Qf,Wr(null,r));if(oa(t),Ph(d)){if(l=d.nextSibling&&d.nextSibling.dataset,l)var O=l.dgst;return l=O,l!==""&&(r=Error(f(419)),r.stack="",r.digest=l,Mi({value:r,source:null,stack:null})),Nd(e,t,C)}if(Fn||Hn(e,t,C,!1),l=(C&e.childLanes)!==0,Fn||l){if(il.current!==null)return Nd(e,t,C);if(l=en,l!==null&&(r=Me(l,C),r!==0&&r!==y.retryLane))throw y.retryLane=r,Sl(e,r),Za(l,e,r),Zf;return Qh(d)||qd(),Nd(e,t,C)}return Qh(d)?(t.flags|=192,t.child=e.child,null):(e=y.treeContext,Vt=$l(d.nextSibling),Mn=t,et=!0,Zl=null,pn=!1,e!==null&&vs(t,e),t=If(t,r.children),t.flags|=134221824,t)}function Tp(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),jc(e.return,t,a)}function Cp(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&zc(a)===null&&(t=e),e=e.sibling}return t}function Sd(e,t,a,l,r,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:r,treeForkCount:d}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=a,y.tailMode=r,y.treeForkCount=d)}function Wf(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function eh(e,t,a){var l=t.pendingProps,r=l.revealOrder,d=l.tail;l=l.children;var y=Dt.current;if(t.flags&128)return ta(t,y),null;var C=(y&2)!==0;if(C?(y=y&1|2,t.flags|=128):y&=1,ta(t,y),r==="backwards"&&e!==null?(Wf(e),la(e,t,l,a),Wf(e)):la(e,t,l,a),l=et?Ro:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tp(e,a,t);else if(e.tag===19)Tp(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":a=Cp(t.child),a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null,Wf(t)),Sd(t,!0,r,null,d,l);break;case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&zc(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Sd(t,!0,a,null,d,l);break;case"together":Sd(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:a=Cp(t.child),a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Sd(t,!1,r,a,d,l)}return t.child}function Ep(e,t,a){var l=t.pendingProps;return ol(t,t.type,l.value),la(e,t,l.children,a),t.child}function oo(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Qo|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Hn(e,t,a,!1),(a&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,a=Ua(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ua(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function th(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ai(e)))}function fv(e,t,a){switch(t.tag){case 3:xa(t,t.stateNode.containerInfo),ol(t,xn,e.memoizedState.cache),Qs();break;case 27:case 5:Z(t);break;case 4:xa(t,t.stateNode.containerInfo);break;case 10:ol(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vo(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return oa(t),t.flags|=128,null;l=Hn(e,t,a,!1);var r=t.child.childLanes;return l||(a&r)!==0?kp(e,t,a):(oa(t),e=oo(e,t,a),e!==null?e.sibling:null)}oa(t);break;case 19:if(t.flags&128)return eh(e,t,a);if(r=(e.flags&128)!==0,l=(a&t.childLanes)!==0,l||(Hn(e,t,a,!1),l=(a&t.childLanes)!==0),r){if(l)return eh(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ta(t,Dt.current),l)break;return null;case 22:return t.lanes=0,vp(e,t,a,t.pendingProps);case 24:ol(t,xn,e.memoizedState.cache)}return oo(e,t,a)}function Mp(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Fn=!0;else{if(!th(e,a)&&(t.flags&128)===0)return Fn=!1,fv(e,t,a);Fn=(e.flags&131072)!==0}else Fn=!1,et&&(t.flags&1048576)!==0&&xc(t,Ro,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ws(t.elementType),t.type=e,typeof e=="function")zo(e)?(l=Qi(e,l),t.tag=1,t=Np(null,t,e,l,a)):(t.tag=0,t=Ff(null,t,e,l,a));else{if(e!=null){var r=e.$$typeof;if(r===me){t.tag=11,t=gp(null,t,e,l,a);break e}else if(r===qe){t.tag=14,t=yp(null,t,e,l,a);break e}else if(r===Fe){t.tag=10,t.type=e,t=Ep(null,t,a);break e}}throw t=de(e)||e,Error(f(306,t,""))}}return t;case 0:return Ff(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,r=Qi(l,t.pendingProps),Np(e,t,l,r,a);case 3:e:{if(xa(t,t.stateNode.containerInfo),e===null)throw Error(f(387));l=t.pendingProps;var d=t.memoizedState;r=d.element,Ec(e,t),_i(t,l,null,a);var y=t.memoizedState;if(l=y.cache,ol(t,xn,l),l!==d.cache&&Nc(t,[xn],a,!0),qo(),l=y.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Sp(e,t,l,a);break e}else if(l!==r){r=qa(Error(f(424)),t),Mi(r),t=Sp(e,t,l,a);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(Vt=$l(e.firstChild),Mn=t,et=!0,Zl=null,pn=!0,a=Ss(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(Qs(),l===r){t=oo(e,t,a);break e}la(e,t,l,a)}t=t.child}return t;case 26:return Vc(e,t),e===null?(a=ey(t.type,null,t.pendingProps,null))?t.memoizedState=a:et||(t.stateNode=Og(t.type,t.pendingProps,Nn.current,t)):t.memoizedState=ey(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Z(t),e===null&&et&&(l=t.stateNode=Pg(t.type,t.pendingProps,Nn.current),Mn=t,pn=!0,r=Vt,Wo(t.type)?(Jh=r,Vt=$l(l.firstChild)):Vt=r),la(e,t,t.pendingProps.children,a),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((r=l=Vt)&&(l=ox(l,t.type,t.pendingProps,pn),l!==null?(t.stateNode=l,Mn=t,Vt=$l(l.firstChild),pn=!1,r=!0):r=!1),r||Gn(t)),Z(t),r=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,l=d.children,Vh(r,d)?l=null:y!==null&&Vh(r,y)&&(t.flags|=32),t.memoizedState!==null&&(r=na(e,t,Rc,null,null,a),or._currentValue=r),Vc(e,t),la(e,t,l,a),t.child;case 6:return e===null&&et&&((e=a=Vt)&&(a=ix(a,t.pendingProps,pn),a!==null?(t.stateNode=a,Mn=t,Vt=null,e=!0):e=!1),e||Gn(t)),null;case 13:return kp(e,t,a);case 4:return xa(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=wn(t,null,l,a):la(e,t,l,a),t.child;case 11:return gp(e,t,t.type,t.pendingProps,a);case 7:return l=t.pendingProps,Vc(e,t),la(e,t,l,a),t.child;case 8:return la(e,t,t.pendingProps.children,a),t.child;case 12:return la(e,t,t.pendingProps.children,a),t.child;case 10:return Ep(e,t,a);case 9:return r=t.type._context,l=t.pendingProps.children,ws(t),r=Yn(r),l=l(r),t.flags|=1,la(e,t,l,a),t.child;case 14:return yp(e,t,t.type,t.pendingProps,a);case 15:return bp(e,t,t.type,t.pendingProps,a);case 19:return eh(e,t,a);case 31:return uv(e,t,a);case 22:return vp(e,t,a,t.pendingProps);case 24:return ws(t),l=Yn(xn),e===null?(r=Di(),r===null&&(r=en,d=Sc(),r.pooledCache=d,d.refCount++,d!==null&&(r.pooledCacheLanes|=a),r=d),t.memoizedState={parent:l,cache:r},Uo(t),ol(t,xn,r)):((e.lanes&a)!==0&&(Ec(e,t),_i(t,null,null,a),qo()),r=e.memoizedState,d=t.memoizedState,r.parent!==l?(r={parent:l,cache:l},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ol(t,xn,l)):(l=d.cache,ol(t,xn,l),l!==r.cache&&Nc(t,[xn],a,!0))),la(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:et&&fa(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Vc(e,t),la(e,t,l.children,a),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function io(e){e.flags|=4}function nh(e,t,a,l,r){var d;if((d=(e.mode&32)!==0)&&(d=a===null?ly(t,l):ly(t,l)&&(l.src!==a.src||l.srcSet!==a.srcSet)),d){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(ug())e.flags|=8192;else throw eo=Hi,Tc}else e.flags&=-16777217}function Ap(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!sy(t))if(ug())e.flags|=8192;else throw eo=Hi,Tc}function kd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ho():536870912,e.lanes|=t,Zc|=t)}function eu(e,t){if(!et)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function sn(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags&1206910976,l|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function hv(e,t,a){var l=t.pendingProps;switch(Kl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(t),null;case 1:return sn(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ql(xn),D(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?io(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Br())),sn(t),null;case 26:var r=t.type,d=t.memoizedState;return e===null?(io(t),d!==null?(sn(t),Ap(t,d)):(sn(t),nh(t,r,null,l,a))):d?d!==e.memoizedState?(io(t),sn(t),Ap(t,d)):(sn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&io(t),sn(t),nh(t,r,e,l,a)),null;case 27:if(ne(t),a=Nn.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&io(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return sn(t),t.subtreeFlags&=-33554433,null}e=on.current,Fs(t)?Do(t):(e=Pg(r,l,a),t.stateNode=e,io(t))}return sn(t),t.subtreeFlags&=-33554433,null;case 5:if(ne(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&io(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return sn(t),t.subtreeFlags&=-33554433,null}if(d=on.current,Fs(t))Do(t);else{var y=du(Nn.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?d.multiple=!0:l.size&&(d.size=l.size);break;default:d=typeof l.is=="string"?y.createElement(r,{is:l.is}):y.createElement(r)}}d[zn]=t,d[da]=l;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=d;e:switch(pa(d,r,l),r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&io(t)}}return sn(t),t.subtreeFlags&=-33554433,nh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&io(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(f(166));if(e=Nn.current,Fs(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,r=Mn,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}e[zn]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Mg(e.nodeValue,a)),e||Gn(t,!0)}else e=du(e).createTextNode(l),e[zn]=t,t.stateNode=e}return sn(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Fs(t),a!==null){if(e===null){if(!l)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[zn]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;sn(t),e=!1}else a=Br(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ia(t),t):(ia(t),null);if((t.flags&128)!==0)throw Error(f(558))}return sn(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fs(t),l!==null&&l.dehydrated!==null){if(e===null){if(!r)throw Error(f(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(f(317));r[zn]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;sn(t),r=!1}else r=Br(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ia(t),t):(ia(t),null)}return ia(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==r&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),kd(t,t.updateQueue),sn(t),null);case 4:return D(),e===null&&Hh(t.stateNode.containerInfo),t.flags|=67108864,sn(t),null;case 10:return Ql(t.type),sn(t),null;case 19:if(qi(t),l=t.memoizedState,l===null)return sn(t),null;if(r=(t.flags&128)!==0,d=l.rendering,d===null)if(r)eu(l,!1);else{if($n!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=zc(e),d!==null){for(t.flags|=128,eu(l,!1),e=d.updateQueue,t.updateQueue=e,kd(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)id(a,e),a=a.sibling;return ta(t,Dt.current&1|2),et&&bs(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&rt()>Hd&&(t.flags|=128,r=!0,eu(l,!1),t.lanes=4194304)}else{if(!r)if(e=zc(d),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,kd(t,e),eu(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!d.alternate&&!et)return sn(t),null}else 2*rt()-l.renderingStartTime>Hd&&a!==536870912&&(t.flags|=128,r=!0,eu(l,!1),t.lanes=4194304);l.isBackwards?(d.sibling=t.child,t.child=d):(e=l.last,e!==null?e.sibling=d:t.child=d,l.last=d)}if(l.tail!==null){e=l.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=rt(),e.sibling=null,d=Dt.current,d=r?d&1|2:d&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!a||et?ta(t,d):(a=d,Pe(Kn,t),Pe(Dt,a),Zn===null&&(Zn=t)),et&&bs(t,l.treeForkCount),e}return sn(t),null;case 22:case 23:return ia(t),Ac(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(sn(t),t.subtreeFlags&6&&(t.flags|=8192)):sn(t),a=t.updateQueue,a!==null&&kd(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&ot(js),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ql(xn),sn(t),null;case 25:return null;case 30:return t.flags|=33554432,sn(t),null}throw Error(f(156,t.tag))}function mv(e,t){switch(Kl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ql(xn),D(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ne(t),null;case 31:if(t.memoizedState!==null){if(ia(t),t.alternate===null)throw Error(f(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ia(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qi(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 D(),null;case 10:return Ql(t.type),null;case 22:case 23:return ia(t),Ac(),e!==null&&ot(js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ql(xn),null;case 25:return null;default:return null}}function $p(e,t){switch(Kl(t),t.tag){case 3:Ql(xn),D();break;case 26:case 27:case 5:ne(t);break;case 4:D();break;case 31:t.memoizedState!==null&&ia(t);break;case 13:ia(t);break;case 19:qi(t);break;case 10:Ql(t.type);break;case 22:case 23:ia(t),Ac(),e!==null&&ot(js);break;case 24:Ql(xn)}}function tu(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){l=void 0;var d=a.create,y=a.inst;l=d(),y.destroy=l}a=a.next}while(a!==r)}}catch(C){Kt(t,t.return,C)}}function Ko(e,t,a){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var d=r.next;l=d;do{if((l.tag&e)===e){var y=l.inst,C=y.destroy;if(C!==void 0){y.destroy=void 0,r=t;var O=a,Y=C;try{Y()}catch(J){Kt(r,O,J)}}}l=l.next}while(l!==d)}}catch(J){Kt(t,t.return,J)}}function zp(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{hd(t,a)}catch(l){Kt(e,e.return,l)}}}function Op(e,t,a){a.props=Qi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Kt(e,t,l)}}function Ms(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var r=e.stateNode,d=Ta(e.memoizedProps,r);(r.ref===null||r.ref.name!==d)&&(r.ref=Ug(d)),l=r.ref;break;case 7:if(e.stateNode===null){var y=new fl(e);w(e.child,!1,lx,y,void 0,void 0),e.stateNode=y}l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(C){Kt(e,t,C)}}function ma(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(r){Kt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Kt(e,t,r)}else a.current=null}function Td(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)Kg(e.stateNode,t[a])}function Rp(e){for(var t=e.return;t!==null&&(lh(t)&&Kg(e.stateNode,t.stateNode),!ah(t));)t=t.return}function nu(e){for(var t=e.return;t!==null&&(lh(t)&&sx(e.stateNode,t.stateNode),!ah(t));)t=t.return}function ah(e){return e.tag===5||e.tag===3||e.tag===27}function lh(e){return e&&e.tag===7&&e.stateNode!==null}function sh(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(r){Kt(e,e.return,r)}}function oh(e,t,a){try{var l=e.stateNode;Uv(l,e.type,a,t),l[da]=t}catch(r){Kt(e,e.return,r)}}function Dp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wo(e.type)||e.tag===4}function ih(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dp(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&&Wo(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 ch(e,t,a,l){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(r,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(r),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=vl)),Td(e,l),ft=!0;else if(r!==4&&(r===27&&(Td(e,l),l=null,Wo(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(ch(e,t,a,l),e=e.sibling;e!==null;)ch(e,t,a,l),e=e.sibling}function Cd(e,t,a,l){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?a.insertBefore(r,t):a.appendChild(r),Td(e,l),ft=!0;else if(r!==4&&(r===27&&(Td(e,l),l=null,Wo(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Cd(e,t,a,l),e=e.sibling;e!==null;)Cd(e,t,a,l),e=e.sibling}function Bp(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);pa(t,l,a),t[zn]=e,t[da]=a}catch(d){Kt(e,e.return,d)}}var Ed=!1,cl=null;function Hp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Ed=!0)}var As=null;function Lp(){var e=As;return As=null,e}var Ya=0;function Gc(e,t,a,l,r){return Ya=0,_p(e.child,t,a,l,r)}function _p(e,t,a,l,r){for(var d=!1;e!==null;){if(e.tag===5){var y=e.stateNode;if(l!==null){var C=Xh(y);l.push(C),C.view&&(d=!0)}else d||Xh(y).view&&(d=!0);Ed=!0,Lg(y,Ya===0?t:t+"_"+Ya,a),Ya++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||_p(e.child,t,a,l,r)&&(d=!0));e=e.sibling}return d}function $s(e,t){for(;e!==null;)e.tag===5?_g(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||$s(e.child,t)),e=e.sibling}function Md(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Md(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 a=t.name;t=Yl(t.default,t.share),t!=="none"&&(Gc(e,a,t,null,!1)||$s(e.child,!1))}e=e.sibling}}function rh(e,t){if(e.tag===30){var a=e.stateNode,l=e.memoizedProps,r=Ta(l,a),d=Yl(l.default,a.paired?l.share:l.enter);d!=="none"?Gc(e,r,d,null,!1)?(Md(e),a.paired||t||Jc(e,l.onEnter)):$s(e.child,!1):Md(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)rh(e,t),e=e.sibling;else Md(e)}function uh(e){if(cl!==null&&cl.size!==0){var t=cl;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 a=e.memoizedProps,l=a.name;if(l!=null&&l!=="auto"){var r=t.get(l);if(r!==void 0){var d=Yl(a.default,a.share);if(d!=="none"&&(Gc(e,l,d,null,!1)?(d=e.stateNode,r.paired=d,d.paired=r,Jc(e,a.onShare)):$s(e.child,!1)),t.delete(l),t.size===0)break}}}uh(e)}e=e.sibling}}}function dh(e){if(e.tag===30){var t=e.memoizedProps,a=Ta(t,e.stateNode),l=cl!==null?cl.get(a):void 0,r=Yl(t.default,l!==void 0?t.share:t.exit);r!=="none"&&(Gc(e,a,r,null,!1)?l!==void 0?(r=e.stateNode,l.paired=r,r.paired=l,cl.delete(a),Jc(e,t.onShare)):Jc(e,t.onExit):$s(e.child,!1)),cl!==null&&uh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)dh(e),e=e.sibling;else cl!==null&&uh(e)}function Up(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=Ta(t,e.stateNode);t=Yl(t.default,t.update),e.flags&=-5,t!=="none"&&Gc(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Up(e);e=e.sibling}}function fh(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,$s(e.child,!1))}fh(e)}e=e.sibling}}function Ad(e){if(e.tag===30)e.stateNode.paired=null,$s(e.child,!1),fh(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ad(e),e=e.sibling;else fh(e)}function qp(e){for(e=e.child;e!==null;)e.tag===30?$s(e.child,!1):(e.subtreeFlags&33554432)!==0&&qp(e),e=e.sibling}function hh(e,t,a,l,r,d,y){for(var C=!1;t!==null;){if(t.tag===5){var O=t.stateNode;if(d!==null&&Ya<d.length){var Y=d[Ya],J=Xh(O);(Y.view||J.view)&&(C=!0);var oe;if(oe=(e.flags&4)===0)if(J.clip)oe=!0;else{oe=Y.rect;var q=J.rect;oe=oe.y!==q.y||oe.x!==q.x||oe.height!==q.height||oe.width!==q.width}oe&&(e.flags|=4),J.abs?J=!Y.abs:(Y=Y.rect,J=J.rect,J=Y.height!==J.height||Y.width!==J.width),J&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Lg(O,Ya===0?a:a+"_"+Ya,r),C&&(e.flags&4)!==0||(As===null&&(As=[]),As.push(O,Ya===0?l:l+"_"+Ya,t.memoizedProps)),Ya++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&y?e.flags|=t.flags&32:hh(e,t.child,a,l,r,d,y)&&(C=!0));t=t.sibling}return C}function Vp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,l=e.stateNode,r=Ta(a,l),d=Yl(a.default,a.update),y;y=e.memoizedState,e.memoizedState=null,l=e;var C=e.child;Ya=0,r=hh(l,C,r,r,d,y,!1),(e.flags&4)!==0&&r&&Jc(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Vp(e);e=e.sibling}}var ra=!1,Ut=!1,zs=!1,mh=!1,Gp=typeof WeakSet=="function"?WeakSet:Set,ua=null,Os=!1,au=!1,$d=!1,ph=!1;function pv(e,t,a){if(e=e.containerInfo,Uh=ir,e=So(e),zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var d=r.anchorOffset,y=r.focusNode;r=r.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var C=0,O=-1,Y=-1,J=0,oe=0,q=e,P=null;t:for(;;){for(var Te;q!==l||d!==0&&q.nodeType!==3||(O=C+d),q!==y||r!==0&&q.nodeType!==3||(Y=C+r),q.nodeType===3&&(C+=q.nodeValue.length),(Te=q.firstChild)!==null;)P=q,q=Te;for(;;){if(q===e)break t;if(P===l&&++J===d&&(O=C),P===y&&++oe===r&&(Y=C),(Te=q.nextSibling)!==null)break;q=P,P=q.parentNode}q=Te}l=O===-1||Y===-1?null:{start:O,end:Y}}else l=null}l=l||{start:0,end:0}}else l=null;for(qh={focusedElem:e,selectionRange:l},ir=!1,a=(a&335544064)===a,ua=t,t=a?9270:1024;ua!==null;){if(e=ua,a&&(l=e.deletions,l!==null))for(d=0;d<l.length;d++)a&&dh(l[d]);if(e.alternate===null&&(e.flags&2)!==0)a&&Hp(e),zd(a);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&a&&dh(l),zd(a);continue}else if(l!==null&&l.memoizedState!==null){a&&Hp(e),zd(a);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,ua=l):(a&&Up(e),zd(a))}}cl=null}function zd(e){for(;ua!==null;){var t=ua,a=e,l=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&l!==null){a=void 0,r=l.memoizedProps,l=l.memoizedState;var d=t.stateNode;try{var y=Qi(t.type,r);a=d.getSnapshotBeforeUpdate(y,l),d.__reactInternalSnapshotBeforeUpdate=a}catch(C){Kt(t,t.return,C)}}break;case 3:if((r&1024)!==0){if(l=t.stateNode.containerInfo,a=l.nodeType,a===9)Fh(l);else if(a===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Fh(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&l!==null&&(a=Ta(l.memoizedProps,l.stateNode),r=t.memoizedProps,r=Yl(r.default,r.update),r!=="none"&&Gc(l,a,r,l.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(f(163))}if(l=t.sibling,l!==null){l.return=t.return,ua=l;break}ua=t.return}}function Yp(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Rs(e,a),l&4&&tu(5,a);break;case 1:if(Rs(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(y){Kt(a,a.return,y)}else{var r=Qi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Kt(a,a.return,y)}}l&64&&zp(a),l&512&&Ms(a,a.return);break;case 3:if(Rs(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{hd(e,t)}catch(y){Kt(a,a.return,y)}}break;case 27:t===null&&l&4&&Bp(a);case 26:case 5:Rs(e,a),t===null&&l&4&&sh(a),l&512&&Ms(a,a.return);break;case 12:Rs(e,a);break;case 31:Rs(e,a),l&4&&Fp(e,a);break;case 13:Rs(e,a),l&4&&Qp(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Cv.bind(null,a),cx(e,a))));break;case 22:if(l=a.memoizedState!==null||ra,!l){var d=t!==null&&t.memoizedState!==null||Ut;t=ra,r=Ut,ra=l,(Ut=d)&&!r?(l=2,(a.subtreeFlags&8772)!==0&&(l|=1),Wl(e,a,l)):Rs(e,a),ra=t,Ut=r}break;case 30:Rs(e,a),l&512&&Ms(a,a.return);break;case 7:l&512&&Ms(a,a.return);default:Rs(e,a)}}function gh(e,t){for(e=e.child;e!==null;)Xp(e,t),e=e.sibling}function Xp(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var l=a.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var r=e.stateNode,d=e.memoizedProps.style,y=d!=null&&d.hasOwnProperty("display")?d.display:null;r.style.display=y==null||typeof y=="boolean"?"":(""+y).trim()}}catch(O){Kt(e,e.return,O)}yh(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,ft=!0}catch(O){Kt(e,e.return,O)}break;case 18:try{var C=e.stateNode;t?Hg(C,!0):Hg(e.stateNode,!1)}catch(O){Kt(e,e.return,O)}break;case 22:case 23:e.memoizedState===null&&gh(e,t);break;default:gh(e,t)}}function yh(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,l=t;switch(a.tag){case 4:Xp(a,l);break e;case 22:a.memoizedState===null&&yh(a,l);break e;default:yh(a,l)}}e=e.sibling}}function Kp(e){var t=e.alternate;t!==null&&(e.alternate=null,Kp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&di(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 yn=null,Xa=!1;function Jl(e,t,a){for(a=a.child;a!==null;)Zp(e,t,a),a=a.sibling}function Zp(e,t,a){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(ml,a)}catch{}switch(a.tag){case 26:Ut||ma(a,t),Jl(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Ut&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ut||ma(a,t),nu(a);var l=yn,r=Xa;Wo(a.type)&&(yn=a.stateNode,Xa=!1),Jl(e,t,a),Jg(a.stateNode,a.type,a.memoizedProps),yn=l,Xa=r;break;case 5:Ut||ma(a,t),nu(a);case 6:if(a.tag===6&&nu(a),l=yn,r=Xa,yn=null,Jl(e,t,a),yn=l,Xa=r,yn!==null)if(Xa)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(a.stateNode),ft=!0}catch(d){Kt(a,t,d)}else try{yn.removeChild(a.stateNode),ft=!0}catch(d){Kt(a,t,d)}break;case 18:yn!==null&&(Xa?(e=yn,Bg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),cr(e)):Bg(yn,a.stateNode));break;case 4:l=yn,r=Xa,yn=a.stateNode.containerInfo,Xa=!0,Jl(e,t,a),yn=l,Xa=r;break;case 0:case 11:case 14:case 15:Ko(2,a,t),Ut||Ko(4,a,t),Jl(e,t,a);break;case 1:Ut||(ma(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Op(a,t,l)),Jl(e,t,a);break;case 21:Jl(e,t,a);break;case 22:Ut=(l=Ut)||a.memoizedState!==null,Jl(e,t,a),Ut=l;break;case 30:ma(a,t),Jl(e,t,a);break;case 7:Ut||ma(a,t),Jl(e,t,a);break;default:Jl(e,t,a)}}function Fp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{cr(e)}catch(a){Kt(t,t.return,a)}}}function Qp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{cr(e)}catch(a){Kt(t,t.return,a)}}function gv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gp),t;default:throw Error(f(435,e.tag))}}function Od(e,t){var a=gv(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var r=Ev.bind(null,e,l);l.then(r,r)}})}function Aa(e,t,a){var l=t.deletions;if(l!==null)for(var r=0;r<l.length;r++){var d=l[r],y=e,C=t,O=C;e:for(;O!==null;){switch(O.tag){case 27:if(Wo(O.type)){yn=O.stateNode,Xa=!1;break e}break;case 5:yn=O.stateNode,Xa=!1;break e;case 3:case 4:yn=O.stateNode.containerInfo,Xa=!0;break e}O=O.return}if(yn===null)throw Error(f(160));Zp(y,C,d),yn=null,Xa=!1,y=d.alternate,y!==null&&(y.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pp(t,e,a),t=t.sibling}var Il=null;function Pp(e,t,a){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var d=0;d<l.length;d++){var y=l[d];y.ref.impl=y.nextImpl}Aa(t,e,a),$a(e),r&4&&(Ko(3,e,e.return),tu(3,e),Ko(5,e,e.return));break;case 1:Aa(t,e,a),$a(e),r&512&&(Ut||l===null||ma(l,l.return)),r&64&&ra&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(d=Il,Aa(t,e,a),$a(e),r&512&&(Ut||l===null||ma(l,l.return)),r&4)if(r=l!==null?l.memoizedState:null,a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null)if(ra)e.stateNode=Og(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,r=d.ownerDocument||d;t:switch(t){case"title":l=r.getElementsByTagName("title")[0],(!l||l[nn]||l[zn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(t),r.head.insertBefore(l,r.querySelector("head > title"))),pa(l,t,a),l[zn]=e,Un(l),t=l;break e;case"link":if(d=ay("link","href",r).get(t+(a.href||""))){for(y=0;y<d.length;y++)if(l=d[y],l.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&l.getAttribute("rel")===(a.rel==null?null:a.rel)&&l.getAttribute("title")===(a.title==null?null:a.title)&&l.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(y,1);break t}}l=r.createElement(t),pa(l,t,a),r.head.appendChild(l);break;case"meta":if(d=ay("meta","content",r).get(t+(a.content||""))){for(y=0;y<d.length;y++)if(l=d[y],l.getAttribute("content")===(a.content==null?null:""+a.content)&&l.getAttribute("name")===(a.name==null?null:a.name)&&l.getAttribute("property")===(a.property==null?null:a.property)&&l.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&l.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(y,1);break t}}l=r.createElement(t),pa(l,t,a),r.head.appendChild(l);break;default:throw Error(f(468,t))}l[zn]=e,Un(l),t=l}e.stateNode=t}else ra||tm(d,e.type,e.stateNode);else e.stateNode=ny(d,a,e.memoizedProps);else r!==a?(r===null?(t=l.stateNode,t===null||Ut||t.parentNode.removeChild(t)):r.count--,a===null?ra||tm(d,e.type,e.stateNode):ny(d,a,e.memoizedProps)):a===null&&e.stateNode!==null&&oh(e,e.memoizedProps,l.memoizedProps);break;case 27:Aa(t,e,a),$a(e),r&512&&(Ut||l===null||ma(l,l.return)),l!==null&&r&4&&oh(e,e.memoizedProps,l.memoizedProps);break;case 5:if(d=zs,zs=!1,Aa(t,e,a),zs=d,$a(e),r&512&&(Ut||l===null||ma(l,l.return)),e.flags&32){t=e.stateNode;try{_s(t,""),ft=!0}catch(J){Kt(e,e.return,J)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,oh(e,t,l!==null?l.memoizedProps:t)),r&1024&&(mh=!0);break;case 6:if(Aa(t,e,a),$a(e),r&4){if(e.stateNode===null)throw Error(f(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,ft=!0}catch(J){Kt(e,e.return,J)}}break;case 3:if(ft=!1,Fd=null,d=Il,Il=fu(t.containerInfo),Aa(t,e,a),Il=d,$a(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{cr(t.containerInfo)}catch(J){Kt(e,e.return,J)}mh&&(mh=!1,Jp(e)),ft=!1;break;case 4:r=zs,zs=ra,l=In(),d=Il,Il=fu(e.stateNode.containerInfo),Aa(t,e,a),$a(e),Il=d,ft&&au&&($d=!0),ft=l,zs=r;break;case 12:Aa(t,e,a),$a(e);break;case 31:Aa(t,e,a),$a(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Od(e,t)));break;case 13:Aa(t,e,a),$a(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Bd=rt()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Od(e,t)));break;case 22:d=e.memoizedState!==null,y=l!==null&&l.memoizedState!==null;var C=ra,O=Ut,Y=zs;ra=C||d,zs=Y||d,Ut=O||y,Aa(t,e,a),Ut=O,zs=Y,ra=C,$a(e),r&8192&&(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,!d||l===null||y||ra||Ut||(t=y||Ut,a=ra,l=Ut,ra=d||ra,Ut=t,Zo(e,2),ra=a,Ut=l),!d&&zs||gh(e,d)),r&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,Od(e,a))));break;case 19:Aa(t,e,a),$a(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Od(e,t)));break;case 30:r&512&&(Ut||l===null||ma(l,l.return)),r=In(),d=au,y=(a&335544064)===a,C=e.memoizedProps,au=y&&Yl(C.default,C.update)!=="none",Aa(t,e,a),$a(e),y&&l!==null&&ft&&(e.flags|=4),au=d,ft=r;break;case 21:break;case 7:r&512&&(Ut||l===null||ma(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Aa(t,e,a),$a(e)}}function $a(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Dp(l)){a=l;break}l=l.return}l=null;for(var r=e.return;r!==null;){if(lh(r)){var d=r.stateNode;l===null?l=[d]:l.push(d)}if(ah(r))break;r=r.return}var y=l;if(a==null)throw Error(f(160));switch(a.tag){case 27:var C=a.stateNode,O=ih(e);Cd(e,O,C,y);break;case 5:var Y=a.stateNode;a.flags&32&&(_s(Y,""),a.flags&=-33);var J=ih(e);Cd(e,J,Y,y);break;case 3:case 4:var oe=a.stateNode.containerInfo,q=ih(e);ch(e,q,oe,y);break;default:throw Error(f(161))}}catch(P){Kt(e,e.return,P)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ir=!0,t.reset(),ir=!1),e=e.sibling}}function Yc(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ip(t,e),t=t.sibling;else Vp(t)}function Ip(e,t){var a=e.alternate;if(a===null)rh(e,!1);else switch(e.tag){case 3:if(ph=Os=!1,Lp(),Yc(t,e),!Os&&!$d){if(e=As,e!==null)for(var l=0;l<e.length;l+=3){a=e[l];var r=e[l+1];_g(a,e[l+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}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"})),ph=!0}As=null;break;case 5:Yc(t,e);break;case 4:l=Os,Os=!1,Yc(t,e),Os&&($d=!0),Os=l;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?rh(e,!1):Yc(t,e));break;case 30:l=Os,r=Lp(),Os=!1,Yc(t,e),Os&&(e.flags|=4);var d=e.memoizedProps,y=e.stateNode;t=Ta(d,y),y=Ta(a.memoizedProps,y);var C=Yl(d.default,d.update);C==="none"?t=!1:(d=a.memoizedState,a.memoizedState=null,a=e.child,Ya=0,t=hh(e,a,t,y,C,d,!0),Ya!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Jc(e,e.memoizedProps.onUpdate),As=r):r!==null&&(r.push.apply(r,As),As=r),Os=(e.flags&32)!==0?!0:l;break;default:Yc(t,e)}}function Rs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yp(e,t.alternate,t),t=t.sibling}function Zo(e,t){for(e=e.child;e!==null;){var a=e,l=t;switch(a.tag){case 0:case 11:case 14:case 15:Ko(4,a,a.return),Zo(a,l);break;case 1:ma(a,a.return);var r=a.stateNode;typeof r.componentWillUnmount=="function"&&Op(a,a.return,r),Zo(a,l);break;case 27:(l&2)!==0&&Jg(a.stateNode,a.type,a.memoizedProps);case 5:ma(a,a.return),a.tag!==5&&a.tag!==27||nu(a),Zo(a,l);break;case 6:nu(a);break;case 26:ma(a,a.return),r=a.stateNode,a.memoizedState!==null||r===null||Ut||r.parentNode.removeChild(r),Zo(a,l);break;case 22:a.memoizedState===null&&Zo(a,l);break;case 30:ma(a,a.return),Zo(a,l);break;case 7:ma(a,a.return);default:Zo(a,l)}e=e.sibling}}function Wl(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var l=t.alternate,r=e,d=t,y=d.flags,C=(a&1)!==0;switch(d.tag){case 0:case 11:case 15:Wl(r,d,a),tu(4,d);break;case 1:if(Wl(r,d,a),l=d,r=l.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(J){Kt(l,l.return,J)}if(l=d,r=l.updateQueue,r!==null){var O=l.stateNode;try{var Y=r.shared.hiddenCallbacks;if(Y!==null)for(r.shared.hiddenCallbacks=null,r=0;r<Y.length;r++)Ui(Y[r],O)}catch(J){Kt(l,l.return,J)}}C&&y&64&&zp(d),Ms(d,d.return);break;case 27:(a&2)!==0&&Bp(d);case 5:d.tag!==5&&d.tag!==27||Rp(d),Wl(r,d,a),C&&l===null&&y&4&&sh(d),Ms(d,d.return);break;case 6:Rp(d);break;case 26:O=d.stateNode,d.memoizedState!==null||O===null||ra||tm(fu(O.ownerDocument),d.type,O),Wl(r,d,a),C&&l===null&&y&4&&sh(d),Ms(d,d.return);break;case 12:Wl(r,d,a);break;case 31:Wl(r,d,a),C&&y&4&&Fp(r,d);break;case 13:Wl(r,d,a),C&&y&4&&Qp(r,d);break;case 22:d.memoizedState===null&&Wl(r,d,a),Ms(d,d.return);break;case 30:Wl(r,d,a),Ms(d,d.return);break;case 7:Ms(d,d.return);default:Wl(r,d,a)}t=t.sibling}}function bh(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&$i(a))}function vh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function Al(e,t,a,l){var r=(a&335544064)===a;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Wp(e,t,a,l),t=t.sibling;else r&&qp(t)}function Wp(e,t,a,l){var r=(a&335544064)===a;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ad(t);var d=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,a,l),d&2048&&tu(9,t);break;case 1:Al(e,t,a,l);break;case 3:Al(e,t,a,l),r&&ph&&(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="")),d&2048&&(d=null,t.alternate!==null&&(d=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==d&&(t.refCount++,d!=null&&$i(d)));break;case 12:if(d&2048){Al(e,t,a,l),d=t.stateNode;try{var y=t.memoizedProps,C=y.id,O=y.onPostCommit;typeof O=="function"&&O(C,t.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(Y){Kt(t,t.return,Y)}}else Al(e,t,a,l);break;case 31:Al(e,t,a,l);break;case 13:Al(e,t,a,l);break;case 23:break;case 22:y=t.stateNode,C=t.alternate,t.memoizedState!==null?(r&&C!==null&&C.memoizedState===null&&Ad(C),y._visibility&2?Al(e,t,a,l):lu(e,t)):(r&&C!==null&&C.memoizedState!==null&&Ad(t),y._visibility&2?Al(e,t,a,l):(y._visibility|=2,Xc(e,t,a,l,(t.subtreeFlags&10256)!==0||!1))),d&2048&&bh(C,t);break;case 24:Al(e,t,a,l),d&2048&&vh(t.alternate,t);break;case 30:r&&(d=t.alternate,d!==null&&($s(d.child,!0),$s(t.child,!0))),Al(e,t,a,l);break;default:Al(e,t,a,l)}}function Xc(e,t,a,l,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,y=t,C=a,O=l,Y=y.flags;switch(y.tag){case 0:case 11:case 15:Xc(d,y,C,O,r),tu(8,y);break;case 23:break;case 22:var J=y.stateNode;y.memoizedState!==null?J._visibility&2?Xc(d,y,C,O,r):lu(d,y):(J._visibility|=2,Xc(d,y,C,O,r)),r&&Y&2048&&bh(y.alternate,y);break;case 24:Xc(d,y,C,O,r),r&&Y&2048&&vh(y.alternate,y);break;default:Xc(d,y,C,O,r)}t=t.sibling}}function lu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,r=l.flags;switch(l.tag){case 22:lu(a,l),r&2048&&bh(l.alternate,l);break;case 24:lu(a,l),r&2048&&vh(l.alternate,l);break;default:lu(a,l)}t=t.sibling}}var Pi=8192;function Ji(e,t,a){if(e.subtreeFlags&Pi)for(e=e.child;e!==null;)eg(e,t,a),e=e.sibling}function eg(e,t,a){switch(e.tag){case 26:Ji(e,t,a),e.flags&Pi&&(e.memoizedState!==null?jx(a,Il,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&iy(a,e)));break;case 5:Ji(e,t,a),e.flags&Pi&&(e=e.stateNode,(t&335544128)===t&&iy(a,e));break;case 3:case 4:var l=Il;Il=fu(e.stateNode.containerInfo),Ji(e,t,a),Il=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Pi,Pi=16777216,Ji(e,t,a),Pi=l):Ji(e,t,a));break;case 30:if((e.flags&Pi)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var r=e.stateNode;r.paired=null,cl===null&&(cl=new Map),cl.set(l,r)}Ji(e,t,a);break;default:Ji(e,t,a)}}function tg(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 su(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ua=l,ag(l,e)}tg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ng(e),e=e.sibling}function ng(e){switch(e.tag){case 0:case 11:case 15:su(e),e.flags&2048&&Ko(9,e,e.return);break;case 3:su(e);break;case 12:su(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rd(e)):su(e);break;default:su(e)}}function Rd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ua=l,ag(l,e)}tg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ko(8,t,t.return),Rd(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Rd(t));break;default:Rd(t)}e=e.sibling}}function ag(e,t){for(;ua!==null;){var a=ua;switch(a.tag){case 0:case 11:case 15:Ko(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:$i(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,ua=l;else e:for(a=e;ua!==null;){l=ua;var r=l.sibling,d=l.return;if(Kp(l),l===a){ua=null;break e}if(r!==null){r.return=d,ua=r;break e}ua=d}}}var yv={getCacheForType:function(e){var t=Yn(xn),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Yn(xn).controller.signal}},bv=typeof WeakMap=="function"?WeakMap:Map,Bt=0,en=null,gt=null,xt=0,Xt=0,rl=null,Fo=!1,Kc=!1,xh=!1,co=0,$n=0,Qo=0,Ii=0,Dd=0,ul=0,Zc=0,ou=null,Ka=null,wh=!1,Bd=0,lg=0,Hd=1/0,Ld=null,Po=null,jn=0,es=null,Wi=null,Ds=0,jh=0,Nh=null,sg=null,Fc=null,Qc=null,Pc=null,iu=0,_d=null;function dl(){return(Bt&2)!==0&&xt!==0?xt&-xt:ae.T!==null?Oh():kn()}function og(){if(ul===0)if((xt&536870912)===0||et){var e=gl;gl<<=1,(gl&3932160)===0&&(gl=262144),ul=e}else ul=536870912;return e=Kn.current,e!==null&&(e.flags|=32),ul}function Jc(e,t){if(t!=null){var a=e.stateNode,l=a.ref;l===null&&(l=a.ref=Ug(Ta(e.memoizedProps,a))),Qc===null&&(Qc=[]),Qc.push(t.bind(null,l))}}function Za(e,t,a){(e===en&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)&&(Ic(e,0),Jo(e,xt,ul,!1)),$(e,a),((Bt&2)===0||e!==en)&&(e===en&&((Bt&2)===0&&(Ii|=a),$n===4&&Jo(e,xt,ul,!1)),Bs(e))}function ig(e,t,a){if((Bt&6)!==0)throw Error(f(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||tn(e,t),r=l?wv(e,t):kh(e,t,!0),d=l;do{if(r===0){Kc&&!l&&Jo(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!vv(a)){r=kh(e,t,!1),d=!1;continue}if(r===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var C=e;r=ou;var O=C.current.memoizedState.isDehydrated;if(O&&(Ic(C,y).flags|=256),y=kh(C,y,!1),y!==2&&y!==6){if(xh&&!O){C.errorRecoveryDisabledLanes|=d,Ii|=d,r=4;break e}d=Ka,Ka=r,d!==null&&(Ka===null?Ka=d:Ka.push.apply(Ka,d))}r=y}if(d=!1,r!==2)continue}}if(r===1){Ic(e,0),Jo(e,t,0,!0);break}e:{switch(l=e,d=r,d){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Jo(l,t,ul,!Fo);break e;case 2:Ka=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(r=Bd+300-rt(),10<r)){if(Jo(l,t,ul,!Fo),is(l,0,!0)!==0)break e;Ds=t,l.timeoutHandle=Yh(cg.bind(null,l,a,Ka,Ld,wh,t,ul,Ii,Zc,Fo,d,"Throttled",-0,0),r);break e}cg(l,a,Ka,Ld,wh,t,ul,Ii,Zc,Fo,d,null,-0,0)}}break}while(!0);Bs(e)}function cg(e,t,a,l,r,d,y,C,O,Y,J,oe,q,P){e.timeoutHandle=-1;var Te=t.subtreeFlags,He=(d&335544064)===d;if(oe=null,(He||Te&8192||(Te&16785408)===16785408)&&(oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vl},cl=null,eg(t,d,oe),He&&(Te=oe,He=e.containerInfo,He=(He.nodeType===9?He:He.ownerDocument).__reactViewTransition,He!=null&&(Te.count++,Te.waitingForViewTransition=!0,Te=pu.bind(Te),He.finished.then(Te,Te))),Te=(d&62914560)===d?Bd-rt():(d&4194048)===d?lg-rt():0,Te=Nx(oe,Te),Te!==null)){Ds=d,e.cancelPendingCommit=Te(gg.bind(null,e,t,d,a,l,r,y,C,O,Y,J,oe,null,q,P)),Jo(e,d,y,!Y);return}gg(e,t,d,a,l,r,y,C,O,Y,J,oe)}function vv(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var r=a[l],d=r.getSnapshot;r=r.value;try{if(!Ma(d(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jo(e,t,a,l){t=ri(e,t),t&=~Dd,t&=~Ii,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var d=31-Jn(r),y=1<<d;l[d]=-1,r&=~y}a!==0&&Le(e,a,t)}function Ud(){return(Bt&6)===0?(cu(0),!1):!0}function Sh(){if(gt!==null){if(Xt===0)var e=gt.return;else e=gt,Fl=Bo=null,Hc(e),Lo=null,_o=0,e=gt;for(;e!==null;)$p(e.alternate,e),e=e.return;gt=null}}function Ic(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,Gv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ds=0,Sh(),en=e,gt=a=Ua(e.current,null),xt=t,Xt=0,rl=null,Fo=!1,Kc=tn(e,t),xh=!1,Zc=ul=Dd=Ii=Qo=$n=0,Ka=ou=null,wh=!1,co=ri(e,t),Ni(),a}function rg(e,t){tt=null,ae.H=vd,t===Is||t===Bi?(t=lt(),Xt=3):t===Tc?(t=lt(),Xt=4):Xt=t===Zf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rl=t,gt===null&&($n=1,xd(e,qa(t,e.current)))}function ug(){var e=Kn.current;return e===null?!0:(xt&4194048)===xt?Zn===null:(xt&62914560)===xt||(xt&536870912)!==0?e===Zn:!1}function dg(){var e=ae.H;return ae.H=vd,e===null?vd:e}function fg(){var e=ae.A;return ae.A=yv,e}function qd(){$n=4,Fo||(xt&4194048)!==xt&&Kn.current!==null||(Kc=!0),(Qo&134217727)===0&&(Ii&134217727)===0||en===null||Jo(en,xt,ul,!1)}function kh(e,t,a){var l=Bt;Bt|=2;var r=dg(),d=fg();(en!==e||xt!==t)&&(Ld=null,Ic(e,t)),t=!1;var y=$n;e:do try{if(Xt!==0&&gt!==null){var C=gt,O=rl;switch(Xt){case 8:Sh(),y=6;break e;case 3:case 2:case 9:case 6:Kn.current===null&&(t=!0);var Y=Xt;if(Xt=0,rl=null,Wc(e,C,O,Y),a&&Kc){y=0;break e}break;default:Y=Xt,Xt=0,rl=null,Wc(e,C,O,Y)}}xv(),y=$n;break}catch(J){rg(e,J)}while(!0);return t&&e.shellSuspendCounter++,Fl=Bo=null,Bt=l,ae.H=r,ae.A=d,gt===null&&(en=null,xt=0,Ni()),y}function xv(){for(;gt!==null;)hg(gt)}function wv(e,t){var a=Bt;Bt|=2;var l=dg(),r=fg();en!==e||xt!==t?(Ld=null,Hd=rt()+500,Ic(e,t)):Kc=tn(e,t);e:do try{if(Xt!==0&&gt!==null){t=gt;var d=rl;t:switch(Xt){case 1:Xt=0,rl=null,Wc(e,t,d,1);break;case 2:case 9:if(fd(d)){Xt=0,rl=null,mg(t);break}t=function(){Xt!==2&&Xt!==9||en!==e||(Xt=7),Bs(e)},d.then(t,t);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:fd(d)?(Xt=0,rl=null,mg(t)):(Xt=0,rl=null,Wc(e,t,d,7));break;case 5:var y=null;switch(gt.tag){case 26:y=gt.memoizedState;case 5:case 27:var C=gt;if(y?sy(y):C.stateNode.complete){Xt=0,rl=null;var O=C.sibling;if(O!==null)gt=O;else{var Y=C.return;Y!==null?(gt=Y,Vd(Y)):gt=null}break t}}Xt=0,rl=null,Wc(e,t,d,5);break;case 6:Xt=0,rl=null,Wc(e,t,d,6);break;case 8:Sh(),$n=6;break e;default:throw Error(f(462))}}jv();break}catch(J){rg(e,J)}while(!0);return Fl=Bo=null,ae.H=l,ae.A=r,Bt=a,gt!==null?0:(en=null,xt=0,Ni(),$n)}function jv(){for(;gt!==null&&!Sn();)hg(gt)}function hg(e){var t=Mp(e.alternate,e,co);e.memoizedProps=e.pendingProps,t===null?Vd(e):gt=t}function mg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=jp(a,t,t.pendingProps,t.type,void 0,xt);break;case 11:t=jp(a,t,t.pendingProps,t.type.render,t.ref,xt);break;case 5:Hc(t);var l=t;l===Mn&&(et?(Ei(l),l.tag===5&&l.stateNode!=null&&(Vt=l.stateNode)):(Ei(l),et=!0));default:$p(a,t),t=gt=id(t,co),t=Mp(a,t,co)}e.memoizedProps=e.pendingProps,t===null?Vd(e):gt=t}function Wc(e,t,a,l){Fl=Bo=null,Hc(t),Lo=null,_o=0;var r=t.return;try{if(rv(e,r,t,a,xt)){$n=1,xd(e,qa(a,e.current)),gt=null;return}}catch(d){if(r!==null)throw gt=r,d;$n=1,xd(e,qa(a,e.current)),gt=null;return}t.flags&32768?(et||l===1?e=!0:Kc||(xt&536870912)!==0?e=!1:(Fo=e=!0,(l===2||l===9||l===3||l===6)&&(l=Kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),pg(t,e)):Vd(t)}function Vd(e){var t=e;do{if((t.flags&32768)!==0){pg(t,Fo);return}e=t.return;var a=hv(t.alternate,t,co);if(a!==null){gt=a;return}if(t=t.sibling,t!==null){gt=t;return}gt=t=e}while(t!==null);$n===0&&($n=5)}function pg(e,t){do{var a=mv(e.alternate,e);if(a!==null){a.flags&=32767,gt=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){gt=e;return}gt=e=a}while(e!==null);$n=6,gt=null}function gg(e,t,a,l,r,d,y,C,O,Y,J,oe){e.cancelPendingCommit=null;do Gd();while(jn!==0);if((Bt&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));e===en&&(gt=en=null,xt=0),Wi=t,es=e,Ds=a,Nh=r,sg=l,Nv(e,t,a,y,C,O,oe)}}function Nv(e,t,a,l,r,d,y){var C=t.lanes|t.childLanes;if(jh=C,C|=Ys,I(e,a,C,l,r,d),Qc=null,(a&335544064)===a?(Pc=Uf(e),l=10262):(Pc=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,Mv(qt,function(){return Mh(),null})):(e.callbackNode=null,e.callbackPriority=0),Ed=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ae.T,ae.T=null,r=ge.p,ge.p=2,d=Bt,Bt|=4;try{pv(e,t,a)}finally{Bt=d,ge.p=r,ae.T=l}}jn=1,Ed?Fc=Qv(y,e.containerInfo,Pc,Th,Ch,kv,Eh,Mh,Sv):(Th(),Ch(),Eh())}function Sv(e){if(jn!==0){var t=es.onRecoverableError;t(e,{componentStack:null})}}function kv(){jn===3&&(jn=0,Ip(Wi,es),jn=4)}function Th(){if(jn===1){jn=0;var e=es,t=Wi,a=Ds,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ae.T,ae.T=null;var r=ge.p;ge.p=2;var d=Bt;Bt|=4;try{au=$d=!1,Pp(t,e,a),a=qh;var y=So(e.containerInfo),C=a.focusedElem,O=a.selectionRange;if(y!==C&&C&&C.ownerDocument&&$r(C.ownerDocument.documentElement,C)){if(O!==null&&zr(C)){var Y=O.start,J=O.end;if(J===void 0&&(J=Y),"selectionStart"in C)C.selectionStart=Y,C.selectionEnd=Math.min(J,C.value.length);else{var oe=C.ownerDocument||document,q=oe&&oe.defaultView||window;if(q.getSelection){var P=q.getSelection(),Te=C.textContent.length,He=Math.min(O.start,Te),st=O.end===void 0?He:Math.min(O.end,Te);!P.extend&&He>st&&(y=st,st=He,He=y);var G=ll(C,He),_=ll(C,st);if(G&&_&&(P.rangeCount!==1||P.anchorNode!==G.node||P.anchorOffset!==G.offset||P.focusNode!==_.node||P.focusOffset!==_.offset)){var F=oe.createRange();F.setStart(G.node,G.offset),P.removeAllRanges(),He>st?(P.addRange(F),P.extend(_.node,_.offset)):(F.setEnd(_.node,_.offset),P.addRange(F))}}}}for(oe=[],P=C;P=P.parentNode;)P.nodeType===1&&oe.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<oe.length;C++){var le=oe[C];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}ir=!!Uh,qh=Uh=null}finally{Bt=d,ge.p=r,ae.T=l}}e.current=t,jn=2}}function Ch(){if(jn===2){jn=0;var e=es,t=Wi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ae.T,ae.T=null;var l=ge.p;ge.p=2;var r=Bt;Bt|=4;try{Yp(e,t.alternate,t)}finally{Bt=r,ge.p=l,ae.T=a}}jn=3}}function Eh(){if(jn===4||jn===3){jn=0;var e=Fc;Fc=null,Lt();var t=es,a=Wi,l=Ds,r=sg,d=(l&335544064)===l?10262:10256;if((a.subtreeFlags&d)!==0||(a.flags&d)!==0?jn=5:(jn=0,Wi=es=null,yg(t,t.pendingLanes)),d=t.pendingLanes,d===0&&(Po=null),Ge(l),a=a.stateNode,hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(ml,a,void 0,(a.current.flags&128)===128)}catch{}if(r!==null){a=ae.T,d=ge.p,ge.p=2,ae.T=null;try{for(var y=t.onRecoverableError,C=0;C<r.length;C++){var O=r[C];y(O.value,{componentStack:O.stack})}}finally{ae.T=a,ge.p=d}}if(r=Qc,y=Pc,Pc=null,r!==null&&(Qc=null,y===null&&(y=[]),e!==null))for(O=0;O<r.length;O++)a=(0,r[O])(y),a!==void 0&&e.finished.finally(a);(Ds&3)!==0&&Gd(),Bs(t),d=t.pendingLanes,(l&261930)!==0&&(d&42)!==0?t===_d?iu++:(iu=0,_d=t):(iu=0,_d=null),cu(0)}}function yg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function Gd(){return Fc!==null&&(Fc.skipTransition(),Fc=null),Th(),Ch(),Eh(),Mh()}function Mh(){if(jn!==5)return!1;var e=es,t=jh;jh=0;var a=Ge(Ds),l=ae.T,r=ge.p;try{ge.p=32>a?32:a,ae.T=null,a=Nh,Nh=null;var d=es,y=Ds;if(jn=0,Wi=es=null,Ds=0,(Bt&6)!==0)throw Error(f(331));var C=Bt;if(Bt|=4,ng(d.current),Wp(d,d.current,y,a),Bt=C,cu(0,!1),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(ml,d)}catch{}return!0}finally{ge.p=r,ae.T=l,yg(e,t)}}function bg(e,t,a){t=qa(a,t),t=Kf(e.stateNode,t,2),e=ks(e,t,2),e!==null&&($(e,2),Bs(e))}function Kt(e,t,a){if(e.tag===3)bg(e,e,a);else for(;t!==null;){if(t.tag===3){bg(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Po===null||!Po.has(l))){e=qa(a,e),a=mp(2),l=ks(t,a,2),l!==null&&(pp(a,l,t,e),$(l,2),Bs(l));break}}t=t.return}}function Ah(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new bv;var r=new Set;l.set(t,r)}else r=l.get(t),r===void 0&&(r=new Set,l.set(t,r));r.has(a)||(xh=!0,r.add(a),e=Tv.bind(null,e,t,a),t.then(e,e))}function Tv(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,en===e&&(xt&a)===a&&(($n===4||$n===3&&(xt&62914560)===xt&&300>rt()-Bd)&&(Bt&2)===0?Ic(e,0):Dd|=a,Zc===xt&&(Zc=0)),Bs(e)}function vg(e,t){t===0&&(t=ho()),e=Sl(e,t),e!==null&&($(e,t),Bs(e))}function Cv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),vg(e,a)}function Ev(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(f(314))}l!==null&&l.delete(t),vg(e,a)}function Mv(e,t){return Pn(e,t)}var er=null,tr=null,$h=!1,Yd=!1,zh=!1,Io=0;function Bs(e){e!==tr&&e.next===null&&(tr===null?er=tr=e:tr=tr.next=e),Yd=!0,$h||($h=!0,$v())}function cu(e,t){if(!zh&&Yd){zh=!0;do for(var a=!1,l=er;l!==null;){if(e!==0){var r=l.pendingLanes;if(r===0)var d=0;else{var y=l.suspendedLanes,C=l.pingedLanes;d=(1<<31-Jn(42|e)+1)-1,d&=r&~(y&~C),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Ng(l,d))}else d=xt,d=is(l,l===en?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||tn(l,d)||(a=!0,Ng(l,d));l=l.next}while(a);zh=!1}}function Av(){xg()}function xg(){Yd=$h=!1;var e=0;Io!==0&&Vv()&&(e=Io);for(var t=rt(),a=null,l=er;l!==null;){var r=l.next,d=wg(l,t);d===0?(l.next=null,a===null?er=r:a.next=r,r===null&&(tr=a)):(a=l,(e!==0||(d&3)!==0)&&(Yd=!0)),l=r}jn!==0&&jn!==5||cu(e),Io!==0&&(Io=0)}function wg(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-Jn(d),C=1<<y,O=r[y];O===-1?((C&a)===0||(C&l)!==0)&&(r[y]=Ot(C,t)):O<=t&&(e.expiredLanes|=C),d&=~C}if(t=en,a=xt,a=is(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ct(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||tn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&ct(l),Ge(a)){case 2:case 8:a=Dl;break;case 32:a=qt;break;case 268435456:a=as;break;default:a=qt}return l=jg.bind(null,e),a=Pn(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&ct(l),e.callbackPriority=2,e.callbackNode=null,2}function jg(e,t){if(jn!==0&&jn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Gd()&&e.callbackNode!==a)return null;var l=xt;return l=is(e,e===en?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(ig(e,l,t),wg(e,rt()),e.callbackNode!=null&&e.callbackNode===a?jg.bind(null,e):null)}function Ng(e,t){if(Gd())return null;ig(e,t,!0)}function $v(){Yv(function(){(Bt&6)!==0?Pn(Ea,Av):xg()})}function Oh(){if(Io===0){var e=Ps;e===0&&(e=Oa,Oa<<=1,(Oa&261888)===0&&(Oa=256)),Io=e}return Io}function Sg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(e)}function zv(e,t,a,l,r){if(t==="submit"&&a&&a.stateNode===r){var d=Sg((r[da]||null).action),y=l.submitter;y&&(t=(t=y[da]||null)?Sg(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var C=new qs("action","action",null,l,r);e.push({event:C,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Io!==0){var O=new FormData(r,y);Fi(a,{pending:!0,data:O,method:r.method,action:d},null,O)}}else typeof d=="function"&&(C.preventDefault(),O=new FormData(r,y),Fi(a,{pending:!0,data:O,method:r.method,action:d},d,O))},currentTarget:r}]})}}for(var Rh=0;Rh<Ao.length;Rh++){var Dh=Ao[Rh],Ov=Dh.toLowerCase(),Rv=Dh[0].toUpperCase()+Dh.slice(1);sl(Ov,"on"+Rv)}sl(pc,"onAnimationEnd"),sl(Mo,"onAnimationIteration"),sl(Gl,"onAnimationStart"),sl("dblclick","onDoubleClick"),sl("focusin","onFocus"),sl("focusout","onBlur"),sl(ad,"onTransitionRun"),sl(ld,"onTransitionStart"),sl(sd,"onTransitionCancel"),sl(wi,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),Hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hl("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(" "),Dv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ru));function kg(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],r=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var y=l.length-1;0<=y;y--){var C=l[y],O=C.instance,Y=C.currentTarget;if(C=C.listener,O!==d&&r.isPropagationStopped())break e;d=C,r.currentTarget=Y;try{d(r)}catch(J){gc(J)}r.currentTarget=null,d=O}else for(y=0;y<l.length;y++){if(C=l[y],O=C.instance,Y=C.currentTarget,C=C.listener,O!==d&&r.isPropagationStopped())break e;d=C,r.currentTarget=Y;try{d(r)}catch(J){gc(J)}r.currentTarget=null,d=O}}}}function yt(e,t){var a=t[ui];a===void 0&&(a=t[ui]=new Set);var l=e+"__bubble";a.has(l)||(Tg(t,e,2,!1),a.add(l))}function Bh(e,t,a){var l=0;t&&(l|=4),Tg(a,e,l,t)}var Xd="_reactListening"+Math.random().toString(36).slice(2);function Hh(e){if(!e[Xd]){e[Xd]=!0,Lu.forEach(function(a){a!=="selectionchange"&&(Dv.has(a)||Bh(a,!1,e),Bh(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xd]||(t[Xd]=!0,Bh("selectionchange",!1,t))}}function Tg(e,t,a,l){switch(py(t)){case 2:var r=Cx;break;case 8:r=Ex;break;default:r=am}a=r.bind(null,t,a,e),r=void 0,!Us||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),l?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Lh(e,t,a,l,r){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var C=l.stateNode.containerInfo;if(C===r)break;if(y===4)for(y=l.return;y!==null;){var O=y.tag;if((O===3||O===4)&&y.stateNode.containerInfo===r)return;y=y.return}for(;C!==null;){if(y=cs(C),y===null)return;if(O=y.tag,O===5||O===6||O===26||O===27){l=d=y;continue e}C=C.parentNode}}l=l.return}jr(function(){var Y=d,J=gi(a),oe=[];e:{var q=ji.get(e);if(q!==void 0){var P=qs,Te=e;switch(e){case"keypress":if(hs(a)===0)break e;case"keydown":case"keyup":P=Ku;break;case"focusin":Te="focus",P=wl;break;case"focusout":Te="blur",P=wl;break;case"beforeblur":case"afterblur":P=wl;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=kr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=$f;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=jl;break;case pc:case Mo:case Gl:P=qu;break;case wi:P=mn;break;case"scroll":case"scrollend":P=Wt;break;case"wheel":P=La;break;case"copy":case"cut":case"paste":P=Gu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=rc;break;case"submit":P=Rf;break;case"toggle":case"beforetoggle":P=Ju}var He=(t&4)!==0,st=!He&&(e==="scroll"||e==="scrollend"),G=He?q!==null?q+"Capture":null:q;He=[];for(var _=Y,F;_!==null;){var le=_;if(F=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||F===null||G===null||(le=Ia(_,G),le!=null&&He.push(uu(_,le,F))),st)break;_=_.return}0<He.length&&(q=new P(q,Te,null,a,J),oe.push({event:q,listeners:He}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",P&&a!==ic&&(Te=a.relatedTarget||a.fromElement)&&(cs(Te)||Te[Ra]))break e;(q||P)&&(Te=J.window===J?J:(P=J.ownerDocument)?P.defaultView||P.parentWindow:window,q?(P=a.relatedTarget||a.toElement,q=Y,P=P?cs(P):null,P!==null&&(st=p(P),He=P.tag,P!==st||He!==5&&He!==27&&He!==6)&&(P=null)):(q=null,P=Y),q!==P&&(He=kr,le="onMouseLeave",G="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(He=rc,le="onPointerLeave",G="onPointerEnter",_="pointer"),st=q==null?Te:po(q),F=P==null?Te:po(P),Te=new He(le,_+"leave",q,a,J),Te.target=st,Te.relatedTarget=F,le=null,cs(J)===Y&&(He=new He(G,_+"enter",P,a,J),He.target=F,He.relatedTarget=st,le=He),st=le,He=q&&P?ce(q,P,Bv):null,q!==null&&Cg(oe,Te,q,He,!1),P!==null&&st!==null&&Cg(oe,st,P,He,!0)))}e:{if(q=Y?po(Y):window,P=q.nodeName&&q.nodeName.toLowerCase(),P==="select"||P==="input"&&q.type==="file")var De=jo;else if(Wu(q))if(Vl)De=td;else{De=Ar;var wt=hc}else P=q.nodeName,!P||P.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?Y&&Ja(Y.elementType)&&(De=jo):De=mc;if(De&&(De=De(e,Y))){tl(oe,De,a,J);break e}wt&&wt(e,q,Y)}switch(wt=Y?po(Y):window,e){case"focusin":(Wu(wt)||wt.contentEditable==="true")&&(Nl=wt,xi=Y,ko=null);break;case"focusout":ko=xi=Nl=null;break;case"mousedown":To=!0;break;case"contextmenu":case"mouseup":case"dragend":To=!1,Or(oe,a,J);break;case"selectionchange":if(Hf)break;case"keydown":case"keyup":Or(oe,a,J)}var Ue;if(uc)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else dt?rn(e,a)&&(Ke="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ke="onCompositionStart");Ke&&(Er&&a.locale!=="ko"&&(dt||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&dt&&(Ue=Sa()):(ds=J,Nr="value"in ds?ds.value:ds.textContent,dt=!0)),wt=Kd(Y,Ke),0<wt.length&&(Ke=new cc(Ke,e,null,a,J),oe.push({event:Ke,listeners:wt}),Ue?Ke.data=Ue:(Ue=ms(a),Ue!==null&&(Ke.data=Ue)))),(Ue=Se?Mr(e,a):En(e,a))&&(Ke=Kd(Y,"onBeforeInput"),0<Ke.length&&(wt=new cc("onBeforeInput","beforeinput",null,a,J),oe.push({event:wt,listeners:Ke}),wt.data=Ue)),zv(oe,e,Y,a,J)}kg(oe,t)})}function uu(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Kd(e,t){for(var a=t+"Capture",l=[];e!==null;){var r=e,d=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||d===null||(r=Ia(e,a),r!=null&&l.unshift(uu(e,r,d)),r=Ia(e,t),r!=null&&l.push(uu(e,r,d))),e.tag===3)return l;e=e.return}return[]}function Bv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Cg(e,t,a,l,r){for(var d=t._reactName,y=[];a!==null&&a!==l;){var C=a,O=C.alternate,Y=C.stateNode;if(C=C.tag,O!==null&&O===l)break;C!==5&&C!==26&&C!==27||Y===null||(O=Y,r?(Y=Ia(a,d),Y!=null&&y.unshift(uu(a,Y,O))):r||(Y=Ia(a,d),Y!=null&&y.push(uu(a,Y,O)))),a=a.return}y.length!==0&&e.push({event:t,listeners:y})}var Hv=/\r\n?/g,Lv=/\u0000|\uFFFD/g;function Eg(e){return(typeof e=="string"?e:""+e).replace(Hv,`
49
+ `).replace(Lv,"")}function Mg(e,t){return t=Eg(t),Eg(e)===t}function Zt(e,t,a,l,r,d){switch(a){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||_s(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&_s(e,""+l);else return;break;case"className":yl(e,"class",l);break;case"tabIndex":yl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":yl(e,a,l);break;case"style":go(e,l,d);return;case"data":if(t!=="object"){yl(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=_l(l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Zt(e,t,"name",r.name,r,null),Zt(e,t,"formEncType",r.formEncType,r,null),Zt(e,t,"formMethod",r.formMethod,r,null),Zt(e,t,"formTarget",r.formTarget,r,null)):(Zt(e,t,"encType",r.encType,r,null),Zt(e,t,"method",r.method,r,null),Zt(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=_l(l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=vl);return;case"onScroll":l!=null&&yt("scroll",e);return;case"onScrollEnd":l!=null&&yt("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(f(60));(d!=null?d.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=_l(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":yt("beforetoggle",e),yt("toggle",e),Da(e,"popover",l);break;case"xlinkActuate":bl(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":bl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":bl(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":bl(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":bl(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":bl(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":bl(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":bl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":bl(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Da(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=yo.get(a)||a,Da(e,a,l);else return}ft=!0}function _h(e,t,a,l,r,d){switch(a){case"style":go(e,l,d);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(f(60));(d!=null?d.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"children":if(typeof l=="string")_s(e,l);else if(typeof l=="number"||typeof l=="bigint")_s(e,""+l);else return;break;case"onScroll":l!=null&&yt("scroll",e);return;case"onScrollEnd":l!=null&&yt("scrollend",e);return;case"onClick":l!=null&&(e.onclick=vl);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!pr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),d=a.slice(2,r?a.length-7:void 0),t=e[da]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(d,t,r),typeof l=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(d,l,r);break e}ft=!0,a in e?e[a]=l:l===!0?e.setAttribute(a,""):Da(e,a,l)}return}ft=!0}function pa(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",e),yt("load",e);var l=!1,r=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Zt(e,t,d,y,a,null)}}r&&Zt(e,t,"srcSet",a.srcSet,a,null),l&&Zt(e,t,"src",a.src,a,null);return;case"input":yt("invalid",e);var C=d=y=r=null,O=null,Y=null;for(l in a)if(a.hasOwnProperty(l)){var J=a[l];if(J!=null)switch(l){case"name":r=J;break;case"type":y=J;break;case"checked":O=J;break;case"defaultChecked":Y=J;break;case"value":d=J;break;case"defaultValue":C=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(f(137,t));break;default:Zt(e,t,l,J,a,null)}}Ll(e,d,C,O,Y,y,r,!1);return;case"select":yt("invalid",e),l=y=d=null;for(r in a)if(a.hasOwnProperty(r)&&(C=a[r],C!=null))switch(r){case"value":d=C;break;case"defaultValue":y=C;break;case"multiple":l=C;default:Zt(e,t,r,C,a,null)}t=d,a=y,e.multiple=!!l,t!=null?us(e,!!l,t,!1):a!=null&&us(e,!!l,a,!0);return;case"textarea":yt("invalid",e),d=r=l=null;for(y in a)if(a.hasOwnProperty(y)&&(C=a[y],C!=null))switch(y){case"value":l=C;break;case"defaultValue":r=C;break;case"children":d=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(f(91));break;default:Zt(e,t,y,C,a,null)}xr(e,l,r,d);return;case"option":for(O in a)if(a.hasOwnProperty(O)&&(l=a[O],l!=null))switch(O){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Zt(e,t,O,l,a,null)}return;case"dialog":yt("beforetoggle",e),yt("toggle",e),yt("cancel",e),yt("close",e);break;case"iframe":case"object":yt("load",e);break;case"video":case"audio":for(l=0;l<ru.length;l++)yt(ru[l],e);break;case"image":yt("error",e),yt("load",e);break;case"details":yt("toggle",e);break;case"embed":case"source":case"link":yt("error",e),yt("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(Y in a)if(a.hasOwnProperty(Y)&&(l=a[Y],l!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Zt(e,t,Y,l,a,null)}return;default:if(Ja(t)){for(J in a)a.hasOwnProperty(J)&&(l=a[J],l!==void 0&&_h(e,t,J,l,a,void 0));return}}for(C in a)a.hasOwnProperty(C)&&(l=a[C],l!=null&&Zt(e,t,C,l,a,null))}var _v={};function Uv(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,d=null,y=null,C=null,O=null,Y=null,J=null;for(P in a){var oe=a[P];if(a.hasOwnProperty(P)&&oe!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":O=oe;default:l.hasOwnProperty(P)||Zt(e,t,P,null,l,oe)}}for(var q in l){var P=l[q];if(oe=a[q],l.hasOwnProperty(q)&&(P!=null||oe!=null))switch(q){case"type":P!==oe&&(ft=!0),d=P;break;case"name":P!==oe&&(ft=!0),r=P;break;case"checked":P!==oe&&(ft=!0),Y=P;break;case"defaultChecked":P!==oe&&(ft=!0),J=P;break;case"value":P!==oe&&(ft=!0),y=P;break;case"defaultValue":P!==oe&&(ft=!0),C=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(f(137,t));break;default:P!==oe&&Zt(e,t,q,P,l,oe)}}mi(e,y,C,O,Y,J,d,r);return;case"select":P=y=C=q=null;for(d in a)if(O=a[d],a.hasOwnProperty(d)&&O!=null)switch(d){case"value":break;case"multiple":P=O;default:l.hasOwnProperty(d)||Zt(e,t,d,null,l,O)}for(r in l)if(d=l[r],O=a[r],l.hasOwnProperty(r)&&(d!=null||O!=null))switch(r){case"value":d!==O&&(ft=!0),q=d;break;case"defaultValue":d!==O&&(ft=!0),C=d;break;case"multiple":d!==O&&(ft=!0),y=d;default:d!==O&&Zt(e,t,r,d,l,O)}t=C,a=y,l=P,q!=null?us(e,!!a,q,!1):!!l!=!!a&&(t!=null?us(e,!!a,t,!0):us(e,!!a,a?[]:"",!1));return;case"textarea":P=q=null;for(C in a)if(r=a[C],a.hasOwnProperty(C)&&r!=null&&!l.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Zt(e,t,C,null,l,r)}for(y in l)if(r=l[y],d=a[y],l.hasOwnProperty(y)&&(r!=null||d!=null))switch(y){case"value":r!==d&&(ft=!0),q=r;break;case"defaultValue":r!==d&&(ft=!0),P=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(f(91));break;default:r!==d&&Zt(e,t,y,r,l,d)}vr(e,q,P);return;case"option":for(var Te in a)if(q=a[Te],a.hasOwnProperty(Te)&&q!=null&&!l.hasOwnProperty(Te))switch(Te){case"selected":e.selected=!1;break;default:Zt(e,t,Te,null,l,q)}for(O in l)if(q=l[O],P=a[O],l.hasOwnProperty(O)&&q!==P&&(q!=null||P!=null))switch(O){case"selected":q!==P&&(ft=!0),e.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:Zt(e,t,O,q,l,P)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in a)q=a[He],a.hasOwnProperty(He)&&q!=null&&!l.hasOwnProperty(He)&&Zt(e,t,He,null,l,q);for(Y in l)if(q=l[Y],P=a[Y],l.hasOwnProperty(Y)&&q!==P&&(q!=null||P!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(f(137,t));break;default:Zt(e,t,Y,q,l,P)}return;default:if(Ja(t)){for(var st in a)q=a[st],a.hasOwnProperty(st)&&q!==void 0&&!l.hasOwnProperty(st)&&_h(e,t,st,void 0,l,q);for(J in l)q=l[J],P=a[J],!l.hasOwnProperty(J)||q===P||q===void 0&&P===void 0||_h(e,t,J,q,l,P);return}}for(var G in a)q=a[G],a.hasOwnProperty(G)&&q!=null&&!l.hasOwnProperty(G)&&Zt(e,t,G,null,l,q);for(oe in l)q=l[oe],P=a[oe],!l.hasOwnProperty(oe)||q===P||q==null&&P==null||Zt(e,t,oe,q,l,P)}function Ag(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var r=a[l],d=r.transferSize,y=r.initiatorType,C=r.duration;if(d&&C&&Ag(y)){for(y=0,C=r.responseEnd,l+=1;l<a.length;l++){var O=a[l],Y=O.startTime;if(Y>C)break;var J=O.transferSize,oe=O.initiatorType;J&&Ag(oe)&&(O=O.responseEnd,y+=J*(O<C?1:(C-Y)/(O-Y)))}if(--l,t+=8*(d+y)/(r.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 Uh=null,qh=null;function du(e){return e.nodeType===9?e:e.ownerDocument}function $g(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 zg(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 Og(e,t,a,l){return a=du(a).createElement(e),a[zn]=l,a[da]=t,pa(a,e,t),Un(a),a}function Vh(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 Gh=null;function Vv(){var e=window.event;return e&&e.type==="popstate"?e===Gh?!1:(Gh=e,!0):(Gh=null,!1)}var Yh=typeof setTimeout=="function"?setTimeout:void 0,Gv=typeof clearTimeout=="function"?clearTimeout:void 0,Rg=typeof Promise=="function"?Promise:void 0,Dg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Yh,Yv=typeof queueMicrotask=="function"?queueMicrotask:typeof Rg<"u"?function(e){return Rg.resolve(null).then(e).catch(Xv)}:Yh;function Xv(e){setTimeout(function(){throw e})}function Wo(e){return e==="head"}function Bg(e,t){var a=t,l=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(r),cr(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Ih(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ih(a);for(var d=a.firstChild;d;){var y=d.nextSibling,C=d.nodeName;d[nn]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=y}}else a==="body"&&Ih(e.ownerDocument.body);a=r}while(a);cr(t)}function Hg(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function Lg(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var r=l=0;r<t.length;r++){var d=t[r];0<d.width&&0<d.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function _g(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Kv(e,t,a){return a=a.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<=a.innerHeight&&e.left<=a.innerWidth}}function Xh(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return Kv(t,a,e)}function Zv(e){return e.documentElement.clientHeight}function Fv(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Qv(e,t,a,l,r,d,y,C,O){var Y=t.nodeType===9?t:t.ownerDocument;try{var J=Y.startViewTransition({update:function(){var q=Y.defaultView,P=q.navigation&&q.navigation.transition,Te=Y.fonts.status;l();var He=[];if(Te==="loaded"&&(Zv(Y),Y.fonts.status==="loading"&&He.push(Y.fonts.ready)),Te=He.length,e!==null)for(var st=e.suspenseyImages,G=0,_=0;_<st.length;_++){var F=st[_];if(!F.complete){var le=F.getBoundingClientRect();if(0<le.bottom&&0<le.right&&le.top<q.innerHeight&&le.left<q.innerWidth){if(G+=oy(F),G>Qd){He.length=Te;break}F=new Promise(Fv.bind(F)),He.push(F)}}}if(0<He.length)return q=Promise.race([Promise.all(He),new Promise(function(De){return setTimeout(De,500)})]).then(r,r),(P?Promise.allSettled([P.finished,q]):q).then(d,d);if(r(),P)return P.finished.then(d,d);d()},types:a});Y.__reactViewTransition=J;var oe=[];return J.ready.then(function(){for(var q=Y.documentElement.getAnimations({subtree:!0}),P=0;P<q.length;P++){var Te=q[P],He=Te.effect,st=He.pseudoElement;if(st!=null&&st.startsWith("::view-transition")){oe.push(Te),Te=He.getKeyframes();for(var G=st=void 0,_=!0,F=0;F<Te.length;F++){var le=Te[F],De=le.width;if(st===void 0)st=De;else if(st!==De){_=!1;break}if(De=le.height,G===void 0)G=De;else if(G!==De){_=!1;break}delete le.width,delete le.height,le.transform==="none"&&delete le.transform}_&&st!==void 0&&G!==void 0&&(He.setKeyframes(Te),_=getComputedStyle(He.target,He.pseudoElement),_.width!==st||_.height!==G)&&(_=Te[0],_.width=st,_.height=G,_=Te[Te.length-1],_.width=st,_.height=G,He.setKeyframes(Te))}}y()},function(q){Y.__reactViewTransition===J&&(Y.__reactViewTransition=null);try{if(typeof q=="object"&&q!==null)switch(q.name){case"InvalidStateError":(q.message==="View transition was skipped because document visibility state is hidden."||q.message==="Skipping view transition because document visibility state has become hidden."||q.message==="Skipping view transition because viewport size changed."||q.message==="Transition was aborted because of invalid state")&&(q=null)}q!==null&&O(q)}finally{l(),r(),y()}}),J.finished.finally(function(){for(var q=0;q<oe.length;q++)oe[q].cancel();Y.__reactViewTransition===J&&(Y.__reactViewTransition=null),C()}),J}catch{return l(),r(),y(),null}}function ec(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ec.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:ie({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ec.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),l=[],r=0;r<a.length;r++){var d=a[r].effect;d!==null&&d.target===e&&d.pseudoElement===t&&l.push(a[r])}return l},ec.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ug(e){return{name:e,group:new ec("group",e),imagePair:new ec("image-pair",e),old:new ec("old",e),new:new ec("new",e)}}function fl(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}fl.prototype.addEventListener=function(e,t,a){var l=null,r=null;if(!(a!=null&&typeof a!="boolean"&&(l=a.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var d=this._eventListeners;if(Vg(d,e,t,a)===-1){var y=this,C=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(C=function(O){y.removeEventListener(e,t,a),typeof t=="function"?t.call(this,O):t.handleEvent(O)}),l!==null&&(r=y.removeEventListener.bind(y,e,t,a),l.addEventListener("abort",r,{once:!0}),r=l.removeEventListener.bind(l,"abort",r)),l=nr(a),d.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:C,cleanup:r}),w(this._fragmentFiber.child,!1,Pv,e,C,l)}this._eventListeners=d}};function Pv(e,t,a,l){return B(e).addEventListener(t,a,l),!1}fl.prototype.removeEventListener=function(e,t,a){var l=this._eventListeners;if(l!==null&&(t=Vg(l,e,t,a),t!==-1)){var r=l[t];a=r.attachedListener;var d=r.cleanup;r=nr(r.optionsOrUseCapture),w(this._fragmentFiber.child,!1,Jv,e,a,r),l.splice(t,1),d!==null&&d()}};function Jv(e,t,a,l){return B(e).removeEventListener(t,a,l),!1}function nr(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Vg(e,t,a,l){if(e.length===0)return-1;l=qg(l);for(var r=0;r<e.length;r++){var d=e[r];if(d.type===t&&d.listener===a&&qg(d.optionsOrUseCapture)===l)return r}return-1}fl.prototype.dispatchEvent=function(e){var t=k(this._fragmentFiber);if(t===null)return!0;t=B(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var r=0;r<a.length;r++){var d=a[r];l.addEventListener(d.type,d.attachedListener,nr(d.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),a)for(r=0;r<a.length;r++)d=a[r],l.removeEventListener(d.type,d.attachedListener,nr(d.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},fl.prototype.focus=function(e){w(this._fragmentFiber.child,!0,Gg,e,void 0,void 0)};function Gg(e,t){return e.tag===6?!1:(e=B(e),rx(e,t))}fl.prototype.focusLast=function(e){var t=[];w(this._fragmentFiber.child,!0,Kh,t,void 0,void 0);for(var a=t.length-1;0<=a&&!Gg(t[a],e);a--);};function Kh(e,t){return t.push(e),!1}fl.prototype.blur=function(){var e=k(this._fragmentFiber);e!==null&&(e=B(e),e=du(e).activeElement,e!==null&&w(this._fragmentFiber.child,!1,Iv,e,void 0,void 0))};function Iv(e,t){return e.tag===6?!1:(e=B(e),e===t||e.contains(t)?(t.blur(),!0):!1)}fl.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),w(this._fragmentFiber.child,!1,Wv,e,void 0,void 0)};function Wv(e,t){return e.tag===6||(e=B(e),t.observe(e)),!1}fl.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),w(this._fragmentFiber.child,!1,ex,e,void 0,void 0);for(var a=t=0;a<ts.length;a++){var l=ts[a];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):ts[t++]=l}ts.length=t}};function ex(e,t){return e.tag===6||(e=B(e),t.unobserve(e)),!1}var ts=[],Zh=!1;function tx(e,t,a){ts.push({fragmentInstance:e,observer:t,instance:a}),Zh||(Zh=!0,ux(function(){Zh=!1;var l=ts;ts=[];for(var r=0;r<l.length;r++){var d=l[r];d.observer.unobserve(d.instance)}}))}fl.prototype.getClientRects=function(){var e=[];return w(this._fragmentFiber.child,!1,nx,e,void 0,void 0),e};function nx(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=B(e),t.push.apply(t,e.getClientRects());return!1}fl.prototype.getRootNode=function(e){var t=k(this._fragmentFiber);return t===null?this:B(t).getRootNode(e)},fl.prototype.compareDocumentPosition=function(e){var t=k(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];w(this._fragmentFiber.child,!1,Kh,a,void 0,void 0);var l=B(t);if(a.length===0){if(a=l,z(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&&(a=t)}t=this._fragmentFiber;var r=l=a.compareDocumentPosition(e);return a===e?r=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=R(t)[1],a===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=B(a).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=B(a[0]),r=B(a[a.length-1]);var d=z(this._fragmentFiber)?t.parentElement:l;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=d.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var y=t.compareDocumentPosition(e),C=r.compareDocumentPosition(e),O=y&Node.DOCUMENT_POSITION_CONTAINED_BY||C&Node.DOCUMENT_POSITION_CONTAINED_BY;return C=l&&d&&y&Node.DOCUMENT_POSITION_FOLLOWING&&C&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||d&&r===e||O||C?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!d&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:y,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||ax(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function ax(e,t,a,l,r){var d=cs(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!d)e:{for(;d!==null;){if(d.tag===7&&(d===t||d.alternate===t)){a=!0;break e}d=d.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(d===null)return d=r.ownerDocument,r===d||r===d.documentElement||r===d.body;e:{for(d=t,t=k(t);d!==null;){if(!(d.tag!==5&&d.tag!==3&&d.tag!==27||d!==t&&d.alternate!==t)){d=!0;break e}d=d.return}d=!1}return d}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!d)&&!(t=d===a)&&(t=ce(a,d,ee),t===null?t=!1:(w(t,!0,X,d,a),d=V,V=null,t=d!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!d)&&!(t=d===l)&&(t=ce(l,d,ee),t===null?t=!1:(w(t,!0,te,d,l),d=V,M=V=null,t=d!==null)),t):!1}function Yg(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}fl.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(f(566));var t=[];w(this._fragmentFiber.child,!1,Kh,t,void 0,void 0);var a=e!==!1;if(t.length===0){var l=R(this._fragmentFiber);if(l=a?l[1]||l[0]||k(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=B(l),Yg(e,a);return}if(l=B(l),l.nodeType!==9){if(l.nodeType===11){a="host"in l?l.host:null,a!==null&&a.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=a?t.length-1:0;l!==(a?-1:t.length);){var r=t[l];r.tag===6?(r=B(r),Yg(r,a)):B(r).scrollIntoView(e),l+=a?-1:1}};function lx(e,t){return e=B(e),Xg(e,t),!1}function Xg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Kg(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var r=a[l];e.addEventListener(r.type,r.attachedListener,nr(r.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(d){for(var y=0,C=0;C<ts.length;C++){var O=ts[C];(O.fragmentInstance!==t||O.observer!==d||O.instance!==e)&&(ts[y++]=O)}ts.length=y,d.observe(e)}),Xg(e,t))}function sx(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var r=a[l];e.removeEventListener(r.type,r.attachedListener,nr(r.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(d){typeof d.rootMargin=="string"?tx(t,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Fh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Fh(a),di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ox(e,t,a,l){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[nn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=$l(e.nextSibling),e===null)break}return null}function ix(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=$l(e.nextSibling),e===null))return null;return e}function Zg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$l(e.nextSibling),e===null))return null;return e}function Qh(e){return e.data==="$?"||e.data==="$~"}function Ph(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cx(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function $l(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 Jh=null;function Fg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return $l(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Qg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function rx(e,t){function a(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return l}function ux(e){Dg(function(){Dg(function(t){return e(t)})})}function Pg(e,t,a){switch(t=du(a),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 Jg(e,t,a){for(var l in a){var r=a[l];a.hasOwnProperty(l)&&r!=null&&Zt(e,t,l,null,_v,r)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===vl&&(e.onclick=null),di(e)}function Ih(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);di(e)}var zl=new Map,Ig=new Set;function fu(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 ro=ge.d;ge.d={f:dx,r:fx,D:hx,C:mx,L:px,m:gx,X:bx,S:yx,M:vx};function dx(){var e=ro.f(),t=Ud();return e||t}function fx(e){var t=mo(e);t!==null&&t.tag===5&&t.type==="form"?ep(t):ro.r(e)}var ar=typeof document>"u"?null:document;function Wg(e,t,a){var l=ar;if(l&&typeof t=="string"&&t){var r=Rn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Ig.has(r)||(Ig.add(r),e={rel:e,crossOrigin:a,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),pa(t,"link",e),Un(t),l.head.appendChild(t)))}}function hx(e){ro.D(e),Wg("dns-prefetch",e,null)}function mx(e,t){ro.C(e,t),Wg("preconnect",e,t)}function px(e,t,a){ro.L(e,t,a);var l=ar;if(l&&e&&t){var r='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Rn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Rn(a.imageSizes)+'"]')):r+='[href="'+Rn(e)+'"]';var d=r;switch(t){case"style":d=lr(e);break;case"script":d=sr(e)}if(!(zl.has(d)||(e=ie({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),zl.set(d,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(hu(d))||t==="script"&&l.querySelector(mu(d))))){var y=l.createElement("link");pa(y,"link",e),t==="style"&&(y[Qa]=!0,y.onload=y.onerror=function(){fi(y)}),Un(y),l.head.appendChild(y)}}}function gx(e,t){ro.m(e,t);var a=ar;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rn(l)+'"][href="'+Rn(e)+'"]',d=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=sr(e)}if(!zl.has(d)&&(e=ie({rel:"modulepreload",href:e},t),zl.set(d,e),a.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(d)))return}l=a.createElement("link"),pa(l,"link",e),Un(l),a.head.appendChild(l)}}}function yx(e,t,a){ro.S(e,t,a);var l=ar;if(l&&e){var r=Bl(l).hoistableStyles,d=lr(e);t=t||"default";var y=r.get(d);if(!y){var C={loading:0,preload:null};if(y=l.querySelector(hu(d)))C.loading=5;else{e=ie({rel:"stylesheet",href:e,"data-precedence":t},a),(a=zl.get(d))&&Wh(e,a);var O=y=l.createElement("link");Un(O),pa(O,"link",e),O._p=new Promise(function(Y,J){O.onload=Y,O.onerror=J}),O.addEventListener("load",function(){C.loading|=1}),O.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Zd(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:C},r.set(d,y)}}}function bx(e,t){ro.X(e,t);var a=ar;if(a&&e){var l=Bl(a).hoistableScripts,r=sr(e),d=l.get(r);d||(d=a.querySelector(mu(r)),d||(e=ie({src:e,async:!0},t),(t=zl.get(r))&&em(e,t),d=a.createElement("script"),Un(d),pa(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(r,d))}}function vx(e,t){ro.M(e,t);var a=ar;if(a&&e){var l=Bl(a).hoistableScripts,r=sr(e),d=l.get(r);d||(d=a.querySelector(mu(r)),d||(e=ie({src:e,async:!0,type:"module"},t),(t=zl.get(r))&&em(e,t),d=a.createElement("script"),Un(d),pa(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(r,d))}}function ey(e,t,a,l){var r=(r=Nn.current)?fu(r):null;if(!r)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=lr(a.href),t=Bl(r).hoistableStyles,l=t.get(a),l||(l={type:"style",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=lr(a.href);var d=Bl(r).hoistableStyles,y=d.get(e);if(y||(r=r.ownerDocument||r,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=r.querySelector(hu(e)))?d._p||(y.instance=d,y.state.loading=5):(d=zl.get(e),d||(d={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},zl.set(e,d)),xx(r,e,d,y.state))),t&&l===null)throw Error(f(528,""));return y}if(t&&l!==null)throw Error(f(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=sr(a),t=Bl(r).hoistableScripts,l=t.get(a),l||(l={type:"script",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function lr(e){return'href="'+Rn(e)+'"'}function hu(e){return'link[rel="stylesheet"]['+e+"]"}function ty(e){return ie({},e,{"data-precedence":e.precedence,precedence:null})}function xx(e,t,a,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Qa]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Qa]=!0,t.onload=t.onerror=fi.bind(null,t),pa(t,"link",a),Un(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function sr(e){return'[src="'+Rn(e)+'"]'}function mu(e){return"script[async]"+e}function ny(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Rn(a.href)+'"]');if(l)return t.instance=l,Un(l),l;var r=ie({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Un(l),pa(l,"style",r),Zd(l,a.precedence,e),t.instance=l;case"stylesheet":r=lr(a.href);var d=e.querySelector(hu(r));if(d)return t.state.loading|=4,t.instance=d,Un(d),d;l=ty(a),(r=zl.get(r))&&Wh(l,r),d=(e.ownerDocument||e).createElement("link"),Un(d);var y=d;return y._p=new Promise(function(C,O){y.onload=C,y.onerror=O}),pa(d,"link",l),t.state.loading|=4,Zd(d,a.precedence,e),t.instance=d;case"script":return d=sr(a.src),(r=e.querySelector(mu(d)))?(t.instance=r,Un(r),r):(l=a,(r=zl.get(d))&&(l=ie({},a),em(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),Un(r),pa(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Zd(l,a.precedence,e));return t.instance}function Zd(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,d=r,y=0;y<l.length;y++){var C=l[y];if(C.dataset.precedence===t)d=C;else if(d!==r)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Wh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function em(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fd=null;function ay(e,t,a){if(Fd===null){var l=new Map,r=Fd=new Map;r.set(a,l)}else r=Fd,l=r.get(a),l||(l=new Map,r.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var d=a[r];if(!(d[nn]||d[zn]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var C=l.get(y);C?C.push(d):l.set(y,[d])}}return l}function tm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function wx(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;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 ly(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function sy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function oy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function iy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=oy(t),e.suspenseyImages.push(t)),e=Sx.bind(e),t.decode().then(e,e))}function jx(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=lr(l.href),d=t.querySelector(hu(r));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pu.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Un(d);return}d=t.ownerDocument||t,l=ty(l),(r=zl.get(r))&&Wh(l,r),d=d.createElement("link"),Un(d);var y=d;y._p=new Promise(function(C,O){y.onload=C,y.onerror=O}),pa(d,"link",l),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=pu.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Qd=0;function Nx(e,t){return e.stylesheets&&e.count===0&&Jd(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Jd(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Qd===0&&(Qd=62500*qv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Jd(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Qd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(r)}}:null}function cy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Jd(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function pu(){this.count--,cy(this)}function Sx(){this.imgCount--,cy(this)}var Pd=null;function Jd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Pd=new Map,t.forEach(kx,e),Pd=null,pu.call(e))}function kx(e,t){if(!(t.state.loading&4)){var a=Pd.get(e);if(a)var l=a.get(null);else{a=new Map,Pd.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<r.length;d++){var y=r[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),l=y)}l&&a.set(null,l)}r=t.instance,y=r.getAttribute("data-precedence"),d=a.get(y)||l,d===l&&a.set(null,r),a.set(y,r),this.count++,l=pu.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),d?d.parentNode.insertBefore(r,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var or={$$typeof:Fe,Provider:null,Consumer:null,_currentValue:Et,_currentValue2:Et,_threadCount:0};function Tx(e,t,a,l,r,d,y,C,O){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=ac(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ac(0),this.hiddenUpdates=ac(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.transitionTypes=null,this.incompleteTransitions=new Map}function ry(e,t,a,l,r,d,y,C,O,Y,J,oe){return e=new Tx(e,t,a,y,O,Y,J,oe,C),t=1,d===!0&&(t|=24),d=qn(3,null,null,t),e.current=d,d.stateNode=e,t=Sc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:l,isDehydrated:a,cache:t},Uo(d),e}function uy(e){return e?(e=Xs,e):Xs}function dy(e,t,a,l,r,d){r=uy(r),l.context===null?l.context=r:l.pendingContext=r,l=Cl(t),l.payload={element:a},d=d===void 0?null:d,d!==null&&(l.callback=d),a=ks(e,l,t),a!==null&&(Za(a,e,t),to(a,e,t))}function fy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function nm(e,t){fy(e,t),(e=e.alternate)&&fy(e,t)}function hy(e){if(e.tag===13||e.tag===31){var t=Sl(e,67108864);t!==null&&Za(t,e,67108864),nm(e,67108864)}}function my(e){if(e.tag===13||e.tag===31){var t=dl();t=nt(t);var a=Sl(e,t);a!==null&&Za(a,e,t),nm(e,t)}}var ir=!0;function Cx(e,t,a,l){var r=ae.T;ae.T=null;var d=ge.p;try{ge.p=2,am(e,t,a,l)}finally{ge.p=d,ae.T=r}}function Ex(e,t,a,l){var r=ae.T;ae.T=null;var d=ge.p;try{ge.p=8,am(e,t,a,l)}finally{ge.p=d,ae.T=r}}function am(e,t,a,l){if(ir){var r=lm(l);if(r===null)Lh(e,t,l,Id,a),gy(e,l);else if(Ax(r,e,t,a,l))l.stopPropagation();else if(gy(e,l),t&4&&-1<Mx.indexOf(e)){for(;r!==null;){var d=mo(r);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=_n(d.pendingLanes);if(y!==0){var C=d;for(C.pendingLanes|=2,C.entangledLanes|=2;y;){var O=1<<31-Jn(y);C.entanglements[1]|=O,y&=~O}Bs(d),(Bt&6)===0&&(Hd=rt()+500,cu(0))}}break;case 31:case 13:C=Sl(d,2),C!==null&&Za(C,d,2),Ud(),nm(d,2)}if(d=lm(l),d===null&&Lh(e,t,l,Id,a),d===r)break;r=d}r!==null&&l.stopPropagation()}else Lh(e,t,l,null,a)}}function lm(e){return e=gi(e),sm(e)}var Id=null;function sm(e){if(Id=null,e=cs(e),e!==null){var t=p(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=b(t),e!==null)return e;e=null}else if(a===31){if(e=N(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Id=e,null}function py(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(bt()){case Ea:return 2;case Dl:return 8;case qt:case St:return 32;case as:return 268435456;default:return 32}default:return 32}}var om=!1,ei=null,ti=null,ni=null,gu=new Map,yu=new Map,ai=[],Mx="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 gy(e,t){switch(e){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":ti=null;break;case"mouseover":case"mouseout":ni=null;break;case"pointerover":case"pointerout":gu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yu.delete(t.pointerId)}}function bu(e,t,a,l,r,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:d,targetContainers:[r]},t!==null&&(t=mo(t),t!==null&&hy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Ax(e,t,a,l,r){switch(t){case"focusin":return ei=bu(ei,e,t,a,l,r),!0;case"dragenter":return ti=bu(ti,e,t,a,l,r),!0;case"mouseover":return ni=bu(ni,e,t,a,l,r),!0;case"pointerover":var d=r.pointerId;return gu.set(d,bu(gu.get(d)||null,e,t,a,l,r)),!0;case"gotpointercapture":return d=r.pointerId,yu.set(d,bu(yu.get(d)||null,e,t,a,l,r)),!0}return!1}function yy(e){var t=cs(e.target);if(t!==null){var a=p(t);if(a!==null){if(t=a.tag,t===13){if(t=b(a),t!==null){e.blockedOn=t,sa(e.priority,function(){my(a)});return}}else if(t===31){if(t=N(a),t!==null){e.blockedOn=t,sa(e.priority,function(){my(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=lm(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);ic=l,a.target.dispatchEvent(l),ic=null}else return t=mo(a),t!==null&&hy(t),e.blockedOn=a,!1;t.shift()}return!0}function by(e,t,a){Wd(e)&&a.delete(t)}function $x(){om=!1,ei!==null&&Wd(ei)&&(ei=null),ti!==null&&Wd(ti)&&(ti=null),ni!==null&&Wd(ni)&&(ni=null),gu.forEach(by),yu.forEach(by)}function ef(e,t){e.blockedOn===t&&(e.blockedOn=null,om||(om=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$x)))}var tf=null;function vy(e){tf!==e&&(tf=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){tf===e&&(tf=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(sm(l||a)===null)continue;break}var d=mo(a);d!==null&&(e.splice(t,3),t-=3,Fi(d,{pending:!0,data:r,method:a.method,action:l},l,r))}}))}function cr(e){function t(O){return ef(O,e)}ei!==null&&ef(ei,e),ti!==null&&ef(ti,e),ni!==null&&ef(ni,e),gu.forEach(t),yu.forEach(t);for(var a=0;a<ai.length;a++){var l=ai[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ai.length&&(a=ai[0],a.blockedOn===null);)yy(a),a.blockedOn===null&&ai.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var r=a[l],d=a[l+1],y=r[da]||null;if(typeof d=="function")y||vy(a);else if(y){var C=null;if(d&&d.hasAttribute("formAction")){if(r=d,y=d[da]||null)C=y.formAction;else if(sm(r)!==null)continue}else C=y.action;typeof C=="function"?a[l+1]=C:(a.splice(l,3),l-=3),vy(a)}}}function xy(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return r=y})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function im(e){this._internalRoot=e}nf.prototype.render=im.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var a=t.current,l=dl();dy(a,l,e,t,null,null)},nf.prototype.unmount=im.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dy(e.current,2,null,e,null,null),Ud(),t[Ra]=null}};function nf(e){this._internalRoot=e}nf.prototype.unstable_scheduleHydration=function(e){if(e){var t=kn();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ai.length&&t!==0&&t<ai[a].priority;a++);ai.splice(a,0,e),a===0&&yy(e)}};var wy=o.version;if(wy!=="19.3.0")throw Error(f(527,wy,"19.3.0"));ge.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=E(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var zx={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ae,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var af=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!af.isDisabled&&af.supportsFiber)try{ml=af.inject(zx),hn=af}catch{}}return xu.createRoot=function(e,t){if(!m(e))throw Error(f(299));var a=!1,l="",r=up,d=dp,y=fp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=ry(e,1,!1,null,null,a,l,null,r,d,y,xy),e[Ra]=t.current,Hh(e),new im(t)},xu.hydrateRoot=function(e,t,a){if(!m(e))throw Error(f(299));var l=!1,r="",d=up,y=dp,C=fp,O=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),t=ry(e,1,!0,t,a??null,l,r,O,d,y,C,xy),t.context=uy(null),a=t.current,l=dl(),l=nt(l),r=Cl(l),r.callback=null,ks(a,r,l),a=l,t.current.lanes=a,$(t,a),Bs(t),e[Ra]=t.current,Hh(e),new nf(t)},xu.version="19.3.0",xu}var zy;function Gx(){if(zy)return um.exports;zy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),um.exports=Vx(),um.exports}var Yx=Gx();const Xm=Math.random().toString(36).slice(2),Cf=(()=>{try{let n=localStorage.getItem("design-canvas:browser");return n||localStorage.setItem("design-canvas:browser",n=Math.random().toString(36).slice(2)),n}catch{return Xm}})();let xf="";const Xx=n=>void(xf=n),lf=()=>({"X-Easel-Client":Cf,...xf?{"X-Easel-Author":encodeURIComponent(xf)}:{}});async function si(n){const o=await n.json().catch(()=>({}));if(!n.ok)throw Object.assign(new Error(o.error??n.statusText),{status:n.status,body:o});return o}const xe={board:()=>fetch("/api/board").then(n=>si(n)),update:()=>fetch("/api/update").then(n=>si(n)),applyUpdate:()=>fetch("/api/update",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(async n=>({status:n.status,body:await n.json().catch(()=>({}))})),health:()=>fetch("/api/health",{cache:"no-store"}).then(n=>si(n)),saveBoard:(n,o)=>fetch("/api/board",{method:"PUT",headers:{"Content-Type":"application/json",...lf()},body:JSON.stringify({...n,clientId:Xm,...o?{label:o}:{}})}).then(i=>si(i)),post:(n,o)=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json",...lf()},body:JSON.stringify(o)}).then(i=>si(i)),put:(n,o)=>fetch(n,{method:"PUT",headers:{"Content-Type":"application/json",...lf()},body:JSON.stringify(o)}).then(i=>si(i)),get:n=>fetch(n).then(o=>si(o)),blob:(n,o)=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json",...lf()},body:JSON.stringify(o)}).then(i=>i.ok?i.blob():si(i))};let fo=null,Em=null;function Eb(n){Em=n,(fo==null?void 0:fo.readyState)===1&&fo.send(JSON.stringify({type:"editing",file:n,client:Cf,person:xf||void 0}))}function Oy(n){(fo==null?void 0:fo.readyState)===1&&fo.send(JSON.stringify({type:"live-cursor",at:n}))}function Kx(n){let o=null,i=!1;const f=()=>{o=fo=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`),o.onopen=()=>Em&&Eb(Em),o.onmessage=m=>{try{n(JSON.parse(m.data))}catch{}},o.onclose=()=>{i||setTimeout(f,1e3)}};return f(),()=>{i=!0,o==null||o.close()}}function hl(n){const o=n.ownerDocument,i=[];let f=n;for(;f&&f!==o.body;){const m=f.parentElement;if(!m)return null;i.unshift(Array.prototype.indexOf.call(m.children,f)),f=m}return f===o.body?i.join("/"):null}function dn(n,o){let i=n.body;if(!o)return i;for(const f of o.split("/"))if(i=(i==null?void 0:i.children[Number(f)])??null,!i)return null;return i}function Rl(n){const o=n.getBoundingClientRect();return{x:o.left,y:o.top,w:o.width,h:o.height}}const Zx=["width","height","padding","margin","gap","font-family","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 Fx(n){const o=n.ownerDocument.defaultView.getComputedStyle(n),i={};for(const f of Zx)i[f]=o.getPropertyValue(f);return i}function Ry(n){const o={},i=n.style;if(!i)return o;for(let f=0;f<i.length;f++)o[i[f]]=i.getPropertyValue(i[f]);return o}function Qx(n,o,i,f){const m=f.replace(/\s+/g," ").trim().slice(0,40);return`${n} ${o} ${m?`"${m}" `:""}(${i})`}const Px={board:{d:"M3 4.5H15A0.5 0.5 0 0 1 15.5 5V13A0.5 0.5 0 0 1 15 13.5H3A0.5 0.5 0 0 1 2.5 13V5A0.5 0.5 0 0 1 3 4.5ZM3 7.5H15"},compare:{d:"M3 4.5H7A0.5 0.5 0 0 1 7.5 5V13A0.5 0.5 0 0 1 7 13.5H3A0.5 0.5 0 0 1 2.5 13V5A0.5 0.5 0 0 1 3 4.5ZM3 7.5H7M11 4.5H15A0.5 0.5 0 0 1 15.5 5V13A0.5 0.5 0 0 1 15 13.5H11A0.5 0.5 0 0 1 10.5 13V5A0.5 0.5 0 0 1 11 4.5ZM11 7.5H15"},fit:{d:"M2.5 6V2.5H6M12 2.5H15.5V6M15.5 12V15.5H12M6 15.5H2.5V12"},focus:{d:"M2.5 6V2.5H6M12 2.5H15.5V6M15.5 12V15.5H12M6 15.5H2.5V12M6 6.5H12A0.5 0.5 0 0 1 12.5 7V11A0.5 0.5 0 0 1 12 11.5H6A0.5 0.5 0 0 1 5.5 11V7A0.5 0.5 0 0 1 6 6.5Z"},panel:{d:"M3 3.5H15A0.5 0.5 0 0 1 15.5 4V14A0.5 0.5 0 0 1 15 14.5H3A0.5 0.5 0 0 1 2.5 14V4A0.5 0.5 0 0 1 3 3.5ZM6.5 3.5V14.5"},panelRight:{d:"M3 3.5H15A0.5 0.5 0 0 1 15.5 4V14A0.5 0.5 0 0 1 15 14.5H3A0.5 0.5 0 0 1 2.5 14V4A0.5 0.5 0 0 1 3 3.5ZM11.5 3.5V14.5"},canvas:{d:"M3 2.5H7A0.5 0.5 0 0 1 7.5 3V7A0.5 0.5 0 0 1 7 7.5H3A0.5 0.5 0 0 1 2.5 7V3A0.5 0.5 0 0 1 3 2.5ZM11 2.5H15A0.5 0.5 0 0 1 15.5 3V7A0.5 0.5 0 0 1 15 7.5H11A0.5 0.5 0 0 1 10.5 7V3A0.5 0.5 0 0 1 11 2.5ZM3 10.5H7A0.5 0.5 0 0 1 7.5 11V15A0.5 0.5 0 0 1 7 15.5H3A0.5 0.5 0 0 1 2.5 15V11A0.5 0.5 0 0 1 3 10.5ZM11 10.5H15A0.5 0.5 0 0 1 15.5 11V15A0.5 0.5 0 0 1 15 15.5H11A0.5 0.5 0 0 1 10.5 15V11A0.5 0.5 0 0 1 11 10.5Z"},copy:{d:"M3 2.5H9A0.5 0.5 0 0 1 9.5 3V9A0.5 0.5 0 0 1 9 9.5H3A0.5 0.5 0 0 1 2.5 9V3A0.5 0.5 0 0 1 3 2.5ZM9 8.5H15A0.5 0.5 0 0 1 15.5 9V15A0.5 0.5 0 0 1 15 15.5H9A0.5 0.5 0 0 1 8.5 15V9A0.5 0.5 0 0 1 9 8.5Z"},front:{d:"M8 7.5H15A0.5 0.5 0 0 1 15.5 8V15A0.5 0.5 0 0 1 15 15.5H8A0.5 0.5 0 0 1 7.5 15V8A0.5 0.5 0 0 1 8 7.5Z",cells:"M5 10h1v1h-1zM4 10h1v1h-1zM2 10h1v1h-1zM2 9h1v1h-1zM2 7h1v1h-1zM2 6h1v1h-1zM2 4h1v1h-1zM2 3h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1zM9 2h1v1h-1zM10 2h1v1h-1zM10 4h1v1h-1zM10 5h1v1h-1z"},back:{d:"M3 2.5H10A0.5 0.5 0 0 1 10.5 3V10A0.5 0.5 0 0 1 10 10.5H3A0.5 0.5 0 0 1 2.5 10V3A0.5 0.5 0 0 1 3 2.5Z",cells:"M12 7h1v1h-1zM13 7h1v1h-1zM15 7h1v1h-1zM15 8h1v1h-1zM15 10h1v1h-1zM15 11h1v1h-1zM15 13h1v1h-1zM15 14h1v1h-1zM14 15h1v1h-1zM13 15h1v1h-1zM11 15h1v1h-1zM10 15h1v1h-1zM8 15h1v1h-1zM7 15h1v1h-1zM7 13h1v1h-1zM7 12h1v1h-1z"},sticky:{d:"M3.5 3.5H14.5V11.5L11.5 14.5H3.5ZM11.5 14.5V11.5H14.5"},file:{d:"M4.5 2.5H10.5L13.5 5.5V15.5H4.5ZM10.5 2.5V5.5H13.5"},pdf:{d:"M4.5 2.5H10.5L13.5 5.5V15.5H4.5ZM10.5 2.5V5.5H13.5M7 9.5H11M7 12.5H10"},folder:{d:"M2.5 14.5V3.5H7.5V5.5H15.5V14.5Z"},select:{d:"M4.5 3V14L7.6 11.2L9.8 15L11.4 14.1L9.3 10.4H13Z"},hand:{d:"M6.5 10V4.5a1 1 0 0 1 2 0V9V3a1 1 0 0 1 2 0V9V4a1 1 0 0 1 2 0V9.5V6a1 1 0 0 1 2 0V11a4.5 4.5 0 0 1-4.5 4.5H9.5a4 4 0 0 1-3-1.4L3.5 10.5L5 9.5L6.5 11"},title:{d:"M3 3.5H14M8.5 3.5V15"},bold:{d:"M5.5 3.5H9.5a2.5 2.5 0 0 1 0 5H5.5ZM5.5 8.5H10.5a3 3 0 0 1 0 6H5.5Z"},italic:{d:"M8 3.5H14M4 14.5H10M11.5 3.5L6.5 14.5"},textLeft:{d:"M3 5.5H15M3 9.5H11M3 13.5H13"},textCenter:{d:"M3 5.5H15M5 9.5H13M4 13.5H14"},textRight:{d:"M3 5.5H15M7 9.5H15M5 13.5H15"},underline:{d:"M5.5 2.5V8a3.5 3.5 0 0 0 7 0V2.5M3 15.5H15"},rect:{d:"M3 5.5H15A0.5 0.5 0 0 1 15.5 6V12A0.5 0.5 0 0 1 15 12.5H3A0.5 0.5 0 0 1 2.5 12V6A0.5 0.5 0 0 1 3 5.5Z"},oval:{d:"M9 4.5c3.6 0 6.5 2 6.5 4.5S12.6 13.5 9 13.5 2.5 11.5 2.5 9 5.4 4.5 9 4.5Z"},line:{d:"M3.5 14.5L14.5 3.5"},arrow:{d:"M3.5 14.5L14.5 3.5M9.5 3.5H14.5V8.5"},pen:{d:"M2.5 12.5C4.5 6.5 5.8 5 7 5c2 0 .5 7 3 7c1.6 0 2.8-2.2 5-6.5"},image:{d:"M3 3.5H15A0.5 0.5 0 0 1 15.5 4V14A0.5 0.5 0 0 1 15 14.5H3A0.5 0.5 0 0 1 2.5 14V4A0.5 0.5 0 0 1 3 3.5ZM2.5 13.5L6.5 9.5L10 13L12 11L15.5 14.5"},person:{d:"M9 8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM3.5 15.5c.6-3 2.8-4.5 5.5-4.5s4.9 1.5 5.5 4.5"},ai:{d:"M3.5 4.5L8 9L3.5 13.5M9 13.5H15"},comment:{d:"M2.5 3.5H15.5V12.5H7.5L4.5 15.5V12.5H2.5Z"},undo:{d:"M6.5 3.5L3.5 6.5L6.5 9.5M3.5 6.5H11a3.5 3.5 0 0 1 0 7H7.5"},redo:{d:"M11.5 3.5L14.5 6.5L11.5 9.5M14.5 6.5H7a3.5 3.5 0 0 0 0 7h3.5"},share:{d:"M8.5 3V12M5.5 5.5L8.5 2.5L11.5 5.5M3.5 9.5V15.5H13.5V9.5"},download:{d:"M8.5 2.5V11.5M5.5 8.5L8.5 11.5L11.5 8.5M3.5 9.5V15.5H13.5V9.5"},expand:{d:"M10.5 2.5H15.5V7.5M15.5 2.5L10.5 7.5M7.5 15.5H2.5V10.5M2.5 15.5L7.5 10.5"},sliders:{d:"M2 5.5H10M13 5.5H16M11 3.5H12A0.5 0.5 0 0 1 12.5 4V7A0.5 0.5 0 0 1 12 7.5H11A0.5 0.5 0 0 1 10.5 7V4A0.5 0.5 0 0 1 11 3.5ZM2 12.5H5M8 12.5H16M6 10.5H7A0.5 0.5 0 0 1 7.5 11V14A0.5 0.5 0 0 1 7 14.5H6A0.5 0.5 0 0 1 5.5 14V11A0.5 0.5 0 0 1 6 10.5Z"},restore:{d:"M10.5 4.5A5 5 0 1 1 5.5 9.5V7.5M2.5 10.5L5.5 7.5L8.5 10.5"},parent:{d:"M13.5 14.5H7.5V3M4.5 5.5L7.5 2.5L10.5 5.5"},link:{d:"M7.5 11.5H5.5a3 3 0 0 1 0-6h2M10.5 5.5h2a3 3 0 0 1 0 6h-2M6 8.5H12"},chevronDown:{d:"M5.5 7L9 10.5L12.5 7"},chevronRight:{d:"M7 5.5L10.5 9L7 12.5"},chevronLeft:{d:"M11 5.5L7.5 9L11 12.5"},lock:{d:"M5 8.5H13A0.5 0.5 0 0 1 13.5 9V15A0.5 0.5 0 0 1 13 15.5H5A0.5 0.5 0 0 1 4.5 15V9A0.5 0.5 0 0 1 5 8.5ZM6.5 8V5.5a2.5 2.5 0 0 1 5 0V8"},edit:{d:"M3.5 14.5V11.5L11.5 3.5L14.5 6.5L6.5 14.5ZM9.5 5.5L12.5 8.5"},radius:{d:"M3.5 15V9.5a6 6 0 0 1 6-6H15"},spacing:{d:"M2.5 3V15M15.5 3V15M5 8.5H13"},alignLeft:{d:"M2.5 2V16M5 5.5H15M5 11.5H11"},alignHcenter:{d:"M8.5 2V16M3 5.5H15M5 11.5H13"},alignRight:{d:"M15.5 2V16M3 5.5H13M7 11.5H13"},alignTop:{d:"M2 2.5H16M5.5 5V15M11.5 5V11"},alignVcenter:{d:"M2 8.5H16M5.5 3V15M11.5 5V13"},alignBottom:{d:"M2 15.5H16M5.5 3V13M11.5 7V13"},search:{d:"M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11ZM12 12L15.5 15.5"},plus:{d:"M3 8.5H15M8.5 3V15"},minus:{d:"M3 8.5H15"},close:{d:"M4.5 4.5L13.5 13.5M13.5 4.5L4.5 13.5"},check:{d:"M3.5 9.5L7 13L14.5 5.5"},warn:{d:"M9 3.5L15 14.5H3ZM8.5 7V11",fill:"M8 12h1v1h-1z"},info:{d:"M9 15.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13ZM8.5 8V13",fill:"M8 5h1.5v1.5h-1.5z"},more:{d:"",fill:"M4 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM9 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM14 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"},trash:{d:"M2 4.5H16M6.5 4V2.5H11.5V4M4.5 5V14.5A1 1 0 0 0 5.5 15.5H12.5A1 1 0 0 0 13.5 14.5V5"},play:{d:"M5.5 3.5V14.5L14.5 9Z"},stop:{d:"M5 4.5H13A0.5 0.5 0 0 1 13.5 5V13A0.5 0.5 0 0 1 13 13.5H5A0.5 0.5 0 0 1 4.5 13V5A0.5 0.5 0 0 1 5 4.5Z"},clock:{d:"M9 15.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13ZM8.5 5V9.5H12"},eye:{d:"M2.5 9c1.9-3.2 4-4.5 6.5-4.5s4.6 1.3 6.5 4.5c-1.9 3.2-4 4.5-6.5 4.5S4.4 12.2 2.5 9ZM9 11a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}},Jx=n=>n>=28?36:n>=15?18:14;function Q({name:n,size:o=18,...i}){const f=Jx(o),m=Px[n];return s.jsxs("svg",{width:f,height:f,viewBox:f===14?"2 2 14 14":"0 0 18 18",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:4,"aria-hidden":"true",...i,children:[m.d&&s.jsx("path",{d:m.d}),m.cells&&s.jsx("path",{d:m.cells,fill:"currentColor",stroke:"none"}),m.fill&&s.jsx("path",{d:m.fill,fill:"currentColor",stroke:"none"})]})}const za=(n,o,i)=>n===1?`1 ${o}`:`${n} ${i}`,mm=n=>za(n,"variant","variants"),Ix={button:"Button",a:"Link",img:"Image",input:"Field",textarea:"Field",select:"Menu",label:"Label",p:"Paragraph",span:"Text",li:"List item",ul:"List",ol:"List",nav:"Navigation",header:"Header",footer:"Footer",main:"Main",section:"Section",form:"Form",svg:"Icon",style:"Styles",script:"Script"},Dy=(n,o)=>Ix[n??""]??(/^h[1-6]$/.test(n??"")?"Heading":o?`.${o}`:n?`<${n}>`:"Element"),Wx={app:{title:"Easel",docTitle:n=>`${n} — Easel`,loadFailed:"Couldn't load:",retry:"Try again",crashed:"The canvas hit an error and stopped:",reload:"Reload",loadingBoards:"Loading boards…",loading:"Loading…",emptyPage:"This page is empty",drawBoard:"Draw board",defaultAuthor:"Me",tokensAside:"Design tokens",assetsAside:"Assets",inspectorAside:"Inspector",navigation:"Navigation",announceBoard:(n,o,i)=>`${n} selected, ${o}/${i}. Enter to select inside`,firstRunEdit:"Click anything on a board to select it · double-click text to edit it",firstRunAi:n=>`Press ${n}J to ask the AI for a change`,cleanOn:"Clean view: only the canvas. Press Esc to bring the tools back",cleanOff:"Tools are back"},templates:{blank:"Blank",mobile:"Mobile screen",desktop:"Desktop screen",doc:"Document",tablet:"Tablet screen",watch:"Watch screen",email:"Email"},tools:{select:"Select",hand:"Hand",board:"Draw board",title:"Title",sticky:"Note",rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen"},toolHints:{select:"Select and move boards",hand:"Drag to pan the canvas",board:"Drag to draw a board",title:"Click to add a title",sticky:"Click to add a sticky note",rect:"Drag to draw a rectangle",oval:"Drag to draw an oval",line:"Drag to draw a line",arrow:"Drag to draw an arrow",pen:"Drag to draw freehand"},toolbar:{aria:"Tools",leftPanel:"Left panel",leftPanelTitle:n=>`Left panel (${n}\\)`,canvasTools:"Canvas tools",shapes:"Shapes",tool:(n,o)=>`${n} (${o})`,shapeToolTitle:(n,o)=>`${n} (${o}) · Shift for square or circle`,insertImage:"Insert image",insertImageTitle:"Insert image (you can also paste onto the canvas)",undo:"Undo",redo:"Redo",undoTitle:(n,o)=>n?`Undo: ${n} (${o}Z)`:`Undo (${o}Z)`,redoTitle:(n,o)=>n?`Redo: ${n} (⇧${o}Z)`:`Redo (⇧${o}Z)`,newBoard:"New board",newBoardTitle:"New board (choose a template)",themeTitle:"Design system theme (used by swatches, token check and AI)",theme:"Theme",themeOption:n=>`Theme: ${n}`,snapshot:"Snapshot (git)",snapshotTitle:"Snapshot: save the design folder as a git commit",erroredBoards:"Boards with errors",erroredBoardsN:n=>`Boards with errors ${n}`,errors:n=>`Errors ${n}`,zoomOut:"Zoom out",zoomOutTitle:n=>`Zoom out (${n}-)`,zoomIn:"Zoom in",zoomInTitle:n=>`Zoom in (${n}+)`,zoom100:"Zoom to 100%",zoom100Title:n=>`Zoom to 100% (${n}0)`,fitAll:"Fit all",fitAllTitle:"Fit all (⇧1)",aiChat:"AI chat",askAi:"Ask AI",aiChatTitle:n=>`AI chat (${n}J)`,guides:"Show layout guides",guidesTitle:"Show layout guides (⌃G)",appearance:n=>`Appearance: ${n==="system"?"System":n==="light"?"Light":"Dark"}`,appearanceTitle:n=>`Appearance: ${n==="system"?"Follow system":n==="light"?"Light":"Dark"} (click to change)`,minimap:"Minimap",minimapTitle:"Minimap (M)",viewMenu:"View",viewMenuTitle:"View: guides, minimap, appearance, theme, language, snapshot",viewMenuTitleNarrow:"View: zoom, history, guides, minimap, appearance, language, snapshot",language:n=>`Language: ${n}`,project:"Project",history:"History",cleanView:"Clean view",showTools:"Show tools",showToolsTitle:n=>`Show tools (Esc or ⇧${n}\\)`,canvasHints:"Canvas hints",comments:"Comments",commentsTitle:n=>n?`Comments, ${n} open`:"Comments",boardsPanel:"Boards, assets, tokens",viewToggle:"View",viewCanvas:"Canvas",viewPrototype:"Prototype",viewPrototypeTitle:"Prototype (F)",play:"Play",playTitle:"Play (full screen)",panelToggle:"Properties panel",panelToggleTitle:n=>`Properties panel (${n}\\)`,zoomMenu:n=>`Zoom ${n}%`,zoomToSelection:"Zoom to selection",zoomNow:n=>`Now ${n}%`,layoutGuides:"Layout guides",pageCount:n=>`${n} pages`,copyPageLink:"Copy page link",copyLink:"Copy link",restart:"Restart",shortcuts:"Keyboard shortcuts",projectMenu:n=>`${n}: project menu`,shareMenu:"Share…",otherProjects:"Running projects",protoMore:"More",playMenu:"Play",protoHeading:"Prototypes",staticHeading:"Static boards",noBoards:"No boards",protoBoard:n=>`Board: ${n}. Switch board`,protoBoards:"Boards",prevBoard:"Previous board (←)",nextBoard:"Next board (→)"},tabs:{left:"Left panel",boards:"Boards",assets:"Assets",tokens:"Tokens",right:"Right panel",closePanel:"Close panel",properties:"Properties",ai:"AI",code:"Code",tweaks:"Tweaks",layers:"Layers",codeEmpty:"Pick an element to edit its code",tweaksEmpty:"No adjustable values yet. Ask the AI to add some"},boardList:{aria:"Pages and boards",pages:"Pages",addPage:"Add page",newPage:"New page",pageSwitch:n=>`Page: ${n}. Switch page`,pageMore:n=>`More for ${n}`,singlePage:"Viewing everything as one page. Use + to split it into pages.",pageTabTitle:"Drag to reorder · right-click to rename or delete",boardsHead:"Boards",searchPlaceholder:"Find boards (⌘K)",search:"Find boards",noMatch:n=>`No boards match "${n}". Try part of the file name.`,emptyPage:"No boards on this page yet. Press B and drag on the canvas to draw one.",fileMissing:"File missing",otherGroup:"Other",mainPage:"Main",groupTitle:n=>`${za(n,"board","boards")} · click to collapse or expand · double-click to rename`,groupMenu:"Group menu"},minimap:{aria:"Minimap: click to move there"},sections:{board:"Board",comments:"Comments",guides:"Layout guides",tweaks:"Adjustable values",tokenCheck:"Token check",a11y:"Accessibility",checks:"Checks",properties:"Properties",layers:"Layers"},boardOptions:{print:"Print",printMode:"Pages",printModes:{continuous:"Continuous",fixed:"Paper"},paper:"Paper size",papers:{letter:"Letter",a4:"A4"},bg:"Background",bgNone:"None",aria:"Board options",positionAndSize:"Position and size",position:"Position",size:"Size",options:"Options",renameTitle:"Rename (F2)",renameFileTitle:"Rename file",width:"Width",height:"Height",radius:"Radius",interactive:"Show Play button",interactiveTitle:"Keeps the ▶ on the board's label always visible, with a dot. Without it the ▶ shows when the board is selected or hovered; any board plays with P or right-click",frameless:"No frame",fill:"Stretch to window",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:n=>`${za(n,"board","boards")} selected`,frontTitleMod:n=>`Bring to front (${n}])`,backTitleMod:n=>`Send to back (${n}[)`,goToSelected:"Go to selected boards",goToSelectedTitle:"Go to selected boards (⇧2)",deleteTitleKey:"Delete (⌫)"},full:{aria:n=>`${n}, full window`,back:"Back to the canvas (Esc)",fill:"Fill",fillTitle:"Fill the window",fit:"Fit",fitTitle:"The board's own size, scaled down to fit",mode:"Size"},focus:{aria:n=>`${n} 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"},share:{button:"Share",buttonTitle:"Share a view-only copy (web folder, single file, PDF or PNG)",title:"Share a view-only copy",scope:"What to export",whole:"Whole canvas",page:"This page",pageNone:"This canvas has one page",selected:n=>`Selected boards (${n})`,webTitle:"Web folder",webHint:"Static files. Host on Vercel, GitHub Pages or a PR preview.",singleTitle:"Single file",singleHint:n=>` · ${n} · opens in any browser, no hosting`,singleSwitch:"One .html file",measuring:"measuring…",pdfTitle:"PDF",pdfHint:"One board per page",pngTitle:"PNG",pngHint:"One image per board, 2×",export:"Export",save:"Save",working:"Exporting…",exported:"exported",saved:"saved",reveal:"Reveal",revealTitle:"Show the folder in your file manager",copyDeploy:"Copy deploy command",copyDeployTitle:n=>`Copies ${n} (run it in the project folder)`,copied:n=>`Copied: ${n}`,copyFailed:"Couldn't copy to the clipboard",attachHint:"Attach it to Slack, email or a PR.",skipped:n=>`${n} reference${n===1?"":"s"} could not be included`,largeFiles:"Large canvases make large files. No live updates.",sameAs:"Same as:",unavailable:"Unavailable here."},live:{title:"Live share",start:"Start",starting:"Starting…",intro:"While Easel is open, anyone with the link sees this canvas with you. The content travels only between this computer and them.",on:"Live share on",people:n=>`${n} ${n===1?"person":"people"}`,stop:"Stop",linkRole:"Link opens as",roleView:"View",roleComment:"Comment",roleEdit:"Edit",roleEditSoon:"Editing comes in a later version",copy:"Copy",copied:"Link copied",copyFailed:"Couldn't copy to the clipboard",linkAria:n=>`${n} link`,nobody:"Nobody has opened the link yet.",endsWith:"Closing Easel ends the share.",rotate:"New link",rotateTitle:"Make a new link for this role; the old one stops working at once",rotateAfter:"the old link stops working at once.",unavailable:"Live share isn't available yet",unavailableHint:n=>`The relay (${n}) can't be reached. Try again later, or start Easel with --relay.`,retry:"Try again",owner:"Owner",you:"You",guest:"Guest",guestTitle:"Left by a guest through a live-share link",presence:n=>`Here now: ${n}`,joinTitle:n=>n?`Join ${n}'s canvas`:"Join the canvas",nameLabel:"Your name, as others see it",canView:"This link can view",canComment:"This link can view and comment",join:"Join",nameKept:"Your name stays in this browser only.",liveWith:n=>n?`Live · ${n}`:"Live",liveTitle:"You are watching the owner's canvas live; changes show as they happen",viewOnlyTool:"View only",commentTool:"Comment",commentToolTitle:"Pick a board, then write a comment on it",commentOn:n=>`Comment on ${n}`,pickBoard:"Click a board to comment on it.",commentPlaceholder:"Write a comment",send:"Comment",reply:"Reply",replyPlaceholder:"Reply",sendFailed:"Couldn't send the comment",badLink:"This link can't be opened",badLinkHint:"The share ended, the link was changed, or the end of the address (after #) was cut off. Ask for a new link.",reconnecting:"Reconnecting…",connecting:"Connecting…",offline:"Disconnected · showing the last state you saw",offlineShort:"Disconnected",offlineFull:n=>`Disconnected · showing the last state you saw, as of ${n}`,offlineTitle:"It updates by itself once the owner is reachable again",commentOffline:"You can comment again once the connection is back.",notLoaded:"Shows once connected",ownerReconnecting:"Reconnecting",ownerReconnectingHint:"The connection to the relay dropped. Guests see the last state until it's back.",full:"This canvas has as many guests as it can take. Try again later.",relayDown:"Live share isn't available right now. Try again later.",shownAs:"Guests see you as",rename:"Change",renameTitle:"Change the name guests see (also your comment name). Saved on this computer only."},viewer:{docTitle:n=>`${n} — view only`,noData:"This page is an Easel export, but its data is missing (easel-viewer/data.js).",bar:"Viewer",pages:"Pages",play:"Play",playTitle:"Try the selected board full screen (or the first one)",stamp:n=>`View only · exported ${n}`,stampTitle:"A read-only copy. Changes happen in the design files, then export again.",madeWith:"Made with Easel",comments:"Comments",commentsN:n=>`Comments ${n}`,noComments:"No comments",replies:n=>n===1?"1 reply":`${n} replies`,pin:(n,o)=>`Comment ${n} by ${o}`,threadOf:(n,o)=>`${n} of ${o}`,closeThread:"Close comment",boardsPanel:"Boards",commentsPanel:"Comments panel",empty:"Nothing on this page",embedGate:"Use the canvas: pan, zoom, open a board, press Play. Esc gives the page back.",embedHint:"Click the canvas to pan and zoom",embedHintLive:"Esc or a click outside gives the page back"},canvas:{aria:"Design canvas",board:(n,o,i,f)=>`Board ${n}${o?" (selected)":""}${i?" editing":""}${f?" playing":""}`,interactive:"Marked as playable",hint:"Click selects · Double-click edits text · Esc deselects",notLoaded:"Scroll closer to load",fileMissing:n=>`File missing · ${n}`,playing:"▶ Playing · Esc",exportingPng:"Exporting PNG…",play:"Play",playTitle:"Play (P)",stopPlay:"Stop Play",stopPlayTitle:"Stop Play (P or Esc)",playShort:"Play",edit:"Edit",exportBoard:"Export this board (PNG)",fullWindow:"Open in full window",tweaks:"This board's adjustable values",boardSize:"Board size",titleMaxWidth:"Max width",stickySize:"Sticky note size",deleteNote:"Delete note"},editMode:{fileChanged:"Someone changed this file first. Select the element 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"},extra:{letterSpacing:"Letter spacing",size:"Size",width:"Width",height:"Height",fixed:"Fixed",hug:"Hug",fill:"Fill",mode:n=>`${n} mode`,position:"Position",flow:"Normal flow",absolute:"Absolute",look:"Appearance",opacity:"Opacity",border:"Border",borderStyles:{none:"None",solid:"Solid",dashed:"Dashed",dotted:"Dotted"},shadow:"Shadow",shadows:{none:"None",small:"Small",medium:"Medium",large:"Large",custom:"Custom"},link:"Link",href:"Address",newTab:"New tab",export:"Export",exportPng:"PNG 2×",exporting:"Exporting…"},code:{inline:"Inline style",placeholder:"property: value;",bad:n=>`Not understood: ${n}`,computed:"Computed"},layers:{collapse:"Collapse",expand:"Expand",title:"Layers",outline:"Page outline",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."},keys:{sections:{tools:"Tools",edit:"Edit",element:"Element",move:"Move around",view:"View",ai:"AI and comments"},rows:{select:"Select",hand:"Hand",board:"Draw a board",title:"Title",note:"Note",rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",penOrPlay:"Pen · play the picked board in place",undo:"Undo",redo:"Redo",copy:"Copy element",paste:"Paste after",duplicate:"Duplicate",delete:"Delete",selectAll:"Select all",lock:"Lock / unlock",rename:"Rename board",front:"Bring to front",back:"Send to back",copyPng:"Copy as PNG",copyProps:"Copy properties",pasteProps:"Paste properties",flipH:"Flip horizontally",flipV:"Flip vertically",wrap:"Group in a flex box",reorder:"Move among siblings",enter:"Into the board · first child",next:"Next element or board",arrows:"Nudge · walk the elements",escape:"Let go · close",regions:"Next area of the app",zoomIn:"Zoom in",zoomOut:"Zoom out",zoom100:"Zoom to 100%",fitAll:"Fit all",zoomSel:"Zoom to selection",guides:"Layout guides",minimap:"Minimap",prototype:"Prototype view",panel:"Properties panel",clean:"Canvas only",ai:"Ask AI",find:"Find a board",comments:"Comment mode"}},inline:{title:"Ask AI",placeholder:"What should change?",send:"Send",history:"Conversation",visible:n=>n===1?"1 board in view":`${n} boards in view`,result:"AI result",done:"Done.",failed:"It did not finish.",cancelled:"Cancelled.",undo:"Undo",undone:"Undone",open:"Open conversation",close:"Close",running:"Working…",agentItem:n=>`AI agent: ${n}`,modelItem:n=>`Model: ${n||"default"}`,modelTitle:"Model",modelLabel:"Model name (empty for the agent's default)"},select:{toolbar:"Element",text:"Text",textOff:"No text in this element",fill:"Fill",textColor:"Text colour",radius:"Radius",spacing:"Spacing",askAi:"Ask AI",askAiAria:"Ask AI",askAiTitle:"Ask AI about this element",comment:"Comment",commentTitle:"Comment on this element",more:"More",textStyle:"Style and alignment",textAlign:"Alignment",bold:"Bold",italic:"Italic",underline:"Underline",align:n=>({left:"Align left",center:"Align centre",right:"Align right"})[n]??"Align",tokens:"Tokens",custom:"Custom…",hex:"Hex colour",picker:"Pick a colour",tokenNow:n=>`${n} · token`,decrease:n=>`Decrease ${n.toLowerCase()}`,increase:n=>`Increase ${n.toLowerCase()}`},design:{fill:"Fill",text:"Text",font:"Font",size:"Size",weight:"Weight",color:"Color",cornerRadius:"Corner radius",padding:"Padding",gap:"Gap",more:"More (CSS)",none:"None",inherited:n=>`(${n})`,weights:{100:"Thin",200:"Extra light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extra bold",900:"Black"},white:"white",black:"black",grade:n=>n>=7?"AAA":n>=4.5?"AA":n>=3?"AA large text only":"too low",contrastWith:(n,o,i)=>`Contrast ${n}:1 with ${o} text · ${i}`,contrastOn:(n,o,i)=>`Contrast ${n}:1 on ${o} · ${i}`,openFill:n=>`${n}: change`},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",layout:"Layout",wrap:"Wrap",image:"Image",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:n=>`Off tokens: ${n}`,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:{selectedN:n=>`${n} shapes selected`,deleteAll:"Delete selected 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:{selectedN:n=>`${n} notes selected`,deleteAll:"Delete selected notes",options:"Note options",title:"Title",sticky:"Sticky note",fontSize:"Font size",defaultSuffix:" (default)",textStyle:"Text style",bold:"Bold",italic:"Italic",color:"Color",stickyColor:n=>`${n} 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:(n,o)=>`Layout guides ${n}/${o}`,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:{renameGroupTitle:"Rename group",menu:"Menu",cancel:"Cancel",ok:"OK",deleteBoardsTitle:(n,o)=>n>1?`Delete ${n} boards?`:`Delete board "${o}"?`,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:n=>`Links or iframes pointing to this file: ${n}`,renameFileNoRefs:"No links or iframes point to this file.",renameFileExtra:n=>`Also update ${za(n,"reference","references")} to the new name`,newPageTitle:"New page",newPageName:n=>`Page ${n}`,create:"Create",renamePageTitle:"Rename page",deletePageTitle:n=>`Delete page "${n}"?`,deletePageBody:n=>`Its ${za(n,"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:n=>`docs(design): design snapshot ${n}`,snapshotHint:"Commits only the design folder. The author comes from your git config, and nothing else you staged is included.",commit:"Commit"},toast:{linkCopied:"Link copied",copiedPng:"Copied as PNG",copiedHtml:"Copied as HTML",copiedProps:"Properties copied",saveFailed:n=>`Save failed: ${n}`,undoRedoDone:(n,o)=>`${n==="undo"?"Undo":"Redo"}: ${o}`,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:(n,o)=>`Copied <${n}> — paste it into another board while editing with ${o}V`,nothingCopied:"No element copied. Select an element while editing and press ⌘C",pasted:(n,o)=>`Pasted <${o}> from ${n}`,imageReplaced:n=>`Replaced the image with ${n}`,boardCreated:n=>`Created board ${n}`,boardCreateFailed:n=>`Couldn't create the board: ${n}`,boardsDeleted:n=>`Deleted ${za(n,"board","boards")}`,duplicated:n=>`Duplicated as ${n}`,renamed:"Renamed",fileRenamed:(n,o)=>`Renamed to ${n}${o?" (references updated)":""}`,notesMax:n=>`You can have up to ${n} notes`,noteDeleted:"Note deleted",shapeDeleted:"Shape deleted",shapesDeleted:n=>`Deleted ${za(n,"shape","shapes")}`,imageReadFailed:"Couldn't read the image",importOnly:n=>`${n}: only HTML or images can be imported`,imported:n=>`Imported ${za(n,"board","boards")}`,pagesMax:"You can have up to 40 pages",pageDeleted:"Page deleted",copied:"Copied",elementDeleted:"Element deleted",wrapped:n=>`Wrapped in ${n}`,theme:n=>`Theme: ${n}`,tokensSaved:"Tokens saved",nothingChanged:"Nothing changed",snapshot:n=>`Snapshot ${n}`,cleanedUp:n=>`Cleaned up ${za(n,"board","boards")}`,uploaded:n=>`Uploaded ${n}`,tweaksSaved:"Saved tweaks to source",blockFlow:"Vertical alignment doesn't apply in block flow. Try changing the parent to flex",pngExporting:n=>`Rendering ${n}…`,pngExported:n=>`Downloaded ${n}`,pngNeedsBrowser:"PNG export needs a headless browser:",pngFailed:n=>`Couldn't render the PNG: ${n}`},history:{lock:"Lock",unlock:"Unlock",flip:"Flip",renameGroup:"Rename group",pageFromGroup:"Page from group",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:{openProps:"Open properties",newBoard:"New board",renameGroup:"Rename group…",pageFromGroup:"Make a page from this group",drawWithB:"B to draw",rename:"Rename",moveUp:"Move up",moveDown:"Move down",unsetLaunchPage:"Unset launch page",setLaunchPage:"Set as launch page",moveSelectedToPage:n=>`Move ${za(n,"selected board","selected boards")} to this page`,delete:"Delete",selectInside:"Select inside",playInPlace:"Play in place",stopPlay:"Stop Play",playFullScreen:"Play full screen",lock:"Lock",unlock:"Unlock",copyPng:"Copy as PNG",copyHtml:"Copy as HTML",copyProps:"Copy properties",pasteProps:"Paste properties",flipH:"Flip horizontal",flipV:"Flip vertical",locked:"Locked",askReview:"Ask AI for a review",focusView:"Prototype view",askAI:"Ask AI",askAIAria:"Ask AI",askFixErrors:"Ask AI to fix errors",goToBoard:"Go to board",exportPng:"Export PNG",exportingPng:"Exporting PNG…",renameFile:"Rename file…",duplicate:"Duplicate",front:"Bring to front",back:"Send to back",deleteBoards:n=>`Delete ${n} 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",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:(n,o)=>`Snapshot · ${n} · ${za(o,"changed file","changed files")}`,snapshotNow:"Save snapshot now (git commit)…",nothingChanged:"Nothing changed",fileMissing:"File is missing",askFixAll:"Ask AI to fix all",cleanMissing:n=>`Clean up ${za(n,"board","boards")} with missing files`},prompts:{fixErrors:n=>`Fix these errors:
50
+ ${n}`,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:n=>`Replace off-token values with tokens (verify with check_tokens):
51
+ ${n}`,fixA11y:n=>`Fix the accessibility issues (keep the visible size; enlarge touch targets with padding):
52
+ ${n}`,line:"Line "},checks:{tokenCheck:n=>`Token check · ${n}`,noOffToken:"No off-token values",off:"off",tokensOffTitle:"No tokens registered — checks are off",tokensOffBody:"Colours and sizes are not checked, and the AI is not given a default palette.",setUpTokens:"Set up tokens",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:n=>`Select ${n} on the board`,line:n=>`Line ${n}`,more:n=>`+${n} more`,colorNotInTokens:"Color not in tokens",tokenFontSizes:n=>`Token font sizes: ${n}`,tokenRadii:n=>`Token radius: ${n}`,notMultipleOf4:"Not a multiple of 4",tokenWeights:n=>`Token weights: ${n}`,smallTarget:(n,o,i,f)=>`<${n}> touch target ${o}×${i} (under ${f})`,noName:n=>`<${n}> has no name (aria-label, text or label)`,noAlt:'<img> has no alt (use alt="" if decorative)',lowContrast:(n,o,i)=>`Contrast ${n}:1 (needs ${o}) "${i}"`},tokens:{import:"Import tokens (tokens.json or Figma variables JSON)",importFailed:n=>`Couldn't import: ${n}`,theme:"Theme",addTheme:"Add theme (copy current theme)",newTheme:"New theme",newThemeN:n=>`New theme ${n}`,activeTheme:"Active theme",themeName:"Theme name",importedTheme:"Imported",colors:n=>`Colors ${n}`,addColor:"Add color",colorN:n=>`Color ${n}`,colorOf:n=>`${n} color`,colorName:"Color name",remove:n=>`Remove ${n}`,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:"Starter values, not in use yet. Registering saves them to tokens.json and turns on the token check and the AI palette.",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:n=>`Failed: ${n}`,kindName:n=>({text:"Text",button:"Button",link:"Link",image:"Image",input:"Input",icon:"Icon",container:"Container"})[n]??n,crumbs:"Selection path",crumbBoard:"Select the board",crumbParent:n=>`Select ${n}`,crumbElement:(n,o)=>`<${n}> ${o}`,more:n=>`+${n} more`,copy:"Copy",copied:"Copied",capturing:"Capturing…",screenshot:"Screenshot",boardScreenshot:"Board screenshot",boardScreenshotTitle:"Save a PNG of this board next to the design folder",screenshotTitle:"Save a PNG of this element",actions:"Element actions",boardActions:"Board actions"},comments:{pinLabel:(n,o,i)=>`Comment ${n} by ${o}: ${i}`,title:"Comments",placeholderElement:n=>`Comment on the selected element (${n})`,placeholderBoard:"Comment on the board",placeholder:"Add a comment",add:"Comment",authorTitle:"Change comment author name",author:n=>`Author: ${n}`,replyPlaceholder:n=>`Reply as ${n} (⌘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",openThread:"Show this comment on its own",allOnBoard:n=>`All ${n} on this board`,mode:"Comment mode",modeTitle:"Comment mode (⌥C)",allTitle:"All comments",thisPage:"This page",allPages:"All pages",showResolved:"Resolved",scope:"Which comments",edit:"Edit",deleteThread:"Delete",more:"Edit or delete",none:"No comments",nothingSelected:"Nothing selected"},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",agentHint:"Which agent edits the files",agentButton:(n,o)=>o?`Agent: ${n} — ${o}`:`Agent: ${n}`,agentStatus:{ready:"ready",signin:"sign-in needed",missing:"not installed",unknown:"couldn't check"},checking:"Checking…",checkedOnOpen:"Checked when the AI tab opened",checkAgain:"Check again",model:"Model",modelDefault:"Default (from CLI config)",modelTitle:n=>`Model for ${n}: an alias or a full model id. Leave empty for the CLI's own default.`,continuing:"Continuing conversation",newConversation:"New conversation",newChat:"New chat",intro:n=>`Sends the selected boards and elements, plus the boards visible on screen, to ${n} 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}],remedySignin:(n,o)=>`${n} is not signed in. Run \`${o}\` in a terminal.`,remedyMissing:n=>`\`${n}\` command not found. Install it, then Check again.`,copyCommand:"Copy command",copy:"Copy",copied:"Copied",sendNeedsSignin:n=>`Sign in to ${n} to send`,sendNeedsInstall:n=>`Install ${n} to send`,running:"Running",cancelled:"Cancelled",failed:"Failed",retry:"Retry",switchTo:n=>`Switch to ${n}`,details:"Details",noFilesChanged:"No files were changed.",restored:"Restored from the failed message",madeVariants:n=>`Made ${mm(n)} side by side · View`,thinking:"Thinking…",chipElement:n=>`Element <${n}>`,chipElementText:(n,o)=>`Element <${n}> ${o}`,chipBoards:n=>`${n} boards`,chipVisible:n=>`Visible boards ${n}`,chipComment:n=>`Comment "${n}"`,variants:mm,tooBig:n=>`${n}: 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",cancelTitle:"Cancel (Esc)",send:"Send",chipRemoveTitle:"Click to remove",chipAddTitle:"Click to attach",remove:n=>`Remove ${n}`,howToInstall:"How to install",customCommand:"Custom command…",checkedAt:(n,o)=>o?`Checked when the AI tab opened · ${n}`:`Checked again at ${n}`,customTitle:"Custom command",customName:"Name",customCommandLabel:"Command",customNamePlaceholder:"Aider",customCommandPlaceholder:"aider --message {prompt} --yes",customHint:"`{prompt}` is replaced with your request and the canvas context. Output is shown as plain text.",customSave:"Save",customCommandTitle:n=>`Runs without a shell: ${n}`,waiting:"Waiting for you",waitingHint:"answer the request above",permAsk:(n,o,i)=>o==="command"?`${n} asks to run a command`:o==="edit"?`${n} asks to ${i==="Write"?"write":"edit"} a file`:o==="fetch"?`${n} asks to fetch a page`:`${n} asks to use ${i}`,permIn:"in",permOutside:"outside the design folder",allowOnce:"Allow once",alwaysAllow:n=>`Always allow ${n}`,alwaysAllowTitle:"Until Easel restarts, for this canvas only",deny:"Deny",permDone:{once:"Allowed",always:"Always allowed",deny:"Denied"},permDoneOutside:"(outside the design folder)",noPause:{codex:"Codex exec cannot pause to ask; it follows its sandbox setting.",cursor:"Cursor Agent cannot pause to ask here; it runs with --force.",gemini:"Gemini CLI cannot pause to ask here; it accepts edits on its own."},runChanged:(n,o)=>n&&o?`Changed ${n} board${n===1?"":"s"} · added ${o}`:o?`Added ${o} board${o===1?"":"s"}`:n?`Changed ${n} board${n===1?"":"s"}`:"Changed the canvas",chipNew:n=>`${n} (new)`,chipRemoved:n=>`${n} (removed)`,undoRun:"Undo this run",compare:"Compare",redo:"Redo",runUndone:n=>`Run undone · ${n} board${n===1?"":"s"} restored`,conflictUndo:n=>`Changed since this run: ${n}. Undo the rest and keep those, or undo all and overwrite them?`,conflictRedo:n=>`Changed since the undo: ${n}. Redo the rest and keep those, or redo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",redoRest:"Redo the rest",redoAll:"Redo all anyway",restoreCopy:"Restore the copy from before this run",savedAt:n=>`Saved ${n}`,copyGone:"The copy from before this run is gone (only the newest 10 are kept).",restoredCopy:"Canvas restored to the copy from before this run",restoreTitle:"Restore the copy from before this run?",restoreBody:n=>`This puts the whole canvas back to ${n}, before this run: every screen and board.json, including anything changed since by you or by other runs. Undo takes the restore back.`,restoreOk:"Restore",restarted:n=>`Easel restarted · ${n}`},compare:{title:n=>`Compare · ${n}`,boards:"Boards",before:"Before",after:"After",notBefore:"This board did not exist before the run.",notAfter:"This run removed the board.",notBeforeChange:"This board did not exist before this change.",close:"Close"},activity:{stepName:n=>String(n),outside:"Outside Easel",ago:n=>{const o=Math.floor(Math.max(0,n)/6e4);return o<1?"now":o<60?`${o}m`:o<1440?`${Math.floor(o/60)}h`:`${Math.floor(o/1440)}d`},agoLong:n=>{const o=Math.floor(Math.max(0,n)/6e4);return o<1?"just now":o<60?`${o} min ago`:o<1440?`${Math.floor(o/60)} h ago`:`${Math.floor(o/1440)} d ago`},tag:(n,o,i,f)=>`${n} · ${o} · ${f&&i===1?"new board":za(i,"change","changes")}`,tagTitle:n=>`${n} — click for the change, Before / After and Undo`,tagsAria:n=>`${za(n,"change","changes")} by others`,popAria:n=>`Change by ${n}`,element:Dy,change:n=>{const o=Dy(n.tag,n.cls);switch(n.kind){case"style":return`Style changed on ${o}`;case"attr":return`${o} attributes changed`;case"edited":return`${o} changed`;case"added":return n.count>1?`${n.count} elements added`:`${o} added`;case"removed":return n.count>1?`${n.count} elements removed`:`${o} removed`;case"replaced":return`${o} replaced`;case"many":return`${n.count}${n.more?"+":""} elements changed`;case"page":return"Page styles or title changed";case"source":return"Only spacing or comments in the source changed";case"new":return"New board";case"deleted":return"Board deleted";case"moved":return"Board moved";case"resized":return"Board resized";case"renamed":return"Board renamed";case"options":return"Board options changed";default:return"Changed"}},changes:n=>`${za(n,"change","changes")} on this board`,quote:n=>`“${n}”`,arrow:"→",beforeAfter:"Before / After",undo:"Undo",undoTitle:n=>n===1?"Undo this change":`Undo these ${n} changes`,conflict:n=>`Changed since: ${n}. Undo the rest and keep those, or undo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",cancel:"Cancel",close:"Close",historyButton:"History",historyTitle:"History · newest first",historyEmpty:"Nothing yet. Changes made in this session show up here.",historyFoot:"History is kept for this session.",now:"Now",goBack:"Go back to here",goBackAria:(n,o,i)=>`${n} by ${o}, ${i} · Go back to here`,nowAria:(n,o,i)=>`${n} by ${o}, ${i} · current`,undoneAria:(n,o,i)=>`${n} by ${o}, ${i} · undone`,wentBack:n=>`Back to: ${n}`},occupancy:{editing:n=>`${n} is editing…`,you:"You · editing",personEditing:n=>`${n} · editing`,done:(n,o)=>`${n} · done ${o}`,someone:"Someone",clock:n=>new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),tagsAria:"Who is on this board",listDot:n=>`${n} is editing`,youListDot:"You are editing",forked:(n,o,i)=>`Forked ${n} — ${o} started while ${i} was editing`,forkBlock:(n,o)=>n===1?`Fork of ${o}`:`${n} forks of ${o}`,forkBlockWhile:(n,o,i)=>`${n===1?`Fork of ${o}`:`${n} forks of ${o}`} · made while ${i} was editing`,forkBlockShort:n=>n===1?"Fork":`${n} forks`,useThis:"Use this",useThisOne:"Use this one",useThisTitle:"Make this variant the original board; the other variants go to trash",useThisOneTitle:n=>`Keep this version as the board; ${n===1?"the other version goes":`the other ${n} versions go`} to trash`,waitFor:n=>`Wait until ${n} is done editing`,confirmVariant:(n,o)=>`Apply "${n}" to ${o}?`,confirmVariantBody:(n,o)=>`${n} is replaced.${o?` The other ${o===1?"variant goes":`${o} variants go`} to trash.`:""}`,confirmFork:(n,o)=>`Use "${n}" for ${o}?`,confirmForkBody:(n,o)=>`${n} is replaced by this version. ${o?`This fork and the other ${o===1?"fork go":`${o} forks go`} to trash.`:"The fork goes to trash."}`,confirmKeep:n=>`Keep "${n}"?`,confirmKeepBody:(n,o)=>`${n} ${o===1?"goes":"go"} to trash.`,apply:"Apply",keepAll:"Keep all",keepBoth:"Keep both",applied:(n,o)=>`Applied ${n} to ${o}`,kept:(n,o)=>`Kept ${n}; ${o===1?"the other version is":`the other ${o} versions are`} in trash`,keptAll:(n,o)=>n==="variant"?`Kept all ${mm(o)} as boards`:o===1?"Kept both versions as boards":`Kept all ${o+1} versions as boards`,undo:"Undo"},requests:{goTo:"AI requests go to",easelChat:"Easel chat",easelChatNote:"Easel runs Claude Code itself.",host:"The agent you're talking to",hostNote:"Requests wait on the canvas.",connected:"Connected",noneConnected:"No agent connected",thisFolder:"this folder",otherFolder:"another folder",since:n=>`since ${n}`,sendTo:"Send to",anyAgent:"Any agent",sayTitle:"Say",line:"handle the Easel requests",quote:n=>`“${n}”`,copy:"Copy",copied:"Copied",copyTitle:"Copy the line for your agent's chat (or run /easel:requests)",forAi:"For AI",forAgent:n=>`For ${n}`,addForAi:"Leave",forAiCheck:"For AI",forAiCheckTitle:"Leave this comment as a request for the agent you're talking to",composerTitle:"Ask your agent",composerAria:"Request for your agent",composerPlaceholder:"What should change here?",cancel:"Cancel",waiting:"Waiting",waitingFor:n=>`Waiting for ${n}`,took:(n,o)=>`${n} working · ${o}`,failed:n=>`${n} couldn't finish`,left:n=>`Waiting (${n} left)`,cancelRequest:"Cancel",useChat:"Use Easel chat",more:"More",retry:"Again",undoChange:"Undo",undone:"Undone",undoGone:"Can't be undone now",changedTitle:n=>`Go to ${n}, the board it changed`,waitingTag:n=>`${n} waiting`,pinLabel:(n,o,i)=>o?`Request ${n} waiting for your agent: ${i}`:`Request ${n} for AI: ${i}`,countAria:n=>n===1?"1 request waiting for your agent":`${n} requests waiting for your agent`,filterAria:"Which comments",filterAll:"All",filterForAi:"For AI",listTitle:"For AI",allBoards:"all boards",listEmpty:"No requests",introTitle:"Leave requests for the agent in this window?",switchTo:"Switch",keepChat:"Keep Easel chat",backToRequests:"Back to requests",hostShort:"your agent",easelChatShort:"Easel chat",goesTo:"Requests go to",connectedN:n=>n?`${n} connected`:"none connected",chatOnce:"Easel chat, for this request",menuHost:"AI requests: your agent",menuChat:"AI requests: Easel chat",added:"Left for your agent",cancelled:"Cancelled. The comment stays.",markerWaiting:"Sent to your agent · waiting",markerWaitingFor:n=>`Sent to ${n} · waiting`,markerWorking:n=>`Working… · ${n}`,markerSay:n=>`Tell your agent “${n}”`,markerDone:"Done",markerCount:n=>n===1?"1 request here":`${n} requests here`,markerAria:"Request for your agent",dismiss:"Dismiss",openComment:"Open comment",kind:{element:"Element",board:"Board",tokens:"Token check",a11y:"Accessibility",errors:"Errors",review:"Review",comment:"Comment"},frameBoard:n=>`Easel board ${n}`,frameElement:(n,o)=>`Easel board ${n}, selected: ${o}`},update:{out:n=>`Easel ${n} is out`,copy:"Copy command",copied:"Copied. Run it, then restart Easel",row:n=>`Update to ${n}`,versions:(n,o)=>`${n} → ${o}`,copyRow:"Copy the update command",retry:"Try updating again",updating:n=>`Updating to ${n}…`,done:n=>`Updated to ${n}`,failed:(n,o)=>`Could not update to ${n}. ${o}`,dotTitle:n=>`Easel ${n} is out`,why:{busy:"Waits for the AI run to finish",permission:"No permission to install there without admin rights",network:"Could not reach the npm registry",nonpm:"npm was not found",failed:"The install did not finish",restart:"The new version did not start; this one keeps running",project:"Installed in this project: update it with npm",source:"Running from source: update it with git",other:"Run the command, then restart Easel"}}},e0={button:"버튼",a:"링크",img:"이미지",input:"입력란",textarea:"입력란",select:"선택 메뉴",label:"라벨",p:"문단",span:"텍스트",li:"목록 항목",ul:"목록",ol:"목록",nav:"내비게이션",header:"헤더",footer:"푸터",main:"본문",section:"섹션",form:"폼",svg:"아이콘",style:"스타일",script:"스크립트"},By=(n,o)=>e0[n??""]??(/^h[1-6]$/.test(n??"")?"제목":o?`.${o}`:n?`<${n}>`:"요소");function t0(n,o){const i=n.replace(/[\s>)"'”’\]]+$/,"").slice(-1),f=i.charCodeAt(0);let m=null;f>=44032&&f<=55203?m=(f-44032)%28:/[0-9]/.test(i)?m=[21,8,0,16,0,0,1,8,8,0][Number(i)]:/[lmn]/i.test(i)?m=/l/i.test(i)?8:/m/i.test(i)?16:4:/[a-z]/i.test(i)&&(m=0);const[p,b]=o.split("/");return m==null?o==="으로/로"?"(으)로":`${p}(${b})`:o==="으로/로"?m===0||m===8?"로":"으로":m?p:b}const jt=(n,o)=>n+t0(n,o),Hy=n=>n==="system"?"시스템":n==="light"?"라이트":"다크",Mb={app:{title:"Easel",docTitle:n=>`${n} — Easel`,loadFailed:"불러오지 못했어요:",retry:"다시 시도",crashed:"캔버스에 오류가 나서 멈췄어요:",reload:"새로고침",loadingBoards:"보드를 불러오는 중…",loading:"불러오는 중…",emptyPage:"이 페이지는 비어 있어요",drawBoard:"보드 그리기",defaultAuthor:"나",tokensAside:"디자인 토큰",assetsAside:"에셋",inspectorAside:"인스펙터",navigation:"내비게이션",announceBoard:(n,o,i)=>`${n} 선택됨, ${o}/${i}. Enter를 누르면 안쪽을 선택해요`,firstRunEdit:"보드에서 무엇이든 클릭해 선택하고, 텍스트는 더블클릭해 고쳐요",firstRunAi:n=>`${n}J를 눌러 AI에게 수정을 요청해요`,cleanOn:"캔버스만 보여요. Esc를 누르면 도구가 다시 보여요",cleanOff:"도구가 다시 보여요"},templates:{blank:"빈 보드",mobile:"모바일 화면",desktop:"데스크톱 화면",doc:"문서",tablet:"태블릿 화면",watch:"워치 화면",email:"이메일"},tools:{select:"선택",hand:"손",board:"보드 그리기",title:"제목",sticky:"메모",rect:"사각형",oval:"타원",line:"선",arrow:"화살표",pen:"펜"},toolHints:{select:"보드를 선택하고 옮겨요",hand:"끌어서 캔버스를 움직여요",board:"끌어서 보드를 그려요",title:"클릭해 제목을 넣어요",sticky:"클릭해 스티키 노트를 붙여요",rect:"끌어서 사각형을 그려요",oval:"끌어서 타원을 그려요",line:"끌어서 선을 그려요",arrow:"끌어서 화살표를 그려요",pen:"끌어서 자유롭게 그려요"},toolbar:{aria:"도구",leftPanel:"왼쪽 패널",leftPanelTitle:n=>`왼쪽 패널 (${n}\\)`,canvasTools:"캔버스 도구",shapes:"도형",tool:(n,o)=>`${n} (${o})`,shapeToolTitle:(n,o)=>`${n} (${o}) · Shift를 누르면 정사각형이나 원`,insertImage:"이미지 넣기",insertImageTitle:"이미지 넣기 (캔버스에 붙여 넣어도 돼요)",undo:"실행 취소",redo:"다시 실행",undoTitle:(n,o)=>n?`실행 취소: ${n} (${o}Z)`:`실행 취소 (${o}Z)`,redoTitle:(n,o)=>n?`다시 실행: ${n} (⇧${o}Z)`:`다시 실행 (⇧${o}Z)`,newBoard:"새 보드",newBoardTitle:"새 보드 (템플릿 고르기)",themeTitle:"디자인 시스템 테마 (색 견본, 토큰 검사, AI가 써요)",theme:"테마",themeOption:n=>`테마: ${n}`,snapshot:"스냅샷 (git)",snapshotTitle:"스냅샷: 디자인 폴더를 git 커밋으로 저장해요",erroredBoards:"오류가 있는 보드",erroredBoardsN:n=>`오류가 있는 보드 ${n}`,errors:n=>`오류 ${n}`,zoomOut:"축소",zoomOutTitle:n=>`축소 (${n}-)`,zoomIn:"확대",zoomInTitle:n=>`확대 (${n}+)`,zoom100:"100%로 보기",zoom100Title:n=>`100%로 보기 (${n}0)`,fitAll:"전체 보기",fitAllTitle:"전체 보기 (⇧1)",aiChat:"AI에게 요청",askAi:"AI",aiChatTitle:n=>`AI에게 요청 (${n}J)`,guides:"레이아웃 가이드 보기",guidesTitle:"레이아웃 가이드 보기 (⌃G)",appearance:n=>`화면 모드: ${Hy(n)}`,appearanceTitle:n=>`화면 모드: ${n==="system"?"시스템 설정 따르기":Hy(n)} (클릭해 바꾸기)`,minimap:"미니맵",minimapTitle:"미니맵 (M)",viewMenu:"보기",viewMenuTitle:"보기: 가이드, 미니맵, 화면 모드, 테마, 언어, 스냅샷",viewMenuTitleNarrow:"보기: 확대/축소, 기록, 가이드, 미니맵, 화면 모드, 언어, 스냅샷",language:n=>`언어: ${n}`,project:"프로젝트",history:"기록",cleanView:"캔버스만 보기",showTools:"도구 보이기",showToolsTitle:n=>`도구 보이기 (Esc 또는 ⇧${n}\\)`,canvasHints:"캔버스 도움말",comments:"댓글",commentsTitle:n=>n?`댓글, 열린 것 ${n}`:"댓글",boardsPanel:"보드·에셋·토큰",viewToggle:"보기",viewCanvas:"캔버스",viewPrototype:"프로토타입",viewPrototypeTitle:"프로토타입 (F)",play:"재생",playTitle:"재생 (전체 화면)",panelToggle:"속성 패널",panelToggleTitle:n=>`속성 패널 (${n}\\)`,zoomMenu:n=>`확대 ${n}%`,zoomToSelection:"선택 항목에 맞추기",zoomNow:n=>`현재 ${n}%`,layoutGuides:"레이아웃 가이드",pageCount:n=>`페이지 ${n}개`,copyPageLink:"페이지 링크 복사",copyLink:"링크 복사",restart:"처음부터",shortcuts:"키보드 단축키",projectMenu:n=>`${n}: 프로젝트 메뉴`,shareMenu:"공유…",otherProjects:"실행 중인 프로젝트",protoMore:"더 보기",playMenu:"재생",protoHeading:"프로토타입",staticHeading:"정적 보드",noBoards:"보드 없음",protoBoard:n=>`보드: ${n}. 다른 보드로`,protoBoards:"보드",prevBoard:"이전 보드 (←)",nextBoard:"다음 보드 (→)"},tabs:{left:"왼쪽 패널",boards:"보드",assets:"에셋",tokens:"토큰",right:"오른쪽 패널",closePanel:"패널 닫기",properties:"속성",ai:"AI",code:"코드",tweaks:"조정",layers:"레이어",codeEmpty:"요소를 고르면 코드를 고칠 수 있어요",tweaksEmpty:"아직 조정 값이 없어요. AI에게 추가해 달라고 하세요"},boardList:{aria:"페이지와 보드",pages:"페이지",addPage:"페이지 추가",newPage:"새 페이지",pageSwitch:n=>`페이지: ${n}. 페이지 바꾸기`,pageMore:n=>`${n} 메뉴`,singlePage:"모든 보드를 한 페이지로 보고 있어요. +를 눌러 페이지를 나눠요.",pageTabTitle:"끌어서 순서 바꾸기 · 오른쪽 클릭으로 이름 바꾸기나 삭제",boardsHead:"보드",searchPlaceholder:"보드 찾기 (⌘K)",search:"보드 찾기",noMatch:n=>`"${n}"에 맞는 보드가 없어요. 파일 이름의 일부로 찾아 보세요.`,emptyPage:"이 페이지에는 아직 보드가 없어요. B를 누르고 캔버스에서 끌어 그려요.",fileMissing:"파일 없음",otherGroup:"기타",mainPage:"기본",groupTitle:n=>`보드 ${n}개 · 클릭해 접고 펼치기 · 더블클릭해 이름 바꾸기`,groupMenu:"그룹 메뉴"},minimap:{aria:"미니맵: 클릭한 곳으로 이동"},sections:{board:"보드",comments:"댓글",guides:"레이아웃 가이드",tweaks:"조정 값",tokenCheck:"토큰 검사",a11y:"접근성",checks:"검사",properties:"속성",layers:"레이어"},boardOptions:{print:"인쇄",printMode:"쪽",printModes:{continuous:"연속",fixed:"용지"},paper:"용지 크기",papers:{letter:"레터",a4:"A4"},bg:"배경",bgNone:"없음",aria:"보드 옵션",positionAndSize:"위치와 크기",position:"위치",size:"크기",options:"옵션",renameTitle:"이름 바꾸기 (F2)",renameFileTitle:"파일 이름 바꾸기",width:"너비",height:"높이",radius:"모서리",interactive:"재생 버튼 표시",interactiveTitle:"보드 라벨의 ▶를 점과 함께 늘 보여 줘요. 끄면 보드를 선택하거나 마우스를 올렸을 때만 ▶가 보여요. 어떤 보드든 P나 오른쪽 클릭으로 재생할 수 있어요",frameless:"프레임 없음",fill:"창에 맞춰 늘이기",launch:"시작 화면으로 열기",page:"페이지",focus:"포커스 보기",focusTitle:"포커스 보기 (F)",front:"맨 앞으로 가져오기",frontTitle:"맨 앞으로 가져오기 (⌘])",back:"맨 뒤로 보내기",backTitle:"맨 뒤로 보내기 (⌘[)",duplicate:"복제",duplicateTitle:"복제 (⌘D)",delete:"삭제",deleteTitle:"삭제 (Delete)",selectedN:n=>`보드 ${n}개 선택됨`,frontTitleMod:n=>`맨 앞으로 가져오기 (${n}])`,backTitleMod:n=>`맨 뒤로 보내기 (${n}[)`,goToSelected:"선택한 보드로 이동",goToSelectedTitle:"선택한 보드로 이동 (⇧2)",deleteTitleKey:"삭제 (⌫)"},full:{aria:n=>`${n} 전체 창`,back:"캔버스로 (Esc)",fill:"채우기",fillTitle:"창 채우기",fit:"맞추기",fitTitle:"보드 원래 크기로, 창에 맞게 축소",mode:"크기"},focus:{aria:n=>`${n} 포커스 보기`,prev:"이전 보드",next:"다음 보드",pageStyle:" · 페이지형",close:"닫기"},play:{back:"뒤로",forward:"앞으로",viewOnCanvas:"캔버스에서 보기",closeTitle:"닫기 (Esc)",close:"닫기"},share:{button:"공유",buttonTitle:"보기 전용 사본 공유 (웹 폴더, 파일 하나, PDF, PNG)",title:"보기 전용 사본 공유",scope:"내보낼 범위",whole:"캔버스 전체",page:"이 페이지",pageNone:"이 캔버스는 페이지가 하나예요",selected:n=>`선택한 보드 (${n})`,webTitle:"웹 폴더",webHint:"정적 파일이에요. Vercel, GitHub Pages, PR 미리보기에 올려요.",singleTitle:"파일 하나",singleHint:n=>` · ${n} · 호스팅 없이 어느 브라우저에서나 열려요`,singleSwitch:".html 파일 하나로",measuring:"크기 재는 중…",pdfTitle:"PDF",pdfHint:"한 페이지에 보드 하나",pngTitle:"PNG",pngHint:"보드마다 이미지 하나, 2배",export:"내보내기",save:"저장",working:"내보내는 중…",exported:"내보냄",saved:"저장함",reveal:"폴더 보기",revealTitle:"파일 관리자에서 폴더를 보여 줘요",copyDeploy:"배포 명령 복사",copyDeployTitle:n=>`${jt(n,"을/를")} 복사해요 (프로젝트 폴더에서 실행해요)`,copied:n=>`복사함: ${n}`,copyFailed:"클립보드에 복사하지 못했어요",attachHint:"Slack, 이메일, PR에 첨부해요.",skipped:n=>`참조 ${n}개는 넣지 못했어요`,largeFiles:"캔버스가 크면 파일도 커져요. 실시간으로 바뀌지 않아요.",sameAs:"같은 명령:",unavailable:"여기서는 쓸 수 없어요."},live:{title:"실시간 공유",start:"시작",starting:"시작하는 중…",intro:"Easel이 켜져 있는 동안 링크를 받은 사람이 이 캔버스를 같이 봐요. 내용은 이 컴퓨터와 받는 사람 사이에서만 풀려요.",on:"실시간 공유 중",people:n=>`${n}명`,stop:"끝내기",linkRole:"링크로 오면",roleView:"보기",roleComment:"댓글",roleEdit:"편집",roleEditSoon:"편집은 다음 버전에서 열려요",copy:"복사",copied:"링크를 복사했어요",copyFailed:"클립보드에 복사하지 못했어요",linkAria:n=>`${n} 링크`,nobody:"아직 링크로 들어온 사람이 없어요.",endsWith:"Easel을 닫으면 공유도 끝나요.",rotate:"링크 바꾸기",rotateTitle:"이 역할의 링크를 새로 만들어요. 이전 링크는 바로 막혀요",rotateAfter:"이전 링크는 바로 막혀요.",unavailable:"실시간 공유를 아직 쓸 수 없어요",unavailableHint:n=>`중계 서버(${n})에 닿지 않아요. 나중에 다시 하거나 --relay로 Easel을 켜요.`,retry:"다시 시도",owner:"소유자",you:"나",guest:"손님",guestTitle:"실시간 공유 링크로 들어온 손님이 남겼어요",presence:n=>`지금 보는 사람: ${n}`,joinTitle:n=>n?`${n}의 캔버스에 들어가요`:"캔버스에 들어가요",nameLabel:"다른 사람에게 보일 이름",canView:"이 링크로는 볼 수 있어요",canComment:"이 링크로는 보고 댓글을 남길 수 있어요",join:"들어가기",nameKept:"이름은 이 브라우저에만 남아요.",liveWith:n=>n?`실시간 · ${n}`:"실시간",liveTitle:"소유자의 캔버스를 실시간으로 보고 있어요. 바뀌면 바로 보여요",viewOnlyTool:"보기만",commentTool:"댓글",commentToolTitle:"보드를 고른 뒤 댓글을 남겨요",commentOn:n=>`${n}에 댓글`,pickBoard:"댓글을 남길 보드를 눌러요.",commentPlaceholder:"댓글 쓰기",send:"남기기",reply:"답글",replyPlaceholder:"답글 쓰기",sendFailed:"댓글을 보내지 못했어요",badLink:"이 링크로는 들어갈 수 없어요",badLinkHint:"공유가 끝났거나, 링크가 바뀌었거나, 주소 끝(# 뒤)이 잘렸어요. 보낸 사람에게 새 링크를 받아요.",reconnecting:"다시 잇는 중…",connecting:"잇는 중…",offline:"끊겼어요 · 마지막으로 본 상태예요",offlineShort:"끊겼어요",offlineFull:n=>`끊겼어요 · ${n}에 마지막으로 본 상태예요`,offlineTitle:"소유자와 다시 이어지면 저절로 최신으로 바뀌어요",commentOffline:"다시 이어지면 댓글을 남길 수 있어요.",notLoaded:"연결되면 보여요",ownerReconnecting:"다시 잇는 중",ownerReconnectingHint:"중계 서버와 끊겼어요. 다시 이어질 때까지 손님에게는 마지막 상태가 보여요.",full:"이 캔버스에 들어올 수 있는 사람이 꽉 찼어요. 나중에 다시 해 봐요.",relayDown:"지금은 실시간 공유를 쓸 수 없어요. 나중에 다시 해 봐요.",shownAs:"손님에게 보이는 이름",rename:"바꾸기",renameTitle:"손님에게 보이는 이름(댓글 이름과 같아요)을 바꿔요. 이 컴퓨터에만 저장돼요."},viewer:{docTitle:n=>`${n} — 보기 전용`,noData:"Easel에서 내보낸 페이지지만 데이터가 없어요 (easel-viewer/data.js).",bar:"뷰어",pages:"페이지",play:"재생",playTitle:"선택한 보드(없으면 첫 보드)를 전체 화면으로 재생해요",stamp:n=>`보기 전용 · ${n}에 내보냄`,stampTitle:"읽기 전용 사본이에요. 디자인 파일을 고친 뒤 다시 내보내요.",madeWith:"Easel로 만듦",comments:"댓글",commentsN:n=>`댓글 ${n}`,noComments:"댓글 없음",replies:n=>`답글 ${n}개`,pin:(n,o)=>`${o}의 댓글 ${n}`,threadOf:(n,o)=>`${n}/${o}`,closeThread:"댓글 닫기",boardsPanel:"보드",commentsPanel:"댓글 패널",empty:"이 페이지에는 아무것도 없어요",embedGate:"캔버스를 직접 써 볼 수 있어요. 화면 이동, 확대/축소, 보드 열기, 재생. Esc를 누르면 페이지로 돌아가요.",embedHint:"클릭하면 캔버스를 움직이고 확대/축소할 수 있어요",embedHintLive:"Esc를 누르거나 바깥을 클릭하면 페이지로 돌아가요"},canvas:{aria:"디자인 캔버스",board:(n,o,i,f)=>`보드 ${n}${o?" (선택됨)":""}${i?" 편집 중":""}${f?" 재생 중":""}`,interactive:"재생할 수 있는 보드",hint:"클릭해 선택 · 더블클릭해 텍스트 고치기 · Esc로 선택 해제",notLoaded:"가까이 가면 불러와요",fileMissing:n=>`파일 없음 · ${n}`,playing:"▶ 재생 중 · Esc",exportingPng:"PNG 내보내는 중…",play:"재생",playTitle:"재생 (P)",stopPlay:"재생 중지",stopPlayTitle:"재생 중지 (P 또는 Esc)",playShort:"재생",edit:"편집",exportBoard:"이 보드 내보내기 (PNG)",fullWindow:"전체 창으로 열기",tweaks:"이 보드의 조정 값",boardSize:"보드 크기",titleMaxWidth:"최대 너비",stickySize:"스티키 노트 크기",deleteNote:"메모 삭제"},editMode:{fileChanged:"다른 사람이 먼저 이 파일을 바꿨어요. 요소를 다시 선택해 주세요."},elementDrag:{moveAria:"요소 옮기기 (Alt: 가리킨 상자 안으로)",moveTitle:"끌어서 옮기기 · Alt를 누르고 있으면 가리킨 상자 안에 넣어요",width:"너비",height:"높이",size:"크기"},extra:{letterSpacing:"자간",size:"크기",width:"너비",height:"높이",fixed:"고정",hug:"콘텐츠 맞춤",fill:"채우기",mode:n=>`${n} 방식`,position:"위치",flow:"일반 흐름",absolute:"절대",look:"모양",opacity:"불투명도",border:"테두리",borderStyles:{none:"없음",solid:"실선",dashed:"파선",dotted:"점선"},shadow:"그림자",shadows:{none:"없음",small:"작게",medium:"보통",large:"크게",custom:"사용자 지정"},link:"링크",href:"주소",newTab:"새 탭",export:"내보내기",exportPng:"PNG 2×",exporting:"내보내는 중…"},code:{inline:"인라인 스타일",placeholder:"속성: 값;",bad:n=>`읽을 수 없는 선언: ${n}`,computed:"계산값"},layers:{collapse:"접기",expand:"펼치기",title:"레이어",outline:"페이지 개요",hint:"항목을 다른 항목 위에 놓으면 그 앞으로 옮겨요. Shift+클릭으로 여러 개를 골라 감쌀 수 있어요. 목록을 클릭한 뒤 ↑↓로 옮기고 ←→로 접고 펼쳐요."},keys:{sections:{tools:"도구",edit:"편집",element:"요소",move:"이동",view:"보기",ai:"AI와 댓글"},rows:{select:"선택",hand:"손",board:"보드 그리기",title:"제목",note:"메모",rect:"사각형",oval:"타원",line:"선",arrow:"화살표",penOrPlay:"펜 · 고른 보드는 제자리에서 재생",undo:"실행 취소",redo:"다시 실행",copy:"요소 복사",paste:"뒤에 붙여넣기",duplicate:"복제",delete:"삭제",selectAll:"모두 선택",lock:"잠금 / 풀기",rename:"보드 이름 바꾸기",front:"맨 앞으로",back:"맨 뒤로",copyPng:"PNG로 복사",copyProps:"속성 복사",pasteProps:"속성 붙여넣기",flipH:"좌우 반전",flipV:"상하 반전",wrap:"flex 상자로 묶기",reorder:"형제 사이에서 옮기기",enter:"보드 안으로 · 첫 자식",next:"다음 요소나 보드",arrows:"조금씩 옮기기 · 요소 사이 이동",escape:"선택 풀기 · 닫기",regions:"앱의 다음 영역",zoomIn:"확대",zoomOut:"축소",zoom100:"100%로 보기",fitAll:"전체 보기",zoomSel:"선택 항목에 맞추기",guides:"레이아웃 가이드",minimap:"미니맵",prototype:"프로토타입 보기",panel:"속성 패널",clean:"캔버스만 보기",ai:"AI에게 요청",find:"보드 찾기",comments:"댓글 모드"}},inline:{title:"AI에게 요청",placeholder:"무엇을 바꿀까요?",send:"보내기",history:"대화",visible:n=>`보이는 보드 ${n}개`,result:"AI 결과",done:"끝났어요.",failed:"끝내지 못했어요.",cancelled:"취소했어요.",undo:"되돌리기",undone:"되돌림",open:"대화 보기",close:"닫기",running:"작업 중…",agentItem:n=>`AI 에이전트: ${n}`,modelItem:n=>`모델: ${n||"기본값"}`,modelTitle:"모델",modelLabel:"모델 이름(비우면 에이전트 기본값)"},select:{toolbar:"요소",text:"텍스트",textOff:"이 요소에는 텍스트가 없어요",fill:"채우기",textColor:"글자색",radius:"모서리",spacing:"간격",askAi:"AI",askAiAria:"AI에게 요청",askAiTitle:"이 요소에 대해 AI에게 요청",comment:"댓글",commentTitle:"이 요소에 댓글 달기",more:"더 보기",textStyle:"스타일과 정렬",textAlign:"정렬",bold:"굵게",italic:"기울임",underline:"밑줄",align:n=>({left:"왼쪽 정렬",center:"가운데 정렬",right:"오른쪽 정렬"})[n]??"정렬",tokens:"토큰",custom:"직접 입력…",hex:"Hex 색",picker:"색 고르기",tokenNow:n=>`${n} · 토큰`,decrease:n=>`${n} 줄이기`,increase:n=>`${n} 늘리기`},design:{fill:"채우기",text:"텍스트",font:"글꼴",size:"크기",weight:"굵기",color:"색",cornerRadius:"모서리 반경",padding:"패딩",gap:"간격",more:"더 보기 (CSS)",none:"없음",inherited:n=>`(${n})`,weights:{100:"Thin",200:"Extra light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extra bold",900:"Black"},white:"흰색",black:"검은색",grade:n=>n>=7?"AAA":n>=4.5?"AA":n>=3?"AA 큰 글자만":"너무 낮음",contrastWith:(n,o,i)=>`${o} 글자와 명도 대비 ${n}:1 · ${i}`,contrastOn:(n,o,i)=>`${o} 위 명도 대비 ${n}:1 · ${i}`,openFill:n=>`${n}: 바꾸기`},properties:{tokenColors:{text:"텍스트",secondaryText:"보조 텍스트",background:"배경",surface:"표면",divider:"구분선",accent:"강조",error:"오류"},fields:{width:"너비",height:"높이",fontSize:"글자 크기",fontWeight:"굵기",color:"색",background:"배경",radius:"모서리",flexDirection:"Flex 방향",alignItems:"항목 정렬",justifyContent:"콘텐츠 배치",flexWrap:"줄바꿈",flexGrow:"늘이기",alignSelf:"자기 정렬",lineHeight:"줄 높이",textAlign:"텍스트 정렬",border:"테두리",boxShadow:"그림자",opacity:"불투명도"},alignButtons:{left:"왼쪽 정렬",hcenter:"가운데 정렬",right:"오른쪽 정렬",top:"위쪽 정렬",vcenter:"세로 가운데 정렬",bottom:"아래쪽 정렬"},columns:"열",rows:"행",align:"정렬",layout:"레이아웃",wrap:"감싸기",image:"이미지",replaceImage:"이미지 바꾸기…",wrapTitle:"같은 부모 아래 이어진 형제 요소를 먼저 선택해요",wrapFlex:"Flex로 감싸기",wrapGrid:"Grid로 감싸기",duplicate:"복제",delete:"삭제",offToken:n=>`토큰 밖: ${n}`,none:"없음",contrastTitle:"배경과의 명도 대비 (본문 4.5 이상, 큰 글자 3 이상)",contrast:"명도 대비",largeTextOnly:"큰 글자만",tooLow:"너무 낮음"},shapes:{selectedN:n=>`도형 ${n}개 선택됨`,deleteAll:"선택한 도형 삭제",stickyColors:{yellow:"노랑",orange:"주황",pink:"분홍",purple:"보라",blue:"파랑",green:"초록",gray:"회색",white:"흰색"},shapeSize:"도형 크기",drawShape:"도형 그리기",kinds:{rect:"사각형",oval:"타원",line:"선",arrow:"화살표",pen:"펜",image:"이미지"},none:"없음",options:"도형 옵션",strokeColor:"선 색",fill:"채우기",weight:"굵기",strokeWeight:"선 굵기",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",deleteShape:"도형 삭제",deleteTitle:"삭제 (⌫)"},notes:{selectedN:n=>`메모 ${n}개 선택됨`,deleteAll:"선택한 메모 삭제",options:"메모 옵션",title:"제목",sticky:"스티키 노트",fontSize:"글자 크기",defaultSuffix:" (기본)",textStyle:"텍스트 스타일",bold:"굵게",italic:"기울임",color:"색",stickyColor:n=>`${n} 스티키 노트`,maxWidth:"최대 너비",maxHeight:"최대 높이",width:"너비",height:"높이",titleHint:"최대 너비나 높이를 넘으면 글자가 작아져요 (0은 제한 없음).",stickyHint:"높이를 정하면 넘치는 글은 스크롤돼요 (0은 내용에 맞춤).",deleteNote:"메모 삭제",deleteTitle:"삭제 (⌫)"},guides:{aria:"레이아웃 가이드",heading:(n,o)=>`레이아웃 가이드 ${n}/${o}`,types:{columns:"열",rows:"행",grid:"그리드"},add:{columns:"열 가이드 추가",rows:"행 가이드 추가",grid:"그리드 가이드 추가"},empty:"열, 행, 그리드 가이드를 6개까지 넣을 수 있어요. 캔버스에만 보이고 화면 HTML에는 들어가지 않아요. 모두 숨기기: ⌃G",color:"가이드 색",show:"보이기",hide:"숨기기",deleteGuide:"가이드 삭제",delete:"삭제",cell:"칸",count:"개수",gutter:"거터",margin:"여백",cellSize:"칸 크기",align:"정렬",alignAria:"가이드 정렬",stretch:"늘이기",left:"왼쪽",top:"위",center:"가운데",right:"오른쪽",bottom:"아래"},dialog:{renameGroupTitle:"그룹 이름 바꾸기",menu:"메뉴",cancel:"취소",ok:"확인",deleteBoardsTitle:(n,o)=>n>1?`보드 ${n}개를 삭제할까요?`:`"${o}" 보드를 삭제할까요?`,deleteBoardsBody:"HTML 파일도 함께 지워져요. 사본은 휴지통(docs/design/.trash)에 남고, 실행 취소(⌘Z)로 바로 되돌릴 수 있어요.",delete:"삭제",renameBoardTitle:"보드 이름 바꾸기",name:"이름",rename:"이름 바꾸기",renameFileTitle:"파일 이름 바꾸기",fileName:"파일 이름",renameFileRefs:n=>`이 파일을 가리키는 링크나 iframe: ${n}`,renameFileNoRefs:"이 파일을 가리키는 링크나 iframe이 없어요.",renameFileExtra:n=>`참조 ${n}개도 새 이름으로 바꾸기`,newPageTitle:"새 페이지",newPageName:n=>`페이지 ${n}`,create:"만들기",renamePageTitle:"페이지 이름 바꾸기",deletePageTitle:n=>`"${n}" 페이지를 삭제할까요?`,deletePageBody:n=>`보드 ${n}개와 메모는 지워지지 않고 첫 페이지로 옮겨져요. ⌘Z로 되돌릴 수 있어요.`,authorTitle:"댓글 작성자",save:"저장",snapshotTitle:"스냅샷 저장",snapshotLabel:"메시지",snapshotMessage:n=>`docs(design): design snapshot ${n}`,snapshotHint:"디자인 폴더만 커밋해요. 작성자는 git 설정을 따르고, 따로 스테이징한 다른 파일은 들어가지 않아요.",commit:"커밋"},toast:{linkCopied:"링크를 복사했어요",copiedPng:"PNG로 복사했어요",copiedHtml:"HTML로 복사했어요",copiedProps:"속성을 복사했어요",saveFailed:n=>`저장하지 못했어요: ${n}`,undoRedoDone:(n,o)=>`${n==="undo"?"실행 취소":"다시 실행"}: ${o}`,nothingToUndo:"되돌릴 작업이 없어요",nothingToRedo:"다시 실행할 작업이 없어요",undoAction:"실행 취소",textOnly:"텍스트(와 줄바꿈)만 든 요소만 그 자리에서 고칠 수 있어요",moved:"옮겼어요",movedFrozen:"옮겼어요 (원래 자리의 크기를 유지했어요)",copiedElement:(n,o)=>`${jt(`<${n}>`,"을/를")} 복사했어요. 다른 보드를 편집하면서 ${o}V로 붙여 넣어요`,nothingCopied:"복사한 요소가 없어요. 편집 중에 요소를 선택하고 ⌘C를 눌러요",pasted:(n,o)=>`${n}에서 ${jt(`<${o}>`,"을/를")} 붙여 넣었어요`,imageReplaced:n=>`이미지를 ${jt(n,"으로/로")} 바꿨어요`,boardCreated:n=>`${n} 보드를 만들었어요`,boardCreateFailed:n=>`보드를 만들지 못했어요: ${n}`,boardsDeleted:n=>`보드 ${n}개를 삭제했어요`,duplicated:n=>`${jt(n,"으로/로")} 복제했어요`,renamed:"이름을 바꿨어요",fileRenamed:(n,o)=>`${jt(n,"으로/로")} 이름을 바꿨어요${o?" (참조도 바꿨어요)":""}`,notesMax:n=>`메모는 ${n}개까지 둘 수 있어요`,noteDeleted:"메모를 삭제했어요",shapeDeleted:"도형을 삭제했어요",shapesDeleted:n=>`도형 ${n}개를 삭제했어요`,imageReadFailed:"이미지를 읽지 못했어요",importOnly:n=>`${n}: HTML이나 이미지만 가져올 수 있어요`,imported:n=>`보드 ${n}개를 가져왔어요`,pagesMax:"페이지는 40개까지 만들 수 있어요",pageDeleted:"페이지를 삭제했어요",copied:"복사했어요",elementDeleted:"요소를 삭제했어요",wrapped:n=>`${jt(n,"으로/로")} 감쌌어요`,theme:n=>`테마: ${n}`,tokensSaved:"토큰을 저장했어요",nothingChanged:"바뀐 것이 없어요",snapshot:n=>`스냅샷 ${n}`,cleanedUp:n=>`보드 ${n}개를 정리했어요`,uploaded:n=>`${jt(n,"을/를")} 올렸어요`,tweaksSaved:"조정 값을 소스에 저장했어요",blockFlow:"블록 흐름에서는 세로 정렬이 적용되지 않아요. 부모를 flex로 바꿔 보세요",pngExporting:n=>`${n} 만드는 중…`,pngExported:n=>`${jt(n,"을/를")} 내려받았어요`,pngNeedsBrowser:"PNG로 내보내려면 헤드리스 브라우저가 필요해요:",pngFailed:n=>`PNG를 만들지 못했어요: ${n}`},history:{lock:"잠금",unlock:"잠금 해제",flip:"뒤집기",renameGroup:"그룹 이름 바꾸기",pageFromGroup:"그룹으로 페이지 만들기",boardOptions:"보드 옵션",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",moveBoard:"보드 옮기기",resizeBoard:"보드 크기 바꾸기",addTitle:"제목 추가",addNote:"메모 추가",deleteNote:"메모 삭제",duplicateNote:"메모 복제",moveNote:"메모 옮기기",editNote:"메모 고치기",noteStyle:"메모 스타일",addShape:"도형 추가",deleteShape:"도형 삭제",moveShape:"도형 옮기기",resizeShape:"도형 크기 바꾸기",shapeStyle:"도형 스타일",shapeFront:"도형 맨 앞으로",shapeBack:"도형 맨 뒤로",addImage:"이미지 추가",launchPage:"시작 페이지",moveToPage:"페이지로 옮기기",launchScreen:"시작 화면 정하기",changeTheme:"테마 바꾸기",cleanMissing:"파일 없는 보드 정리",editGuide:"레이아웃 가이드 고치기",addGuide:"레이아웃 가이드 추가",deleteGuide:"레이아웃 가이드 삭제",saveTokens:"토큰 저장",registerTokens:"토큰 등록"},defaults:{newTitle:"새 제목",note:"메모",pastedImage:"pasted-image.png"},menu:{openProps:"속성 패널 열기",newBoard:"새 보드",renameGroup:"그룹 이름 바꾸기…",pageFromGroup:"이 그룹으로 페이지 만들기",drawWithB:"B로 그리기",rename:"이름 바꾸기",moveUp:"위로 옮기기",moveDown:"아래로 옮기기",unsetLaunchPage:"시작 페이지 해제",setLaunchPage:"시작 페이지로 정하기",moveSelectedToPage:n=>`선택한 보드 ${n}개를 이 페이지로 옮기기`,delete:"삭제",selectInside:"안쪽 선택",playInPlace:"제자리에서 재생",stopPlay:"재생 중지",playFullScreen:"전체 화면으로 재생",lock:"잠금",unlock:"잠금 해제",copyPng:"PNG로 복사",copyHtml:"HTML로 복사",copyProps:"속성 복사",pasteProps:"속성 붙여넣기",flipH:"좌우 반전",flipV:"상하 반전",locked:"잠김",askReview:"AI에게 리뷰 요청",focusView:"프로토타입 보기",askAI:"AI",askAIAria:"AI에게 요청",askFixErrors:"AI에게 오류 수정 요청",goToBoard:"보드로 이동",exportPng:"PNG로 내보내기",exportingPng:"PNG 내보내는 중…",renameFile:"파일 이름 바꾸기…",duplicate:"복제",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",deleteBoards:n=>`보드 ${n}개 삭제`,title:"제목",note:"메모",duplicateInFront:"앞에 복제",newBoardHere:"여기에 새 보드",mobileFrameHere:"여기에 모바일 화면 프레임",titleHere:"여기에 제목",noteHere:"여기에 메모",selectAll:"이 페이지 모두 선택",fitAll:"전체 보기",zoom100:"100%로 보기",undo:"실행 취소",redo:"다시 실행",element:"요소",editText:"텍스트 고치기",selectParent:"부모 선택",copy:"복사",pasteAfter:"뒤에 붙여넣기",replaceImage:"이미지 바꾸기…",copyForAI:"AI용 설명 복사",shape:"도형",snapshot:"스냅샷",notGit:"디자인 폴더가 git 저장소 안에 있지 않아요",snapshotStatus:(n,o)=>`스냅샷 · ${n} · 바뀐 파일 ${o}개`,snapshotNow:"지금 스냅샷 저장 (git 커밋)…",nothingChanged:"바뀐 것 없음",fileMissing:"파일이 없어요",askFixAll:"AI에게 모두 수정 요청",cleanMissing:n=>`파일 없는 보드 ${n}개 정리`},prompts:{fixErrors:n=>`이 오류들을 고쳐 줘:
53
+ ${n}`,error:"오류",review:"이 화면을 리뷰해 줘: 접근성(48px 터치 영역, 명도 대비 4.5, 라벨), 정보 위계, 토큰 위반(get_tokens, check_tokens)을 짚고 우선순위대로 고칠 방법을 알려 줘. 아무것도 고치지 말고 제안만 해 줘.",fixComment:"이 댓글이 말하는 대로 그 부분만 고쳐 줘",fixTokens:n=>`토큰 밖의 값을 토큰으로 바꿔 줘 (check_tokens로 확인해 줘):
54
+ ${n}`,fixA11y:n=>`접근성 문제를 고쳐 줘 (보이는 크기는 그대로 두고 터치 영역은 패딩으로 넓혀 줘):
55
+ ${n}`,line:"줄 "},checks:{tokenCheck:n=>`토큰 검사 · ${n}`,noOffToken:"토큰 밖의 값이 없어요",off:"꺼짐",tokensOffTitle:"등록된 토큰이 없어 검사가 꺼져 있어요",tokensOffBody:"색과 크기를 검사하지 않고, AI에게 기본 팔레트도 주지 않아요.",setUpTokens:"토큰 설정",a11y:"접근성",a11yOk:"터치 영역, 명도 대비, 라벨 문제가 없어요",askFix:"AI에게 수정 요청",notVisible:"보드가 화면에 보일 때 검사해요.",pickInEdit:n=>`보드에서 ${n} 선택`,line:n=>`${n}번째 줄`,more:n=>`외 ${n}개`,colorNotInTokens:"토큰에 없는 색",tokenFontSizes:n=>`토큰 글자 크기: ${n}`,tokenRadii:n=>`토큰 모서리: ${n}`,notMultipleOf4:"4의 배수가 아님",tokenWeights:n=>`토큰 굵기: ${n}`,smallTarget:(n,o,i,f)=>`<${n}> 터치 영역 ${o}×${i} (${f} 미만)`,noName:n=>`<${n}>에 이름이 없어요 (aria-label, 텍스트, label)`,noAlt:'<img>에 alt가 없어요 (장식용이면 alt="")',lowContrast:(n,o,i)=>`명도 대비 ${n}:1 (${o} 필요) "${i}"`},tokens:{import:"토큰 가져오기 (tokens.json 또는 Figma 변수 JSON)",importFailed:n=>`가져오지 못했어요: ${n}`,theme:"테마",addTheme:"테마 추가 (지금 테마 복사)",newTheme:"새 테마",newThemeN:n=>`새 테마 ${n}`,activeTheme:"사용 중인 테마",themeName:"테마 이름",importedTheme:"가져온 테마",colors:n=>`색 ${n}`,addColor:"색 추가",colorN:n=>`색 ${n}`,colorOf:n=>`${n} 색`,colorName:"색 이름",remove:n=>`${n} 삭제`,fontSizes:"글자 크기",fontWeights:"글자 굵기",radii:"모서리",spacing:"간격",touchTarget:"터치 영역",minTouchTarget:"최소 터치 영역",saveTitle:"docs/design/tokens.json에 저장",save:"저장",register:"토큰 등록",registeredHint:"속성 패널의 색 견본, 토큰 검사, AI(get_tokens)가 선택한 테마의 값을 써요.",defaultHint:"아직 쓰이지 않는 시작 값이에요. 등록하면 tokens.json에 저장되고 토큰 검사와 AI 팔레트가 켜져요.",noColors:"색 값을 찾지 못했어요"},tweaks:{revert:"되돌리기",save:"소스에 저장",hint:"CSS 변수로 바로 적용돼요. 저장하면 board-tweaks JSON의 값만 바뀌어요."},inspector:{shotFailed:n=>`실패: ${n}`,kindName:n=>({text:"텍스트",button:"버튼",link:"링크",image:"이미지",input:"입력란",icon:"아이콘",container:"컨테이너"})[n]??n,crumbs:"선택 경로",crumbBoard:"보드 선택",crumbParent:n=>`${n} 선택`,crumbElement:(n,o)=>`<${n}> ${o}`,more:n=>`외 ${n}개`,copy:"복사",copied:"복사함",capturing:"캡처하는 중…",screenshot:"스크린샷",boardScreenshot:"보드 스크린샷",boardScreenshotTitle:"이 보드의 PNG를 디자인 폴더 옆에 저장해요",screenshotTitle:"이 요소의 PNG를 저장해요",actions:"요소 작업",boardActions:"보드 작업"},comments:{pinLabel:(n,o,i)=>`${o}의 댓글 ${n}: ${i}`,title:"댓글",placeholderElement:n=>`선택한 요소(${n})에 댓글 달기`,placeholderBoard:"보드에 댓글 달기",placeholder:"댓글 달기",add:"댓글",authorTitle:"댓글 작성자 이름 바꾸기",author:n=>`작성자: ${n}`,replyPlaceholder:n=>`${jt(n,"으로/로")} 답글 달기 (⌘Enter)`,reply:"답글",replyResolve:"답글 달고 해결",reopen:"다시 열기",resolve:"해결",sendToAI:"AI에게 보내기",sendToAITitle:"이 댓글이 가리키는 곳만 고치도록 AI에게 보내요",openThread:"이 댓글만 보기",allOnBoard:n=>`이 보드 댓글 ${n}개 모두`,mode:"댓글 모드",modeTitle:"댓글 모드 (⌥C)",allTitle:"모든 댓글",thisPage:"이 페이지",allPages:"모든 페이지",showResolved:"해결됨",scope:"보일 댓글",edit:"편집",deleteThread:"삭제",more:"편집·삭제",none:"댓글 없음",nothingSelected:"선택 없음"},assets:{uploading:"올리는 중…",upload:"올리기 (이미지와 글꼴, 끌어다 놓아도 돼요)",loading:"불러오는 중…",empty:"아직 에셋이 없어요. 올린 이미지는 docs/design/assets/에 저장되고 화면에서는 ../assets/이름 으로 써요.",copyPath:" · 클릭해 경로 복사",file:"파일",pickImage:"이미지 고르기",pickLabel:", 이 이미지 쓰기",close:"닫기"},chat:{aria:"AI 채팅",agent:"에이전트",agentHint:"파일을 고칠 에이전트",agentButton:(n,o)=>o?`에이전트: ${n} — ${o}`:`에이전트: ${n}`,agentStatus:{ready:"준비됨",signin:"로그인 필요",missing:"설치 안 됨",unknown:"확인하지 못함"},checking:"확인하는 중…",checkedOnOpen:"AI 탭을 열 때 확인함",checkAgain:"다시 확인",model:"모델",modelDefault:"기본값 (CLI 설정)",modelTitle:n=>`${n}의 모델: 별칭이나 전체 모델 ID. 비워 두면 CLI 기본값을 써요.`,continuing:"대화 이어 가는 중",newConversation:"새 대화",newChat:"새 채팅",intro:n=>`선택한 보드와 요소, 화면에 보이는 보드를 맥락으로 ${n}에게 보내요. 에이전트가 소스 HTML을 바로 고치고, 캔버스는 곧바로 다시 그려져요.`,suggestions:[{label:"AI 리뷰: 접근성, 명도 대비, 위계",text:"선택한 화면을 리뷰해 줘: 접근성(48px 터치 영역, 명도 대비 4.5, 라벨), 정보 위계, 토큰 위반(get_tokens, check_tokens). 아무것도 고치지 말고 우선순위대로 제안만 해 줘.",n:1},{label:"이 화면의 시안 3개",text:"선택한 화면을 서로 다른 방향으로 시안 3개 만들어 줘 (레이아웃, 위계, 강조점을 각각 다르게).",n:3},{label:"선택한 버튼 문구 줄이기",text:"선택한 버튼 문구를 줄여 줘",n:1},{label:"새 빈 상태 화면 만들기",text:"새 빈 상태 화면을 만들어 줘",n:1}],remedySignin:(n,o)=>`${n}에 로그인되어 있지 않아요. 터미널에서 \`${o}\` 명령을 실행해요.`,remedyMissing:n=>`\`${n}\` 명령을 찾지 못했어요. 설치한 뒤 다시 확인해요.`,copyCommand:"명령 복사",copy:"복사",copied:"복사함",sendNeedsSignin:n=>`보내려면 ${n}에 로그인해요`,sendNeedsInstall:n=>`보내려면 ${jt(n,"을/를")} 설치해요`,running:"실행 중",cancelled:"취소됨",failed:"실패",retry:"다시 시도",switchTo:n=>`${jt(n,"으로/로")} 바꾸기`,details:"자세히",noFilesChanged:"바뀐 파일이 없어요.",restored:"실패한 메시지에서 되살렸어요",madeVariants:n=>`시안 ${n}개를 나란히 만들었어요 · 보기`,thinking:"생각하는 중…",chipElement:n=>`요소 <${n}>`,chipElementText:(n,o)=>`요소 <${n}> ${o}`,chipBoards:n=>`보드 ${n}개`,chipVisible:n=>`보이는 보드 ${n}`,chipComment:n=>`댓글 "${n}"`,variants:n=>`시안 ${n}개`,tooBig:n=>`${n}: 15MB보다 커요`,refLink:"참고 링크",placeholderRunning:"실행 중… (Esc로 취소)",placeholder:"무엇을 바꿀까요? (Enter로 보내기 · Shift+Enter로 줄바꿈)",input:"AI에게 보낼 메시지",attach:"파일이나 이미지 첨부",attachTitle:"파일이나 이미지 첨부 (끌어다 놓거나 붙여 넣어도 돼요)",addLink:"참고 링크 추가",variantsTitle:"선택한 보드를 복사해 서로 다른 시안을 나란히 만들어요",variantsDisabledTitle:"보드를 하나 선택하면 쓸 수 있어요",variantsAria:"시안 개수",cancel:"취소",cancelTitle:"취소 (Esc)",send:"보내기",chipRemoveTitle:"클릭해 빼기",chipAddTitle:"클릭해 첨부",remove:n=>`${n} 빼기`,howToInstall:"설치 방법",customCommand:"직접 지정한 명령…",checkedAt:(n,o)=>o?`AI 탭을 열 때 확인함 · ${n}`:`${n}에 다시 확인함`,customTitle:"직접 지정한 명령",customName:"이름",customCommandLabel:"명령",customNamePlaceholder:"Aider",customCommandPlaceholder:"aider --message {prompt} --yes",customHint:"`{prompt}`는 요청과 캔버스 맥락으로 바뀌어요. 출력은 일반 텍스트로 보여요.",customSave:"저장",customCommandTitle:n=>`셸 없이 실행해요: ${n}`,waiting:"응답 기다리는 중",waitingHint:"위의 요청에 답해 주세요",permAsk:(n,o,i)=>o==="command"?`${jt(n,"이/가")} 명령 실행을 요청해요`:o==="edit"?`${jt(n,"이/가")} 파일 ${i==="Write"?"쓰기를":"수정을"} 요청해요`:o==="fetch"?`${jt(n,"이/가")} 페이지 가져오기를 요청해요`:`${jt(n,"이/가")} ${i} 사용을 요청해요`,permIn:"위치",permOutside:"디자인 폴더 밖",allowOnce:"한 번 허용",alwaysAllow:n=>`${n} 항상 허용`,alwaysAllowTitle:"Easel을 다시 시작할 때까지, 이 캔버스에서만",deny:"거부",permDone:{once:"허용함",always:"항상 허용함",deny:"거부함"},permDoneOutside:"(디자인 폴더 밖)",noPause:{codex:"Codex exec는 멈추고 물어볼 수 없어서 샌드박스 설정을 따라요.",cursor:"Cursor Agent는 여기서 멈추고 물어볼 수 없어서 --force로 실행돼요.",gemini:"Gemini CLI는 여기서 멈추고 물어볼 수 없어서 수정을 스스로 받아들여요."},runChanged:(n,o)=>n&&o?`보드 ${n}개 바꿈 · ${o}개 추가`:o?`보드 ${o}개 추가`:n?`보드 ${n}개 바꿈`:"캔버스를 바꿈",chipNew:n=>`${n} (새로 만듦)`,chipRemoved:n=>`${n} (삭제됨)`,undoRun:"이 실행 취소",compare:"비교",redo:"다시 실행",runUndone:n=>`실행을 취소했어요 · 보드 ${n}개를 되돌렸어요`,conflictUndo:n=>`이 실행 뒤에 바뀐 보드: ${n}. 나머지만 취소하고 이 보드는 그대로 둘까요, 모두 취소하고 덮어쓸까요?`,conflictRedo:n=>`취소한 뒤에 바뀐 보드: ${n}. 나머지만 다시 실행하고 이 보드는 그대로 둘까요, 모두 다시 실행하고 덮어쓸까요?`,undoRest:"나머지만 취소",undoAll:"그래도 모두 취소",redoRest:"나머지만 다시 실행",redoAll:"그래도 모두 다시 실행",restoreCopy:"이 실행 전 사본으로 되돌리기",savedAt:n=>`${n}에 저장함`,copyGone:"이 실행 전 사본이 없어요 (최근 10개만 보관해요).",restoredCopy:"캔버스를 이 실행 전 사본으로 되돌렸어요",restoreTitle:"이 실행 전 사본으로 되돌릴까요?",restoreBody:n=>`캔버스 전체를 이 실행 전인 ${n} 상태로 되돌려요. 모든 화면과 board.json이 바뀌고, 그 뒤에 내가 바꾸거나 다른 실행이 바꾼 것도 포함돼요. 실행 취소로 되돌리기를 취소할 수 있어요.`,restoreOk:"되돌리기",restarted:n=>`Easel 다시 시작됨 · ${n}`},compare:{title:n=>`비교 · ${n}`,boards:"보드",before:"전",after:"후",notBefore:"실행 전에는 없던 보드예요.",notAfter:"이 실행이 보드를 삭제했어요.",notBeforeChange:"이 변경 전에는 없던 보드예요.",close:"닫기"},activity:{stepName:n=>{const o=String(n),i={text:"텍스트",heading:"제목","button copy":"버튼 글","link text":"링크 글",label:"라벨",style:"스타일",attribute:"속성",tweaks:"조정 값",colour:"글자색",fill:"채우기","text size":"글자 크기",weight:"굵기",italic:"기울임",underline:"밑줄",alignment:"정렬",radius:"모서리",padding:"패딩",gap:"간격",opacity:"불투명도","letter spacing":"자간",size:"크기",position:"위치",shadow:"그림자",border:"테두리"},f={Delete:"요소 삭제",Duplicate:"요소 복제",Move:"요소 이동",Add:"요소 추가"},m={"Add board":"보드 추가","Duplicate board":"보드 복제","Delete board":"보드 삭제","Rename board":"보드 이름 변경","Move board":"보드 이동","Resize board":"보드 크기 변경","Change board":"보드 변경","Board options":"보드 옵션","Bring to front":"맨 앞으로","Send to back":"맨 뒤로","Move to page":"페이지로 이동","Set launch screen":"시작 화면 지정"};let p;if(p=o.match(/^Undo (\d+) changes$/))return`변경 ${p[1]}개 실행 취소`;if(p=o.match(/^Undo (.+)$/))return`실행 취소: ${Mb.activity.stepName(p[1])}`;if((p=o.match(/^Change (.+) on (.+)$/))&&i[p[1]])return`${p[2]} · ${i[p[1]]} 변경`;if(p=o.match(/^(Delete|Duplicate|Move|Add) element on (.+)$/))return`${p[2]} · ${f[p[1]]}`;if(p=o.match(/^Group elements on (.+)$/))return`${p[1]} · 요소 묶기`;if(p=o.match(/^(Add|Delete|Move|Resize|Change) (\d+) boards$/))return`보드 ${p[2]}개 ${{Add:"추가",Delete:"삭제",Move:"이동",Resize:"크기 변경",Change:"변경"}[p[1]]}`;for(const[b,N]of Object.entries(m))if(o.startsWith(b+" "))return`${N} · ${o.slice(b.length+1)}`;return(p=o.match(/^Edit (.+)$/))?`${p[1]} · 편집`:(p=o.match(/^Change (.+)$/))?`${p[1]} · 변경`:o},outside:"Easel 밖",ago:n=>{const o=Math.floor(Math.max(0,n)/6e4);return o<1?"방금":o<60?`${o}분`:o<1440?`${Math.floor(o/60)}시간`:`${Math.floor(o/1440)}일`},agoLong:n=>{const o=Math.floor(Math.max(0,n)/6e4);return o<1?"방금":o<60?`${o}분 전`:o<1440?`${Math.floor(o/60)}시간 전`:`${Math.floor(o/1440)}일 전`},tag:(n,o,i,f)=>`${n} · ${o} · ${f&&i===1?"새 보드":`변경 ${i}개`}`,tagTitle:n=>`${n} — 클릭해 변경 내용, 전/후, 실행 취소 보기`,tagsAria:n=>`다른 사람의 변경 ${n}개`,popAria:n=>`${n}의 변경`,element:By,change:n=>{const o=By(n.tag,n.cls);switch(n.kind){case"style":return`${o} 스타일 바뀜`;case"attr":return`${o} 속성 바뀜`;case"edited":return`${o} 바뀜`;case"added":return n.count>1?`요소 ${n.count}개 추가됨`:`${o} 추가됨`;case"removed":return n.count>1?`요소 ${n.count}개 삭제됨`:`${o} 삭제됨`;case"replaced":return`${o} 교체됨`;case"many":return`요소 ${n.count}${n.more?"+":""}개 바뀜`;case"page":return"페이지 스타일이나 제목 바뀜";case"source":return"소스의 공백이나 주석만 바뀜";case"new":return"새 보드";case"deleted":return"보드 삭제됨";case"moved":return"보드 옮겨짐";case"resized":return"보드 크기 바뀜";case"renamed":return"보드 이름 바뀜";case"options":return"보드 옵션 바뀜";default:return"바뀜"}},changes:n=>`이 보드의 변경 ${n}개`,quote:n=>`“${n}”`,arrow:"→",beforeAfter:"전 / 후",undo:"실행 취소",undoTitle:n=>n===1?"이 변경 실행 취소":`이 변경 ${n}개 실행 취소`,conflict:n=>`그 뒤에 바뀐 보드: ${n}. 나머지만 취소하고 이 보드는 그대로 둘까요, 모두 취소하고 덮어쓸까요?`,undoRest:"나머지만 취소",undoAll:"그래도 모두 취소",cancel:"취소",close:"닫기",historyButton:"기록",historyTitle:"기록 · 최신순",historyEmpty:"아직 없어요. 이 세션에서 바꾼 것이 여기에 보여요.",historyFoot:"기록은 이 세션 동안 보관돼요.",now:"지금",goBack:"여기로 돌아가기",goBackAria:(n,o,i)=>`${o}, ${i}: ${n} · 여기로 돌아가기`,nowAria:(n,o,i)=>`${o}, ${i}: ${n} · 지금`,undoneAria:(n,o,i)=>`${o}, ${i}: ${n} · 취소됨`,wentBack:n=>`되돌아감: ${n}`},occupancy:{editing:n=>`${n} 편집 중…`,you:"나 · 편집 중",personEditing:n=>`${n} · 편집 중`,done:(n,o)=>`${n} · ${o} 완료`,someone:"누군가",clock:n=>new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),tagsAria:"이 보드에 있는 사람",listDot:n=>`${n} 편집 중`,youListDot:"내가 편집 중",forked:(n,o,i)=>`${n}에 포크됨 — ${jt(i,"이/가")} 편집하는 동안 ${jt(o,"이/가")} 시작함`,forkBlock:(n,o)=>n===1?`${o}의 포크`:`${o}의 포크 ${n}개`,forkBlockWhile:(n,o,i)=>`${n===1?`${o}의 포크`:`${o}의 포크 ${n}개`} · ${jt(i,"이/가")} 편집하는 동안 만듦`,forkBlockShort:n=>n===1?"포크":`포크 ${n}개`,useThis:"이걸로 쓰기",useThisOne:"이 버전으로 쓰기",useThisTitle:"이 시안을 원래 보드로 만들고 나머지 시안은 휴지통으로 보내요",useThisOneTitle:n=>`이 버전을 보드로 남기고 다른 버전 ${n}개는 휴지통으로 보내요`,waitFor:n=>`${jt(n,"이/가")} 편집을 마칠 때까지 기다려요`,confirmVariant:(n,o)=>`${jt(`"${n}"`,"을/를")} ${o}에 적용할까요?`,confirmVariantBody:(n,o)=>`${jt(n,"이/가")} 바뀌어요.${o?` 다른 시안 ${o}개는 휴지통으로 가요.`:""}`,confirmFork:(n,o)=>`${o}에 ${jt(`"${n}"`,"을/를")} 쓸까요?`,confirmForkBody:(n,o)=>`${jt(n,"이/가")} 이 버전으로 바뀌어요. ${o?`이 포크와 다른 포크 ${o}개는 휴지통으로 가요.`:"포크는 휴지통으로 가요."}`,confirmKeep:n=>`${jt(`"${n}"`,"을/를")} 남길까요?`,confirmKeepBody:(n,o)=>`${jt(n,"은/는")} 휴지통으로 가요.`,apply:"적용",keepAll:"모두 남기기",keepBoth:"둘 다 남기기",applied:(n,o)=>`${jt(n,"을/를")} ${o}에 적용했어요`,kept:(n,o)=>`${jt(n,"을/를")} 남겼어요. 다른 버전 ${o}개는 휴지통에 있어요`,keptAll:(n,o)=>n==="variant"?`시안 ${o}개를 모두 보드로 남겼어요`:`버전 ${o+1}개를 모두 보드로 남겼어요`,undo:"실행 취소"},requests:{goTo:"AI 요청 보낼 곳",easelChat:"Easel 채팅",easelChatNote:"Easel이 Claude Code를 직접 실행해요.",host:"대화 중인 에이전트",hostNote:"요청이 캔버스에 남아요.",connected:"연결됨",noneConnected:"연결된 에이전트 없음",thisFolder:"이 폴더",otherFolder:"다른 폴더",since:n=>`${n}부터`,sendTo:"받는 에이전트",anyAgent:"아무 에이전트",sayTitle:"에이전트에게",line:"Easel 요청 처리해 줘",quote:n=>`“${n}”`,copy:"복사",copied:"복사됨",copyTitle:"에이전트 채팅에 붙여 넣을 말 복사 (또는 /easel:requests)",forAi:"AI용",forAgent:n=>`${n}용`,addForAi:"남기기",forAiCheck:"AI용",forAiCheckTitle:"이 댓글을 대화 중인 에이전트에게 남기는 요청으로",composerTitle:"AI에게 요청",composerAria:"AI에게 남길 요청",composerPlaceholder:"여기서 무엇을 바꿀까요?",cancel:"취소",waiting:"대기 중",waitingFor:n=>`${n} 대기 중`,took:(n,o)=>`${n} 작업 중 · ${o}`,failed:n=>`${jt(n,"이/가")} 끝내지 못함`,left:n=>`대기 중 (${n} 나감)`,cancelRequest:"취소",useChat:"Easel 채팅으로",more:"더 보기",retry:"다시",undoChange:"되돌리기",undone:"되돌림",undoGone:"지금은 되돌릴 수 없음",changedTitle:n=>`바뀐 보드 ${jt(n,"으로/로")} 가기`,waitingTag:n=>`대기 ${n}`,pinLabel:(n,o,i)=>o?`에이전트를 기다리는 요청 ${n}: ${i}`:`AI용 요청 ${n}: ${i}`,countAria:n=>`에이전트를 기다리는 요청 ${n}개`,filterAria:"보일 댓글",filterAll:"전체",filterForAi:"AI용",listTitle:"AI용",allBoards:"모든 보드",listEmpty:"요청 없음",introTitle:"이 창의 에이전트에게 요청을 남길까요?",switchTo:"바꾸기",keepChat:"Easel 채팅 유지",backToRequests:"요청으로 돌아가기",hostShort:"대화 중인 에이전트",easelChatShort:"Easel 채팅",goesTo:"요청 보낼 곳",connectedN:n=>n?`${n}개 연결됨`:"연결 없음",chatOnce:"Easel 채팅, 이 요청만",menuHost:"AI 요청: 대화 중인 에이전트",menuChat:"AI 요청: Easel 채팅",added:"에이전트에게 남겼어요",cancelled:"취소했어요. 댓글은 남아요.",markerWaiting:"에이전트에게 보냄 · 대기 중",markerWaitingFor:n=>`${n}에게 보냄 · 대기 중`,markerWorking:n=>`작업 중… · ${n}`,markerSay:n=>`채팅에 “${n}”라고 하세요`,markerDone:"끝났어요",markerCount:n=>`요청 ${n}개`,markerAria:"에이전트에게 보낸 요청",dismiss:"닫기",openComment:"댓글 보기",kind:{element:"요소",board:"보드",tokens:"토큰 검사",a11y:"접근성",errors:"오류",review:"검토",comment:"댓글"},frameBoard:n=>`Easel 보드 ${n}`,frameElement:(n,o)=>`Easel 보드 ${n}, 선택: ${o}`},update:{out:n=>`Easel ${jt(n,"이/가")} 나왔어요`,copy:"명령 복사",copied:"복사했어요. 실행한 뒤 Easel을 다시 시작해요",row:n=>`${jt(n,"으로/로")} 업데이트`,versions:(n,o)=>`${n} → ${o}`,copyRow:"업데이트 명령 복사",retry:"다시 업데이트해 보기",updating:n=>`${jt(n,"으로/로")} 업데이트 중…`,done:n=>`${jt(n,"으로/로")} 업데이트했어요`,failed:(n,o)=>`${jt(n,"으로/로")} 업데이트하지 못했어요. ${o}`,dotTitle:n=>`Easel ${jt(n,"이/가")} 나왔어요`,why:{busy:"AI 작업이 끝나면 할 수 있어요",permission:"관리자 권한 없이는 그곳에 설치할 수 없어요",network:"npm 레지스트리에 닿지 않았어요",nonpm:"npm을 찾지 못했어요",failed:"설치가 끝나지 않았어요",restart:"새 버전이 시작되지 않아 지금 버전을 그대로 써요",project:"이 프로젝트에 설치돼 있어요. npm으로 올려 주세요",source:"소스에서 실행 중이에요. git으로 올려 주세요",other:"명령을 실행한 뒤 Easel을 다시 시작해요"}}},sf=[{id:"en",name:"English"},{id:"ko",name:"한국어"}],Ab="design-canvas:lang";function n0(n,o){return n==="en"||n==="ko"?n:/^ko($|[-_])/i.test(o??"")?"ko":"en"}function a0(){if(typeof window>"u")return"en";let n=null;try{n=localStorage.getItem(Ab)}catch{}return n0(n,navigator.language)}const wf=a0();function l0(n){try{localStorage.setItem(Ab,n)}catch{}location.reload()}const s0={en:Wx,ko:Mb},u=s0[wf],o0=1440*60*1e3,pm=n=>`design-canvas:seen:${n}`,Ef=n=>n.by?"ai":n.person||!n.outside?"person":"file",Km=(n,o)=>n.by??n.person??(n.outside?u.activity.outside:o);function i0(n){const[o,i]=v.useState(null),[f,m]=v.useState(()=>Date.now()),[p,b]=v.useState({}),N=v.useRef(null),j=v.useCallback(()=>{N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{xe.get(`/api/activity?client=${encodeURIComponent(Cf)}`).then(i).catch(()=>{})},120)},[]);v.useEffect(()=>{j();const k=window.setInterval(()=>m(Date.now()),3e4);return()=>window.clearInterval(k)},[j]),v.useEffect(()=>{if(!(!n||!o))try{const k=JSON.parse(localStorage.getItem(pm(n))??"{}"),z=Object.fromEntries(Object.entries(k).filter(([R])=>R.startsWith(`${o.boot}:`)));b(z),Object.keys(z).length!==Object.keys(k).length&&localStorage.setItem(pm(n),JSON.stringify(z))}catch{}},[n,o==null?void 0:o.boot]);const E=v.useCallback(k=>{!o||!k.length||b(z=>{const R=k.filter(B=>!z[`${o.boot}:${B}`]);if(!R.length)return z;const K={...z,...Object.fromEntries(R.map(B=>[`${o.boot}:${B}`,Date.now()]))};try{n&&localStorage.setItem(pm(n),JSON.stringify(K))}catch{}return K})},[o,n]),S=v.useCallback(k=>{if(!o)return"fresh";const z=k.steps.map(R=>p[`${o.boot}:${R}`]);return z.some(R=>!R)?"fresh":f-Math.max(...z)>o0?"gone":"seen"},[o,p,f]),w=v.useCallback(k=>((o==null?void 0:o.tags[k])??[]).filter(z=>S(z)!=="gone"),[o,S]);return{data:o,now:f,reload:j,markSeen:E,stateOf:S,tagsOf:w}}function c0({file:n,act:o,me:i,onOpen:f,lead:m,open:p}){const b=o.tagsOf(n);return!b.length&&!m?null:s.jsxs("span",{className:"act-tags",role:"group","aria-label":b.length?u.activity.tagsAria(b.reduce((N,j)=>N+j.count,0)):u.occupancy.tagsAria,children:[m,b.map(N=>{const j=u.activity.tag(Km(N,i),u.activity.ago(o.now-N.at),N.count,N.newBoard);return s.jsxs("button",{className:`act-tag ${o.stateOf(N)==="seen"?"seen":""}`,"data-tag":`${n}|${N.key}`,title:u.activity.tagTitle(j),"aria-haspopup":"dialog","aria-expanded":p===N.key,onPointerDown:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),f(n,N.key)},children:[s.jsx(Q,{name:Ef(N),size:16}),s.jsx("span",{className:"act-tag-text",children:j})]},N.key)})]})}function r0({tag:n}){const o=n.change;return n.count>1?s.jsx("div",{className:"callout-diff",children:u.activity.changes(n.count)}):(o==null?void 0:o.kind)==="text"?s.jsxs("div",{className:"callout-diff",children:[s.jsx("span",{className:"diff-old",children:u.activity.quote(o.from??"")})," ",u.activity.arrow," ",s.jsx("span",{className:"diff-new",children:u.activity.quote(o.to??"")})]}):s.jsx("div",{className:"callout-diff",children:o?u.activity.change(o):u.activity.change({kind:"",count:1})})}function u0(n){const o=v.useRef(null),[i,f]=v.useState(null),m=()=>document.querySelector(`[data-tag="${CSS.escape(`${n.file}|${n.tag.key}`)}"]`);v.useLayoutEffect(()=>{var k,z;const b=m();if(!b)return void n.onClose();const N=b.getBoundingClientRect(),j=((k=o.current)==null?void 0:k.offsetWidth)??280,E=((z=o.current)==null?void 0:z.offsetHeight)??140,S=Math.max(8,Math.min(N.left,window.innerWidth-j-8)),w=N.bottom+8+E>window.innerHeight-8?Math.max(8,N.top-E-8):N.bottom+8;(!i||Math.abs(i.x-S)>.5||Math.abs(i.y-w)>.5)&&f({x:S,y:w})}),v.useEffect(()=>{var N,j;(j=(N=o.current)==null?void 0:N.querySelector("button"))==null||j.focus();const b=E=>{var w,k;const S=E.target;(w=o.current)!=null&&w.contains(S)||(k=m())!=null&&k.contains(S)||S instanceof Element&&S.closest(".dialog-backdrop")||n.onClose()};return window.addEventListener("pointerdown",b,!0),()=>window.removeEventListener("pointerdown",b,!0)},[n.file,n.tag.key]);const p=Km(n.tag,n.me);return s.jsxs("div",{ref:o,className:"callout",role:"dialog","aria-label":u.activity.popAria(p),style:{left:(i==null?void 0:i.x)??-9999,top:(i==null?void 0:i.y)??-9999},onKeyDown:b=>{var N;b.key==="Escape"&&(b.stopPropagation(),n.onClose(),(N=m())==null||N.focus())},children:[s.jsxs("div",{className:"callout-top",children:[s.jsx(Q,{name:Ef(n.tag),size:16}),p," ",s.jsxs("span",{className:"muted",children:["· ",u.activity.agoLong(n.now-n.tag.at)]}),s.jsx("button",{className:"icon-btn sm callout-x","aria-label":u.activity.close,title:u.activity.close,onClick:n.onClose,children:s.jsx(Q,{name:"close",size:14})})]}),s.jsx(r0,{tag:n.tag}),s.jsxs("div",{className:"callout-actions",children:[s.jsxs("button",{onClick:n.onCompare,children:[s.jsx(Q,{name:"compare",size:14})," ",u.activity.beforeAfter]}),s.jsxs("button",{disabled:n.busy,title:u.activity.undoTitle(n.tag.steps.length),onClick:()=>n.onUndo(),children:[s.jsx(Q,{name:"undo",size:14})," ",u.activity.undo]})]}),n.conflict&&s.jsxs("div",{className:"rr-conflict",role:"alert",children:[s.jsx("p",{children:u.activity.conflict(n.conflict.join(", "))}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{onClick:()=>n.onUndo("rest"),children:u.activity.undoRest}),s.jsx("button",{className:"danger",onClick:()=>n.onUndo("all"),children:u.activity.undoAll}),s.jsx("button",{onClick:n.onCancelConflict,children:u.activity.cancel})]})]})]})}function d0({frame:n,paths:o,zoom:i}){const[f,m]=v.useState([]),p=o.join(",");v.useEffect(()=>{if(!n)return m([]);const N=()=>{const E=n.isConnected?n.contentDocument:null;if(!(E!=null&&E.body))return m([]);m(o.map(S=>dn(E,S)).filter(S=>!!S&&S!==E.body).map(Rl))};N();const j=window.setTimeout(N,300);return n.addEventListener("load",N),n.addEventListener("dc-reloaded",N),n.addEventListener("dc-patched",N),()=>{n.removeEventListener("dc-patched",N),window.clearTimeout(j),n.removeEventListener("load",N),n.removeEventListener("dc-reloaded",N)}},[n,p]);const b=1/Math.max(i,.05);return s.jsx(s.Fragment,{children:f.map((N,j)=>s.jsx("div",{className:"box change-outline",style:{left:N.x,top:N.y,width:N.w,height:N.h,"--px":`${b}px`}},j))})}function f0(n){var E;const o=v.useRef(null),i=Math.max(0,n.steps.findIndex(S=>S.now)),[f,m]=v.useState(i),p=v.useRef([]),b=(E=n.steps[i])==null?void 0:E.id;v.useEffect(()=>{var S;(S=p.current[i])==null||S.focus(),m(i)},[b]),v.useEffect(()=>{const S=w=>{var z;const k=w.target;(z=o.current)!=null&&z.contains(k)||k instanceof Element&&k.closest(".caret-btn")||n.onClose()};return window.addEventListener("pointerdown",S,!0),()=>window.removeEventListener("pointerdown",S,!0)},[n.onClose]);const N=S=>{var k;const w=Math.max(0,Math.min(n.steps.length-1,S));m(w),(k=p.current[w])==null||k.focus()},j=v.useMemo(()=>{var z;const S=((z=document.querySelector(".oc-dock"))==null?void 0:z.getBoundingClientRect())??n.anchor,w=Math.min(448,window.innerWidth-16);if(!S)return{left:8,bottom:76,width:w};const k=Math.round(window.innerHeight-S.top+8);return{left:Math.round(Math.max(8,Math.min(S.right-w,window.innerWidth-w-8))),bottom:k,width:w,maxHeight:Math.round(window.innerHeight-k-8)}},[n.anchor]);return s.jsxs("div",{ref:o,className:"menu oc-hist entering",role:"menu","aria-label":u.activity.historyTitle,style:j,onKeyDown:S=>{var w;["Escape","ArrowDown","ArrowUp","Home","End","Enter"," "].includes(S.key)&&S.stopPropagation(),S.key==="Escape"?(S.preventDefault(),n.onClose(),(w=document.querySelector(".caret-btn"))==null||w.focus()):S.key==="ArrowDown"||S.key==="ArrowUp"?(S.preventDefault(),N(f+(S.key==="ArrowDown"?1:-1))):(S.key==="Home"||S.key==="End")&&(S.preventDefault(),N(S.key==="Home"?0:n.steps.length-1))},children:[s.jsx("div",{className:"oc-menu-h",children:u.activity.historyTitle}),!n.steps.length&&s.jsx("p",{className:"hist-empty",children:u.activity.historyEmpty}),s.jsx("div",{className:"hist-rows",children:n.steps.map((S,w)=>{const k=Km(S,n.me),z=u.activity.ago(n.now-S.at);return s.jsxs("button",{ref:R=>void(p.current[w]=R),role:"menuitem",className:`menu-item oc-hrow ${S.now?"now":""} ${S.undone?"past":""} ${f===w?"active":""}`,"aria-label":(S.now?u.activity.nowAria:S.undone?u.activity.undoneAria:u.activity.goBackAria)(u.activity.stepName(S.name),k,z),"aria-current":S.now?"step":void 0,title:S.label,"aria-disabled":n.busy||void 0,onMouseEnter:()=>m(w),onFocus:()=>m(w),onClick:()=>!S.now&&!n.busy&&n.onGo(S),children:[s.jsx("span",{className:"oc-now-dot","aria-hidden":"true"}),s.jsxs("span",{className:"oc-who",children:[s.jsx(Q,{name:Ef(S),size:16}),s.jsx("span",{children:k})]}),s.jsx("span",{className:"oc-what",children:u.activity.stepName(S.name)}),S.now?s.jsx("span",{className:"oc-mark",children:u.activity.now}):f===w?s.jsx("span",{className:"oc-mark go",children:u.activity.goBack}):s.jsx("span",{}),s.jsx("span",{className:"oc-when",children:z})]},S.id)})}),s.jsx("div",{className:"menu-foot",children:s.jsx("span",{children:u.activity.historyFoot})})]})}const h0=3,Ly=(n,o,i=h0)=>Math.abs(n)+Math.abs(o)>=i;function m0(n,o,i=8,f=n){const m=(o.full??o.w)>Math.min(n,f)-i*2;let p=Math.max(i,Math.round((n-o.w)/2));return p+o.w>f-i&&(p=Math.max(i,Math.round((f-o.w)/2))),{x:p,icons:m}}function p0(n,o=2){const i=n.split("/"),f=i.slice(1).map((m,p)=>i.slice(0,p+1).join("/"));return{paths:f.slice(-o),skipped:f.length>o}}function Fa(n){const o=(n??"").trim(),i=o.match(/^(-?\d+(?:\.\d+)?)px$/);return i?String(Number(i[1])):o}const Mm=n=>(n??"").trim().split(/\s+/).filter(Boolean).map(Fa).join(" · ");function g0(n){return n.replace(/·/g," ").trim().split(/\s+/).filter(Boolean).map(i=>/^-?\d+(?:\.\d+)?$/.test(i)?`${Number(i)}px`:i).join(" ")}function Am(n,o){const i=Number(n);return!n||!Number.isFinite(i)?String(n??""):o[i]?`${o[i]} · ${i}`:String(i)}const y0=/^(system-ui|-apple-system|blinkmacsystemfont|ui-sans-serif)$/i;function _y(n){var i;const o=((i=(n??"").split(",")[0])==null?void 0:i.trim().replace(/^["']|["']$/g,""))??"";return y0.test(o)?"System UI":o}function b0(n){const o=n.trim();return/^system ui$/i.test(o)?"system-ui":o.includes(",")||/^["'].*["']$/.test(o)||!/\s/.test(o)?o:`"${o}"`}function ba(n){const o=(n??"").trim().toLowerCase();let i=o.match(/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/);if(i){let f=i[1];return f.length<=4&&(f=[...f].map(m=>m+m).join("")),f.length===8&&f.slice(6)!=="ff"?null:"#"+f.slice(0,6).toUpperCase()}return i=o.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+%?))?\s*\)$/),i?i[4]!=null&&parseFloat(i[4])<(i[4].endsWith("%")?100:1)?null:"#"+[i[1],i[2],i[3]].map(f=>Math.round(Number(f)).toString(16).padStart(2,"0")).join("").toUpperCase():null}const $b=n=>n.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"token";function Bu(n,o){var p;const i=(n??"").trim(),f=i.match(/^var\(\s*--([a-z0-9-]+)/i);if(f){const b=o.find(j=>$b(j.name)===f[1].toLowerCase());if(b)return b;const N=(p=i.match(/,\s*([^)]+)\)\s*$/))==null?void 0:p[1];return N?Bu(N,o):null}const m=ba(i);return m?o.find(b=>ba(b.value)===m)??null:null}function v0(n,o){const i=$b(n.name);if(o[`--${i}`]!=null)return`var(--${i})`;const f=ba(n.value),m=Object.keys(o).find(p=>f&&ba(o[p])===f);return m?`var(${m})`:`var(--${i}, ${f??n.value})`}const x0=(n,o)=>n==="text"&&ba(o)==null?"color":"background";function gf(n,o,i=1,f=0){const m=parseFloat(n),p=Number.isFinite(m)?m:0;return Math.max(f,Math.round((p+o*i)*100)/100)}function w0(n,o,i=4){return(n||"0px").trim().split(/\s+/).map(m=>`${gf(m,o,i)}px`).join(" ")}const $m=[{id:"yellow",label:u.shapes.stickyColors.yellow,bg:"#FFF1A8"},{id:"orange",label:u.shapes.stickyColors.orange,bg:"#FFD9BC"},{id:"pink",label:u.shapes.stickyColors.pink,bg:"#FFD6E2"},{id:"purple",label:u.shapes.stickyColors.purple,bg:"#E5DAFF"},{id:"blue",label:u.shapes.stickyColors.blue,bg:"#D2E4FF"},{id:"green",label:u.shapes.stickyColors.green,bg:"#D5F0D3"},{id:"gray",label:u.shapes.stickyColors.gray,bg:"#ECEBE7"},{id:"white",label:u.shapes.stickyColors.white,bg:"#FFFFFF"}],j0=n=>{var o;return((o=$m.find(i=>i.id===n))==null?void 0:o.bg)??$m[0].bg},Uy=200,qy=6,N0=["#111111","#6B6B6B","#C94F0C","#B42318","#1E7A4C","#2F6FDE","#FFFFFF","none"];function zb({s:n,id:o}){var E;const i=n.strokeWidth??4,f=n.stroke??"#111111",m=n.fill??"none",p=i,b=Math.max(1,n.w),N=Math.max(1,n.h),j=(n.points??[]).map(([S,w])=>`${S},${w}`).join(" ");return s.jsxs("svg",{width:b+p*2,height:N+p*2,viewBox:`${-p} ${-p} ${b+p*2} ${N+p*2}`,style:{position:"absolute",left:-p,top:-p,overflow:"visible"},children:[n.kind==="arrow"&&s.jsx("defs",{children:s.jsx("marker",{id:`ah-${o}`,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:s.jsx("path",{d:"M0 0L10 5L0 10z",fill:f})})}),n.kind==="rect"&&s.jsx("rect",{x:0,y:0,width:b,height:N,rx:8,fill:m,stroke:f,strokeWidth:i}),n.kind==="oval"&&s.jsx("ellipse",{cx:b/2,cy:N/2,rx:b/2,ry:N/2,fill:m,stroke:f,strokeWidth:i}),(n.kind==="line"||n.kind==="arrow")&&s.jsx("polyline",{points:j,fill:"none",stroke:f,strokeWidth:i,strokeLinecap:"round",markerEnd:n.kind==="arrow"?`url(#ah-${o})`:void 0}),n.kind==="pen"&&s.jsx("polyline",{points:j,fill:"none",stroke:f,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round"}),n.kind==="image"&&s.jsx("image",{href:(E=n.src)==null?void 0:E.replace(/^\.\.\//,"/"),x:0,y:0,width:b,height:N,preserveAspectRatio:"xMidYMid slice"})]})}function S0(n){const o=v.useRef(null),i=(m,p)=>b=>{b.button!==0||!n.interactive||(b.stopPropagation(),n.onSelect(m,b.shiftKey),!b.shiftKey&&(o.current={id:m,mode:p,sx:b.clientX,sy:b.clientY,o:n.shapes[m],moved:!1},b.currentTarget.setPointerCapture(b.pointerId)))},f=(m,p=!1)=>{const b=o.current;if(!b)return;const N=(m.clientX-b.sx)/n.zoom,j=(m.clientY-b.sy)/n.zoom;if(!b.moved&&Math.abs(N)+Math.abs(j)<2/n.zoom){p&&(o.current=null);return}if(b.moved=!0,b.mode==="move")n.onChange(b.id,{x:Math.round(b.o.x+N),y:Math.round(b.o.y+j)},p);else{const E=Math.max(8,b.o.w+N),S=Math.max(8,b.o.h+j),w=E/Math.max(1,b.o.w),k=S/Math.max(1,b.o.h),z={w:Math.round(E),h:Math.round(S)};b.o.points&&(z.points=b.o.points.map(([R,K])=>[Math.round(R*w),Math.round(K*k)])),n.onChange(b.id,z,p)}p&&(o.current=null)};return s.jsx(s.Fragment,{children:n.ids.map(m=>{const p=n.shapes[m],b=n.selected.includes(m);return s.jsxs("div",{className:`shape ${b?"selected":""}`,"data-shape":m,style:{left:p.x,top:p.y,width:Math.max(1,p.w),height:Math.max(1,p.h),pointerEvents:n.interactive?"auto":"none"},onPointerDown:i(m,"move"),onPointerMove:N=>f(N),onPointerUp:N=>f(N,!0),onContextMenu:N=>{N.preventDefault(),N.stopPropagation(),n.selected.includes(m)||n.onSelect(m),n.onContext(m,N)},children:[s.jsx(zb,{s:p,id:m}),b&&s.jsx("div",{className:"shape-resize",role:"slider","aria-label":u.shapes.shapeSize,"aria-valuetext":`${p.w} × ${p.h}`,style:{width:12/n.zoom,height:12/n.zoom,right:-6/n.zoom,bottom:-6/n.zoom,borderWidth:1.5/n.zoom},onPointerDown:i(m,"resize"),onPointerMove:N=>f(N),onPointerUp:N=>f(N,!0)})]},m)})})}function k0({tool:n,view:o,onDone:i}){const[f,m]=v.useState(null),p=v.useRef(null),b=j=>{const E=j.currentTarget.getBoundingClientRect();return{x:(j.clientX-E.left-o.x)/o.zoom,y:(j.clientY-E.top-o.y)/o.zoom}},N=(j,E,S,w,k,z)=>{if(z&&(n==="rect"||n==="oval")){const M=Math.max(Math.abs(S-j),Math.abs(w-E));S=j+Math.sign(S-j||1)*M,w=E+Math.sign(w-E||1)*M}if(n==="pen"){const M=k.map(ce=>ce[0]),X=k.map(ce=>ce[1]),te=Math.min(...M),ee=Math.min(...X);return{kind:"pen",x:te,y:ee,w:Math.max(...M)-te,h:Math.max(...X)-ee,points:k.map(([ce,ie])=>[Math.round(ce-te),Math.round(ie-ee)])}}const R=Math.min(j,S),K=Math.min(E,w),B=Math.abs(S-j),V=Math.abs(w-E);return n==="line"||n==="arrow"?{kind:n,x:R,y:K,w:B,h:V,points:[[Math.round(j-R),Math.round(E-K)],[Math.round(S-R),Math.round(w-K)]]}:{kind:n,x:R,y:K,w:B,h:V}};return s.jsx("div",{className:"shape-drawer","aria-label":u.shapes.drawShape,onPointerDown:j=>{if(j.button!==0)return;j.currentTarget.setPointerCapture(j.pointerId);const E=b(j);p.current={x0:E.x,y0:E.y,pts:[[E.x,E.y]]}},onPointerMove:j=>{const E=p.current;if(!E)return;const S=b(j);n==="pen"&&E.pts.push([S.x,S.y]),m(N(E.x0,E.y0,S.x,S.y,E.pts,j.shiftKey))},onPointerUp:j=>{const E=p.current;if(p.current=null,m(null),!E)return;const S=b(j);let w=N(E.x0,E.y0,S.x,S.y,E.pts,j.shiftKey);if(w.w<4&&w.h<4){if(n==="pen")return;w=n==="line"||n==="arrow"?{kind:n,x:E.x0,y:E.y0,w:200,h:0,points:[[0,0],[200,0]]}:{kind:n,x:E.x0,y:E.y0,w:200,h:140}}i({...w,x:Math.round(w.x),y:Math.round(w.y),w:Math.round(w.w),h:Math.round(w.h)})},children:f&&s.jsx("div",{className:"world",style:{transform:`translate(${o.x}px, ${o.y}px) scale(${o.zoom})`,pointerEvents:"none"},children:s.jsx("div",{className:"shape",style:{left:f.x,top:f.y,width:Math.max(1,f.w),height:Math.max(1,f.h)},children:s.jsx(zb,{s:{...f,strokeWidth:4},id:"draft"})})})})}function T0({shape:n,onPatch:o,onDelete:i,onFront:f,onBack:m}){const p=u.shapes.kinds,b=({value:N,onPick:j,allowNone:E})=>s.jsx("span",{className:"swatches",children:N0.filter(S=>E||S!=="none").map(S=>s.jsx("button",{className:`swatch ${N===S?"on":""} ${S==="none"?"none":""}`,title:S==="none"?u.shapes.none:S,"aria-label":S==="none"?u.shapes.none:S,style:{background:S==="none"?void 0:S},onClick:()=>j(S)},S))});return s.jsxs("section",{className:"board-opts","aria-label":u.shapes.options,children:[s.jsx("div",{className:"sec-head",children:s.jsx("span",{children:p[n.kind]})}),n.kind!=="image"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:u.shapes.strokeColor}),s.jsx(b,{value:n.stroke??"#111111",onPick:N=>o({stroke:N})})]}),(n.kind==="rect"||n.kind==="oval")&&s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:u.shapes.fill}),s.jsx(b,{value:n.fill??"none",onPick:N=>o({fill:N}),allowNone:!0})]}),s.jsxs("label",{className:"field-row",children:[s.jsx("span",{children:u.shapes.weight}),s.jsx("input",{type:"range",min:1,max:24,value:n.strokeWidth??4,onChange:N=>o({strokeWidth:Number(N.target.value)}),"aria-label":u.shapes.strokeWeight})]})]}),s.jsxs("div",{className:"muted small",children:[n.w," × ",n.h," · (",n.x,", ",n.y,")"]}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"icon-btn","aria-label":u.shapes.front,title:u.shapes.front,onClick:f,children:s.jsx(Q,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":u.shapes.back,title:u.shapes.back,onClick:m,children:s.jsx(Q,{name:"back"})}),s.jsx("button",{className:"icon-btn danger","aria-label":u.shapes.deleteShape,title:u.shapes.deleteTitle,onClick:i,children:s.jsx(Q,{name:"trash"})})]})]})}function C0({note:n,onPatch:o,onDelete:i}){const f=n.kind==="title",m=f?72:22;return s.jsxs("section",{className:"board-opts","aria-label":u.notes.options,children:[s.jsx("div",{className:"sec-head",children:s.jsx("span",{children:f?u.notes.title:u.notes.sticky})}),s.jsxs("label",{className:"field-row",children:[s.jsx("span",{children:u.notes.fontSize}),s.jsx("select",{value:n.size??m,onChange:p=>o({size:Number(p.target.value)===m?void 0:Number(p.target.value)}),"aria-label":u.notes.fontSize,children:(f?[32,48,56,72,96,128]:[14,18,22,28,36]).map(p=>s.jsxs("option",{value:p,children:[p,"px",p===m?u.notes.defaultSuffix:""]},p))})]}),s.jsxs("div",{className:"btn-row",role:"group","aria-label":u.notes.textStyle,children:[s.jsx("button",{className:`icon-btn ${n.bold??f?"on":""}`,"aria-pressed":!!(n.bold??f),"aria-label":u.notes.bold,title:u.notes.bold,onClick:()=>o({bold:!(n.bold??f)}),children:s.jsx("strong",{children:"B"})}),s.jsx("button",{className:`icon-btn ${n.italic?"on":""}`,"aria-pressed":!!n.italic,"aria-label":u.notes.italic,title:u.notes.italic,onClick:()=>o({italic:!n.italic||void 0}),children:s.jsx("em",{children:"I"})})]}),!f&&s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:u.notes.color}),s.jsx("span",{className:"swatches",children:$m.map(p=>s.jsx("button",{className:`swatch ${(n.color??"yellow")===p.id?"on":""}`,title:p.label,"aria-label":u.notes.stickyColor(p.label),style:{background:p.bg},onClick:()=>o({color:p.id==="yellow"?void 0:p.id})},p.id))})]}),f?s.jsxs("div",{className:"grid2",children:[s.jsx(uo,{label:u.notes.maxWidth,value:n.maxW??2e3,onCommit:p=>o({maxW:p})}),s.jsx(uo,{label:u.notes.maxHeight,value:n.maxH??0,onCommit:p=>o({maxH:p||void 0})})]}):s.jsxs("div",{className:"grid2",children:[s.jsx(uo,{label:u.notes.width,value:n.w??400,onCommit:p=>o({w:p})}),s.jsx(uo,{label:u.notes.height,value:n.h??0,onCommit:p=>o({h:p||void 0})})]}),s.jsx("p",{className:"muted small",children:f?u.notes.titleHint:u.notes.stickyHint}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":u.notes.deleteNote,title:u.notes.deleteTitle,onClick:i,children:s.jsx(Q,{name:"trash"})})})]})}function uo({label:n,value:o,onCommit:i}){return s.jsxs("label",{className:"num",children:[s.jsx("span",{children:n}),s.jsx("input",{inputMode:"numeric",defaultValue:o,onBlur:f=>{const m=Math.max(0,Math.round(Number(f.target.value)));Number.isFinite(m)&&m!==o&&i(m)},onKeyDown:f=>!f.nativeEvent.isComposing&&f.key==="Enter"&&f.target.blur()},o)]})}const E0=n=>n==="grid"?{type:n,count:0,gutter:0,margin:0,align:"stretch",size:8,color:"#C94F0C"}:{type:n,count:n==="columns"?4:6,gutter:16,margin:20,align:"stretch",size:80,color:"#C94F0C"};function M0(n,o){const i=Math.max(1,Math.round(o.count));if(o.align==="stretch"){const b=(n-o.margin*2-o.gutter*(i-1))/i;return Array.from({length:i},(N,j)=>[o.margin+j*(b+o.gutter),b])}const f=i*o.size+(i-1)*o.gutter,m=o.align==="start"?o.margin:o.align==="end"?n-o.margin-f:(n-f)/2;return Array.from({length:i},(p,b)=>[m+b*(o.size+o.gutter),o.size])}function A0({guides:n,w:o,h:i}){return s.jsx("div",{className:"layout-guides","aria-hidden":"true",children:n.filter(f=>!f.hidden).map((f,m)=>f.type==="grid"?s.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`}},m):M0(f.type==="columns"?o:i,f).map(([p,b],N)=>s.jsx("div",{className:"lg-track",style:f.type==="columns"?{left:p,top:0,width:b,height:i,background:`${f.color}1f`}:{top:p,left:0,height:b,width:o,background:`${f.color}1f`}},`${m}-${N}`)))})}function $0({guides:n,onChange:o}){const i=(m,p)=>o(n.map((b,N)=>N===m?{...b,...p}:b),u.history.editGuide),f=u.guides.types;return s.jsxs("section",{className:"board-opts guides-editor","aria-label":u.guides.aria,children:[s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:u.guides.heading(n.length,qy)}),s.jsx("span",{className:"btn-row",children:["columns","rows","grid"].map(m=>s.jsx("button",{className:"icon-btn sm",disabled:n.length>=qy,title:u.guides.add[m],"aria-label":u.guides.add[m],onClick:()=>o([...n,E0(m)],u.history.addGuide),children:s.jsx("span",{className:"small",children:f[m]})},m))})]}),n.length===0&&s.jsx("p",{className:"muted small",children:u.guides.empty}),n.map((m,p)=>s.jsxs("div",{className:"guide-row",children:[s.jsxs("div",{className:"guide-head",children:[s.jsx("strong",{children:f[m.type]}),s.jsx("input",{type:"color",value:m.color,onChange:b=>i(p,{color:b.target.value}),"aria-label":u.guides.color}),s.jsx("div",{className:"spacer"}),s.jsx("button",{className:"icon-btn sm","aria-label":m.hidden?u.guides.show:u.guides.hide,title:m.hidden?u.guides.show:u.guides.hide,onClick:()=>i(p,{hidden:!m.hidden||void 0}),children:s.jsx(Q,{name:m.hidden?"close":"check",size:14})}),s.jsx("button",{className:"icon-btn sm danger","aria-label":u.guides.deleteGuide,title:u.guides.delete,onClick:()=>o(n.filter((b,N)=>N!==p),u.history.deleteGuide),children:s.jsx(Q,{name:"trash",size:14})})]}),m.type==="grid"?s.jsx("div",{className:"grid2",children:s.jsx(uo,{label:u.guides.cell,value:m.size,onCommit:b=>i(p,{size:Math.max(2,b)})})}):s.jsxs("div",{className:"grid2",children:[s.jsx(uo,{label:u.guides.count,value:m.count,onCommit:b=>i(p,{count:Math.max(1,Math.min(48,b))})}),s.jsx(uo,{label:u.guides.gutter,value:m.gutter,onCommit:b=>i(p,{gutter:b})}),s.jsx(uo,{label:u.guides.margin,value:m.margin,onCommit:b=>i(p,{margin:b})}),m.align!=="stretch"&&s.jsx(uo,{label:u.guides.cellSize,value:m.size,onCommit:b=>i(p,{size:Math.max(1,b)})}),s.jsxs("label",{className:"field-row span2",children:[s.jsx("span",{children:u.guides.align}),s.jsxs("select",{value:m.align,onChange:b=>i(p,{align:b.target.value}),"aria-label":u.guides.alignAria,children:[s.jsx("option",{value:"stretch",children:u.guides.stretch}),s.jsx("option",{value:"start",children:m.type==="columns"?u.guides.left:u.guides.top}),s.jsx("option",{value:"center",children:u.guides.center}),s.jsx("option",{value:"end",children:m.type==="columns"?u.guides.right:u.guides.bottom})]})]})]})]},p))]})}const Vy={paths:[],rects:[],selection:null,error:null};function z0(n,o){const[i,f]=v.useState(Vy),m=v.useRef([]);m.current=i.paths;const p=v.useCallback(()=>{var E;if(!n)return;const j=(E=o(n))==null?void 0:E.contentDocument;j&&f(S=>{const w=S.paths.map(k=>dn(j,k));return w.some(k=>!k)?{...S,paths:[],rects:[],selection:null,error:u.editMode.fileChanged}:{...S,rects:w.map(k=>Rl(k))}})},[n,o]),b=v.useCallback(async j=>{var k;if(!n)return;const E=(k=o(n))==null?void 0:k.contentDocument,S=E?j.map(z=>dn(E,z)):[];if(!E||!j.length||S.some(z=>!z)){f(z=>({...z,paths:[],rects:[],selection:null})),await xe.put("/api/selection",{file:null}).catch(()=>{});return}const w=j[j.length-1];f(z=>({...z,paths:j,rects:S.map(R=>Rl(R)),error:null}));try{const{selection:z}=await xe.put("/api/selection",{file:n,path:w,paths:j,styles:Fx(dn(E,w)),...Su(dn(E,w))});f(R=>R.paths===j||R.paths.join()===j.join()?{...R,selection:z}:R)}catch(z){f(R=>({...R,selection:null,error:String(z.message)}))}},[n,o]),N=v.useRef(!0);return v.useEffect(()=>{f(Vy),N.current?N.current=!1:n||xe.put("/api/selection",{file:null}).catch(()=>{})},[n]),v.useEffect(()=>{var z;if(!n)return;const j=o(n);if(!j)return;let E=()=>{};const S=()=>{E();const R=j.contentDocument,K=j.contentWindow;if(!R||!K)return;const B=M=>{var X;M.isComposing||(X=M.target)!=null&&X.isContentEditable||(window.dispatchEvent(new KeyboardEvent("keydown",{key:M.key,code:M.code,metaKey:M.metaKey,ctrlKey:M.ctrlKey,shiftKey:M.shiftKey,altKey:M.altKey})),(/^(Arrow|Delete|Backspace|Tab|Enter|Escape)/.test(M.key)||(M.metaKey||M.ctrlKey)&&/^[zydcvg]$/i.test(M.key))&&M.preventDefault())},V=()=>p();R.addEventListener("keydown",B,!0),K.addEventListener("scroll",V,!0),E=()=>{R.removeEventListener("keydown",B,!0),K.removeEventListener("scroll",V,!0)}},w=()=>{S(),m.current.length&&b(m.current)},k=()=>m.current.length&&void b(m.current);return((z=j.contentDocument)==null?void 0:z.readyState)==="complete"&&S(),j.addEventListener("load",w),j.addEventListener("dc-patched",k),()=>{j.removeEventListener("load",w),j.removeEventListener("dc-patched",k),E()}},[n,o,b,p]),{state:i,select:b,refresh:p,setError:j=>f(E=>({...E,error:j}))}}function of(n,o,i){const f=n==null?void 0:n.contentDocument;if(!n||!(f!=null&&f.body))return null;const m=n.getBoundingClientRect(),p=m.width/(n.offsetWidth||m.width)||1,b=f.elementFromPoint((o-m.left)/p,(i-m.top)/p);if(!b||b===f.body||b===f.documentElement)return null;const N=hl(b);return N==null?null:{el:b,path:N}}function O0(n,o,i,f,m){const p=n==null?void 0:n.contentDocument,b=n==null?void 0:n.contentWindow;if(!n||!(p!=null&&p.body)||!b)return!1;const N=n.getBoundingClientRect(),j=N.width/(n.offsetWidth||N.width)||1,E=p.scrollingElement??p.documentElement,S=z=>{const R=z===E?null:b.getComputedStyle(z),K=(!R||/auto|scroll/.test(R.overflowY))&&(m<0?z.scrollTop>0:m>0&&z.scrollTop+z.clientHeight<z.scrollHeight-1),B=(!R||/auto|scroll/.test(R.overflowX))&&(f<0?z.scrollLeft>0:f>0&&z.scrollLeft+z.clientWidth<z.scrollWidth-1);return K||B};let w=p.elementFromPoint((o-N.left)/j,(i-N.top)/j);for(;w&&w!==E&&w!==p.body&&!S(w);)w=w.parentElement;const k=w&&w!==p.body&&S(w)?w:S(E)?E:null;return k?(k.scrollBy(f/j,m/j),!0):!1}function R0(n,o){const i=p=>{const b=p.getBoundingClientRect();return b.width>0&&b.height>0&&b.left>=o.x&&b.top>=o.y&&b.right<=o.x+o.w&&b.bottom<=o.y+o.h},f=[],m=p=>{for(const b of Array.from(p.children))if(!/^(script|style|template)$/i.test(b.tagName))if(i(b)){const N=hl(b);N!=null&&f.push(N)}else m(b)};return m(n.body),f}function Su(n){var p,b,N;const o=n.tagName.toLowerCase(),i=n.getAttribute("role"),f=o==="img"||o==="picture"||(b=(p=n.style)==null?void 0:p.backgroundImage)!=null&&b.includes("url(")?"image":o==="button"||i==="button"?"button":o==="a"?"link":/^(input|textarea|select)$/.test(o)?"input":o==="svg"?"icon":!n.children.length&&((N=n.textContent)!=null&&N.trim())?"text":"container",m=(n.getAttribute("aria-label")||n.getAttribute("alt")||n.getAttribute("title")||n.getAttribute("placeholder")||n.innerText||n.textContent||"").trim().replace(/\s+/g," ").slice(0,60);return{kind:f,label:m}}function D0(n){let o=n;const i=new Set;return{get:()=>o,set(f){const m=typeof f=="function"?f(o):f;if(!(m===o||m.x===o.x&&m.y===o.y&&m.zoom===o.zoom)){o=m;for(const p of[...i])p()}},subscribe(f){return i.add(f),()=>i.delete(f)}}}function B0(n){const o=v.useRef(null);return o.current||(o.current=D0(n)),o.current}function Zm(n){return v.useSyncExternalStore(n.subscribe,n.get,n.get)}function jf(n,o){const i=()=>o(n.get());return v.useSyncExternalStore(n.subscribe,i,i)}function H0(n,o){const i=()=>o?n.get():null;return v.useSyncExternalStore(n.subscribe,i,i)}const Fm=.04,Qm=4,L0=.25,_0=640,gm=.5,Gy=150,U0=40,zu=[600,1200,2400],q0=n=>zu.find(o=>o>=n)??zu[zu.length-1],V0=6,Ob={url:n=>`/screens/${n}`,thumbs:!0};function G0(n){var xa;const o=Zm(n.view),i=n.view.set,f=v.useRef(null),m=v.useRef(null),[p,b]=v.useState({w:1200,h:800}),[N,j]=v.useState(!1),[E,S]=v.useState([]),[w,k]=v.useState(null),z=v.useRef(null),R=v.useRef(null);v.useLayoutEffect(()=>{const D=f.current,Z=()=>{var _e;const Re={w:D.clientWidth,h:D.clientHeight};!Re.w||!Re.h||(b(Je=>Je.w===Re.w&&Je.h===Re.h?Je:Re),(_e=n.onSize)==null||_e.call(n,Re))},ne=new ResizeObserver(Z);return ne.observe(D),document.addEventListener("visibilitychange",Z),()=>{ne.disconnect(),document.removeEventListener("visibilitychange",Z)}},[]);const K=v.useRef(!1);v.useEffect(()=>{const D=m.current;if(!D)return;if(!K.current){K.current=!0;return}D.style.willChange="transform";const Z=setTimeout(()=>D.style.willChange="",200);return()=>clearTimeout(Z)},[o.x,o.y,o.zoom]),v.useEffect(()=>{const D=f.current,Z=ne=>{var it,Nt,cn;ne.preventDefault();const Re=D.getBoundingClientRect(),_e=ne.clientX-Re.left,Je=ne.clientY-Re.top;if(ne.ctrlKey||ne.metaKey)i(Ft=>{const Qt=dr(Ft.zoom*Math.exp(-ne.deltaY*.01),Fm,Qm),Pn=(_e-Ft.x)/Ft.zoom,ct=(Je-Ft.y)/Ft.zoom;return{zoom:Qt,x:_e-Pn*Qt,y:Je-ct*Qt}});else{const Ft=((cn=(Nt=(it=ne.target)==null?void 0:it.closest)==null?void 0:Nt.call(it,".board-frame[data-inside]"))==null?void 0:cn.querySelector("iframe"))??null;if(O0(Ft,ne.clientX,ne.clientY,ne.deltaX,ne.deltaY))return;i(Qt=>({...Qt,x:Qt.x-ne.deltaX,y:Qt.y-ne.deltaY}))}};return D.addEventListener("wheel",Z,{passive:!1}),()=>D.removeEventListener("wheel",Z)},[i]),v.useEffect(()=>{const D=ne=>{ne.code==="Space"&&!ku(ne)&&!ne.repeat&&(ne.preventDefault(),j(!0))},Z=ne=>ne.code==="Space"&&j(!1);return window.addEventListener("keydown",D),window.addEventListener("keyup",Z),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Z)}},[]);const B=(D,Z)=>{const ne=f.current.getBoundingClientRect();return{x:(D-ne.left-o.x)/o.zoom,y:(Z-ne.top-o.y)/o.zoom}},V=D=>{z.current=D,k(D)},M=N||n.tool==="hand"||!!n.readOnly,X=n.screens??Ob,te=D=>{if(D.target!==D.currentTarget&&D.button!==1)return;if(D.currentTarget.setPointerCapture(D.pointerId),D.button===1||M){R.current={kind:"pan",sx:D.clientX,sy:D.clientY,vx:o.x,vy:o.y};return}if(D.button!==0)return;const Z=B(D.clientX,D.clientY);if(n.tool==="title"||n.tool==="sticky"){n.onCreateNote(n.tool,{x:Math.round(Z.x),y:Math.round(Z.y)}),n.setTool("select");return}R.current={kind:n.tool==="board"?"draw":"marquee",sx:Z.x,sy:Z.y,additive:D.shiftKey,moved:!1}},ee=D=>{const Z=R.current;if(!Z)return;if(Z.kind==="pan"){i(_e=>({..._e,x:Z.vx+D.clientX-Z.sx,y:Z.vy+D.clientY-Z.sy}));return}const ne=B(D.clientX,D.clientY),Re={x:Math.min(Z.sx,ne.x),y:Math.min(Z.sy,ne.y),w:Math.abs(ne.x-Z.sx),h:Math.abs(ne.y-Z.sy)};(Re.w+Re.h)*o.zoom>4&&(Z.moved=!0),Z.moved&&V(Re)},ce=D=>{const Z=R.current;if(R.current=null,(Z==null?void 0:Z.kind)==="pan"&&n.readOnly&&Math.abs(D.clientX-Z.sx)+Math.abs(D.clientY-Z.sy)<4&&n.onSelect([],"replace"),!Z||Z.kind==="pan")return;const ne=z.current;if(V(null),Z.kind==="draw"){const it=B(D.clientX,D.clientY);n.onCreateBoard(Z.moved&&ne&&ne.w>20&&ne.h>20?Z0(ne):{x:Math.round(it.x),y:Math.round(it.y),w:390,h:844}),n.setTool("select");return}if(!Z.moved||!ne){Z.additive||(n.onSelect([],"replace"),n.onSelectNote(null));return}const Re=n.visibleBoards.filter(it=>!n.board.boards[it].locked&&ym(n.board.boards[it],ne)),_e=n.visibleNotes.filter(it=>{var Pn,ct;if((Pn=n.board.notes[it])!=null&&Pn.locked)return!1;const Nt=(ct=f.current)==null?void 0:ct.querySelector(`[data-note="${it}"]`);if(!Nt)return!1;const cn=Nt.getBoundingClientRect(),Ft=B(cn.left,cn.top),Qt=B(cn.right,cn.bottom);return ym({x:Ft.x,y:Ft.y,w:Qt.x-Ft.x,h:Qt.y-Ft.y},ne)}),Je=Object.entries(n.board.shapes??{}).filter(([,it])=>ym({x:it.x,y:it.y,w:Math.max(1,it.w),h:Math.max(1,it.h)},ne)).map(([it])=>it);n.onMarquee({boards:Re,notes:_e,shapes:Je},Z.additive)},ie=v.useRef(null),he=(D,Z)=>{const ne=n.selected.includes(Z)?n.selected:[Z],Re={};for(const _e of ne)n.board.boards[_e].locked||(Re[_e]={x:n.board.boards[_e].x,y:n.board.boards[_e].y});ie.current={sx:D.clientX,sy:D.clientY,origins:Re,moved:!1},D.currentTarget.setPointerCapture(D.pointerId)},fe=(D,Z=!1)=>{const ne=ie.current;if(!ne)return;let Re=(D.clientX-ne.sx)/o.zoom,_e=(D.clientY-ne.sy)/o.zoom;if(!ne.moved&&!Ly(D.clientX-ne.sx,D.clientY-ne.sy))return;ne.moved=!0;const Je=Object.keys(ne.origins),it=Je.map(ct=>({...n.board.boards[ct],x:ne.origins[ct].x+Re,y:ne.origins[ct].y+_e})),Nt=Rb(it),cn=n.visibleBoards.filter(ct=>!Je.includes(ct)).map(ct=>n.board.boards[ct]),Ft=V0/o.zoom,Qt=[];if(!D.altKey){const ct=Xy([Nt.x,Nt.x+Nt.w/2,Nt.x+Nt.w],cn.flatMap(Lt=>[Lt.x,Lt.x+Lt.w/2,Lt.x+Lt.w]),Ft),Sn=Xy([Nt.y,Nt.y+Nt.h/2,Nt.y+Nt.h],cn.flatMap(Lt=>[Lt.y,Lt.y+Lt.h/2,Lt.y+Lt.h]),Ft);if(ct){Re+=ct.d;const Lt=cn.filter(rt=>[rt.x,rt.x+rt.w/2,rt.x+rt.w].some(bt=>Math.abs(bt-ct.at)<.5));Qt.push({axis:"x",at:ct.at,from:Math.min(Nt.y+((Sn==null?void 0:Sn.d)??0),...Lt.map(rt=>rt.y)),to:Math.max(Nt.y+Nt.h+((Sn==null?void 0:Sn.d)??0),...Lt.map(rt=>rt.y+rt.h))})}if(Sn){_e+=Sn.d;const Lt=cn.filter(rt=>[rt.y,rt.y+rt.h/2,rt.y+rt.h].some(bt=>Math.abs(bt-Sn.at)<.5));Qt.push({axis:"y",at:Sn.at,from:Math.min(Nt.x+((ct==null?void 0:ct.d)??0),...Lt.map(rt=>rt.x)),to:Math.max(Nt.x+Nt.w+((ct==null?void 0:ct.d)??0),...Lt.map(rt=>rt.x+rt.w))})}}S(Z?[]:Qt);const Pn={};for(const ct of Je)Pn[ct]={x:Math.round(ne.origins[ct].x+Re),y:Math.round(ne.origins[ct].y+_e)};n.onMoveBoards(Pn,Z)},pe=D=>{const Z=ie.current;Z!=null&&Z.moved&&fe(D,!0),ie.current=null,S([])},Oe=p.w/o.zoom,Ye=p.h/o.zoom,ue=-o.x/o.zoom,pt=-o.y/o.zoom,Fe=D=>D.x+D.w>ue-200&&D.x<ue+Oe+200&&D.y+D.h>pt-200&&D.y<pt+Ye+200,me=D=>{D.currentTarget.setPointerCapture(D.pointerId),R.current={kind:"pan",sx:D.clientX,sy:D.clientY,vx:o.x,vy:o.y}},Ae=v.useRef(null),ze=!!n.onPickElement&&!n.readOnly&&!M&&n.tool==="select",qe=(D,Z,ne,Re)=>{var Je;if(D.button!==0)return;if(D.stopPropagation(),n.readOnly||M)return n.readOnly&&n.onSelect([Z],"replace"),me(D);const _e=n.selected.includes(Z);if((Je=n.onHoverElement)==null||Je.call(n,null),ne==="frame"&&ze&&Re&&D.shiftKey&&n.editFile===Z){D.currentTarget.setPointerCapture(D.pointerId),Ae.current={file:Z,kind:"elements",sx:D.clientX,sy:D.clientY,moved:!1};return}if(D.shiftKey)return n.onSelect([Z],"toggle");_e||n.onSelect([Z],"replace"),he(D,Z),Ae.current={file:Z,kind:ne==="frame"&&ze&&Re?"board":"label",sx:D.clientX,sy:D.clientY,moved:!1}},Ve=(D,Z)=>({x:Math.min(D.sx,Z.clientX),y:Math.min(D.sy,Z.clientY),w:Math.abs(Z.clientX-D.sx),h:Math.abs(Z.clientY-D.sy)}),re=(D,Z,ne)=>{var _e,Je,it;if(n.readOnly||((_e=R.current)==null?void 0:_e.kind)==="pan")return ee(D);Ae.current&&D.buttons===0&&(Ae.current=null,ie.current=null);const Re=Ae.current;if(!Re){D.buttons===0&&ze&&ne&&((Je=n.onHoverElement)==null||Je.call(n,Z,D));return}if(Re.kind==="elements"){if(!Re.moved&&!Ly(D.clientX-Re.sx,D.clientY-Re.sy))return;Re.moved=!0,(it=n.onElementMarquee)==null||it.call(n,Re.file,Ve(Re,D),!1);return}fe(D)},Ne=(D,Z)=>{var _e,Je,it,Nt,cn;if(n.readOnly||((_e=R.current)==null?void 0:_e.kind)==="pan")return void(R.current=null);const ne=Ae.current;if(Ae.current=null,(ne==null?void 0:ne.kind)==="elements"){ne.moved?(Je=n.onElementMarquee)==null||Je.call(n,ne.file,Ve(ne,D),!0):(it=n.onPickElement)==null||it.call(n,Z,D,{add:!0,double:!1});return}const Re=!!((Nt=ie.current)!=null&&Nt.moved);pe(D),!(!ne||Re)&&(ne.kind==="board"?(cn=n.onPickElement)==null||cn.call(n,Z,D,{add:!1,double:!1}):ne.kind==="label"&&n.editFile===Z&&n.onSelect([Z],"replace"))},at=new Set(n.visibleBoards),H=new Set;for(const D of n.visibleBoards){const Z=(xa=n.board.boards[D])==null?void 0:xa.origin;(Z==null?void 0:Z.kind)==="fork"&&(H.add(D),at.has(Z.of)&&H.add(Z.of))}const se=v.useRef(new Set),ve=v.useRef([]),Ce=v.useRef(!1),Qe=v.useRef(0),[,de]=v.useState(0),U=()=>{if(Qe.current||!Ce.current)return;const D=ve.current.find(Z=>!se.current.has(Z));D&&(se.current.add(D),de(Z=>Z+1),Qe.current=window.setTimeout(()=>{Qe.current=0,U()},U0))},ae=v.useRef(0);v.useEffect(()=>{Ce.current=!1;const D=performance.now(),Z=D-ae.current;ae.current=D;const ne=window.setTimeout(()=>{Ce.current=!0,U()},Z<400?Math.max(Gy,Z*3):Gy);return()=>window.clearTimeout(ne)},[o.x,o.y,o.zoom]),v.useEffect(()=>()=>window.clearTimeout(Qe.current),[]);const ge=[],Et=ue+Oe/2,Jt=pt+Ye/2;v.useEffect(()=>{const D=new Set(ge.map(Z=>Z.f));for(const Z of se.current)D.has(Z)||se.current.delete(Z);ve.current=ge.sort((Z,ne)=>Z.d-ne.d).map(Z=>Z.f),U()});const Ht=v.useRef({p:n,pressBoard:qe,moveBoardPress:re,releaseBoard:Ne,picking:ze});Ht.current={p:n,pressBoard:qe,moveBoardPress:re,releaseBoard:Ne,picking:ze};const Be=v.useMemo(()=>{const D=()=>Ht.current;return{press:(Z,ne,Re,_e)=>D().pressBoard(Z,ne,Re,_e),pressMove:(Z,ne,Re)=>D().moveBoardPress(Z,ne,Re),release:(Z,ne)=>D().releaseBoard(Z,ne),leave:()=>{var Z,ne;return!Ae.current&&((ne=(Z=D().p).onHoverElement)==null?void 0:ne.call(Z,null))},doubleClickFrame:(Z,ne)=>{var Re,_e;return(_e=(Re=D().p).onPickElement)==null?void 0:_e.call(Re,ne,Z,{add:!1,double:!0})},contextFrame:(Z,ne,Re)=>{var _e,Je;return D().picking&&Re&&!!((Je=(_e=D().p).onElementContext)!=null&&Je.call(_e,ne,Z))},resize:(Z,ne,Re)=>D().p.onMoveBoards({[Z]:ne},Re),play:Z=>D().p.onPlay(Z),action:(Z,ne,Re)=>{var _e,Je;return(Je=(_e=D().p).onBoardAction)==null?void 0:Je.call(_e,Z,ne,Re)},rename:Z=>D().p.onRename(Z),context:(Z,ne)=>D().p.onContext({type:"board",file:Z},ne),iframeRef:(Z,ne)=>{var Re,_e;return(_e=(Re=D().p).iframeRef)==null?void 0:_e.call(Re,Z,ne)},selectNote:(Z,ne)=>D().p.onSelectNote(Z,ne),moveNote:(Z,ne,Re)=>D().p.onMoveNote(Z,ne,Re),deleteNote:Z=>D().p.onDeleteNote(Z),contextNote:(Z,ne)=>D().p.onContext({type:"note",id:Z},ne)}},[]),ot=v.useMemo(()=>new Set(n.files),[n.files]),Pe=v.useRef({zoom:0,of:new Map,pins:new Map});(Pe.current.fn!==n.renderBoardOverlay||Pe.current.pf!==n.renderBoardPins||Pe.current.zoom!==o.zoom)&&(Pe.current={fn:n.renderBoardOverlay,pf:n.renderBoardPins,zoom:o.zoom,of:new Map,pins:new Map});const on=D=>{var ne;const Z=Pe.current.pins;return Z.has(D)||Z.set(D,(ne=n.renderBoardPins)==null?void 0:ne.call(n,D,o.zoom)),Z.get(D)},fn=D=>{var ne;const Z=Pe.current.of;return Z.has(D)||Z.set(D,(ne=n.renderBoardOverlay)==null?void 0:ne.call(n,D,o.zoom)),Z.get(D)},Nn=v.useMemo(()=>{var D;return(D=n.underLayer)==null?void 0:D.call(n,o.zoom)},[n.underLayer,o.zoom]),It=v.useMemo(()=>{var D;return(D=n.worldLayer)==null?void 0:D.call(n,o.zoom)},[n.worldLayer,o.zoom]);return s.jsxs("div",{ref:f,className:`canvas tool-${M?"hand":n.tool}`,onPointerDown:te,onPointerMove:ee,onPointerUp:ce,onAuxClick:D=>D.preventDefault(),onContextMenu:D=>{if(D.target!==D.currentTarget)return;D.preventDefault();const Z=B(D.clientX,D.clientY);n.onContext({type:"canvas",x:Math.round(Z.x),y:Math.round(Z.y)},D)},role:"application","aria-label":u.canvas.aria,children:[s.jsxs("div",{ref:m,className:"world",style:{transform:`translate(${o.x}px, ${o.y}px) scale(${o.zoom})`},children:[Nn,n.visibleNotes.map(D=>s.jsx(K0,{note:n.board.notes[D],zoom:o.zoom,id:D,selected:n.selectedNotes.includes(D),readOnly:n.readOnly,h:Be},D)),n.visibleBoards.map(D=>{var cn,Ft,Qt,Pn,ct,Sn;const Z=n.board.boards[D],ne=n.playing===D||n.editFile===D||n.typing===D,Re=ne||Fe(Z),_e=ne||Re&&(!X.thumbs||o.zoom>=L0||Math.max(Z.w,Z.h)*o.zoom>=_0);_e&&ge.push({f:D,d:ne?-1:Math.hypot(Z.x+Z.w/2-Et,Z.y+Z.h/2-Jt)}),ne&&se.current.add(D);const Je=ne||_e&&se.current.has(D),it=_e&&!Je,Nt=n.selected.includes(D);return s.jsx(Y0,{file:D,item:Z,exists:ot.has(D),zoom:o.zoom,live:Je,selected:Nt,single:Nt&&n.selected.length===1&&!n.readOnly,readOnly:n.readOnly,screens:X,editing:n.editFile===D,typing:n.typing===D,playing:n.playing===D,near:Re,waiting:it,reloadKey:n.reloadKeys[D]??0,stamp:(cn=n.stamps)==null?void 0:cn[D],pickable:ze&&Je,h:Be,overlay:fn(D),pins:on(D),compact:Z.w*o.zoom>=48&&o.zoom<gm&&H.has(D),forkScene:H.has(D),tags:Z.w*o.zoom>=48&&!(o.zoom<gm&&H.has(D))&&n.playing!==D?(Ft=n.renderBoardTags)==null?void 0:Ft.call(n,D):null,buttons:n.readOnly?null:(Qt=n.renderBoardButtons)==null?void 0:Qt.call(n,D,o.zoom<gm&&H.has(D)),ring:((Pn=n.boardRing)==null?void 0:Pn.call(n,D))??null,pick:((ct=n.frameInfo)==null?void 0:ct.call(n,D))??null,actions:!n.readOnly&&!!n.onBoardAction,tweaks:!!((Sn=n.hasTweaks)!=null&&Sn.call(n,D))},D)}),It,E.map((D,Z)=>D.axis==="x"?s.jsx("div",{className:"guide",style:{left:D.at,top:D.from,width:1/o.zoom,height:D.to-D.from}},Z):s.jsx("div",{className:"guide",style:{left:D.from,top:D.at,height:1/o.zoom,width:D.to-D.from}},Z)),w&&s.jsx("div",{className:n.tool==="board"?"draft-board":"marquee",style:{left:w.x,top:w.y,width:w.w,height:w.h,borderWidth:1/o.zoom},children:n.tool==="board"&&s.jsxs("span",{style:{transform:`scale(${1/o.zoom})`},children:[Math.round(w.w)," × ",Math.round(w.h)]})})]}),N&&s.jsx("div",{className:"pan-capture",onPointerDown:me,onPointerMove:ee,onPointerUp:()=>R.current=null})]})}const Y0=v.memo(function(o){var ce,ie,he,fe,pe,Oe,Ye;const{item:i,zoom:f,file:m,h:p,live:b}=o,N=zm(f),j=i.title??o.file,[E,S]=v.useState(!1);v.useEffect(()=>{o.live||S(!1)},[o.live]);const w=i.w*f<48,k=!w&&!!o.compact,z=((ce=i.origin)==null?void 0:ce.kind)==="fork"&&i.origin.by?i.origin:null,R=z?u.occupancy.forked(u.occupancy.clock(Date.parse(z.at??"")||Date.now()),z.by,z.while??u.occupancy.someone):null,K=ue=>{ue.preventDefault(),ue.stopPropagation(),p.context(m,ue)},B=ue=>ue.stopPropagation(),V=i.w*f,M=!!o.actions&&V>=180,X=ue=>pt=>{var me;pt.stopPropagation();const Fe=pt.currentTarget.getBoundingClientRect();(me=p.action)==null||me.call(p,m,ue,{clientX:Fe.left,clientY:Fe.bottom+4})},te=V>=110&&s.jsxs("button",{className:`icon-btn sm board-play ${M?"pill":""} ${i.is_interactive?"always":""} ${o.playing?"pressed":""}`,"aria-label":o.playing?o.actions?u.canvas.edit:u.canvas.stopPlay:u.canvas.play,"aria-haspopup":o.actions&&!o.playing?"menu":void 0,title:o.playing?u.canvas.stopPlayTitle:u.canvas.playTitle,onPointerDown:B,onClick:ue=>{if(ue.stopPropagation(),o.actions&&!o.playing)return X("playMenu")(ue);p.play(m)},children:[o.playing&&M?s.jsx("span",{className:"pill-label",children:u.canvas.edit}):s.jsx(Q,{name:o.playing?"stop":"play",size:14}),M&&!o.playing&&s.jsx("span",{className:"pill-label",children:u.canvas.playShort})]}),ee=o.actions&&V>=220&&s.jsxs(s.Fragment,{children:[o.tweaks&&s.jsx("button",{className:"icon-btn sm board-tool","aria-label":u.canvas.tweaks,title:u.canvas.tweaks,onPointerDown:B,onClick:X("tweaks"),children:s.jsx(Q,{name:"sliders",size:14})}),s.jsx("button",{className:"icon-btn sm board-tool","aria-label":u.canvas.fullWindow,title:u.canvas.fullWindow,onPointerDown:B,onClick:X("expand"),children:s.jsx(Q,{name:"expand",size:14})}),s.jsx("button",{className:"icon-btn sm board-tool","aria-label":u.canvas.exportBoard,title:u.canvas.exportBoard,onPointerDown:B,onClick:X("export"),children:s.jsx(Q,{name:"download",size:14})})]});return s.jsxs("div",{className:`board ${o.selected?"selected":""} ${o.editing?"editing":""} ${o.playing?"playing":""} ${i.frameless?"frameless":""} ${i.is_interactive?"interactive":""} ${o.ring?"held":""}`,style:{left:i.x,top:i.y,width:i.w,height:i.h,...o.ring?{"--ring":o.ring}:{}},"data-file":o.file,role:"group","aria-label":u.canvas.board(j,!!o.selected,!!o.editing,!!o.playing),"aria-description":R??void 0,children:[s.jsxs("div",{className:`board-label ${w?"tiny":""} ${k?"compact":""} ${o.tags?"tagged":""} ${o.forkScene?"fork-scene":""}`,style:{transform:`scale(${1/f})`,width:i.w*f},onPointerDown:ue=>p.press(ue,m,"label",b),onPointerMove:ue=>p.pressMove(ue,m,b),onPointerUp:ue=>p.release(ue,m),onContextMenu:K,title:`${j} · ${o.file}${R?`
56
+ ${R}`:""}`,children:[o.tags,s.jsxs("span",{className:"lab-row",children:[i.is_interactive&&s.jsx("span",{className:"dot","aria-label":u.canvas.interactive}),k&&z?s.jsxs("span",{className:`occ-tag fork-who ${o.ring?"":"done"}`,onDoubleClick:ue=>ue.stopPropagation(),children:[o.ring?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(Q,{name:"ai",size:14}),s.jsx("span",{className:"act-tag-text",children:z.by})]}):s.jsx("span",{className:"board-title",onDoubleClick:ue=>{ue.stopPropagation(),o.readOnly||p.rename(m)},children:j}),i.locked&&s.jsx("span",{className:"board-lock",role:"img","aria-label":u.menu.locked,title:u.menu.locked,children:s.jsx(Q,{name:"lock",size:14})}),i.w*f>=160&&j!==o.file&&!(k&&z)&&s.jsx("span",{className:"board-file",children:o.file}),k&&o.selected&&(o.buttons||te)&&s.jsxs("span",{className:"board-btns pinned",children:[o.buttons,te]}),!k&&i.w*f>=110&&s.jsxs("span",{className:`board-btns ${o.buttons?"pinned":""}`,children:[o.buttons,ee,te]})]})]}),s.jsxs("div",{className:"board-frame","data-inside":o.editing&&!o.readOnly?"":void 0,"data-easel-file":(ie=o.pick)==null?void 0:ie.file,"data-easel-path":(he=o.pick)==null?void 0:he.path,"data-easel-element":(fe=o.pick)==null?void 0:fe.element,"aria-label":(pe=o.pick)==null?void 0:pe.label,style:{borderRadius:i.radius??0,background:i.bg||void 0},onDoubleClick:ue=>{o.playing||o.typing||!o.pickable||(ue.stopPropagation(),p.doubleClickFrame(ue,m))},onPointerDown:ue=>!o.playing&&!o.typing&&p.press(ue,m,"frame",b),onPointerMove:ue=>!o.playing&&!o.typing&&p.pressMove(ue,m,b),onPointerUp:ue=>!o.playing&&!o.typing&&p.release(ue,m),onPointerLeave:p.leave,onContextMenu:ue=>{o.playing||o.typing||(p.contextFrame(ue,m,b)?(ue.preventDefault(),ue.stopPropagation()):K(ue))},children:[o.exists?o.live?s.jsxs(s.Fragment,{children:[s.jsx(X0,{reloadKey:o.reloadKey,iframeRef:ue=>p.iframeRef(m,ue),src:o.screens.url(o.file),html:(Ye=(Oe=o.screens).html)==null?void 0:Ye.call(Oe,o.file),title:j,interactive:!!o.playing||!!o.typing,onLoad:()=>S(!0)}),!E&&o.screens.thumbs&&s.jsx("div",{className:"board-placeholder loading board-cover",style:{position:"absolute",inset:0,pointerEvents:"none",fontSize:Math.min(64,14/f)},"aria-hidden":"true",children:s.jsx(Yy,{file:o.file,s:o.stamp,px:zu[0]})})]}):s.jsxs("div",{className:`board-placeholder ${o.near?"loading":"far"}`,style:{fontSize:Math.min(64,14/f)},children:[o.near&&o.screens.thumbs&&s.jsx(Yy,{file:o.file,s:o.stamp,px:o.waiting?zu[0]:q0(Math.max(i.w,i.h)*f*(window.devicePixelRatio||1))}),s.jsx("span",{className:"ph-title","data-hint":o.near?"":u.canvas.notLoaded,children:j}),o.near&&s.jsx("span",{className:"ph-bar",style:{height:3/Math.max(f,.05)},"aria-hidden":"true"})]}):s.jsx("div",{className:"board-missing",children:u.canvas.fileMissing(o.file)}),o.playing&&!o.actions&&s.jsx("div",{className:"playing-badge",style:{transform:`scale(${1/Math.max(f,.25)})`},children:u.canvas.playing}),o.overlay]}),o.single&&!i.locked&&s.jsx("div",{className:"board-resize",role:"slider","aria-label":u.canvas.boardSize,"aria-valuetext":`${i.w} × ${i.h}`,style:{width:12/f,height:12/f,right:-6/f,bottom:-6/f,borderWidth:1.5/f},onPointerDown:ue=>{ue.button===0&&(ue.stopPropagation(),N.start(ue,{x:i.w,y:i.h},(pt,Fe)=>p.resize(m,{w:dr(Math.round(pt.x),40,8e3),h:dr(Math.round(pt.y),40,8e3)},Fe)))},onPointerMove:N.move,onPointerUp:N.end}),o.pins&&s.jsx("div",{className:"pin-layer",children:o.pins})]})});function Yy({file:n,s:o,px:i}){const[f,m]=v.useState(!1),[p,b]=v.useState(i);v.useEffect(()=>b(w=>Math.max(w,i)),[i]);const N=`/api/thumb?f=${encodeURIComponent(n)}${o?`&s=${o}`:""}&px=${p}`,[j,E]=v.useState(null),S=v.useRef(null);return v.useEffect(()=>{if(N===S.current)return;const w=new Image;return w.onload=()=>E(S.current=N),w.onerror=()=>!S.current&&m(!0),w.src=N,()=>{w.onload=w.onerror=null}},[N]),f||!j?null:s.jsx("img",{className:"board-thumb",src:j,alt:"",decoding:"async",draggable:!1,onLoad:w=>{var k;w.currentTarget.classList.add("loaded"),(k=w.currentTarget.parentElement)==null||k.classList.remove("loading")}})}function X0(n){const o=v.useRef(null),i=v.useRef(!0);return v.useEffect(()=>{if(i.current){i.current=!1;return}const f=o.current,m=f==null?void 0:f.contentWindow;if(!f||!m)return;const p=m.document,b=[];p.querySelectorAll("*").forEach((S,w)=>{(S.scrollTop||S.scrollLeft)&&b.push([w,S.scrollTop,S.scrollLeft])});const N=m.scrollX,j=m.scrollY,E=()=>{f.removeEventListener("load",E);const S=f.contentWindow;S.scrollTo(N,j);const w=S.document.querySelectorAll("*");for(const[k,z,R]of b){const K=w[k];K&&(K.scrollTop=z,K.scrollLeft=R)}f.dispatchEvent(new CustomEvent("dc-reloaded"))};f.addEventListener("load",E),m.location.reload()},[n.reloadKey]),s.jsx("iframe",{ref:f=>{o.current=f,n.iframeRef(f)},src:n.html==null?n.src:void 0,srcDoc:n.html??void 0,title:n.title,onLoad:n.onLoad,style:{pointerEvents:n.interactive?"auto":"none"}})}const K0=v.memo(function(o){const{note:i,h:f,id:m}=o,p=(X,te)=>f.moveNote(m,X,te),b=zm(o.zoom),[N,j]=v.useState(!1),E=v.useRef(null);v.useEffect(()=>{if(N&&E.current){E.current.focus();const X=document.createRange();X.selectNodeContents(E.current);const te=getSelection();te==null||te.removeAllRanges(),te==null||te.addRange(X)}},[N]);const S=v.useRef(!1),w=v.useRef(!1),k=X=>{j(!1);const te=X.innerText;te!==i.text&&p({text:te},!0)},z=i.size??(i.kind==="title"?72:22),[R,K]=v.useState(z);v.useLayoutEffect(()=>{const X=E.current;if(!X||i.kind!=="title"||N)return K(z);let te=z;X.style.fontSize=`${te}px`;const ee=i.maxW??4e3,ce=i.maxH||1/0;for(let ie=0;ie<40&&te>12&&(X.scrollWidth>ee+1||X.scrollHeight>ce+1);ie++)te=Math.max(12,Math.floor(te*.92)),X.style.fontSize=`${te}px`;K(te)},[i.text,z,i.maxW,i.maxH,i.kind,N]);const B=zm(o.zoom),V=i.kind==="title"?{left:i.x,top:i.y,maxWidth:i.maxW??4e3,maxHeight:i.maxH||void 0}:{left:i.x,top:i.y,width:i.w??320,height:i.h||void 0,background:j0(i.color)},M={fontSize:R,fontWeight:i.bold??i.kind==="title"?700:400,fontStyle:i.italic?"italic":void 0};return i.kind==="title"&&R*o.zoom<12&&Object.assign(V,{transform:`scale(${12/(R*o.zoom)})`,transformOrigin:"0 0"}),s.jsxs("div",{className:`note note-${i.kind} ${o.selected?"selected":""} ${o.readOnly?"read-only":""}`,"data-note":o.id,style:V,onPointerDown:X=>{N||X.button!==0||o.readOnly||(X.stopPropagation(),X.shiftKey?f.selectNote(m,!0):o.selected||f.selectNote(m,!1),i.locked||b.start(X,{x:i.x,y:i.y},(te,ee)=>p({x:Math.round(te.x),y:Math.round(te.y)},ee)))},onPointerMove:b.move,onPointerUp:b.end,onDoubleClick:X=>{X.stopPropagation(),o.readOnly||j(!0)},onContextMenu:X=>{X.preventDefault(),X.stopPropagation(),!o.readOnly&&(f.selectNote(m,!1),f.contextNote(m,X))},children:[s.jsx("div",{ref:E,className:"note-text",style:M,contentEditable:N,suppressContentEditableWarning:!0,onCompositionStart:()=>S.current=!0,onCompositionEnd:X=>{S.current=!1,w.current&&(w.current=!1,k(X.currentTarget))},onBlur:X=>{S.current?w.current=!0:k(X.currentTarget)},onKeyDown:X=>{X.nativeEvent.isComposing||X.key==="Escape"&&X.currentTarget.blur()},children:i.text}),i.locked&&s.jsx("span",{className:"note-lock",role:"img","aria-label":u.menu.locked,title:u.menu.locked,style:{transform:`scale(${1/Math.max(o.zoom,.25)})`},children:s.jsx(Q,{name:"lock",size:14})}),o.selected&&o.zoom>=.2&&!N&&!i.locked&&s.jsx("div",{className:"note-resize",role:"slider","aria-label":i.kind==="title"?u.canvas.titleMaxWidth:u.canvas.stickySize,style:{width:12/o.zoom,height:12/o.zoom,right:-6/o.zoom,bottom:-6/o.zoom,borderWidth:1.5/o.zoom},onPointerDown:X=>{if(X.button!==0)return;X.stopPropagation();const te=X.currentTarget.parentElement.getBoundingClientRect(),ee=te.width/o.zoom,ce=te.height/o.zoom;B.start(X,{x:ee,y:ce},(ie,he)=>p(i.kind==="title"?{maxW:Math.max(80,Math.round(ie.x))}:{w:Math.max(80,Math.round(ie.x)),h:Math.max(60,Math.round(ie.y))},he))},onPointerMove:B.move,onPointerUp:B.end}),o.selected&&!N&&o.zoom>=.2&&s.jsx("button",{className:"note-del icon-btn","aria-label":u.canvas.deleteNote,style:{transform:`scale(${1/o.zoom})`},onPointerDown:X=>X.stopPropagation(),onClick:X=>{X.stopPropagation(),f.deleteNote(m)},children:s.jsx(Q,{name:"close",size:14})})]})});function zm(n){const o=v.useRef(null);return{start(i,f,m){o.current={sx:i.clientX,sy:i.clientY,ox:f.x,oy:f.y,cb:m,moved:!1},i.currentTarget.setPointerCapture(i.pointerId)},move(i){const f=o.current;if(!f)return;const m=(i.clientX-f.sx)/n,p=(i.clientY-f.sy)/n;!f.moved&&Math.abs(m)+Math.abs(p)<2/n||(f.moved=!0,f.cb({x:f.ox+m,y:f.oy+p},!1))},end(i){const f=o.current;o.current=null,!(!f||!f.moved)&&f.cb({x:f.ox+(i.clientX-f.sx)/n,y:f.oy+(i.clientY-f.sy)/n},!0)}}}function Xy(n,o,i){let f=null;for(const m of n)for(const p of o){const b=p-m;Math.abs(b)<=i&&(!f||Math.abs(b)<Math.abs(f.d))&&(f={d:b,at:p})}return f}const Rb=n=>{const o=Math.min(...n.map(f=>f.x)),i=Math.min(...n.map(f=>f.y));return{x:o,y:i,w:Math.max(...n.map(f=>f.x+f.w))-o,h:Math.max(...n.map(f=>f.y+f.h))-i}},ym=(n,o)=>n.x<o.x+o.w&&n.x+n.w>o.x&&n.y<o.y+o.h&&n.y+n.h>o.y,Z0=n=>({x:Math.round(n.x),y:Math.round(n.y),w:Math.round(n.w),h:Math.round(n.h)});function dr(n,o,i){return Math.min(i,Math.max(o,n))}function ku(n){const o=n.target;return o?o.tagName==="INPUT"?!/^(checkbox|radio|button|range|color)$/.test(o.type):o.isContentEditable||/^(TEXTAREA|SELECT)$/.test(o.tagName):!1}function tc(n,o,i=60,f){if(!n.length)return{x:0,y:0,zoom:1};(o.w<100||o.h<100)&&(o={w:window.innerWidth,h:Math.max(200,window.innerHeight)});const m=f&&f.w>=100&&f.h>=100?f:{x:0,y:0,w:o.w,h:o.h};i=Math.min(i,m.w*.08,m.h*.08);const p=Rb(n),b=dr(Math.min((m.w-i*2)/p.w,(m.h-i*2)/p.h),Fm,Qm);return{zoom:b,x:Math.round(m.x+i-p.x*b+(m.w-i*2-p.w*b)/2),y:Math.round(m.y+i-p.y*b+(m.h-i*2-p.h*b)/2)}}function F0(n){const[o,i]=v.useState(null),f=v.useCallback(()=>xe.get("/api/assets").then(m=>i(m.assets)).catch(()=>i([])),[]);return v.useEffect(()=>{f()},[f,n]),{list:o,reload:f}}async function Om(n){const o=[];for(const i of Array.from(n)){const f=await new Promise(m=>{const p=new FileReader;p.onload=()=>m(String(p.result).split(",")[1]??""),p.readAsDataURL(i)});o.push(await xe.post("/api/assets",{name:i.name,data:f}))}return o}const Q0=n=>n>1024*1024?`${(n/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(n/1024))}KB`;function Db(n){const{list:o,reload:i}=F0(n.version),[f,m]=v.useState(!1),[p,b]=v.useState(!1),N=async E=>{var S;m(!0);try{const w=await Om(E);await i(),(S=n.onUploaded)==null||S.call(n,w)}catch(w){n.onError(w.message)}finally{m(!1)}},j=(o??[]).filter(E=>!n.only||E.kind===n.only);return s.jsxs("div",{className:`assets ${p?"over":""}`,onDragOver:E=>{E.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:E=>{E.preventDefault(),b(!1),E.dataTransfer.files.length&&N(E.dataTransfer.files)},children:[s.jsxs("label",{className:"upload",children:[s.jsx(Q,{name:"plus",size:14})," ",f?u.assets.uploading:u.assets.upload,s.jsx("input",{type:"file",hidden:!0,multiple:!0,accept:"image/*,.woff,.woff2,.ttf,.otf",onChange:E=>E.target.files&&void N(E.target.files)})]}),o==null?s.jsxs("p",{className:"empty",children:[s.jsx("span",{className:"spinner","aria-hidden":"true"})," ",u.assets.loading]}):j.length===0?s.jsx("p",{className:"empty",children:u.assets.empty}):s.jsx("ul",{className:"asset-grid",children:j.map(E=>s.jsx("li",{children:s.jsxs("button",{className:"asset",title:`${E.ref} · ${Q0(E.size)}${n.onPick?"":u.assets.copyPath}`,"aria-label":`${E.name}${n.pickLabel??""}`,onClick:()=>n.onPick?n.onPick(E):void navigator.clipboard.writeText(E.ref).catch(()=>{}),children:[E.kind==="image"?s.jsx("img",{src:E.url,alt:"",loading:"lazy"}):s.jsx("span",{className:"asset-font",children:E.kind==="font"?"Aa":u.assets.file}),s.jsx("span",{className:"asset-name",children:E.name})]})},E.name))})]})}function P0({open:n,version:o,onClose:i,onPick:f,onError:m}){return v.useEffect(()=>{if(!n)return;const p=b=>b.key==="Escape"&&i();return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n,i]),n?s.jsx("div",{className:"dialog-backdrop",onPointerDown:p=>p.target===p.currentTarget&&i(),children:s.jsxs("div",{className:"dialog wide",role:"dialog","aria-modal":"true","aria-label":u.assets.pickImage,children:[s.jsx("h2",{children:u.assets.pickImage}),s.jsx(Db,{version:o,only:"image",pickLabel:u.assets.pickLabel,onPick:f,onError:m,onUploaded:p=>p[0]&&p[0].kind==="image"&&f(p[0])}),s.jsx("div",{className:"dialog-actions",children:s.jsx("button",{onClick:i,children:u.assets.close})})]})}):null}var bm=Cb();function Ky({label:n,src:o,empty:i,w:f,h:m}){const p=v.useRef(null),[b,N]=v.useState(0);return v.useEffect(()=>{const j=p.current;if(!j)return;const E=()=>N(Math.min(1,(j.clientWidth-16)/f,(j.clientHeight-16)/m));E();const S=new ResizeObserver(E);return S.observe(j),()=>S.disconnect()},[f,m]),s.jsxs("figure",{className:"cmp-pane",children:[s.jsx("figcaption",{children:n}),s.jsx("div",{className:"cmp-stage",ref:p,children:o?s.jsx("div",{className:"cmp-frame",style:{width:f*b,height:m*b},children:b>0&&s.jsx("iframe",{title:n,src:o,style:{width:f,height:m,transform:`scale(${b})`}})}):s.jsx("p",{className:"muted",children:i})})]})}const J0=n=>o=>`/api/chat/run-file?id=${encodeURIComponent(n)}&f=${encodeURIComponent(`screens/${o}`)}`,I0=n=>o=>`/api/history/step-file?id=${encodeURIComponent(n)}&f=${encodeURIComponent(o)}`;function Bb({before:n,boards:o,onClose:i,notBefore:f=u.compare.notBefore}){const[m,p]=v.useState(()=>Math.max(0,o.findIndex(j=>j.kind==="changed"))),b=o[m];if(!b)return null;const N=j=>j.split("/").map(encodeURIComponent).join("/");return s.jsx("div",{className:"dialog-backdrop",onPointerDown:j=>j.target===j.currentTarget&&i(),children:s.jsxs("div",{className:"dialog cmp",role:"dialog","aria-modal":"true","aria-label":u.compare.title(b.title),onKeyDown:j=>{j.key==="Escape"&&(j.stopPropagation(),i())},children:[s.jsxs("div",{className:"cmp-head",children:[s.jsx("h2",{children:u.compare.title(b.title)}),s.jsx("button",{className:"icon-btn sm","aria-label":u.compare.close,title:u.compare.close,autoFocus:!0,onClick:i,children:s.jsx(Q,{name:"close",size:14})})]}),o.length>1&&s.jsx("div",{className:"chips",role:"tablist","aria-label":u.compare.boards,children:o.map((j,E)=>s.jsx("button",{role:"tab","aria-selected":E===m,className:`chip cmp-tab ${E===m?"on":""}`,onClick:()=>p(E),children:j.kind==="added"?u.chat.chipNew(j.title):j.title},j.file))}),s.jsxs("div",{className:"cmp-panes",children:[s.jsx(Ky,{label:u.compare.before,src:b.kind==="added"?null:n(b.file),empty:f,w:b.w,h:b.h},`b-${b.file}`),s.jsx(Ky,{label:u.compare.after,src:b.kind==="removed"?null:`/screens/${N(b.file)}`,empty:u.compare.notAfter,w:b.w,h:b.h},`a-${b.file}`)]})]})})}const W0=/^ {0,3}(`{3,}|~{3,})\s*([\w#+.-]*)/,e1=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,Tu=/^(\s*)([-*+]|\d{1,9}[.)])\s+(.*)$/,t1=/^ {0,3}([-*_])(\s*\1){2,}\s*$/,n1=n=>/^https?:\/\/[^\s<>"]+$/i.test(n)?n:null;function a1(n){const o=String(n??"").replace(/\r\n?/g,`
57
+ `).split(`
58
+ `),i=[];let f=[];const m=()=>{f.length&&i.push({t:"p",c:nc(f.join(`
59
+ `))}),f=[]};for(let p=0;p<o.length;p++){const b=o[p],N=W0.exec(b);if(N){m();const E=N[1],S=[];let w=!0;for(p++;p<o.length;p++){if(new RegExp(`^ {0,3}${E[0]==="`"?"`":"~"}{${E.length},}\\s*$`).test(o[p])){w=!1;break}S.push(o[p])}i.push({t:"code",lang:N[2]??"",v:S.join(`
60
+ `),open:w});continue}if(!b.trim()){m();continue}const j=e1.exec(b);if(j){m(),i.push({t:"h",level:j[1].length,c:nc(j[2])});continue}if(t1.test(b)&&!f.length){i.push({t:"hr"});continue}if(Tu.test(b)&&(!f.length||!/^\s/.test(b))){m(),p=l1(o,p,i)-1;continue}f.push(b.trim())}return m(),i}const wu=n=>/\d/.test(n)?"ol":"ul";function l1(n,o,i){var j;const f=Tu.exec(n[o]),m=f[1].length,p={t:wu(f[2]),start:wu(f[2])==="ol"?parseInt(f[2],10):1,items:[]},b=[],N=[];for(;o<n.length;o++){const E=n[o];if(!E.trim()){const k=n.slice(o+1).find(z=>z.trim());if(k&&Tu.test(k)&&Tu.exec(k)[1].length>=m)continue;break}const S=Tu.exec(E);if(S&&S[1].length<=m+1){if(wu(S[2])!==p.t)break;p.items.push({c:[]}),b.push([S[3]]),N.push({list:{t:"ul",start:1,items:[]},texts:[]});continue}if(!p.items.length)break;const w=N[N.length-1];if(S){w.list.items.length||(w.list={t:wu(S[2]),start:wu(S[2])==="ol"?parseInt(S[2],10):1,items:[]}),w.list.items.push({c:[]}),w.texts.push([S[3]]);continue}if(!/^\s/.test(E)&&!((j=n[o-1])!=null&&j.trim()))break;(w.texts.length?w.texts[w.texts.length-1]:b[b.length-1]).push(E.trim())}return p.items.forEach((E,S)=>{E.c=nc(b[S].join(`
61
+ `));const w=N[S];w.list.items.length&&(w.list.items.forEach((k,z)=>k.c=nc(w.texts[z].join(`
62
+ `))),E.sub=w.list)}),i.push(p),o}function nc(n){const o=[];let i="";const f=p=>{i&&o.push({t:"text",v:i}),i="",o.push(p)};let m=0;for(;m<n.length;){const p=n[m];if(p==="\\"&&m+1<n.length&&/[\\`*_[\]()#+\-.!>~|]/.test(n[m+1])){i+=n[m+1],m+=2;continue}if(p===`
63
+ `){f({t:"br"}),m++;continue}if(p==="`"){let b=1;for(;n[m+b]==="`";)b++;const N="`".repeat(b),j=n.indexOf(N,m+b);if(j>m){const E=n.slice(m+b,j);f({t:"code",v:E.length>2&&E.startsWith(" ")&&E.endsWith(" ")?E.slice(1,-1):E}),m=j+b;continue}i+=N,m+=b;continue}if((p==="*"||p==="_")&&n[m+1]===p){const b=n.indexOf(p+p,m+2);if(b>m+2&&n[m+2]!==" "){f({t:"b",c:nc(n.slice(m+2,b))}),m=b+2;continue}}else if(p==="*"||p==="_"){const b=p==="*"||!/\w/.test(n[m-1]??"");let N=-1;for(let j=m+1;j<n.length;j++)if(n[j]===p&&n[j+1]!==p&&n[j-1]!==" "&&(p==="*"||!/\w/.test(n[j+1]??""))){N=j;break}if(b&&N>m+1&&n[m+1]!==" "&&!n.slice(m+1,N).includes(`
64
+ `)){f({t:"i",c:nc(n.slice(m+1,N))}),m=N+1;continue}}if(p==="["){const b=/^\[([^\]\n]*)\]\(([^)\s]*)\)/.exec(n.slice(m));if(b){const N=n1(b[2]),j=nc(b[1]);if(N)f({t:"a",href:N,c:j});else for(const E of j)E.t==="text"?i+=E.v:f(E);m+=b[0].length;continue}}if((p==="h"||p==="H")&&!/\w/.test(n[m-1]??"")){const b=/^https?:\/\/[^\s<>"`]+/i.exec(n.slice(m));if(b){const N=b[0].replace(/[.,;:!?)\]'"]+$/,"");f({t:"a",href:N,c:[{t:"text",v:N}]}),m+=N.length;continue}}i+=p,m++}return i&&o.push({t:"text",v:i}),o}const Hb=v.createContext(()=>{}),Pm=()=>v.useContext(Hb);function s1({children:n}){const[o,i]=v.useState([]),f=v.useCallback(m=>{const p=Date.now()+Math.random();i(b=>[...b.filter(N=>!m.slot||N.slot!==m.slot).slice(-3),{...m,id:p}]),setTimeout(()=>i(b=>b.filter(N=>N.id!==p)),m.ms??(m.tone==="error"?6e3:3200))},[]);return s.jsxs(Hb.Provider,{value:f,children:[n,s.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:o.map(m=>s.jsxs("div",{className:`toast ${m.tone??"info"}`,children:[m.tone==="error"?s.jsx(Q,{name:"warn"}):m.tone==="ok"?s.jsx(Q,{name:"check"}):null,m.dot&&s.jsx("span",{className:"toast-dot","aria-hidden":"true"}),s.jsx("span",{children:m.text}),m.code&&s.jsx("code",{className:"toast-code",children:m.code}),m.action&&s.jsx("button",{className:"toast-action",onClick:()=>{m.action.run(),i(p=>p.filter(b=>b.id!==m.id))},children:m.action.label}),m.close&&s.jsx("button",{className:"icon-btn oc-ib toast-close","aria-label":m.close.label,title:m.close.label,onClick:()=>{var p,b;(b=(p=m.close).run)==null||b.call(p),i(N=>N.filter(j=>j.id!==m.id))},children:s.jsx(Q,{name:"close",size:16})})]},m.id))})]})}function Lb({icon:n,text:o,alt:i}){return s.jsxs("span",{className:"swap-label",children:[s.jsxs("span",{children:[n," ",o]}),s.jsxs("span",{"aria-hidden":"true",children:[n," ",i]})]})}function o1({menu:n,onClose:o,head:i}){const f=v.useRef(null),[m,p]=v.useState({x:0,y:0}),[b,N]=v.useState(-1);if(v.useLayoutEffect(()=>{if(!n||!f.current)return;const S=f.current.getBoundingClientRect(),w=n.right?n.x-S.width:n.x,k=n.up?n.y-S.height:n.y;p({x:Math.round(Math.max(8,Math.min(w,window.innerWidth-S.width-8))),y:Math.round(Math.max(8,Math.min(k,window.innerHeight-S.height-8)))}),N(-1),f.current.focus()},[n]),v.useEffect(()=>{if(!n)return;const S=w=>{f.current&&w.target instanceof Node&&f.current.contains(w.target)||o()};return window.addEventListener("pointerdown",S,!0),window.addEventListener("blur",o),()=>{window.removeEventListener("pointerdown",S,!0),window.removeEventListener("blur",o)}},[n,o]),!n)return null;const j=n.items,E=j.map((S,w)=>S!=="sep"&&!S.disabled&&!S.heading?w:-1).filter(S=>S>=0);return s.jsxs("div",{ref:f,className:`menu entering ${n.className??""}`,role:"menu",tabIndex:-1,"aria-label":n.title??u.dialog.menu,style:{left:m.x,top:m.y},onKeyDown:S=>{var w,k;if(["Escape","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"].includes(S.key)&&S.stopPropagation(),S.key==="Escape")o();else if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const z=E.indexOf(b),R=S.key==="ArrowDown"?E[(z+1)%E.length]:E[(z-1+E.length)%E.length];N(R)}else if((S.key==="ArrowRight"||S.key==="F10"&&S.shiftKey)&&b>=0){const z=j[b],R=z!=="sep"&&z.more,K=R&&((k=(w=f.current)==null?void 0:w.querySelector(`[data-more="${b}"]`))==null?void 0:k.getBoundingClientRect());R&&K&&(S.preventDefault(),o(),R.open({clientX:K.left,clientY:K.bottom+4}))}else if(S.key==="Enter"&&b>=0){const z=j[b];z!=="sep"&&(o(),z.run())}},children:[n.title&&s.jsx("div",{className:"menu-title",children:n.title}),i??n.head,j.map((S,w)=>S==="sep"?s.jsx("div",{className:"menu-sep",role:"separator"},w):S.heading?s.jsx("div",{className:"menu-title menu-heading",role:"presentation",children:S.label},w):S.more?s.jsxs("div",{className:`menu-row ${b===w?"active":""}`,role:"none",children:[s.jsx(i1,{it:S,icons:!!n.icons,active:b===w,onHover:()=>N(w),onClose:o}),s.jsx("button",{className:"icon-btn menu-more",role:"menuitem",tabIndex:-1,"data-more":w,"aria-haspopup":"menu","aria-label":S.more.label,title:S.more.label,onMouseEnter:()=>N(w),onClick:k=>{const z=k.currentTarget.getBoundingClientRect();o(),S.more.open({clientX:z.left,clientY:z.bottom+4})},children:s.jsx(Q,{name:"more",size:16})})]},w):s.jsxs("button",{role:S.check===void 0?"menuitem":"menuitemcheckbox","aria-checked":S.check===void 0?void 0:S.check,"aria-label":S.aria&&S.aria!==S.label?S.aria:void 0,title:S.aria&&S.aria!==S.label?S.shortcut?`${S.aria} (${S.shortcut})`:S.aria:S.tip,className:`menu-item ${b===w?"active":""} ${S.danger?"danger":""}`,disabled:S.disabled,onMouseEnter:()=>N(w),onClick:()=>{o(),S.run()},children:[n.icons&&s.jsx("span",{className:"menu-icon",children:S.icon&&s.jsx(Q,{name:S.icon})}),S.note?s.jsxs("span",{className:"menu-label menu-two",children:[s.jsxs("span",{children:[S.dot&&s.jsx("span",{className:"menu-dot","aria-hidden":"true"}),S.label]}),s.jsx("span",{className:"menu-note",children:S.note})]}):s.jsxs("span",{className:"menu-label",children:[S.dot&&s.jsx("span",{className:"menu-dot","aria-hidden":"true"}),S.label]}),S.check!==void 0&&s.jsx("span",{className:`menu-check ${S.check?"on":""}`,"aria-hidden":"true",children:s.jsx(Q,{name:"check",size:14})}),S.shortcut&&s.jsx("kbd",{children:S.shortcut})]},w))]})}function i1({it:n,icons:o,active:i,onHover:f,onClose:m}){return s.jsxs("button",{role:n.check===void 0?"menuitem":"menuitemcheckbox","aria-checked":n.check===void 0?void 0:n.check,"aria-label":n.aria&&n.aria!==n.label?n.aria:void 0,className:`menu-item ${i?"active":""} ${n.danger?"danger":""}`,disabled:n.disabled,title:n.aria&&n.aria!==n.label?n.aria:n.tip,onMouseEnter:f,onClick:()=>{m(),n.run()},children:[o&&s.jsx("span",{className:"menu-icon",children:n.icon&&s.jsx(Q,{name:n.icon})}),s.jsxs("span",{className:"menu-label",children:[n.dot&&s.jsx("span",{className:"menu-dot","aria-hidden":"true"}),n.label]}),n.check!==void 0&&s.jsx("span",{className:`menu-check ${n.check?"on":""}`,"aria-hidden":"true",children:s.jsx(Q,{name:"check",size:14})})]})}function c1({state:n,onClose:o}){const[i,f]=v.useState(""),[m,p]=v.useState(!1),b=v.useRef(null),N=v.useRef(null);if(v.useEffect(()=>{var S;n&&(n.kind==="prompt"?(f(n.value),p(((S=n.extra)==null?void 0:S.checked)??!1),setTimeout(()=>{var w;return(w=b.current)==null?void 0:w.select()},0)):setTimeout(()=>{var w;return(w=N.current)==null?void 0:w.focus()},0))},[n]),!n)return null;const j=()=>{n.kind==="prompt"?n.resolve(null):n.resolve(!1),o()},E=()=>{n.kind==="prompt"?n.resolve({value:i,extra:m}):n.resolve(!0),o()};return s.jsx("div",{className:"dialog-backdrop",onPointerDown:S=>S.target===S.currentTarget&&j(),children:s.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-label":n.title,onKeyDown:S=>{S.key==="Escape"&&j(),S.key==="Enter"&&!S.nativeEvent.isComposing&&E()},children:[s.jsx("h2",{children:n.title}),n.kind==="prompt"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"dialog-field",children:[n.label&&s.jsx("span",{children:n.label}),s.jsx("input",{ref:b,value:i,onChange:S=>f(S.target.value)})]}),n.hint&&s.jsx("p",{className:"muted",children:n.hint}),n.extra&&s.jsxs("label",{className:"check",children:[s.jsx("input",{type:"checkbox",checked:m,onChange:S=>p(S.target.checked)}),n.extra.label]})]}):s.jsx("p",{children:n.body}),s.jsxs("div",{className:"dialog-actions",children:[s.jsx("button",{onClick:j,children:u.dialog.cancel}),s.jsx("button",{ref:N,className:n.kind==="confirm"&&n.danger?"danger primary":"primary",onClick:E,children:n.ok})]})]})})}function r1(){const[n,o]=v.useState(null);return{state:n,close:()=>o(null),prompt:m=>new Promise(p=>o({kind:"prompt",value:m.value??"",ok:m.ok??u.dialog.ok,...m,resolve:p})),confirm:m=>new Promise(p=>o({kind:"confirm",ok:m.ok??u.dialog.ok,...m,resolve:p}))}}const Zy=n=>`design-canvas:open:${n}`;function Cu({id:n,title:o,count:i,defaultOpen:f=!1,right:m,variant:p="head",children:b}){const[N,j]=v.useState(()=>{try{const k=localStorage.getItem(Zy(n));return k==null?f:k==="1"}catch{return f}}),E=()=>{j(k=>{try{localStorage.setItem(Zy(n),k?"0":"1")}catch{}return!k})},w=i!==void 0&&i!==""&&s.jsx("span",{className:`collapsible-count ${typeof i=="string"?"oc-off":""}`,children:i});return p==="row"?s.jsxs("div",{className:`pp-foldset ${N?"open":""}`,children:[s.jsxs("button",{className:"pp-fold","aria-expanded":N,"aria-controls":`sec-${n}`,onClick:E,children:[s.jsx("span",{className:"pp-l",children:o}),s.jsxs("span",{className:"pp-v",children:[w,s.jsx(Q,{name:"chevronRight",size:14,className:"chev"})]})]}),N&&s.jsx("div",{className:"pp-fold-body",id:`sec-${n}`,children:b})]}):s.jsxs("section",{className:`pp-group collapsible ${N?"open":""}`,"data-collapsible":n,children:[s.jsxs("div",{className:"collapsible-head",children:[s.jsxs("button",{className:"pp-fold-h","aria-expanded":N,"aria-controls":`sec-${n}`,onClick:E,children:[s.jsx(Q,{name:"chevronRight",size:14,className:"chev"}),s.jsx("span",{className:"collapsible-title",children:o}),w]}),m&&s.jsx("span",{className:"collapsible-right",children:m})]}),N&&s.jsx("div",{className:"pp-fold-body",id:`sec-${n}`,children:b})]})}function ns(n,o="button"){var b,N;if(!n)return;const i=Array.from(n.querySelectorAll(o)),f=`${window.innerWidth}|${(b=document.fonts)==null?void 0:b.status}|${((N=n.closest(".app"))==null?void 0:N.className)??""}|${i.map(j=>`${j.className}${j.textContent}`).join("")}`,m=vm.get(n);if(m&&m.key===f&&m.els.length===i.length&&m.els.every((j,E)=>j===i[E]))return;for(const j of i)j.style.width="";const p=i.map(j=>j.getBoundingClientRect().width);i.forEach((j,E)=>{p[E]%1>.01&&(j.style.width=`${Math.ceil(p[E])}px`)}),p.some(j=>j===0)?vm.delete(n):vm.set(n,{key:f,els:i})}const vm=new WeakMap;function _b(n,o,i=o){const[f,m]=v.useState(null);return v.useLayoutEffect(()=>{const p=n.current;if(!p)return;ns(p);let b=Math.max(8,Math.round((o-p.offsetWidth)/2));b+p.offsetWidth>i-8&&(b=Math.max(8,Math.round((i-p.offsetWidth)/2))),b!==f&&m(b)}),f}function ur({c:n}){return s.jsx(s.Fragment,{children:n.map((o,i)=>o.t==="text"?o.v:o.t==="code"?s.jsx("code",{className:o.v.length>24?"long":void 0,children:o.v},i):o.t==="b"?s.jsx("strong",{children:s.jsx(ur,{c:o.c})},i):o.t==="i"?s.jsx("em",{children:s.jsx(ur,{c:o.c})},i):o.t==="a"?s.jsx("a",{href:o.href,target:"_blank",rel:"noopener noreferrer",children:s.jsx(ur,{c:o.c})},i):s.jsx("br",{},i))})}function Ub({list:n}){const o=n.items.map((i,f)=>s.jsxs("li",{children:[s.jsx(ur,{c:i.c}),i.sub&&s.jsx(Ub,{list:i.sub})]},f));return n.t==="ol"?s.jsx("ol",{start:n.start,children:o}):s.jsx("ul",{children:o})}function u1({v:n}){const[o,i]=v.useState(!1);return s.jsxs("div",{className:"codeblock",children:[s.jsx("button",{className:"copy",onClick:()=>{var f;return void((f=navigator.clipboard)==null?void 0:f.writeText(n).then(()=>{i(!0),window.setTimeout(()=>i(!1),1500)}))},children:s.jsx(Lb,{icon:s.jsx(Q,{name:"copy",size:12}),text:o?u.chat.copied:u.chat.copy,alt:o?u.chat.copy:u.chat.copied})}),s.jsx("pre",{children:s.jsx("code",{children:n})})]})}const d1=({b:n})=>n.t==="p"?s.jsx("p",{children:s.jsx(ur,{c:n.c})}):n.t==="h"?s.jsx("p",{className:`md-h h${Math.min(n.level,3)}`,role:"heading","aria-level":n.level,children:s.jsx(ur,{c:n.c})}):n.t==="code"?s.jsx(u1,{v:n.v}):n.t==="hr"?s.jsx("hr",{}):s.jsx(Ub,{list:n});function f1({text:n,className:o=""}){const i=v.useMemo(()=>a1(n),[n]);return s.jsx("div",{className:`md ${o}`,children:i.map((f,m)=>s.jsx(d1,{b:f},m))})}const rr={claude:"Claude Code",codex:"Codex",cursor:"Cursor Agent",gemini:"Gemini CLI"},h1=Object.entries(rr).map(([n,o])=>({id:n,label:o,ok:!0})),m1={claude:"claude",codex:"codex",cursor:"cursor-agent",gemini:"gemini"},Fy={claude:"claude auth login",codex:"codex login",cursor:"cursor-agent login",gemini:"gemini"},p1={claude:"npm install -g @anthropic-ai/claude-code",codex:"npm install -g @openai/codex",cursor:"curl https://cursor.com/install -fsS | bash",gemini:"npm install -g @google/gemini-cli"},g1={claude:["opus","sonnet","haiku"],codex:[],cursor:[],gemini:["gemini-2.5-pro","gemini-2.5-flash"]},cf={changed:0,added:1,removed:2},y1=n=>rr[n]?`var(--agent-${n})`:"var(--line-strong)",Qy=(n,o)=>{try{const i=localStorage.getItem(n);return i==null?o:JSON.parse(i)}catch{return o}},Py=(n,o)=>{try{localStorage.setItem(n,JSON.stringify(o))}catch{}},Jy=n=>new Date(n).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),Iy=n=>new Date(n).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}),b1=n=>(n.split(/[\\/]/).filter(Boolean).pop()??n)+"/";function xm({text:n}){return s.jsx(s.Fragment,{children:n.split("`").map((o,i)=>i%2?s.jsx("code",{children:o},i):o)})}function rf(n,o){const i=[...n.parts],f=i[i.length-1],m={...n};if(o.kind==="delta")(f==null?void 0:f.t)==="text"?i[i.length-1]={t:"text",text:f.text+o.text}:i.push({t:"text",text:o.text});else if(o.kind==="break")(f==null?void 0:f.t)==="text"&&f.text&&i.push({t:"text",text:""});else if(o.kind==="text")i.push({t:"text",text:o.text});else if(o.kind==="plain")(f==null?void 0:f.t)==="plain"?i[i.length-1]={t:"plain",text:`${f.text}
65
+ ${o.text}`}:i.push({t:"plain",text:o.text});else if(o.kind==="tool")i.push({t:"tool",name:o.name,detail:o.detail});else if(o.kind==="permission"){const{kind:p,...b}=o,N=i.findIndex(j=>j.t==="perm"&&j.id===o.id);N>=0?i[N]={...i[N],...b}:i.push({t:"perm",...b})}else if(o.kind==="permission-answered"){const p=i.findIndex(b=>b.t==="perm"&&b.id===o.id);p>=0&&(i[p]={...i[p],decision:o.decision})}else if(o.kind==="error"&&o.cause){for(let p=i.length-1;p>=0;p--)i[p].t==="error"&&i.splice(p,1);i.push({t:"error",text:o.text,cause:o.cause,raw:o.raw,changed:o.changed})}else o.kind==="error"?i.push({t:"error",text:o.text}):o.kind==="done"?m.cost=o.cost:o.kind==="start"?m.variants=o.variants:o.kind==="run-undo"?m.undone=o.undone:o.kind==="end"&&(m.status=o.status,m.step=o.step,m.boards=o.boards);return m.parts=i.filter(p=>p.t!=="text"&&p.t!=="plain"||p.text),m}function v1(n){const[o,i]=v.useState([]),[f,m]=v.useState(!1),[p,b]=v.useState(null),[N,j]=v.useState(!1),[E,S]=v.useState(null),[w,k]=v.useState(!1),[z,R]=v.useState(()=>Qy("design-canvas:models",{})),[K,B]=v.useState(!1),[V,M]=v.useState(null),[X,te]=v.useState(()=>{try{return localStorage.getItem("design-canvas:agent")??"claude"}catch{return"claude"}}),[ee,ce]=v.useState([]),[ie,he]=v.useState(null),[fe,pe]=v.useState({}),[Oe,Ye]=v.useState(!0),[ue,pt]=v.useState(!0),[Fe,me]=v.useState(!0),[Ae,ze]=v.useState(1),[qe,Ve]=v.useState(null),[re,Ne]=v.useState(null),[at,H]=v.useState(null),[se,ve]=v.useState(null),[Ce,Qe]=v.useState(!1),[de,U]=v.useState({}),[ae,ge]=v.useState(null),[Et,Jt]=v.useState(null),[Ht,Be]=v.useState(null),[ot,Pe]=v.useState(null),on=v.useRef(null),fn=v.useRef(null),Nn=v.useRef(null),It=v.useRef(null),xa=v.useRef(null),D=v.useRef(null);D.current=ie;const Z=v.useRef(new Map),ne=n.storeKey?`easel:chat:${n.storeKey}`:null,Re=v.useRef(0),_e=v.useCallback(($=!1)=>{m(!0);const I=++Re.current;xe.get("/api/agents").then(Le=>{I===Re.current&&(i(Le.agents),b({at:Le.checkedAt,onOpen:$}))}).catch(()=>{}).finally(()=>I===Re.current&&m(!1))},[]);v.useEffect(()=>{n.open&&_e(!0)},[n.open,_e]),v.useEffect(()=>{try{localStorage.setItem("design-canvas:agent",X)}catch{}},[X]),v.useEffect(()=>Py("design-canvas:models",z),[z]),v.useEffect(()=>{if(!N)return;const $=Le=>{const we=Me=>Me.current&&Le.target instanceof Node&&Me.current.contains(Le.target);we(Nn)||we(It)||j(!1)},I=()=>j(!1);return window.addEventListener("pointerdown",$,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("pointerdown",$,!0),window.removeEventListener("resize",I)}},[N]),v.useEffect(()=>{var $,I;N&&((I=($=It.current)==null?void 0:$.querySelector('[aria-checked="true"], [role^="menuitem"]'))==null||I.focus())},[N]);const Je=()=>{var $,I;j(!1),(I=($=Nn.current)==null?void 0:$.querySelector(".agent-btn"))==null||I.focus()},it=$=>{if($.key==="Escape")return Je();if($.key!=="Tab"||!It.current)return;const I=Array.from(It.current.querySelectorAll("button:not(:disabled), a[href]"));$.target===I[$.shiftKey?0:I.length-1]&&($.preventDefault(),Je())},Nt=$=>{const I=$.getBoundingClientRect();S({right:Math.round(window.innerWidth-I.right),top:Math.round(I.bottom+4)}),j(Le=>!Le)},cn=($,I)=>{var Le;(Le=navigator.clipboard)==null||Le.writeText(I).then(()=>{M($),window.setTimeout(()=>M(we=>we===$?null:we),1500)})},Ft=v.useRef(new Set),Qt=v.useRef(new Map),Pn=v.useRef(()=>{});v.useEffect(()=>n.subscribe(($,I)=>{if(I.kind==="boot")return H(I.boot);if(!Ft.current.has($)){Qt.current.set($,[...Qt.current.get($)??[],I]);return}Pn.current($,I)}),[n.subscribe]),Pn.current=($,I)=>{if(ce(we=>we.map(Me=>Me.role==="ai"&&Me.id===$?rf(Me,I):Me)),I.kind==="end"&&n.onRunEnd){const we=ee.find(Ge=>Ge.role==="ai"&&Ge.id===$),Me=we?rf(we,I):null,nt=((Me==null?void 0:Me.parts)??[]).filter(Ge=>Ge.t==="text").map(Ge=>Ge.text).join("").trim();n.onRunEnd({id:$,status:I.status,reply:nt,files:(I.boards??(Me==null?void 0:Me.boards)??[]).map(Ge=>Ge.file)})}if(I.kind==="end"&&he(we=>we===$?null:we),I.kind==="session"){const we=ee.find(Me=>Me.role==="ai"&&Me.id===$);we&&pe(Me=>({...Me,[we.agent]:I.id}))}I.kind==="error"&&(I.cause==="signin"||I.cause==="missing")&&_e();const Le=Z.current.get($);I.kind==="end"&&I.status==="error"&&Le&&!n.draft.trim()&&!n.attach.comments.length&&!n.attach.refs.length&&(n.setDraft(Le.text),n.setAttach(()=>Le.attach),B(!0))},v.useEffect(()=>{xe.get("/api/chat/runs?ids=").then($=>H(I=>I??$.boot)).catch(()=>{})},[]),v.useEffect(()=>{var I;if(!ne||Ce)return;const $=Qy(ne,null);(I=$==null?void 0:$.msgs)!=null&&I.length&&(ce($.msgs),pe($.sessions??{})),ve(($==null?void 0:$.boot)??null),Qe(!0)},[ne,Ce]),v.useEffect(()=>{Ce&&ne&&Py(ne,{msgs:ee.slice(-100),sessions:fe,boot:at??se})},[Ce,ne,ee,fe,at,se]),v.useEffect(()=>{if(!Ce||!at)return;const $=!!se&&se!==at;ve(at),ce(we=>{if(!$||!we.length)return we;const Me=we.map(nt=>nt.role==="ai"&&nt.status==="running"?{...nt,status:"cancelled"}:nt);return Me[Me.length-1].role==="restart"?Me:[...Me,{role:"restart",at}]});const I=ee.filter(we=>we.role==="ai");for(const we of I)we.status==="running"&&!$&&!Ft.current.has(we.id)&&xe.get(`/api/chat?id=${encodeURIComponent(we.id)}`).then(Me=>{Ft.current.add(we.id),ce(nt=>nt.map(Ge=>Ge.role==="ai"&&Ge.id===we.id?Me.events.reduce(rf,{...Ge,parts:[]}):Ge)),Me.events.some(nt=>nt.kind==="end")||he(we.id)});const Le=I.filter(we=>we.step).map(we=>we.id);Le.length&&xe.get(`/api/chat/runs?ids=${Le.join(",")}`).then(we=>U(Me=>({...Me,...we.runs}))).catch(()=>{})},[Ce,at]),v.useEffect(()=>{const $=on.current;$&&$.scrollHeight-$.scrollTop-$.clientHeight<160&&($.scrollTop=$.scrollHeight)},[ee]);const ct=Oe?n.selection:null,Sn=ue?n.boards:[],Lt=Sn.length===1||!Sn.length&&!!ct,rt=o.length?o:h1,bt=rt.find($=>$.id===X),Ea=(bt==null?void 0:bt.label)??rr[X]??X,Dl=X.startsWith("custom:"),qt=z[X]??"",St=(bt==null?void 0:bt.status)==="signin"?u.chat.sendNeedsSignin(Ea):(bt==null?void 0:bt.status)==="missing"?u.chat.sendNeedsInstall(Ea):null,as=ee.find($=>$.role==="ai"&&$.id===ie),fr=!!(as!=null&&as.parts.some($=>$.t==="perm"&&!$.decision)),Ls=async($=n.draft.trim(),I=n.attach,Le=!1)=>{if(!$)return{error:""};if(ie)return{error:u.chat.running};if(St)return{error:St};Ne(null);const we=[...ct?[u.chat.chipElement(ct.tag)]:[],...Sn.map(Me=>n.titleOf(Me)),...Fe&&n.visibleCount?[u.chat.chipVisible(n.visibleCount)]:[],...I.comments.map(Me=>u.chat.chipComment(Me.text.slice(0,16))),...I.refs.map(Me=>Me.name??Me.value),...Ae>1?[u.chat.variants(Ae)]:[]];try{const Me=await xe.post("/api/chat",{agent:X,text:$,model:Dl?void 0:qt.trim()||void 0,resume:fe[X],variants:Lt?Ae:0,attach:{selection:!!ct,boards:Sn,visible:Fe,comments:I.comments.map(nt=>nt.id),refs:I.refs}});Z.current.set(Me.id,{text:$,attach:I}),B(!1),ce(nt=>[...nt,{role:"user",text:$,chips:we},{role:"ai",id:Me.id,agent:X,label:Ea,parts:[],status:"running",boot:at??void 0}]),he(Me.id),Ft.current.add(Me.id);for(const nt of Qt.current.get(Me.id)??[])Pn.current(Me.id,nt);return Qt.current.delete(Me.id),Le||(n.setDraft(""),n.setAttach(()=>({comments:[],refs:[]}))),ze(1),Me.variants.length&&n.onLocate(Me.variants),{id:Me.id}}catch(Me){return Ne(Me.message),{error:Me.message}}};n.handle&&(n.handle.current={send:$=>Ls($,{comments:[],refs:[]},!0),undo:$=>ls($,"undo"),check:()=>_e(),agent:X,label:Ea,model:qt,isCustom:Dl,setModel:$=>R(I=>({...I,[X]:$})),openAgentMenu:$=>{_e(),S($),j(!0)},running:ie});const ml=()=>ie&&xe.post("/api/chat/cancel",{id:ie}).catch(()=>{}),hn=$=>{const I=Z.current.get($);n.draft.trim()||!I?Ls():Ls(I.text,I.attach)},wa=($,I)=>ce(Le=>Le.map(we=>we.role==="ai"&&we.id===$?I(we):we)),Jn=($,I,Le)=>{wa($,we=>rf(we,{kind:"permission-answered",id:I,decision:Le})),xe.post("/api/chat/permission/answer",{id:I,decision:Le}).catch(we=>Ne(we.message))},ls=async($,I,Le)=>{var we;Jt($);try{await xe.post(`/api/chat/${I}-run`,{id:$,mode:Le}),ge(null),wa($,Me=>({...Me,undone:I==="undo"}))}catch(Me){const nt=Me;nt.status===409&&((we=nt.body)!=null&&we.conflicts)?ge({id:$,kind:I,names:[...new Set(nt.body.conflicts.map(Ge=>Ge.file.endsWith(".html")?n.titleOf(Ge.file):Ge.file))]}):Ne(nt.message)}finally{Jt(null)}},ss=async($,I)=>{if(await n.confirm({title:u.chat.restoreTitle,body:u.chat.restoreBody(Iy(I)),ok:u.chat.restoreOk,danger:!0}))try{await xe.post("/api/chat/revert",{id:$.id}),wa($.id,Le=>({...Le,restored:!0}))}catch(Le){Ne(Le.message)}},pl=$=>Be({id:$.id,boards:[...$.boards??[]].sort((I,Le)=>cf[I.kind]-cf[Le.kind]).map(I=>({...I,title:n.titleOf(I.file),...n.sizeOf(I.file)??{w:390,h:844}}))}),Oa=async()=>{if(ot)try{const $=await xe.post("/api/agents/custom",{name:ot.name,command:ot.command});i(I=>[...I.filter(Le=>Le.id!==$.agent.id),$.agent]),te($.agent.id),Pe(null)}catch($){Pe(I=>I&&{...I,error:$.message})}},gl=async $=>{await xe.post("/api/agents/custom",{action:"delete",id:$}).catch(()=>{}),i(I=>I.filter(Le=>Le.id!==$)),X===$&&te("claude")},os=$=>$.status?u.chat.agentStatus[$.status]:f?u.chat.checking:"",_n=(bt==null?void 0:bt.status)==="signin"?{text:u.chat.remedySignin(Ea,Fy[X]??`${X} login`),cmd:Fy[X]??`${X} login`}:(bt==null?void 0:bt.status)==="missing"?{text:u.chat.remedyMissing(Dl?(bt.command??"").split(/\s+/)[0]:m1[X]??X),cmd:Dl?null:p1[X]??X}:null,is=async $=>{for(const I of Array.from($)){if(I.size>15*1024*1024){Ne(u.chat.tooBig(I.name));continue}const Le=await new Promise(we=>{const Me=new FileReader;Me.onload=()=>we(String(Me.result).split(",")[1]??""),Me.readAsDataURL(I)});try{const we=await xe.post("/api/refs",{name:I.name||u.defaults.pastedImage,data:Le});n.setAttach(Me=>({...Me,refs:[...Me.refs,we]}))}catch(we){Ne(we.message)}}},tn=$=>{const I=[...$.boards??[]].sort((vt,zn)=>cf[vt.kind]-cf[zn.kind]),Le=I.filter(vt=>vt.kind!=="added").length,we=I.filter(vt=>vt.kind==="added").length,Me=u.chat.runChanged(Le,we),nt=!!at&&!!$.boot&&$.boot!==at,Ge=de[$.id],kn=(ae==null?void 0:ae.id)===$.id?ae:null;if($.restored)return s.jsx("div",{className:"run-result undone",children:s.jsx("div",{className:"oc-rr-top",children:s.jsxs("span",{className:"rr-line",children:[s.jsx(Q,{name:"restore",size:14})," ",u.chat.restoredCopy]})})});if(nt)return s.jsxs("div",{className:"run-result",children:[s.jsx("div",{className:"oc-rr-top",children:s.jsx("span",{className:"rr-line",children:Me})}),Ge===void 0?null:Ge.copy?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"btn-row",children:s.jsxs("button",{className:"btn",onClick:()=>void ss($,Ge.copy.at),children:[s.jsx(Q,{name:"restore",size:14})," ",u.chat.restoreCopy]})}),s.jsx("p",{className:"sub",children:u.chat.savedAt(Iy(Ge.copy.at))})]}):s.jsx("p",{className:"sub",children:u.chat.copyGone})]});const sa=kn&&s.jsxs("div",{className:"rr-conflict",role:"alert",children:[s.jsx("p",{children:(kn.kind==="undo"?u.chat.conflictUndo:u.chat.conflictRedo)(kn.names.join(", "))}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn",onClick:()=>void ls($.id,kn.kind,"rest"),children:kn.kind==="undo"?u.chat.undoRest:u.chat.redoRest}),s.jsx("button",{className:"btn danger",onClick:()=>void ls($.id,kn.kind,"all"),children:kn.kind==="undo"?u.chat.undoAll:u.chat.redoAll}),s.jsx("button",{className:"btn",onClick:()=>ge(null),children:u.chat.cancel})]})]});return $.undone?s.jsxs("div",{className:"run-result undone",children:[s.jsx("div",{className:"oc-rr-top",children:s.jsxs("span",{className:"rr-line",children:[s.jsx(Q,{name:"undo",size:14})," ",u.chat.runUndone(I.length)]})}),s.jsx("div",{className:"btn-row",children:s.jsxs("button",{className:"btn",disabled:Et===$.id||!!ie,onClick:()=>void ls($.id,"redo"),children:[s.jsx(Q,{name:"redo",size:14})," ",u.chat.redo]})}),sa]}):s.jsxs("div",{className:"run-result",children:[s.jsxs("div",{className:"oc-rr-top",children:[s.jsx("span",{className:"rr-line",children:Me}),I.map(vt=>vt.kind==="removed"?s.jsxs("span",{className:"chip",children:[s.jsx(Q,{name:"board",size:12})," ",u.chat.chipRemoved(n.titleOf(vt.file))]},vt.file):s.jsxs("button",{className:"chip",title:vt.file,onClick:()=>n.onLocate([vt.file]),children:[s.jsx(Q,{name:"board",size:12})," ",vt.kind==="added"?u.chat.chipNew(n.titleOf(vt.file)):n.titleOf(vt.file)]},vt.file))]}),s.jsxs("div",{className:"btn-row",children:[s.jsxs("button",{className:"btn",disabled:Et===$.id||!!ie,onClick:()=>void ls($.id,"undo"),children:[s.jsx(Q,{name:"undo",size:14})," ",u.chat.undoRun]}),I.length>0&&s.jsxs("button",{className:"btn",onClick:()=>pl($),children:[s.jsx(Q,{name:"compare",size:14})," ",u.chat.compare]})]}),sa]})},ri=($,I)=>I.decision?s.jsxs("div",{className:"perm-done",title:I.subject,children:[s.jsx(Q,{name:I.decision==="deny"?"close":"check",size:14,className:I.decision==="deny"?"no":"ok"}),s.jsxs("span",{children:[u.chat.permDone[I.decision]," · ",I.tool," ",I.what==="tool"?null:s.jsx("code",{children:I.subject}),I.outside?` ${u.chat.permDoneOutside}`:""]})]}):s.jsxs("div",{className:"perm",role:"group","aria-label":u.chat.permAsk($.label??rr[$.agent]??$.agent,I.what,I.tool),children:[s.jsxs("div",{className:"perm-head",children:[s.jsx("span",{className:"idot","aria-hidden":"true"}),u.chat.permAsk($.label??rr[$.agent]??$.agent,I.what,I.tool)]}),s.jsx("div",{className:"perm-cmd",children:I.subject}),s.jsxs("div",{className:"perm-where",title:I.where,children:[s.jsx(Q,{name:"folder",size:14})," ",u.chat.permIn," ",s.jsx("code",{children:b1(I.where)}),I.outside&&s.jsxs("span",{className:"perm-outside",children:["· ",u.chat.permOutside]})]}),s.jsxs("div",{className:`btn-row ${I.rule?"":"oc-one"}`,children:[s.jsx("button",{className:"btn primary",onClick:()=>Jn($.id,I.id,"once"),children:u.chat.allowOnce}),I.rule&&s.jsx("button",{className:"btn",title:u.chat.alwaysAllowTitle,onClick:()=>Jn($.id,I.id,"always"),children:u.chat.alwaysAllow(I.rule)}),s.jsx("button",{className:"btn",onClick:()=>Jn($.id,I.id,"deny"),children:u.chat.deny})]})]}),Ot=ee.map($=>$.role==="ai"?`${$.status}${$.undone?"u":""}${$.restored?"r":""}${$.parts.length}`:$.role).join(),ho=v.useCallback(()=>{ns(xa.current,".chat-head .new-chat, .rr-line, .chip, .bubble, .btn-row .btn, .oc-variants, .run-status > *"),ns(It.current,".agent-status, .menu-foot .btn")},[]);v.useLayoutEffect(ho,[ho,Ot,ie,X,N,n.open,n.attach,n.selection,n.boards,n.visibleCount,V,de,ae,f,o,Oe,ue,Fe]),v.useEffect(()=>{const $=xa.current;if(!$)return;const I=new ResizeObserver(ho);return I.observe($),()=>I.disconnect()},[ho]);const ac=($,I)=>{const Le=[];let we=[],Me=0;const nt=()=>{we.length&&Le.push(s.jsx("div",{className:"oc-tools",children:we},`t${Me}`)),we=[]};return $.parts.forEach((Ge,kn)=>{if(Ge.t==="tool"||Ge.t==="perm"&&Ge.decision){we.length||(Me=kn);const sa=$.status==="running"&&kn===$.parts.length-1;we.push(Ge.t==="tool"?s.jsxs("div",{className:`ai-tool ${sa?"is-current":""}`,children:[s.jsx(Q,{name:"edit",size:14}),s.jsx("span",{children:Ge.name}),Ge.detail&&s.jsx("code",{children:Ge.detail})]},kn):s.jsx(v.Fragment,{children:ri($,Ge)},kn));return}nt(),Le.push(Ge.t==="text"?s.jsx(f1,{className:"ai-text",text:Ge.text},kn):Ge.t==="plain"?s.jsx("pre",{className:"ai-plain",children:Ge.text},kn):Ge.t==="perm"?s.jsx(v.Fragment,{children:ri($,Ge)},kn):Ge.cause?s.jsxs("div",{className:"ai-fail",children:[s.jsx("div",{className:"ai-error",children:s.jsx("span",{children:s.jsx(xm,{text:Ge.text})})}),I&&s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn",disabled:!!ie||!!St,title:St??void 0,onClick:()=>hn($.id),children:u.chat.retry}),(()=>{const sa=rt.find(vt=>vt.id!==$.agent&&vt.status!=="missing"&&vt.ok&&!vt.custom);return sa&&sa.id!==X?s.jsx("button",{className:"btn",onClick:()=>te(sa.id),children:u.chat.switchTo(sa.label)}):null})()]}),Ge.raw&&s.jsxs("details",{className:"ai-details",children:[s.jsxs("summary",{children:[s.jsx(Q,{name:"chevronDown",size:14}),u.chat.details]}),s.jsx("div",{className:"ai-details-bar",children:s.jsx("button",{className:"btn copy",onClick:()=>cn(`raw-${$.id}`,Ge.raw),children:s.jsx(Lb,{icon:s.jsx(Q,{name:"copy",size:12}),text:V===`raw-${$.id}`?u.chat.copied:u.chat.copy,alt:V===`raw-${$.id}`?u.chat.copy:u.chat.copied})})}),s.jsx("pre",{children:Ge.raw})]}),Ge.changed===!1&&s.jsx("p",{className:"muted small",children:u.chat.noFilesChanged})]},kn):s.jsxs("div",{className:"ai-error",children:[s.jsx(Q,{name:"warn",size:14})," ",Ge.text]},kn))}),nt(),Le};return s.jsxs("section",{className:"chat","aria-label":u.chat.aria,ref:xa,children:[s.jsxs("div",{className:`chat-head ${w?"is-scrolled":""}`,children:[!n.settingsElsewhere&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-head-row oc-field",children:[s.jsx("span",{className:"pp-l",children:u.chat.agent}),s.jsx("div",{className:"agent-pick",ref:Nn,children:s.jsxs("button",{className:`agent-btn ${N?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":N,"aria-label":u.chat.agentButton(Ea,bt?os(bt):""),title:u.chat.agentHint,disabled:!!ie,onClick:$=>Nt($.currentTarget),onKeyDown:$=>$.key==="Escape"&&j(!1),children:[s.jsx("span",{className:`dot ${(bt==null?void 0:bt.status)??""}`,"aria-hidden":"true"}),s.jsx("span",{className:"agent-name",children:Ea}),s.jsx(Q,{name:"chevronDown",size:14})]})})]}),s.jsxs("div",{className:"chat-head-row oc-field",children:[s.jsx("span",{className:"pp-l",children:Dl?u.chat.customCommandLabel:u.chat.model}),Dl?s.jsx("span",{className:"model-field mono custom-cmd",title:bt==null?void 0:bt.command,children:bt==null?void 0:bt.command}):s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"model-field",list:`models-${X}`,value:qt,placeholder:u.chat.modelDefault,"aria-label":u.chat.model,title:u.chat.modelTitle(Ea),disabled:!!ie,spellCheck:!1,onChange:$=>R(I=>({...I,[X]:$.target.value}))}),s.jsx("datalist",{id:`models-${X}`,children:(g1[X]??[]).map($=>s.jsx("option",{value:$},$))})]})]})]}),s.jsxs("div",{className:"chat-head-row sub",children:[s.jsx("span",{className:"muted small",children:ie?u.chat.running:fe[X]?u.chat.continuing:u.chat.newConversation}),s.jsx("div",{className:"spacer"}),s.jsxs("button",{className:"icon-btn sm new-chat","aria-label":u.chat.newChat,title:u.chat.newChat,disabled:!!ie||!ee.length&&!fe[X],onClick:()=>{ce([]),pe({}),B(!1),ge(null),k(!1)},children:[s.jsx(Q,{name:"plus",size:14})," ",s.jsx("span",{children:u.chat.newChat})]})]})]}),N&&E&&bm.createPortal(s.jsxs("div",{ref:It,className:"menu agent-menu oc-agent-menu entering",role:"menu","aria-label":u.chat.agent,style:{right:E.right,top:E.top},onKeyDown:it,children:[rt.map($=>s.jsxs("div",{className:`menu-item agent-item ${$.status==="missing"?"off":""}`,role:"none",children:[s.jsxs("button",{role:"menuitemradio","aria-checked":$.id===X,className:"agent-choose",title:$.custom&&$.command?u.chat.customCommandTitle($.command):void 0,onClick:()=>{te($.id),j(!1)},children:[s.jsx("span",{className:`menu-check ${$.id===X?"on":""}`,"aria-hidden":"true",children:s.jsx(Q,{name:"check",size:14})}),s.jsx("span",{className:"idot",style:{background:y1($.id)},"aria-hidden":"true"}),s.jsx("span",{className:"menu-label",children:$.label})]}),s.jsxs("span",{className:`agent-status ${$.status==="missing"?"off":$.status??""}`,children:[$.status&&$.status!=="missing"&&s.jsx("span",{className:`dot ${$.status}`,"aria-hidden":"true"}),os($),$.status==="missing"&&$.install&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{className:"link",href:$.install,target:"_blank",rel:"noopener noreferrer",children:u.chat.howToInstall})]})]}),$.custom&&s.jsx("button",{className:"icon-btn sm oc-remove","aria-label":u.chat.remove($.label),title:u.chat.remove($.label),onClick:()=>void gl($.id),children:s.jsx(Q,{name:"close",size:12})})]},$.id)),s.jsx("div",{className:"menu-sep",role:"separator"}),s.jsxs("button",{role:"menuitem",className:"menu-item oc-custom",onClick:()=>{j(!1),Pe({name:"",command:""})},children:[s.jsx("span",{className:"menu-check on muted","aria-hidden":"true",children:s.jsx(Q,{name:"plus",size:14})}),s.jsx("span",{className:"menu-label",children:u.chat.customCommand})]}),s.jsxs("div",{className:"menu-foot",children:[s.jsx("span",{children:f?u.chat.checking:p?u.chat.checkedAt(Jy(p.at),p.onOpen):u.chat.checkedOnOpen}),s.jsx("button",{className:"btn",disabled:f,onClick:()=>_e(),children:u.chat.checkAgain})]})]}),document.body),ot&&bm.createPortal(s.jsx("div",{className:"dialog-backdrop",onPointerDown:$=>$.target===$.currentTarget&&Pe(null),children:s.jsxs("div",{className:"dialog cf",role:"dialog","aria-modal":"true","aria-label":u.chat.customTitle,onKeyDown:$=>$.key==="Escape"&&Pe(null),children:[s.jsxs("h2",{className:"cf-title",children:[s.jsx("span",{className:"idot","aria-hidden":"true"}),u.chat.customTitle]}),s.jsxs("label",{className:"dialog-field",children:[u.chat.customName,s.jsx("input",{autoFocus:!0,value:ot.name,placeholder:u.chat.customNamePlaceholder,onChange:$=>Pe({...ot,name:$.target.value,error:void 0})})]}),s.jsxs("label",{className:"dialog-field",children:[u.chat.customCommandLabel,s.jsx("input",{className:"mono",value:ot.command,spellCheck:!1,placeholder:u.chat.customCommandPlaceholder,onChange:$=>Pe({...ot,command:$.target.value,error:void 0}),onKeyDown:$=>$.key==="Enter"&&!$.nativeEvent.isComposing&&void Oa()})]}),s.jsx("p",{className:"cf-hint",children:s.jsx(xm,{text:u.chat.customHint})}),ot.error&&s.jsxs("p",{className:"cf-error",children:[s.jsx(Q,{name:"warn",size:14})," ",ot.error]}),s.jsxs("div",{className:"dialog-actions",children:[s.jsx("button",{onClick:()=>Pe(null),children:u.chat.cancel}),s.jsx("button",{className:"primary",disabled:!ot.name.trim()||!ot.command.trim(),onClick:()=>void Oa(),children:u.chat.customSave})]})]})}),document.body),s.jsx("div",{className:"chat-list",ref:on,"aria-live":"polite",onScroll:$=>k($.currentTarget.scrollTop>0),children:ee.length===0?s.jsxs("div",{className:"chat-empty",children:[s.jsx("p",{children:u.chat.intro(Ea)}),s.jsx("div",{className:"chat-suggest",children:u.chat.suggestions.map($=>s.jsx("button",{className:"btn",onClick:()=>{n.setDraft($.text),ze($.n)},children:$.label},$.label))})]}):ee.map(($,I)=>{var Le;return $.role==="restart"?s.jsx("div",{className:"restart",role:"separator",children:u.chat.restarted(Jy($.at))},I):$.role==="user"?s.jsxs("div",{className:"msg user",children:[$.chips.length>0&&s.jsx("div",{className:"chips",children:$.chips.map((we,Me)=>s.jsx("span",{className:"chip",children:we},Me))}),s.jsx("div",{className:"bubble",children:$.text})]},I):s.jsxs("div",{className:`msg ai ${$.status}`,children:[s.jsxs("div",{className:"msg-head",children:[s.jsx("strong",{children:$.label??rr[$.agent]??$.agent}),$.status==="running"&&($.parts.some(we=>we.t==="perm"&&!we.decision)?s.jsxs("span",{className:"waiting",children:[s.jsx("span",{className:"pulse","aria-hidden":"true"}),u.chat.waiting]}):s.jsx("span",{className:"spinner",role:"img","aria-label":u.chat.running})),$.status==="cancelled"&&s.jsx("span",{className:"muted",children:u.chat.cancelled}),$.status==="error"&&s.jsxs("span",{className:"oc-failed",children:[s.jsx(Q,{name:"warn",size:14}),u.chat.failed]}),$.status==="done"&&$.cost!=null&&s.jsxs("span",{className:"muted small",children:["$",$.cost.toFixed(3)]})]}),(Le=$.variants)!=null&&Le.length?s.jsxs("button",{className:"btn oc-variants",onClick:()=>n.onLocate($.variants),children:[s.jsx(Q,{name:"board",size:14})," ",u.chat.madeVariants($.variants.length)]}):null,ac($,I===ee.length-1),$.status==="running"&&!$.parts.length&&s.jsx("div",{className:"muted oc-thinking",children:u.chat.thinking}),u.chat.noPause[$.agent]&&$.parts.some(we=>we.t==="tool")&&s.jsx("p",{className:"ai-note",children:u.chat.noPause[$.agent]}),$.status!=="running"&&$.step&&tn($)]},I)})}),_n&&s.jsxs("div",{className:"remedy",role:"status",children:[s.jsx(Q,{name:"warn",size:16}),s.jsxs("div",{children:[s.jsx("p",{children:s.jsx(xm,{text:_n.text})}),s.jsxs("div",{className:"btn-row",children:[_n.cmd&&s.jsxs("button",{className:"btn",onClick:()=>cn("cmd",_n.cmd),title:_n.cmd,children:[s.jsx(Q,{name:"copy",size:14})," ",V==="cmd"?u.chat.copied:u.chat.copyCommand]}),s.jsx("button",{className:"btn",disabled:f,onClick:()=>_e(),children:f?u.chat.checking:u.chat.checkAgain})]})]})]}),s.jsxs("div",{className:"composer",onDragOver:$=>$.preventDefault(),onDrop:$=>{$.preventDefault(),$.dataTransfer.files.length&&is($.dataTransfer.files)},children:[fr&&s.jsxs("div",{className:"run-status",role:"status",children:[s.jsxs("span",{className:"waiting",children:[s.jsx("span",{className:"pulse","aria-hidden":"true"}),u.chat.waiting]}),s.jsxs("span",{className:"muted",children:["· ",u.chat.waitingHint]})]}),s.jsxs("div",{className:"chips",children:[n.selection&&s.jsx(ju,{on:Oe,onToggle:()=>Ye($=>!$),icon:"select",label:u.chat.chipElementText(n.selection.tag,n.selection.text.slice(0,14))}),n.boards.length>0&&s.jsx(ju,{on:ue,onToggle:()=>pt($=>!$),icon:"board",label:n.boards.length===1?n.titleOf(n.boards[0]):u.chat.chipBoards(n.boards.length)}),n.visibleCount>0&&s.jsx(ju,{on:Fe,onToggle:()=>me($=>!$),icon:"fit",label:u.chat.chipVisible(n.visibleCount)}),n.attach.comments.map($=>s.jsx(ju,{on:!0,icon:"comment",label:u.chat.chipComment($.text.slice(0,14)),onRemove:()=>n.setAttach(I=>({...I,comments:I.comments.filter(Le=>Le.id!==$.id)}))},$.id)),n.attach.refs.map(($,I)=>s.jsx(ju,{on:!0,icon:$.kind==="url"?"link":"file",label:$.name??$.value,onRemove:()=>n.setAttach(Le=>({...Le,refs:Le.refs.filter((we,Me)=>Me!==I)}))},I))]}),qe!=null&&s.jsx("div",{className:"url-row",children:s.jsx("input",{autoFocus:!0,value:qe,placeholder:"https://","aria-label":u.chat.refLink,onChange:$=>Ve($.target.value),onKeyDown:$=>{$.nativeEvent.isComposing||($.key==="Enter"&&/^https?:\/\/\S+$/.test(qe.trim())&&(n.setAttach(I=>({...I,refs:[...I.refs,{kind:"url",value:qe.trim()}]})),Ve(null)),$.key==="Escape"&&Ve(null))}})}),K&&n.draft.trim()&&s.jsx("span",{className:"restored muted small",children:u.chat.restored}),s.jsx("textarea",{ref:n.inputRef,value:n.draft,rows:3,placeholder:ie?u.chat.placeholderRunning:u.chat.placeholder,"aria-label":u.chat.input,onChange:$=>n.setDraft($.target.value),onPaste:$=>{const I=Array.from($.clipboardData.files);I.length&&($.preventDefault(),is(I))},onKeyDown:$=>{$.nativeEvent.isComposing||$.keyCode===229||($.key==="Enter"&&!$.shiftKey&&($.preventDefault(),Ls()),$.key==="Escape"&&(ie?ml():$.target.blur()))}}),re&&s.jsxs("p",{className:"warn small oc-err",children:[s.jsx(Q,{name:"warn",size:14})," ",re]}),St&&!ie&&s.jsxs("p",{className:"send-why",children:[s.jsx(Q,{name:"warn",size:14})," ",St]}),s.jsxs("div",{className:"composer-bar",children:[s.jsx("button",{className:"icon-btn sm","aria-label":u.chat.attach,title:u.chat.attachTitle,onClick:()=>{var $;return($=fn.current)==null?void 0:$.click()},children:s.jsx(Q,{name:"plus",size:14})}),s.jsx("button",{className:"icon-btn sm","aria-label":u.chat.addLink,title:u.chat.addLink,onClick:()=>Ve(""),children:s.jsx(Q,{name:"link",size:14})}),s.jsx("input",{ref:fn,type:"file",multiple:!0,hidden:!0,accept:"image/*,.pdf,.md,.txt,.html,.csv,.json",onChange:$=>$.target.files&&void is($.target.files)}),s.jsx("label",{className:"variants",title:Lt?u.chat.variantsTitle:u.chat.variantsDisabledTitle,children:s.jsxs("select",{value:Ae,disabled:!Lt||!!ie,onChange:$=>ze(Number($.target.value)),"aria-label":u.chat.variantsAria,children:[s.jsx("option",{value:1,children:u.chat.variants(1)}),s.jsx("option",{value:2,children:u.chat.variants(2)}),s.jsx("option",{value:3,children:u.chat.variants(3)}),s.jsx("option",{value:4,children:u.chat.variants(4)})]})}),s.jsx("div",{className:"spacer"}),ie?s.jsxs("button",{className:"btn oc-cancel",title:u.chat.cancelTitle,onClick:ml,children:[s.jsx(Q,{name:"close",size:14})," ",u.chat.cancel]}):s.jsx("button",{className:"primary",disabled:!n.draft.trim()||!!St,title:St??void 0,onClick:()=>void Ls(),children:u.chat.send})]})]}),Ht&&bm.createPortal(s.jsx(Bb,{before:J0(Ht.id),boards:Ht.boards,onClose:()=>Be(null)}),document.body)]})}function ju({on:n,onToggle:o,onRemove:i,icon:f,label:m}){return s.jsxs("span",{className:`chip ${n?"on":"off"}`,children:[s.jsxs("button",{className:"chip-main",onClick:o,disabled:!o,"aria-pressed":o?n:void 0,title:o?n?u.chat.chipRemoveTitle:u.chat.chipAddTitle:void 0,children:[s.jsx(Q,{name:f,size:12}),s.jsx("span",{children:m})]}),i&&s.jsx("button",{className:"chip-x","aria-label":u.chat.remove(m),onClick:i,children:s.jsx(Q,{name:"close",size:12})})]})}function x1(n,o,i,f=8){const m=typeof f=="number"?{above:f,below:f}:f;let p=!1,b=n.y-m.above-o.h;if(typeof f!="number"&&f.side==="right"){const N=Math.min(o.h,36),j=Math.max(i.left,Math.min(n.x+n.w+m.above,i.right-o.w)),E=Math.max(i.top,Math.min(n.y+n.h/2-N/2,i.bottom-o.h));return{x:Math.round(j),y:Math.round(E),below:!0}}if(typeof f!="number"&&f.first==="below"&&n.y+n.h+m.below+o.h<=i.bottom)return{...Nf(n,o,i),y:Math.round(Math.max(i.top,n.y+n.h+m.below)),below:!0};if(b<i.top){const N=n.y+n.h+m.below;N+o.h<=i.bottom?(b=N,p=!0):b=i.top}return b=Math.max(i.top,Math.min(b,i.bottom-o.h)),{...Nf(n,o,i),y:Math.round(b),below:p}}function w1(n,o,i,f,m,p=[],b=24){const N=Math.round(Math.max(f.top,Math.min(n.y+n.h/2-i.h/2,f.bottom-i.h))),j=k=>k>=f.left&&k+i.w<=f.right&&!p.some(z=>k<z.x+z.w&&z.x<k+i.w&&N<z.y+z.h&&z.y<N+i.h),E=o.x+o.w+b;if(j(E))return{x:Math.round(E),y:N,below:!0,side:"right"};const S=o.x-b-i.w;if(j(S))return{x:Math.round(S),y:N,below:!0,side:"left"};const w=n.y-8-i.h;return!m&&w>=Math.max(f.top,o.y)?{...Nf(n,i,f),y:Math.round(w),below:!1,side:"above"}:{...Nf(n,i,f),y:Math.round(Math.max(f.top,Math.min(n.y+n.h+8,f.bottom-i.h))),below:!0,side:"below"}}const Nf=(n,o,i)=>({x:Math.round(Math.max(i.left,Math.min(n.x+n.w/2-o.w/2,i.right-o.w)))});function Hu(n,o,i,f,m=8,p,b){const N=v.useRef({target:i,bounds:f,gap:m,avoid:p,placer:b});N.current={target:i,bounds:f,gap:m,avoid:p,placer:b};const j=()=>{const E=n.current;if(!E)return;const S=N.current.target();if(!S){E.style.visibility="hidden";return}const w={w:E.offsetWidth,h:E.offsetHeight},k=N.current.placer?N.current.placer(S,w,N.current.bounds):x1(S,w,N.current.bounds,N.current.gap);if(N.current.avoid)for(const z of document.querySelectorAll(N.current.avoid)){if(z===E)break;if(z.style.visibility==="hidden")continue;const R=parseFloat(z.style.left),K=parseFloat(z.style.top);k.x<R+z.offsetWidth&&R<k.x+E.offsetWidth&&k.y<K+z.offsetHeight&&K<k.y+E.offsetHeight&&(k.y=k.below?K+z.offsetHeight+6:K-6-E.offsetHeight)}E.style.left=`${k.x}px`,E.style.top=`${k.y}px`,E.style.visibility="",E.dataset.below=k.below?"true":"false"};return v.useLayoutEffect(j),v.useEffect(()=>o.subscribe(j),[o]),j}const Eu={above:28,below:12},ya=u.inline;function j1(n){const o=v.useRef(null),i=v.useRef(null),[f,m]=v.useState(n.initial??""),[p,b]=v.useState(!1),[N,j]=v.useState(null),E=Math.min(380,n.bounds.right-n.bounds.left),S=Hu(o,n.store,n.target,n.bounds,n.gap??8);v.useEffect(()=>{var k;return(k=i.current)==null?void 0:k.focus()},[]),v.useEffect(()=>{const k=i.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,132)}px`,S())},[f]),v.useEffect(()=>{const k=z=>{var R,K;(R=o.current)!=null&&R.contains(z.target)||(K=i.current)!=null&&K.value.trim()||n.onClose()};return window.addEventListener("pointerdown",k,!0),()=>window.removeEventListener("pointerdown",k,!0)},[]);const w=async()=>{const k=f.trim();if(!k||p)return;b(!0),j(null);const z=await n.onSend(k);b(!1),z!=null&&j(z||null)};return s.jsxs("div",{ref:o,className:"oc-ask oc-anchored",role:"dialog","aria-label":ya.title,style:{width:E},onPointerDown:k=>k.stopPropagation(),children:[s.jsxs("div",{className:"oc-ask-top",children:[s.jsx("span",{className:"oc-ask-about",title:n.about,children:n.about}),n.onHistory&&s.jsx("button",{className:"link oc-ask-history",onClick:n.onHistory,children:ya.history})]}),s.jsxs("div",{className:"oc-ask-row",children:[s.jsx("textarea",{ref:i,rows:1,value:f,placeholder:ya.placeholder,"aria-label":ya.title,onChange:k=>m(k.target.value),onKeyDown:k=>{k.stopPropagation(),!(k.nativeEvent.isComposing||k.keyCode===229)&&(k.key==="Enter"&&!k.shiftKey?(k.preventDefault(),w()):k.key==="Escape"&&(k.preventDefault(),n.onClose()))}}),s.jsx("button",{className:`oc-ask-send ${f.trim()?"is-ready":""}`,disabled:!f.trim()||p,onClick:()=>void w(),children:n.sendLabel??ya.send})]}),N&&s.jsxs("p",{className:"oc-ask-err",children:[s.jsx(Q,{name:"warn",size:14})," ",N]})]})}function N1(n){const o=v.useRef(null);return Hu(o,n.store,n.target,n.bounds,n.gap??8),s.jsx("div",{ref:o,className:"oc-result oc-anchored is-running",role:"status","aria-label":ya.running,onPointerDown:i=>i.stopPropagation(),children:s.jsxs("div",{className:"oc-result-head",children:[s.jsx("span",{className:"spinner","aria-hidden":"true"}),s.jsx("p",{className:"oc-result-text",children:ya.running}),s.jsx("button",{className:"link oc-result-open",onClick:n.onOpen,children:ya.open})]})})}function S1(n){const o=v.useRef(null),[i,f]=v.useState(!1);Hu(o,n.store,n.target,n.bounds,n.gap??8),v.useEffect(()=>{const p=b=>{var N;return!((N=o.current)!=null&&N.contains(b.target))&&n.onClose()};return window.addEventListener("pointerdown",p,!0),()=>window.removeEventListener("pointerdown",p,!0)},[]);const m=n.reply||(n.status==="done"?ya.done:n.status==="cancelled"?ya.cancelled:ya.failed);return s.jsxs("div",{ref:o,className:`oc-result oc-anchored is-${n.status}`,role:"status","aria-label":ya.result,onPointerDown:p=>p.stopPropagation(),children:[s.jsxs("div",{className:"oc-result-head",children:[s.jsx("span",{className:`dot ${n.status==="done"?"ok":"bad"}`,"aria-hidden":"true"}),s.jsx("p",{className:"oc-result-text",children:m}),s.jsx("button",{className:"icon-btn sm","aria-label":ya.close,title:ya.close,onClick:n.onClose,children:s.jsx(Q,{name:"close",size:14})})]}),s.jsxs("div",{className:"oc-result-acts",children:[n.onUndo&&n.status==="done"&&s.jsx("button",{className:"btn",disabled:i,onClick:()=>void n.onUndo().then(()=>{f(!0)}),children:i?ya.undone:ya.undo}),s.jsx("button",{className:"btn",onClick:n.onOpen,children:ya.open})]})]})}const Mf=n=>(n==null?void 0:n.querySelector("script[data-dc-probe]"))??null;function Jm(n,o){const i=n!=null&&n.isConnected?n.contentDocument:null;if(!i||i.readyState!=="complete"||!i.body)return null;try{if(decodeURIComponent(i.location.pathname)!==`/screens/${o}`)return null}catch{return null}return i}function qb(n,o){const i=Mf(Jm(n,o));return!i||i.hasAttribute("data-dc-dirty")?null:i.getAttribute("data-dc-src")}const Wy=(n,o)=>{var i;return!!((i=Mf(Jm(n,o)))!=null&&i.hasAttribute("data-dc-patched"))},k1=n=>{var o;return(o=Mf(n))==null?void 0:o.setAttribute("data-dc-dirty","")};function T1(n,o,i){var b;if(!((b=i.live)!=null&&b.length)||!i.base||!i.hash||i.forked)return!1;const f=Jm(n,o);if(!f||qb(n,o)!==i.base)return!1;const m=i.live.map(N=>dn(f,N.path));if(m.some((N,j)=>!N||N===f.body||N.localName!==i.live[j].tag||N.namespaceURI!=="http://www.w3.org/1999/xhtml"))return!1;i.live.forEach((N,j)=>{const E=m[j];for(const[S,w]of N.attrs??[])w==null?E.removeAttribute(S):E.setAttribute(S,w);N.inner!=null&&(E.innerHTML=N.inner)});const p=Mf(f);return p.setAttribute("data-dc-src",i.hash),p.setAttribute("data-dc-patched",""),n.dispatchEvent(new CustomEvent("dc-patched")),!0}function C1(){const n=new Map,o=new Map,i=new Map;return{begin(f){n.set(f,(n.get(f)??0)+1)},end(f){const m=(n.get(f)??1)-1;if(m>0)return n.set(f,m),[];n.delete(f);const p=o.get(f)??[];return o.delete(f),p},patched(f,m,p){const b=i.get(f)??new Set;b.add(m).add(p),i.set(f,b)},reset(f){i.delete(f)},decide(f,m,p,b=!1){var N;return n.get(f)?(o.set(f,[...o.get(f)??[],m]),"queue"):m?b?m===p.shown?"keep":"reload":!p.patched||!p.shown?"reload":m===p.shown?"keep":(N=i.get(f))!=null&&N.has(m)?"check":"reload":"reload"}}}function E1(n){const[o,i]=v.useState(null);return v.useEffect(()=>{xe.get("/api/tokens").then(i).catch(()=>{})},[n]),o}const Vb=n=>Object.entries((n==null?void 0:n.themes[n.active])??{}).map(([o,i])=>({name:o,value:i}));function Sf(n){const o=n.trim().toLowerCase();let i=o.match(/^#([0-9a-f]{3,8})$/);if(i){let f=i[1];return f.length<=4&&(f=[...f].map(m=>m+m).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 i=o.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+))?\s*\)$/),i?[Number(i[1]),Number(i[2]),Number(i[3]),i[4]==null?1:Number(i[4])]:o==="transparent"?[0,0,0,0]:null}const eb=([n,o,i])=>{const f=m=>{const p=m/255;return p<=.03928?p/12.92:((p+.055)/1.055)**2.4};return .2126*f(n)+.7152*f(o)+.0722*f(i)};function yf(n,o){const i=Sf(n),f=Sf(o);if(!i||!f)return null;const[m,p]=[eb(i),eb(f)].sort((b,N)=>N-b);return(m+.05)/(p+.05)}const Rm=n=>{const o=Sf(n);return o&&o[3]===1?"#"+o.slice(0,3).map(i=>Math.round(i).toString(16).padStart(2,"0")).join("").toUpperCase():null};function tb(n,o,i){if(!(i!=null&&i.registered)||!o)return null;const f=new Set(Vb(i).map(p=>Rm(p.value)));if(/^(color|background|background-color|border-color)$/.test(n)){const p=Rm(o);if(p&&!f.has(p))return u.checks.colorNotInTokens}const m=[...o.matchAll(/(-?\d+(?:\.\d+)?)px/g)].map(p=>Number(p[1]));return n==="font-size"&&m.some(p=>!i.fontSizes.includes(p))?u.checks.tokenFontSizes(i.fontSizes.join("·")):n==="border-radius"&&m.some(p=>!i.radii.includes(p)&&p<999)?u.checks.tokenRadii(i.radii.join("·")):/^(gap|padding|margin)/.test(n)&&m.some(p=>p%4!==0)?u.checks.notMultipleOf4:n==="font-weight"&&/^\d+$/.test(o)&&!i.fontWeights.includes(Number(o))?u.checks.tokenWeights(i.fontWeights.join("·")):null}function M1(n,o=48){var E,S;const i=n.defaultView,f=[],m=w=>{for(let k=w;k&&k.nodeType===1;k=k.parentElement){const z=i.getComputedStyle(k),R=Sf(z.backgroundColor);if(z.backgroundImage!=="none")return"";if(R&&R[3]>.5)return z.backgroundColor}return"rgb(255,255,255)"},p=w=>{const k=w.getBoundingClientRect(),z=i.getComputedStyle(w);return k.width>0&&k.height>0&&z.visibility!=="hidden"&&z.display!=="none"},b=n.body.querySelectorAll("a[href], button, input:not([type=hidden]), select, textarea, [role=button], [role=tab], [onclick]");for(const w of Array.from(b)){if(!p(w))continue;const k=hl(w);if(k==null)continue;const z=w.getBoundingClientRect();z.width<o&&z.height<o&&f.push({path:k,kind:"target",message:u.checks.smallTarget(w.tagName.toLowerCase(),Math.round(z.width),Math.round(z.height),o)});const R=(w.getAttribute("aria-label")||w.getAttribute("title")||w.getAttribute("placeholder")||w.innerText||((E=w.querySelector("img[alt]"))==null?void 0:E.getAttribute("alt"))||"").trim(),K=w.getAttribute("aria-labelledby")||w.id&&n.querySelector(`label[for="${w.id}"]`)||w.closest("label");!R&&!K&&f.push({path:k,kind:"label",message:u.checks.noName(w.tagName.toLowerCase())})}for(const w of Array.from(n.body.querySelectorAll("img")))if(!w.hasAttribute("alt")&&p(w)){const k=hl(w);k!=null&&f.push({path:k,kind:"label",message:u.checks.noAlt})}const N=n.createTreeWalker(n.body,NodeFilter.SHOW_TEXT),j=new Set;for(let w=N.nextNode();w;w=N.nextNode()){const k=w.parentElement;if(!k||j.has(k)||!((S=w.textContent)!=null&&S.trim())||/^(SCRIPT|STYLE)$/.test(k.tagName)||!p(k))continue;j.add(k);const z=i.getComputedStyle(k),R=m(k);if(!R)continue;const K=yf(z.color,R);if(K==null)continue;const B=parseFloat(z.fontSize),M=B>=24||B>=18.66&&Number(z.fontWeight)>=700?3:4.5;if(K<M){const X=hl(k);X!=null&&f.push({path:X,kind:"contrast",message:u.checks.lowContrast(K.toFixed(2),M,w.textContent.trim().slice(0,16))})}}return f}function A1({tokens:n,onSave:o}){const[i,f]=v.useState(n);v.useEffect(()=>f(n),[n]);const m=i.themes[i.active]??{},p=JSON.stringify(i)!==JSON.stringify(n)||!n.registered,b=j=>f({...i,themes:{...i.themes,[i.active]:j}}),N=(j,E)=>s.jsxs("label",{className:"field-row tok-list",children:[s.jsx("span",{children:E}),s.jsx("input",{defaultValue:i[j].join(", "),"aria-label":E,onBlur:S=>f({...i,[j]:S.target.value.split(/[,\s]+/).map(Number).filter(w=>Number.isFinite(w))})},i[j].join())]});return s.jsxs("div",{className:"tokens",children:[s.jsxs("label",{className:"upload small",children:[s.jsx(Q,{name:"plus",size:14})," ",u.tokens.import,s.jsx("input",{type:"file",hidden:!0,accept:".json,application/json",onChange:async j=>{var S;const E=(S=j.target.files)==null?void 0:S[0];if(E)try{f($1(JSON.parse(await E.text()),i))}catch(w){alert(u.tokens.importFailed(w.message))}}})]}),s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:u.tokens.theme}),s.jsx("button",{className:"icon-btn sm","aria-label":u.tokens.addTheme,title:u.tokens.addTheme,onClick:()=>{let j=u.tokens.newTheme;for(let E=2;i.themes[j];E++)j=u.tokens.newThemeN(E);f({...i,themes:{...i.themes,[j]:{...m}},active:j})},children:s.jsx(Q,{name:"plus",size:14})})]}),s.jsxs("div",{className:"theme-row",children:[s.jsx("select",{value:i.active,onChange:j=>f({...i,active:j.target.value}),"aria-label":u.tokens.activeTheme,children:Object.keys(i.themes).map(j=>s.jsx("option",{children:j},j))}),s.jsx("input",{defaultValue:i.active,"aria-label":u.tokens.themeName,onBlur:j=>{const E=j.target.value.trim();if(!E||E===i.active||i.themes[E])return;const{[i.active]:S,...w}=i.themes;f({...i,themes:{...w,[E]:S},active:E})}},i.active)]}),s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:u.tokens.colors(Object.keys(m).length)}),s.jsx("button",{className:"icon-btn sm","aria-label":u.tokens.addColor,title:u.tokens.addColor,onClick:()=>b({...m,[u.tokens.colorN(Object.keys(m).length+1)]:"#111111"}),children:s.jsx(Q,{name:"plus",size:14})})]}),s.jsx("ul",{className:"tok-colors",children:Object.entries(m).map(([j,E])=>{var S;return s.jsxs("li",{children:[s.jsx("input",{type:"color",value:((S=Rm(E))==null?void 0:S.toLowerCase())??"#000000","aria-label":u.tokens.colorOf(j),onChange:w=>b({...m,[j]:w.target.value.toUpperCase()})}),s.jsx("input",{defaultValue:j,"aria-label":u.tokens.colorName,onBlur:w=>{const k=w.target.value.trim();!k||k===j||m[k]||b(Object.fromEntries(Object.entries(m).map(([z,R])=>z===j?[k,R]:[z,R])))}}),s.jsx("code",{children:E}),s.jsx("button",{className:"icon-btn sm danger","aria-label":u.tokens.remove(j),onClick:()=>b(Object.fromEntries(Object.entries(m).filter(([w])=>w!==j))),children:s.jsx(Q,{name:"close",size:12})})]},j)})}),N("fontSizes",u.tokens.fontSizes),N("fontWeights",u.tokens.fontWeights),N("radii",u.tokens.radii),N("spacing",u.tokens.spacing),s.jsxs("label",{className:"field-row tok-list",children:[s.jsx("span",{children:u.tokens.touchTarget}),s.jsx("input",{type:"number",value:i.minTarget,onChange:j=>f({...i,minTarget:Number(j.target.value)||48}),"aria-label":u.tokens.minTouchTarget})]}),s.jsx("button",{disabled:!p,title:u.tokens.saveTitle,onClick:()=>o(i,n.registered?u.history.saveTokens:u.history.registerTokens),children:n.registered?u.tokens.save:u.tokens.register}),s.jsx("p",{className:"muted small",children:n.registered?u.tokens.registeredHint:u.tokens.defaultHint})]})}function $1(n,o){const i=n;if(i&&typeof i=="object"&&i.themes&&typeof i.themes=="object")return{...o,...i,active:i.active??Object.keys(i.themes)[0]};const f={},m=(p,b)=>{if(typeof p=="string"&&/^#|^rgb/i.test(p))f[b]=p.toUpperCase();else if(p&&typeof p=="object"){const N=p.value??p.$value;if(typeof N=="string")m(N,b);else for(const[j,E]of Object.entries(p))m(E,b?`${b} ${j}`:j)}};if(m(n,""),!Object.keys(f).length)throw new Error(u.tokens.noColors);return{...o,themes:{...o.themes,[u.tokens.importedTheme]:f},active:u.tokens.importedTheme}}function nb({title:n,items:o,empty:i,onPick:f,onAskAI:m}){return s.jsxs("section",{className:"board-opts","aria-label":n,children:[s.jsxs("div",{className:"sec-head",children:[s.jsxs("span",{children:[n," ",o?o.length:""]}),m&&o&&o.length>0&&s.jsx("button",{className:"link",onClick:m,children:u.checks.askFix})]}),o==null?s.jsx("p",{className:"muted small",children:u.checks.notVisible}):o.length===0?s.jsxs("p",{className:"ok-line",children:[s.jsx(Q,{name:"check",size:14})," ",i]}):s.jsxs("ul",{className:"check-list",children:[o.slice(0,30).map((p,b)=>s.jsx("li",{children:s.jsxs("button",{className:"check-item",disabled:!p.path,onClick:()=>p.path&&f(p.path),title:p.path?u.checks.pickInEdit(p.path):u.checks.line(p.line),children:[s.jsx(Q,{name:"warn",size:12}),s.jsx("span",{children:p.message}),s.jsx("code",{children:p.path??u.checks.line(p.line)})]})},b)),o.length>30&&s.jsx("li",{className:"muted small",children:u.checks.more(o.length-30)})]})]})}function z1({onSetUp:n}){const o=v.useRef(null);return v.useLayoutEffect(()=>ns(o.current,".btn"),[]),s.jsxs("div",{ref:o,className:"oc-tc-off",role:"note","aria-label":u.checks.tokensOffTitle,children:[s.jsx(Q,{name:"info",size:16}),s.jsxs("div",{children:[s.jsx("strong",{children:u.checks.tokensOffTitle}),s.jsx("p",{children:u.checks.tokensOffBody})]}),s.jsx("button",{className:"btn",onClick:n,children:u.checks.setUpTokens})]})}function Ou(n){const o=n==null?void 0:n.getElementById("board-tweaks");if(!o)return null;try{return JSON.parse(o.textContent??"")}catch{return null}}function ab(n,o,i){k1(n);const f=i.type==="boolean"?i.value?"1":"0":String(i.value)+(i.type==="number"&&i.unit?i.unit:"");i.var&&n.documentElement.style.setProperty(i.var,f),n.documentElement.setAttribute(`data-tweak-${o}`,i.type==="boolean"?i.value?"on":"off":String(i.value))}function O1({doc:n,onSave:o}){const[i,f]=v.useState(()=>Ou(n)),[m,p]=v.useState(()=>JSON.stringify(Ou(n)));if(v.useEffect(()=>{const j=Ou(n);f(j),p(JSON.stringify(j))},[n]),!i)return null;const b=(j,E)=>{const S={...i,[j]:{...i[j],value:E}};f(S),n&&ab(n,j,S[j])},N=JSON.stringify(i)!==m;return s.jsxs("section",{className:"tweaks","aria-label":u.tabs.tweaks,children:[Object.entries(i).map(([j,E])=>{const S=E.label??j;return s.jsxs("div",{className:"pp-row tw-row",children:[s.jsx("span",{className:"pp-l",title:E.var??j,children:S}),s.jsx("span",{className:"pp-v",children:E.type==="boolean"?s.jsx("button",{type:"button",role:"switch","aria-checked":!!E.value,"aria-label":S,className:`switch ${E.value?"on":""}`,onClick:()=>b(j,!E.value)}):E.type==="color"?s.jsxs("span",{className:"tw-color",children:[s.jsx("label",{className:"sw-btn",style:{background:String(E.value)},children:s.jsx("input",{type:"color",value:/^#[0-9a-f]{6}$/i.test(String(E.value))?String(E.value):"#000000",onChange:w=>b(j,w.target.value.toUpperCase()),"aria-label":S})}),s.jsx("input",{className:"tw-hex",value:String(E.value),"aria-label":`${S} (hex)`,spellCheck:!1,onChange:w=>b(j,w.target.value)})]}):E.type==="enum"?s.jsx("select",{value:String(E.value),onChange:w=>b(j,w.target.value),"aria-label":S,children:(E.options??[]).map(w=>s.jsx("option",{children:w},w))}):E.type==="number"?s.jsxs("span",{className:"num tw-num",children:[s.jsx("input",{type:"number",min:E.min,max:E.max,step:E.step??1,value:Number(E.value),onChange:w=>w.target.value!==""&&b(j,Number(w.target.value)),"aria-label":S}),E.unit&&s.jsx("span",{children:E.unit})]}):s.jsx("input",{value:String(E.value),onChange:w=>b(j,w.target.value),"aria-label":S})})]},j)}),N&&s.jsxs("div",{className:"tw-foot",children:[s.jsx("button",{className:"btn",onClick:()=>{const j=JSON.parse(m);if(f(j),n)for(const[E,S]of Object.entries(j))ab(n,E,S)},children:u.tweaks.revert}),s.jsx("button",{className:"btn primary",onClick:()=>void o(Object.fromEntries(Object.entries(i).map(([j,E])=>[j,E.value]))).then(()=>p(JSON.stringify(i))),children:u.tweaks.save})]})]})}const zt=u.select,Hs=u.design,Gb=n=>n!=null&&n.registered?Vb(n):[];function R1(n){const o={};if(!(n!=null&&n.documentElement))return o;const i=f=>{for(let m=0;m<f.length;m++)f[m].startsWith("--")&&(o[f[m]]=f.getPropertyValue(f[m]).trim())};for(const f of Array.from(n.styleSheets)){let m=null;try{m=f.cssRules}catch{continue}for(const p of Array.from(m??[])){const b=p;b.selectorText&&b.style&&/(^|,)\s*(:root|html|body)\s*(,|$)/.test(b.selectorText)&&i(b.style)}}return i(n.documentElement.style),o}function Yb(n,o){const i=x0(n.kind,n.styles["background-color"]);if(i==="color")return{prop:i,css:"color",value:o.color||n.styles.color||""};const f=o.background!=null?"background":"background-color";return{prop:i,css:f,value:o.background||o["background-color"]||n.styles["background-color"]||""}}function Dm(n){const o=Bu(n.value,n.colors),i=ba(n.value)??(o?ba(o.value):null)??"",[f,m]=v.useState(i);v.useEffect(()=>m(i),[i]);const p=v.useRef(null);v.useEffect(()=>{var N,j;n.autoFocus&&((j=(N=p.current)==null?void 0:N.querySelector("button, input"))==null||j.focus())},[]);const b=()=>{const N=ba(f.startsWith("#")?f:`#${f}`);N&&N!==i?n.onPick(N):m(i)};return s.jsxs("div",{className:"fill-picker",ref:p,children:[s.jsxs("div",{className:"pop-top",children:[s.jsx("strong",{children:n.title}),s.jsx("span",{className:"muted",children:o?zt.tokenNow(o.name):i||Hs.none})]}),n.colors.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"pop-h",children:zt.tokens}),s.jsx("div",{className:"tok-row",role:"group","aria-label":zt.tokens,children:n.colors.map(N=>s.jsxs("button",{className:`tok ${(o==null?void 0:o.name)===N.name?"on":""}`,"aria-pressed":(o==null?void 0:o.name)===N.name,title:`${N.name} ${ba(N.value)??N.value}`,onClick:()=>n.onPick(v0(N,n.vars)),children:[s.jsx("i",{style:{background:N.value}}),s.jsx("span",{children:N.name})]},N.name))}),s.jsx("div",{className:"pop-sep"})]}),s.jsx("div",{className:"custom-row",children:s.jsx("span",{children:zt.custom})}),s.jsxs("div",{className:"hex",children:[s.jsx("input",{type:"color",className:"sw","aria-label":zt.picker,value:(ba(f)??(i||"#000000")).toLowerCase(),onChange:N=>m(N.target.value.toUpperCase()),onBlur:b}),s.jsx("input",{className:"num","aria-label":zt.hex,value:f,spellCheck:!1,onChange:N=>m(N.target.value),onBlur:b,onKeyDown:N=>{N.nativeEvent.isComposing||N.key==="Enter"&&b()}})]})]})}function uf(n){const[o,i]=v.useState(n.value);v.useEffect(()=>i(n.value),[n.value]);const f=()=>o.trim()!==n.value.trim()&&n.onCommit(o.trim());return s.jsxs("div",{className:"pop-field",children:[s.jsx("span",{className:"pop-h",title:n.css,children:n.label}),n.chips&&n.chips.length>0&&s.jsx("span",{className:"chips-row",children:n.chips.map(m=>s.jsx("button",{className:`tchip ${Fa(n.value||n.placeholder)===String(m)?"on":""}`,onClick:()=>n.onCommit(String(m)),children:m},m))}),s.jsxs("span",{className:"stepper",children:[s.jsx("button",{className:"icon-btn sm","aria-label":zt.decrease(n.label),onClick:()=>n.onStep(-1),children:s.jsx(Q,{name:"minus",size:14})}),s.jsx("input",{"aria-label":n.label,title:n.css,value:o,placeholder:n.placeholder,onChange:m=>i(m.target.value),onBlur:f,onKeyDown:m=>{m.nativeEvent.isComposing||m.key==="Enter"&&f()}}),s.jsx("button",{className:"icon-btn sm","aria-label":zt.increase(n.label),onClick:()=>n.onStep(1),children:s.jsx(Q,{name:"plus",size:14})})]})]})}const df=n=>/^-?\d+(?:\.\d+)?$/.test(n)?`${Number(n)}px`:n;function D1(n){var H,se,ve,Ce,Qe,de;const o=n.selection,i=v.useRef(null),f=v.useRef(null),[m,p]=v.useState({w:420,h:36}),b=v.useRef(0),[N,j]=v.useState(null),[E,S]=v.useState(null),[w,k]=v.useState(0),z=v.useRef([]),[R,K]=v.useState({});v.useEffect(()=>K({}),[o.hash,o.path,o.file]);const B=U=>R[U]??n.inline[U]??o.styles[U]??"",V=(U,ae)=>{K(ge=>({...ge,[U]:ae})),n.onStyle(U,ae)},M={icons:(b.current||m.w)>n.bounds.right-n.bounds.left};v.useLayoutEffect(()=>{const U=i.current;U&&(ns(U),M.icons||(b.current=U.offsetWidth),(U.offsetWidth!==m.w||U.offsetHeight!==m.h)&&p({w:U.offsetWidth,h:U.offsetHeight}))}),Hu(i,n.store,n.target,n.bounds,Eu),v.useEffect(()=>N?n.store.subscribe(()=>j(null)):void 0,[N,n.store]),v.useLayoutEffect(()=>{if(!N)return S(null);const U=f.current,ae=z.current[Ye.findIndex(D=>D.pop===N)],ge=i.current;if(!U||!ae||!ge)return;const Et=ge.getBoundingClientRect(),Jt=U.offsetWidth,Ht=U.offsetHeight,Be=n.bounds,ot=Math.round(Math.max(Be.left,Math.min(Et.left+ae.offsetLeft,Be.right-Jt))),Pe=ge.dataset.below==="true",on=Et.top-8-Ht,fn=Et.bottom+8,Nn=on>=Be.top,It=fn+Ht<=Be.bottom,xa=Math.round(Pe?It?fn:Nn?on:Math.max(Be.top,Math.min(fn,Be.bottom-Ht)):Nn?on:It?fn:Math.max(Be.top,Math.min(fn,Be.bottom-Ht)));(!E||E.x!==ot||E.y!==xa)&&S({x:ot,y:xa})}),v.useEffect(()=>{if(!N)return;const U=ae=>{var Et,Jt;const ge=ae.target;(Et=f.current)!=null&&Et.contains(ge)||(Jt=i.current)!=null&&Jt.contains(ge)||j(null)};return window.addEventListener("pointerdown",U,!0),()=>window.removeEventListener("pointerdown",U,!0)},[N]);const X=Gb(n.tokens),te=!!o.text.trim(),ee=Yb(o,n.inline),ce=ee.prop==="color"?zt.textColor:zt.fill,ie=R[ee.css]??ee.value,he=ba(ie)??ba((H=Bu(ie,X))==null?void 0:H.value)??null,fe=Number(B("font-weight"))>=600,pe=B("font-style")==="italic",Oe=/underline/.test(B("text-decoration-line")||B("text-decoration")),Ye=[{id:"text",label:zt.text,icon:"title",pop:"text",disabled:!te,title:te?zt.text:zt.textOff},...te?[{id:"bold",label:zt.bold,icon:"bold",iconOnly:!0,on:fe,title:zt.bold,run:()=>V("font-weight",fe?"400":"700")},{id:"italic",label:zt.italic,icon:"italic",iconOnly:!0,on:pe,title:zt.italic,run:()=>V("font-style",pe?"normal":"italic")},{id:"underline",label:zt.underline,icon:"underline",iconOnly:!0,on:Oe,title:zt.underline,run:()=>V("text-decoration-line",Oe?"none":"underline")}]:[],{id:"fill",label:ce,pop:"fill",title:`${ce} (${ee.css})`},{id:"radius",label:zt.radius,icon:"radius",pop:"radius",title:`${Hs.cornerRadius} (border-radius)`},{id:"spacing",label:zt.spacing,icon:"spacing",pop:"spacing",title:`${Hs.padding} · ${Hs.gap}`},{id:"ask",label:zt.askAi,aria:zt.askAiAria,icon:"ai",cls:"accent",title:zt.askAiTitle,run:n.onAskAi},{id:"comment",label:zt.comment,icon:"comment",title:zt.commentTitle,run:n.onComment},{id:"more",label:zt.more,icon:"more",title:zt.more,run:()=>{var ae;const U=(ae=z.current[Ye.length-1])==null?void 0:ae.getBoundingClientRect();U&&n.onMore({clientX:U.left,clientY:U.bottom+8})}}],ue=Ye.map((U,ae)=>U.disabled?-1:ae).filter(U=>U>=0),pt=ue.includes(w)?w:ue[0],Fe=U=>{var ae;return U.pop?j(ge=>ge===U.pop?null:U.pop):(ae=U.run)==null?void 0:ae.call(U)},me=()=>{var ae;const U=Ye.findIndex(ge=>ge.pop===N);j(null),(ae=z.current[U])==null||ae.focus()},Ae=U=>{if(!U.nativeEvent.isComposing){if(U.key==="Escape"){N&&(U.preventDefault(),U.stopPropagation(),me());return}U.metaKey||U.ctrlKey||/^(Arrow|Home$|End$|Enter$| $|Delete$|Backspace$)/.test(U.key)&&U.stopPropagation()}},ze=U=>{const ae=ue.indexOf(pt),ge=Et=>{var Ht;U.preventDefault();const Jt=ue[(Et+ue.length)%ue.length];k(Jt),(Ht=z.current[Jt])==null||Ht.focus()};U.key==="ArrowRight"?ge(ae+1):U.key==="ArrowLeft"?ge(ae-1):U.key==="Home"?ge(0):U.key==="End"&&ge(ue.length-1)},qe=(se=n.tokens)!=null&&se.registered?n.tokens.fontSizes:[],Ve=[...new Set([...(ve=n.tokens)!=null&&ve.registered?n.tokens.fontWeights:[],400,500,600,700])].sort((U,ae)=>U-ae),re=(Ce=n.tokens)!=null&&Ce.registered?n.tokens.radii.filter(U=>U<999):[],Ne=(Qe=n.tokens)!=null&&Qe.registered?n.tokens.spacing.filter(U=>U<=64):[];let at=null;return N==="text"?at=s.jsxs(s.Fragment,{children:[s.jsx(uf,{label:Hs.size,css:"font-size",value:Fa(B("font-size")),chips:qe,onStep:U=>V("font-size",`${gf(B("font-size"),U,1,1)}px`),onCommit:U=>V("font-size",df(U))}),s.jsxs("label",{className:"pop-field",children:[s.jsx("span",{className:"pop-h",title:"font-weight",children:Hs.weight}),s.jsx("select",{className:"pop-select",value:String(Number(B("font-weight"))||""),onChange:U=>V("font-weight",U.target.value),children:Ve.map(U=>s.jsx("option",{value:String(U),children:Am(U,Hs.weights)},U))})]}),s.jsx("div",{className:"pop-row",role:"group","aria-label":zt.textAlign,children:[["left","textLeft"],["center","textCenter"],["right","textRight"]].map(([U,ae])=>s.jsx("button",{className:`pop-tog ${B("text-align")===U||U==="left"&&/^(start|left|)$/.test(B("text-align"))?"on":""}`,"aria-pressed":B("text-align")===U,"aria-label":zt.align(U),title:zt.align(U),onClick:()=>V("text-align",U),children:s.jsx(Q,{name:ae,size:14})},U))})]}):N==="fill"?at=s.jsx(Dm,{title:ce,value:ie,colors:X,vars:n.vars,autoFocus:!0,onPick:U=>V(ee.css,U)}):N==="radius"?at=s.jsx(uf,{label:Hs.cornerRadius,css:"border-radius",value:Fa(B("border-radius")),chips:re,onStep:U=>V("border-radius",`${gf(B("border-radius"),U)}px`),onCommit:U=>V("border-radius",df(U))}):N==="spacing"&&(at=s.jsxs(s.Fragment,{children:[s.jsx(uf,{label:Hs.padding,css:"padding",value:Mm(B("padding")),chips:Ne,onStep:U=>V("padding",w0(B("padding"),U)),onCommit:U=>V("padding",U.replace(/·/g," ").trim().split(/\s+/).map(df).join(" "))}),s.jsx(uf,{label:Hs.gap,css:"gap",value:Fa(B("gap")==="normal"?"0px":B("gap")),chips:Ne,onStep:U=>V("gap",`${gf(B("gap"),U,4)}px`),onCommit:U=>V("gap",df(U))})]})),s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:i,className:`etb oc-anchored ${M.icons?"is-icons":""}`,role:"toolbar","aria-label":zt.toolbar,"aria-orientation":"horizontal",onKeyDown:U=>{Ae(U),ze(U)},onPointerDown:U=>U.stopPropagation(),children:Ye.map((U,ae)=>s.jsxs("span",{className:"etb-item",children:[U.id==="ask"&&s.jsx("span",{className:"sep","aria-hidden":"true"}),s.jsxs("button",{ref:ge=>void(z.current[ae]=ge),className:`${U.cls??""} ${N&&N===U.pop||U.on?"on":""} ${U.iconOnly?"is-icon":""}`,tabIndex:ae===pt?0:-1,disabled:U.disabled,title:U.title,"aria-pressed":U.iconOnly?!!U.on:void 0,"aria-label":U.id==="fill"?ce:U.id==="more"||U.iconOnly?U.label:U.aria&&U.aria!==U.label?U.aria:M.icons?U.label:void 0,"aria-haspopup":U.pop?"dialog":void 0,"aria-expanded":U.pop?N===U.pop:void 0,onFocus:()=>k(ae),onClick:()=>Fe(U),children:[U.id==="fill"?s.jsx("span",{className:"sw",style:{background:he??"transparent"}}):s.jsx(Q,{name:U.icon,size:14}),U.id!=="fill"&&U.id!=="more"&&!U.iconOnly&&!M.icons&&U.label,(U.id==="text"||U.id==="fill")&&s.jsx(Q,{name:"chevronDown",size:14})]})]},U.id))}),N&&s.jsx("div",{ref:f,className:"menu pop",role:"dialog","aria-label":(de=Ye.find(U=>U.pop===N))==null?void 0:de.label,style:E?{left:E.x,top:E.y}:{visibility:"hidden",left:0,top:0},onKeyDown:Ae,onPointerDown:U=>U.stopPropagation(),children:at})]})}function B1(n){return s.jsxs("nav",{className:"crumb","aria-label":u.inspector.crumbs,children:[s.jsx("button",{className:"link",title:u.inspector.crumbBoard,onClick:n.onBoard,children:n.board}),n.skipped&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("span",{children:"…"})]}),n.parents.map(o=>s.jsxs("span",{className:"crumb-step",children:[s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("button",{className:"link",title:u.inspector.crumbParent(o.name),onClick:()=>n.onPath(o.path),children:o.name})]},o.path)),s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("b",{"aria-current":"true",title:n.title,children:n.current})]})}const H1=n=>n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",Mu=n=>`${Math.round(n)}px`;function L1(n,o,i,f,m){const p=o.style.pointerEvents;o.style.pointerEvents="none";const b=n.elementFromPoint(i,f);if(o.style.pointerEvents=p,!b||b===n.documentElement||o.contains(b))return null;const N=n.defaultView,j=X=>{const te=N.getComputedStyle(X);return/flex/.test(te.display)&&!te.flexDirection.startsWith("column")},E=/^(img|input|br|hr|textarea|select|svg|path|video|iframe)$/i,S=X=>{const te=X===n.body?"":hl(X);if(te==null)return null;const ee=j(X),ce=Array.from(X.children).filter(pe=>{var Oe;return pe!==o&&!((Oe=pe.hasAttribute)!=null&&Oe.call(pe,"data-dc-probe"))});let ie=ce.length;for(let pe=0;pe<ce.length;pe++){const Oe=Rl(ce[pe]);if(ee?i<Oe.x+Oe.w/2:f<Oe.y+Oe.h/2){ie=pe;break}}const he=Rl(X);let fe;if(ie<ce.length){const pe=Rl(ce[ie]);fe=ee?{x:pe.x-1,y:pe.y,w:2,h:pe.h}:{x:pe.x,y:pe.y-1,w:pe.w,h:2}}else if(ce.length){const pe=Rl(ce[ce.length-1]);fe=ee?{x:pe.x+pe.w,y:pe.y,w:2,h:pe.h}:{x:pe.x,y:pe.y+pe.h,w:pe.w,h:2}}else fe={x:he.x,y:he.y+he.h-2,w:he.w,h:2};return{toParentPath:te,index:ie,freeze:[],line:fe}};if(b.contains(o)||b===n.body)return S(b===n.body?n.body:b);if(m&&!E.test(b.tagName))return S(b);const w=b.parentElement,k=w===n.body?"":hl(w);if(k==null)return null;const z=j(w),R=Rl(b),K=z?i>R.x+R.w/2:f>R.y+R.h/2,V=Array.from(w.children).filter(X=>X!==o).indexOf(b)+(K?1:0),M=z?{x:K?R.x+R.w:R.x-1,y:R.y,w:2,h:R.h}:{x:R.x,y:K?R.y+R.h:R.y-1,w:R.w,h:2};return{toParentPath:k,index:V,freeze:[],line:M}}function _1(n,o,i){const f=o.parentElement;if(!f||f===n.body)return[];const m=hl(f);if(m==null||m===i)return[];const p=n.defaultView.getComputedStyle(f);if(!/flex|grid/.test(p.display))return[];const b=[],N=(S,w)=>{const k=hl(S),z=S.style,R=S.getBoundingClientRect(),K={};for(const B of w)z.getPropertyValue(B)||(K[B]=Mu(B==="width"?R.width:R.height));k!=null&&Object.keys(K).length&&b.push({path:k,props:K})};N(f,["width","height"]);const j=p.display.includes("grid"),E=!p.flexDirection.startsWith("column");for(const S of Array.from(f.children))S!==o&&N(S,j?["width","height"]:E?["width"]:["height"]);return b}function U1(n){const[o,i]=v.useState(null),[f,m]=v.useState(null),p=v.useRef(null),b=1/Math.max(n.zoom,.25),N=k=>z=>{if(z.button!==0)return;z.stopPropagation(),z.preventDefault();const R=dn(n.doc,n.path);if(!R)return;const K=n.doc.defaultView.getComputedStyle(R),B=K.position==="absolute"||K.position==="fixed",V=R.getBoundingClientRect();p.current={kind:k,sx:z.clientX,sy:z.clientY,el:R,abs:B,left:parseFloat(K.left)||0,top:parseFloat(K.top)||0,w:V.width,h:V.height,plan:null,moved:!1},z.currentTarget.setPointerCapture(z.pointerId)},j=k=>{var B,V;const z=p.current;if(!z)return;const R=(k.clientX-z.sx)/n.zoom,K=(k.clientY-z.sy)/n.zoom;if(!(!z.moved&&Math.abs(R)+Math.abs(K)<3)){if(z.moved=!0,z.kind==="move"){if(z.abs){z.el.style.left=Mu(z.left+R),z.el.style.top=Mu(z.top+K);return}m({...n.rect,x:n.rect.x+R,y:n.rect.y+K});const M=(V=(B=n.doc.defaultView)==null?void 0:B.frameElement)==null?void 0:V.getBoundingClientRect(),X=M?M.width/(n.doc.defaultView.innerWidth||M.width):n.zoom,te=M?(k.clientX-M.left)/X:n.rect.x+R,ee=M?(k.clientY-M.top)/X:n.rect.y+K,ce=L1(n.doc,z.el,te,ee,k.altKey);z.plan=ce?{toParentPath:ce.toParentPath,index:ce.index,freeze:[]}:null,i((ce==null?void 0:ce.line)??null);return}z.kind!=="s"&&(z.el.style.width=Mu(Math.max(8,z.w+R))),z.kind!=="e"&&(z.el.style.height=Mu(Math.max(8,z.h+K)))}},E=k=>{const z=p.current;if(p.current=null,i(null),m(null),!z||!z.moved)return;const R=(k.clientX-z.sx)/n.zoom,K=(k.clientY-z.sy)/n.zoom;if(z.kind==="move"){if(z.abs)return n.onPosition(Math.round(z.left+R),Math.round(z.top+K));if(!z.plan||z.plan.toParentPath===H1(n.path)&&z.plan.index===Array.from(z.el.parentElement.children).indexOf(z.el))return;n.onMove({...z.plan,freeze:_1(n.doc,z.el,z.plan.toParentPath)});return}n.onResize(Math.round(z.kind==="s"?z.w:Math.max(8,z.w+R)),Math.round(z.kind==="e"?z.h:Math.max(8,z.h+K)))},S=n.rect,w=10*b;return s.jsxs(s.Fragment,{children:[f&&s.jsx("div",{className:"drag-ghost",style:{left:f.x,top:f.y,width:f.w,height:f.h}}),o&&s.jsx("div",{className:"drop-line",style:{left:o.x,top:o.y,width:Math.max(o.w,2*b),height:Math.max(o.h,2*b)}}),s.jsx("button",{className:"el-move","aria-label":u.elementDrag.moveAria,title:u.elementDrag.moveTitle,style:{left:Math.max(0,S.x),top:S.y>=22*b?S.y-22*b:Math.max(0,S.y),transform:`scale(${b})`,transformOrigin:S.y>=22*b?"0 100%":"0 0"},onPointerDown:N("move"),onPointerMove:j,onPointerUp:E,children:s.jsx(Q,{name:"hand",size:12})}),["e","s","se"].map(k=>s.jsx("div",{className:`el-resize ${k}`,role:"slider","aria-label":k==="e"?u.elementDrag.width:k==="s"?u.elementDrag.height:u.elementDrag.size,"aria-valuetext":`${Math.round(S.w)} × ${Math.round(S.h)}`,style:{left:k==="s"?S.x+S.w/2-w/2:S.x+S.w-w/2,top:k==="e"?S.y+S.h/2-w/2:S.y+S.h-w/2,width:w,height:w,borderWidth:1.5*b},onPointerDown:N(k),onPointerMove:j,onPointerUp:E},k))]})}function q1(n,o,i,f){const m=dn(n,o),p=m==null?void 0:m.parentElement;if(!m||!p)return null;const b=n.defaultView.getComputedStyle(p),N=/flex/.test(b.display),j=N&&b.flexDirection.startsWith("column"),E=f==="left"||f==="hcenter"||f==="right",S=f==="left"||f==="top"?"start":f==="right"||f==="bottom"?"end":"center",w={start:"flex-start",center:"center",end:"flex-end"}[S],k=(z,R)=>({op:"setStyle",path:o,hash:i,prop:z,value:R});return N&&(E?j:!j)?[k("align-self",w)]:E?S==="start"?[k("margin-left","0"),k("margin-right","auto")]:S==="end"?[k("margin-left","auto"),k("margin-right","0")]:[k("margin-left","auto"),k("margin-right","auto")]:N?S==="start"?[k("margin-top","0"),k("margin-bottom","auto")]:S==="end"?[k("margin-top","auto"),k("margin-bottom","0")]:[k("margin-top","auto"),k("margin-bottom","auto")]:null}const Xb={status:"off",error:null,relay:"",links:{},guests:[]};let Bm=Xb,kf=[];const Hm=new Set,Kb=()=>Hm.forEach(n=>n()),Zb=n=>(Hm.add(n),()=>void Hm.delete(n));function Au(n){Bm=n,n.status!=="on"&&(kf=[]),Kb()}const Lm=()=>xe.get("/api/live").then(Au,()=>{});function V1(n){n.type==="live"?Lm():n.type==="live-presence"?(kf=n.peers??[],Kb()):n.type==="hello"&&Lm()}const Im=()=>v.useSyncExternalStore(Zb,()=>Bm,()=>Bm),G1=()=>v.useSyncExternalStore(Zb,()=>kf,()=>kf),_m=n=>n==="owner"?"var(--select)":n,Y1=n=>{var o;return((o=Array.from(n.trim())[0])==null?void 0:o.toUpperCase())??"?"};function X1(n,o){v.useEffect(()=>{if(!o)return;const i=document.querySelector(".canvas-wrap");if(!i)return;let f=0,m=null,p=null;const b=()=>{m=null,f=Date.now(),Oy(p)},N=E=>{const S=i.getBoundingClientRect(),w=n.get();p={x:(E.clientX-S.left-w.x)/w.zoom,y:(E.clientY-S.top-w.y)/w.zoom},!m&&(m=setTimeout(b,Math.max(0,100-(Date.now()-f))))},j=()=>{p=null,m||b()};return i.addEventListener("pointermove",N),i.addEventListener("pointerleave",j),()=>{i.removeEventListener("pointermove",N),i.removeEventListener("pointerleave",j),m&&clearTimeout(m),Oy(null)}},[n,o])}function K1({peers:n,zoom:o}){return s.jsx(s.Fragment,{children:n.map(i=>s.jsxs("div",{className:"live-cursor",style:{left:i.x,top:i.y,transform:`scale(${1/o})`,color:_m(i.color)},"aria-hidden":"true",children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:s.jsx("path",{d:"M2 1.5 L2 13 L5.2 10.2 L7.4 15 L9.4 14.1 L7.2 9.4 L11.6 9.4 Z",fill:"currentColor",stroke:"#fff",strokeWidth:"1.2",strokeLinejoin:"round"})}),s.jsx("span",{className:"live-cursor-name",style:{background:_m(i.color)},children:i.name})]},i.id))})}function Fb({people:n,max:o=3,size:i=24}){const f=n.length>o?n.slice(0,Math.max(1,o-1)):n,m=n.length-f.length;return s.jsxs("span",{className:"live-avatars",style:{"--av":`${i}px`},children:[f.map(p=>s.jsx("span",{className:"live-av",style:{background:_m(p.color)},title:p.name,children:Y1(p.name)},p.id)),m>0&&s.jsxs("span",{className:"live-av more",children:["+",m]})]})}function Z1({live:n}){return s.jsxs(s.Fragment,{children:[s.jsx("span",{className:`live-dot ${n.reconnecting?"wait":""}`,"aria-hidden":"true",title:n.reconnecting?u.live.ownerReconnectingHint:void 0}),n.guests.length?s.jsx(Fb,{people:n.guests,max:2,size:20}):s.jsx("span",{className:"share-label",children:u.share.button}),s.jsx("span",{className:"live-n",children:n.guests.length||""})]})}function lb({owner:n,onRename:o}){return s.jsxs("div",{className:"live-role live-me",children:[s.jsx("span",{children:u.live.shownAs}),s.jsx("span",{className:"live-me-name",children:n||"—"}),o&&s.jsx("button",{className:"live-rename",title:u.live.renameTitle,onClick:o,children:u.live.rename})]})}function F1({owner:n,onRename:o}){const i=Im(),f=i.status==="on";v.useEffect(()=>{f&&xe.post("/api/live/owner",{owner:n}).catch(()=>{})},[f,n]);const m=Pm(),[p,b]=v.useState("comment"),[N,j]=v.useState(!1),E=async()=>{if(!N){j(!0);try{Au(await xe.post("/api/live/start",{owner:n}))}catch(K){Au({...Xb,status:"unavailable",error:K.message})}finally{j(!1)}}},S=async()=>Au(await xe.post("/api/live/stop",{})),w=async()=>Au(await xe.post("/api/live/rotate",{role:p})),k=async K=>{try{await navigator.clipboard.writeText(K),m({tone:"ok",text:u.live.copied})}catch{m({tone:"error",text:u.live.copyFailed})}};if(i.status!=="on"){const K=i.status==="unavailable";return s.jsxs("section",{className:"live-sec","aria-label":u.live.title,children:[s.jsxs("div",{className:"live-head",children:[s.jsx("h4",{children:K?u.live.unavailable:u.live.title}),s.jsx("button",{className:"btn live-start","aria-busy":N||i.status==="connecting",onClick:()=>void E(),children:N||i.status==="connecting"?u.live.starting:K?u.live.retry:u.live.start})]}),s.jsx("p",{className:"live-note",children:K?u.live.unavailableHint(i.relay||"relay"):u.live.intro}),s.jsx(lb,{owner:n,onRename:o})]})}const z=i.links[p]??"",R=K=>K==="view"?u.live.roleView:u.live.roleComment;return s.jsxs("section",{className:"live-sec on","aria-label":u.live.title,children:[s.jsxs("div",{className:"live-head",children:[s.jsxs("h4",{children:[s.jsx("span",{className:`live-dot ${i.reconnecting?"wait":""}`,"aria-hidden":"true"}),i.reconnecting?u.live.ownerReconnecting:u.live.on]}),s.jsx("span",{className:"live-count",children:u.live.people(i.guests.length)}),s.jsx("button",{className:"btn",onClick:()=>void S(),children:u.live.stop})]}),i.reconnecting&&s.jsx("p",{className:"live-note live-wait",role:"status",children:u.live.ownerReconnectingHint}),s.jsx(lb,{owner:n,onRename:o}),s.jsxs("div",{className:"live-role",children:[s.jsx("span",{children:u.live.linkRole}),s.jsxs("div",{className:"oc-seg",role:"radiogroup","aria-label":u.live.linkRole,children:[["view","comment"].map(K=>s.jsx("button",{role:"radio","aria-checked":p===K,className:p===K?"on":"",onClick:()=>b(K),children:R(K)},K)),s.jsx("button",{role:"radio","aria-checked":!1,disabled:!0,title:u.live.roleEditSoon,children:u.live.roleEdit})]})]}),s.jsxs("div",{className:"live-link",children:[s.jsx("input",{readOnly:!0,value:z,"aria-label":u.live.linkAria(R(p)),onFocus:K=>K.currentTarget.select()}),s.jsxs("button",{className:"btn live-copy",onClick:()=>void k(z),children:[s.jsx(Q,{name:"link",size:16}),u.live.copy]})]}),i.guests.length?s.jsx("ul",{className:"live-people",children:i.guests.map(K=>s.jsxs("li",{children:[s.jsx(Fb,{people:[K],max:1,size:24}),s.jsx("span",{className:"live-name",children:K.name}),s.jsx("span",{className:"live-prole",children:R(K.role)})]},K.id))}):s.jsx("p",{className:"live-note",children:u.live.nobody}),s.jsxs("p",{className:"live-note",children:[u.live.endsWith," ",s.jsx("button",{className:"live-rotate",title:u.live.rotateTitle,onClick:()=>void w(),children:u.live.rotate})," ",u.live.rotateAfter]})]})}function sb(){return s.jsx("span",{className:"guest-badge",title:u.live.guestTitle,children:u.live.guest})}const be=u.requests,Ru=n=>{var o;return((o=n.request)==null?void 0:o.state)==="done"&&n.request.replyId?(n.replies??[]).find(i=>i.id===n.request.replyId):void 0},va=n=>!!n.forAgent&&!!n.request,Q1=n=>va(n)&&(n.request.state==="waiting"||n.request.state==="taken"),ob=(n,o)=>n.filter(i=>va(i)&&i.request.state==="waiting"&&(!o||i.file===o)).length,P1=()=>/\bClaude\/\d/.test(navigator.userAgent),Af=n=>u.occupancy.clock(n?Date.parse(n):Date.now());function J1(){const[n,o]=v.useState({mode:"chat",to:"any",intro:!1}),[i,f]=v.useState([]),[m,p]=v.useState(!1),b=v.useCallback(()=>{xe.get("/api/requests/settings").then(j=>(o(j),p(!0))).catch(()=>{}),xe.get("/api/agents/connected").then(j=>f(j.agents)).catch(()=>{})},[]);v.useEffect(()=>{b();const j=window.setInterval(b,6e4);return()=>window.clearInterval(j)},[b]);const N=v.useCallback(async j=>{o(E=>({...E,...j})),o(await xe.post("/api/requests/settings",j))},[]);return{settings:n,agents:i,ready:m,reload:b,save:N,host:n.mode==="host"}}function Um({comments:n}){const[o,i]=v.useState(!1);return!n.some(f=>va(f)&&f.request.state==="waiting")||n.some(f=>va(f)&&f.request.state==="taken")?null:s.jsxs("p",{className:"req-say1",children:[s.jsxs("span",{className:"req-say1-text",children:[be.sayTitle," ",s.jsx("strong",{children:be.quote(be.line)})]}),s.jsx("button",{className:"icon-btn req-say1-copy","aria-label":o?be.copied:be.copy,title:be.copyTitle,onClick:()=>void navigator.clipboard.writeText(be.line).catch(()=>{}).then(()=>{i(!0),window.setTimeout(()=>i(!1),1400)}),children:s.jsx(Q,{name:o?"check":"copy",size:16})})]})}function Qb({req:n,inLine:o=!1}){const{settings:i,agents:f}=n,m=p=>void n.save({mode:p,intro:!0});return s.jsxs("section",{className:`req-mode ${o?"in-line":""}`,"aria-label":be.goTo,id:o?"req-mode-more":void 0,children:[!o&&s.jsx("h3",{className:"req-h",children:be.goTo}),s.jsx("div",{className:"req-opts",role:"radiogroup","aria-label":be.goTo,children:["chat","host"].map(p=>s.jsxs("button",{role:"radio","aria-checked":i.mode===p,className:`req-opt ${i.mode===p?"on":""}`,onClick:()=>m(p),children:[s.jsx("span",{className:"req-radio","aria-hidden":"true"}),s.jsxs("span",{className:"req-opt-text",children:[s.jsx("strong",{children:p==="chat"?be.easelChat:be.host}),s.jsx("span",{children:p==="chat"?be.easelChatNote:be.hostNote})]})]},p))}),i.mode==="host"&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"req-h",children:be.connected}),f.length?s.jsx("ul",{className:"req-agents",children:f.map(p=>s.jsxs("li",{children:[s.jsx("span",{className:"req-dot","aria-hidden":"true"}),s.jsx("span",{className:"req-agent",children:p.label}),s.jsxs("span",{className:"req-agent-where",children:[p.here?be.thisFolder:be.otherFolder," · ",be.since(u.occupancy.clock(p.at))]})]},p.client))}):s.jsx("p",{className:"req-note",children:be.noneConnected}),new Set(f.map(p=>p.label)).size>=2&&s.jsxs("label",{className:"req-to",children:[s.jsx("span",{children:be.sendTo}),s.jsxs("select",{value:i.to,onChange:p=>void n.save({to:p.target.value}),children:[s.jsx("option",{value:"any",children:be.anyAgent}),[...new Set(f.map(p=>p.label))].map(p=>s.jsx("option",{value:p,children:p},p))]})]})]})]})}function I1({req:n}){const[o,i]=v.useState(!1),f=n.settings.mode==="host"?be.hostShort:be.easelChatShort,m=n.agents.length;return s.jsxs("section",{className:`req-mode-line ${o?"is-open":""}`,children:[s.jsxs("button",{className:"req-line","aria-expanded":o,"aria-controls":"req-mode-more",title:be.connectedN(m),onClick:()=>i(p=>!p),children:[s.jsx("span",{className:"req-line-k",children:be.goesTo}),s.jsx("span",{className:"req-line-v",children:f}),n.host&&s.jsx("span",{className:`req-dot ${m?"":"is-off"}`,"aria-hidden":"true"}),n.host&&s.jsx("span",{className:"sr-only",children:be.connectedN(m)}),s.jsx(Q,{name:"chevronDown",size:16,className:"chev"})]}),o&&s.jsx(Qb,{req:n,inLine:!0})]})}const Pb=({c:n})=>va(n)?s.jsx("span",{className:"req-badge",children:n.forAgent===!0?be.forAi:be.forAgent(String(n.forAgent))}):null;function Jb({c:n,a:o}){var b,N;if(!va(n))return null;const i=n.request,f=n.forAgent===!0?null:String(n.forAgent),m=i.state==="done"?((b=o.undoFor)==null?void 0:b.call(o,n))??null:null,p=i.state==="waiting"?i.left?be.left(i.left):f?be.waitingFor(f):be.waiting:i.state==="taken"?be.took(i.by??"AI",Af(i.takenAt)):i.state==="failed"?i.reason??be.failed(i.by??"AI"):null;return s.jsxs("div",{className:`req-status is-${i.state}`,"data-req":n.id,children:[p&&s.jsx("span",{className:"req-state",role:"status",children:p}),i.state==="done"&&((((N=i.changed)==null?void 0:N.length)??0)>0||m||i.undo)&&s.jsxs("div",{className:"req-done",children:[(i.changed??[]).map(j=>s.jsxs("button",{className:"req-chip",title:be.changedTitle(o.titleOf(j)),onClick:()=>o.onBoard(j),children:[s.jsx(Q,{name:"board",size:14}),s.jsx("span",{className:"req-chip-title",children:o.titleOf(j)})]},j)),m&&s.jsx("button",{className:"btn oc-plain req-undo",onClick:m,children:be.undoChange}),!m&&i.undo==="undone"&&s.jsx("span",{className:"req-undone",role:"status",children:be.undone}),!m&&i.undo==="gone"&&s.jsx("span",{className:"req-undone",children:be.undoGone})]})]})}function Ib({c:n,a:o}){const[i,f]=v.useState(!1);if(!va(n))return null;const m=n.request.state;return m!=="waiting"&&m!=="failed"?null:s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn oc-plain",onClick:()=>m==="waiting"?o.onCancel(n):o.onRetry(n),children:m==="waiting"?be.cancelRequest:be.retry}),i?s.jsx("button",{className:"btn oc-plain",onClick:()=>o.onChat(n),children:be.useChat}):s.jsx("button",{className:"icon-btn req-more","aria-label":be.more,title:be.useChat,"aria-expanded":!1,onClick:()=>f(!0),children:s.jsx(Q,{name:"more",size:16})})]})}function ib({all:n,forAi:o,value:i,onChange:f}){return s.jsxs("span",{className:"req-filter",role:"group","aria-label":be.filterAria,children:[s.jsxs("button",{"aria-pressed":i==="all",className:i==="all"?"on":"",onClick:()=>f("all"),children:[be.filterAll," ",s.jsx("span",{className:"req-n",children:n})]}),s.jsxs("button",{"aria-pressed":i==="ai",className:i==="ai"?"on":"",onClick:()=>f("ai"),children:[be.filterForAi," ",s.jsx("span",{className:"req-n",children:o})]})]})}const W1=({n,working:o,short:i,onOpen:f})=>{if(!(n>0)&&!o)return null;const m=o?be.markerWorking(o):be.waitingTag(n),p=s.jsxs(s.Fragment,{children:[o?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(Q,{name:"clock",size:16}),s.jsx("span",{className:o&&i?"sr-only":"act-tag-text",children:m}),!o&&s.jsx("span",{className:"req-tag-n","aria-hidden":"true",children:n})]});return f?s.jsx("button",{className:`occ-tag req-tag is-button ${o?"is-taken":""}`,title:m,"aria-label":`${m}. ${be.markerAria}`,onPointerDown:b=>b.stopPropagation(),onDoubleClick:b=>b.stopPropagation(),onClick:f,children:p}):s.jsx("span",{className:"occ-tag req-tag",title:m,children:p})},ew=({n})=>n>0?s.jsx("span",{className:"req-count","aria-label":be.countAria(n),title:be.countAria(n),children:n}):null,tw=(n,o)=>{var f;const i=(f=n.request)==null?void 0:f.attach;return i!=null&&i.label?i.label.startsWith(o)?i.label:`${o} · ${i.label}`:i!=null&&i.kind&&i.kind!=="element"?`${o} · ${be.kind[i.kind]}`:o};function nw({req:n,comments:o,actions:i,onOpen:f,chatBack:m,compact:p=!1}){const b=new Date().toDateString(),N=o.filter(j=>va(j)&&(j.request.state!=="done"||new Date(j.request.doneAt??0).toDateString()===b)).sort((j,E)=>+(E.request.state!=="done")-+(j.request.state!=="done")||Date.parse(E.createdAt)-Date.parse(j.createdAt));return s.jsx("div",{className:`pp req-panel ${p?"is-compact":""}`,children:s.jsxs("div",{className:"pp-scroll",children:[m,!p&&s.jsx(Qb,{req:n}),n.host&&s.jsxs("section",{className:"req-list","aria-label":be.listTitle,children:[s.jsxs("h3",{className:"req-h",children:[be.listTitle," ",s.jsx("span",{className:"oc-count",children:N.filter(j=>j.request.state!=="done").length}),s.jsx("span",{className:"req-h-side",children:be.allBoards})]}),s.jsx(Um,{comments:N}),N.length===0?s.jsx("p",{className:"req-note",children:be.listEmpty}):s.jsx("ul",{className:"req-items",children:N.map(j=>s.jsxs("li",{className:"req-item",children:[s.jsxs("button",{className:"req-item-head",onClick:()=>f(j),children:[s.jsx("span",{className:"who",children:j.author}),j.forAgent!==!0&&s.jsx(Pb,{c:j}),s.jsx("span",{className:"when",children:Af(j.createdAt)})]}),s.jsx("div",{className:"req-item-text",children:j.text}),s.jsx("div",{className:"req-where",children:tw(j,i.titleOf(j.file))}),Ru(j)&&s.jsxs("div",{className:"req-reply",children:[s.jsx("span",{className:"who",children:Ru(j).author})," ",Ru(j).text]}),s.jsx(Jb,{c:j,a:i}),(j.request.state==="waiting"||j.request.state==="failed")&&s.jsx("div",{className:"oc-cmt-bar req-actions",children:s.jsx(Ib,{c:j,a:i})})]},j.id))})]}),p&&s.jsx(I1,{req:n})]})})}function aw(n){const o=Math.min(360,n.win.w-16),i=n.room<n.win.w?Math.max(8,Math.round((n.room-o)/2)):m0(n.win.w,{w:o},8,n.room).x;return s.jsxs("div",{className:"req-composer req-intro",role:"dialog","aria-label":be.introTitle,style:{left:i,width:o,bottom:n.bottom},onPointerDown:f=>f.stopPropagation(),children:[s.jsx("strong",{className:"req-intro-title",children:be.introTitle}),s.jsxs("div",{className:"req-comp-foot",children:[s.jsx("span",{className:"req-comp-hint"}),s.jsx("button",{className:"btn oc-plain",onClick:n.onKeep,children:be.keepChat}),s.jsx("button",{className:"btn req-primary",autoFocus:!0,onClick:n.onSwitch,children:be.switchTo})]})]})}const cb={taken:0,waiting:1,failed:2,done:3},lw=n=>!!n&&new Date(n).toDateString()===new Date().toDateString(),Nu=(n,o)=>va(n)&&(Q1(n)||(n.request.state==="done"||n.request.state==="failed")&&lw(n.request.doneAt)&&!o.has(n.id)),rb="easel:request-markers-dismissed";function sw(){const[n,o]=v.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem(rb)??"[]"))}catch{return new Set}}),i=v.useCallback(f=>{o(m=>{const p=[...m,...f.filter(b=>!m.has(b))].slice(-200);try{localStorage.setItem(rb,JSON.stringify(p))}catch{}return new Set(p)})},[]);return[n,i]}const Wb=n=>{var i;const o=n.request;return o.state==="waiting"?n.forAgent===!0?be.markerWaiting:be.markerWaitingFor(String(n.forAgent)):o.state==="taken"?be.markerWorking(o.by??"AI"):o.state==="done"?((i=Ru(n))==null?void 0:i.text)??be.markerDone:o.reason??be.failed(o.by??"AI")},ev=({state:n})=>n==="taken"?s.jsx("span",{className:"spinner","aria-hidden":"true"}):n==="waiting"?s.jsx(Q,{name:"ai",size:14,className:"req-mk-ai"}):s.jsx("span",{className:`dot ${n==="done"?"ok":"bad"}`,"aria-hidden":"true"});function ow(){const[n,o]=v.useState(!1);return s.jsxs("button",{className:"btn req-mk-copy",title:be.copyTitle,onClick:()=>void navigator.clipboard.writeText(be.line).catch(()=>{}).then(()=>{o(!0),window.setTimeout(()=>o(!1),1400)}),children:[s.jsx(Q,{name:n?"check":"copy",size:14}),s.jsx("span",{children:n?be.copied:be.copy})]})}function iw(n){const o=v.useRef(null),i=Hu(o,n.store,n.target,n.bounds,n.gap??8,".req-mk",n.open?void 0:n.placer),f=[...n.items].sort((N,j)=>cb[N.request.state]-cb[j.request.state]||Date.parse(j.createdAt)-Date.parse(N.createdAt)),m=f[0],p=n.open;v.useEffect(i,[p,f.length]),v.useEffect(()=>{if(!n.open)return;const N=j=>{var E;return!((E=o.current)!=null&&E.contains(j.target))&&n.onOpen(!1)};return window.addEventListener("pointerdown",N,!0),()=>window.removeEventListener("pointerdown",N,!0)},[n.open]);const b=f.filter(N=>N.request.state==="done"||N.request.state==="failed");return s.jsxs("div",{ref:o,className:`oc-result oc-anchored req-mk is-${m.request.state} ${p?"is-open":""}`,role:"group","aria-label":be.markerAria,"data-req-marker":m.file+"|"+(m.path||""),onPointerDown:N=>N.stopPropagation(),children:[s.jsxs("div",{className:"oc-result-head req-mk-line",children:[s.jsx(ev,{state:m.request.state}),s.jsx("button",{className:"req-mk-text","aria-expanded":p,onClick:()=>n.onOpen(!n.open),title:m.text,children:s.jsx("span",{className:"oc-result-text",role:"status",children:Wb(m)})}),f.length>1&&s.jsx("span",{className:"req-mk-n",title:be.markerCount(f.length),"aria-label":be.markerCount(f.length),children:f.length}),b.length===f.length&&s.jsx("button",{className:"icon-btn sm","aria-label":be.dismiss,title:be.dismiss,onClick:()=>n.onDismiss(b.map(N=>N.id)),children:s.jsx(Q,{name:"close",size:14})})]}),p&&s.jsx("div",{className:"req-mk-more",children:f.length===1?s.jsx(cw,{c:m,a:n.a,onComment:n.onComment}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"req-mk-rows",children:f.map(N=>s.jsx(rw,{c:N,a:n.a,onDismiss:n.onDismiss,onComment:n.onComment},N.id))}),f.some(N=>N.request.state==="waiting")&&s.jsx(tv,{})]})})]})}const tv=()=>s.jsxs("p",{className:"req-mk-how",children:[s.jsx("span",{children:be.markerSay(be.line)}),s.jsx(ow,{})]});function nv({c:n,a:o}){var m;const i=n.request,f=i.state==="done"?((m=o.undoFor)==null?void 0:m.call(o,n))??null:null;return f?s.jsx("button",{className:"btn",onClick:f,children:be.undoChange}):i.state==="done"&&i.undo==="undone"?s.jsx("span",{className:"req-undone",children:be.undone}):i.state==="done"&&i.undo==="gone"?s.jsx("span",{className:"req-undone",children:be.undoGone}):null}function cw({c:n,a:o,onComment:i}){const f=n.request;return s.jsxs("div",{className:`req-mk-row is-${f.state}`,"data-req":n.id,children:[s.jsx("p",{className:"req-mk-ask",title:n.text,children:n.text}),f.state==="taken"&&s.jsx("p",{className:"req-mk-state",children:be.took(f.by??"AI",Af(f.takenAt))}),f.state==="waiting"&&s.jsx(tv,{}),s.jsxs("div",{className:"oc-result-acts",children:[f.state==="waiting"&&s.jsx("button",{className:"btn",onClick:()=>o.onCancel(n),children:be.cancelRequest}),f.state==="failed"&&s.jsx("button",{className:"btn",onClick:()=>o.onRetry(n),children:be.retry}),s.jsx(nv,{c:n,a:o}),s.jsx("button",{className:"btn oc-plain req-mk-cmt",onClick:()=>i(n),children:be.openComment})]})]})}function rw({c:n,a:o,onDismiss:i,onComment:f}){var b;const m=n.request,p=m.state==="done"?(b=Ru(n))==null?void 0:b.text:m.state==="failed"?Wb(n):m.state==="taken"?be.took(m.by??"AI",Af(m.takenAt)):null;return s.jsxs("li",{className:`req-mk-item is-${m.state}`,"data-req":n.id,children:[s.jsx(ev,{state:m.state}),s.jsxs("div",{className:"req-mk-item-text",children:[s.jsx("button",{className:"req-mk-ask is-own",title:`${n.text}
66
+ ${be.openComment}`,onClick:()=>f(n),children:n.text}),p&&s.jsx("p",{className:"req-mk-sub",children:p})]}),s.jsxs("span",{className:"req-mk-item-act",children:[m.state==="waiting"&&s.jsx("button",{className:"btn oc-plain",onClick:()=>o.onCancel(n),children:be.cancelRequest}),m.state==="failed"&&s.jsx("button",{className:"btn oc-plain",onClick:()=>o.onRetry(n),children:be.retry}),m.state==="done"&&s.jsx(nv,{c:n,a:o}),(m.state==="done"||m.state==="failed")&&s.jsx("button",{className:"icon-btn sm","aria-label":be.dismiss,title:be.dismiss,onClick:()=>i([n.id]),children:s.jsx(Q,{name:"close",size:14})})]})]})}function ub(n){const[o,i]=v.useState(""),[f,m]=v.useState(null),[p,b]=v.useState(!1),[N,j]=v.useState(!1),[E,S]=v.useState(null),[w,k]=v.useState(""),[z,R]=v.useState(!1),[K,B]=v.useState("all"),[V,M]=v.useState("page"),[X,te]=v.useState(!1),ee=v.useRef(null),ce=v.useRef(null);v.useLayoutEffect(()=>{ns(ee.current),ns(ce.current,".crumb button, .crumb span[aria-hidden], .oc-cmt button")});const ie=async(re,Ne=!1)=>{w.trim()&&(await xe.post("/api/comments",{action:"reply",id:re,text:w,author:n.author,resolve:Ne}),k(""),S(null))},he=re=>new Date(re).toLocaleString("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),fe=n.selection,pe=!!fe&&!!n.file&&fe.file===n.file,Oe=n.comments.filter(re=>(!n.file||re.file===n.file)&&(!n.listAll||(V==="all"||!n.pageFiles||n.pageFiles.includes(re.file))&&(X||!re.resolved))),Ye=Oe.filter(va).length,ue=K==="ai"&&Ye?Oe.filter(va):Oe,pt=Oe.filter(re=>!re.resolved).length,Fe=v.useRef(null);v.useEffect(()=>{var re;n.focusComment&&(!ue.some(Ne=>Ne.id===n.focusComment)&&Oe.some(Ne=>Ne.id===n.focusComment)&&B("all"),(re=Fe.current)==null||re.scrollIntoView({block:"nearest"}))},[n.focusComment,n.file,ue.length]);const me=n.threadOnly?n.comments.find(re=>re.id===n.focusComment):void 0,Ae=async()=>{fe&&(await navigator.clipboard.writeText(Qx(fe.file,fe.path,fe.tag,fe.text)).catch(()=>{}),j(!0),setTimeout(()=>j(!1),1200))},ze=async()=>{if(n.file){b(!0);try{const re=await xe.post("/api/screenshot",{file:n.file,path:fe==null?void 0:fe.path});m(re.path)}catch(re){m(u.inspector.shotFailed(re.message))}finally{b(!1)}}},qe=async()=>{if(!n.file||!o.trim())return;const re=(fe==null?void 0:fe.file)===n.file?fe.path:"";n.host&&z&&n.onAddForAi?await n.onAddForAi(o,re):await xe.post("/api/comments",{file:n.file,path:re,text:o,author:n.author}),i("")},Ve=re=>{var Ne,at,H,se;return s.jsxs("li",{ref:re.id===n.focusComment?Fe:void 0,className:`oc-cmt-item ${re.resolved?"resolved":""} ${re.id===n.focusComment&&!n.threadOnly?"on":""}`,"aria-current":re.id===n.focusComment?"true":void 0,children:[s.jsxs("div",{className:"c-head",children:[s.jsx("span",{className:"who",children:re.author}),re.guest&&s.jsx(sb,{}),s.jsx(Pb,{c:re}),re.path&&s.jsx("button",{className:"btn oc-plain c-path",title:re.path,onClick:()=>n.onSelectPath(re.path),children:((at=(Ne=re.request)==null?void 0:Ne.attach)==null?void 0:at.label)??((H=n.nameOf)==null?void 0:H.call(n,re.file,re.path))??re.path}),n.listAll&&s.jsx("span",{className:"c-file",children:((se=n.titleOf)==null?void 0:se.call(n,re.file))??re.file}),s.jsx("span",{className:"when",children:he(re.createdAt)})]}),(n.compact||n.listAll)&&!n.threadOnly&&n.onOpenThread?s.jsx("button",{className:"c-open",title:u.comments.openThread,onClick:()=>n.onOpenThread(re),children:re.text}):s.jsx("div",{children:re.text}),n.reqActions&&s.jsx(Jb,{c:re,a:n.reqActions}),(re.replies??[]).length>0&&s.jsx("ul",{className:"replies",children:re.replies.map(ve=>s.jsxs("li",{children:[s.jsxs("div",{className:"c-head",children:[s.jsx("span",{className:"who",children:ve.author}),ve.guest&&s.jsx(sb,{}),s.jsx("span",{className:"when",children:he(ve.createdAt)})]}),s.jsx("div",{children:ve.text})]},ve.id))}),E===re.id&&s.jsxs("div",{className:"reply-box",children:[s.jsx("textarea",{autoFocus:!0,value:w,placeholder:u.comments.replyPlaceholder(n.author),"aria-label":u.comments.reply,onChange:ve=>k(ve.target.value),onKeyDown:ve=>{ve.nativeEvent.isComposing||(ve.key==="Enter"&&(ve.metaKey||ve.ctrlKey)&&ie(re.id),ve.key==="Escape"&&S(null))}}),s.jsxs("div",{className:"oc-cmt-bar",children:[s.jsx("button",{className:"btn",onClick:()=>void ie(re.id),disabled:!w.trim(),children:u.comments.reply}),s.jsx("button",{className:"btn",onClick:()=>void ie(re.id,!0),disabled:!w.trim(),children:u.comments.replyResolve})]})]}),s.jsxs("div",{className:"oc-cmt-bar",children:[n.reqActions&&s.jsx(Ib,{c:re,a:n.reqActions}),E!==re.id&&s.jsx("button",{className:"btn oc-plain",onClick:()=>S(re.id),children:u.comments.reply}),s.jsx("button",{className:"btn oc-plain",onClick:()=>xe.post("/api/comments",{action:"resolve",id:re.id,resolved:!re.resolved}),children:re.resolved?u.comments.reopen:u.comments.resolve}),!re.resolved&&n.onAskAI&&!(va(re)&&re.request.state!=="done")&&s.jsx("button",{className:"btn oc-plain",onClick:()=>n.onAskAI(re),title:u.comments.sendToAITitle,children:u.comments.sendToAI}),n.onCommentMenu&&s.jsx("button",{className:"icon-btn oc-ib c-more","aria-haspopup":"menu","aria-label":u.comments.more,title:u.comments.more,onClick:ve=>{const Ce=ve.currentTarget.getBoundingClientRect();n.onCommentMenu(re,{clientX:Ce.left,clientY:Ce.bottom+4})},children:s.jsx(Q,{name:"more",size:16})})]})]},re.id)};return me?s.jsx("div",{className:"pp inspector is-thread",children:s.jsx("div",{className:"pp-scroll",ref:ce,children:s.jsxs("section",{className:"pp-group oc-cmt","aria-label":u.comments.title,children:[s.jsxs("h3",{className:"pp-group-h",children:[u.comments.title,s.jsx("span",{className:"c-file",children:me.file}),n.onAllComments&&Oe.length>1&&s.jsx("button",{className:"btn oc-plain c-all",onClick:n.onAllComments,children:u.comments.allOnBoard(Oe.length)})]}),s.jsx("ul",{className:"comments",children:Ve(me)})]})})}):n.listAll&&!me?s.jsx("div",{className:`pp inspector is-all ${n.listAll==="comments"?"is-comments":""}`,children:s.jsxs("div",{className:"pp-scroll",ref:ce,children:[n.listAll==="empty"&&s.jsx("p",{className:"pp-note muted pp-nothing",children:u.comments.nothingSelected}),s.jsxs("section",{className:"pp-group oc-cmt","aria-label":u.comments.title,children:[s.jsxs("div",{className:"cmt-filters",role:"group","aria-label":u.comments.scope,children:[s.jsx("span",{className:"pp-seg",children:["page","all"].map(re=>s.jsx("button",{"aria-pressed":V===re,className:V===re?"on":"",onClick:()=>M(re),children:re==="page"?u.comments.thisPage:u.comments.allPages},re))}),s.jsx("button",{"aria-pressed":X,className:`cmt-resolved ${X?"on":""}`,onClick:()=>te(re=>!re),children:u.comments.showResolved})]}),Ye>0&&s.jsx(ib,{all:Oe.length,forAi:Ye,value:K,onChange:B}),n.host&&s.jsx(Um,{comments:Oe}),ue.length?s.jsx("ul",{className:"comments",children:ue.map(Ve)}):s.jsx("p",{className:"oc-empty oc-cmt-none",children:u.comments.none})]})]})}):s.jsxs("div",{className:"pp inspector",children:[s.jsxs("div",{className:"pp-scroll",ref:ce,children:[pe&&fe&&s.jsxs("header",{className:"pp-head",children:[s.jsx("span",{className:"pp-file",children:fe.file}),s.jsx("h2",{className:"pp-name",children:s.jsxs("span",{children:[u.inspector.kindName(fe.kind??fe.tag),fe.label&&` · ${fe.label.slice(0,40)}`,n.multi>1&&s.jsxs("span",{className:"muted",children:[" ",u.inspector.more(n.multi-1)]})]})}),s.jsxs("div",{className:"pp-crumb",children:[n.crumbs,fe.path.includes("/")&&s.jsx("button",{className:"icon-btn pp-ib","aria-label":u.menu.selectParent,title:u.menu.selectParent,onClick:()=>n.onSelectPath(fe.path.slice(0,fe.path.lastIndexOf("/"))),children:s.jsx(Q,{name:"parent",size:16})})]}),fe.text&&!fe.label&&s.jsxs("p",{className:"pp-note sel-text",children:["“",fe.text.slice(0,120),"”"]})]}),n.error&&s.jsx("p",{className:"pp-note warn",children:n.error}),f&&s.jsx("p",{className:"pp-note muted shot",children:f}),n.section!=="comments"&&n.children,n.file&&n.section!=="props"&&s.jsxs("section",{className:"pp-group oc-cmt","aria-label":u.comments.title,children:[s.jsxs("h3",{className:"pp-group-h",children:[u.comments.title,pt>0&&s.jsx("span",{className:"oc-count",children:pt}),Ye>0&&s.jsx(ib,{all:Oe.length,forAi:Ye,value:K,onChange:B})]}),s.jsx("textarea",{ref:n.commentRef,value:o,"aria-label":u.comments.title,placeholder:pe&&fe?u.comments.placeholderElement(fe.path):u.comments.placeholderBoard,onChange:re=>i(re.target.value),onKeyDown:re=>{re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&qe()}}),s.jsxs("div",{className:"oc-cmt-bar",children:[n.host&&n.onAddForAi&&s.jsxs("label",{className:"req-check",title:u.requests.forAiCheckTitle,children:[s.jsx("input",{type:"checkbox",checked:z,onChange:re=>R(re.target.checked)}),u.requests.forAiCheck]}),s.jsx("button",{className:`btn ${n.host&&z?"req-primary":""}`,onClick:qe,disabled:!o.trim(),children:n.host&&z?u.requests.addForAi:u.comments.add}),s.jsx("button",{className:"btn oc-plain",onClick:n.onAuthor,title:u.comments.authorTitle,children:u.comments.author(n.author)}),!pe&&s.jsx("button",{className:"btn oc-plain shot-link",onClick:ze,disabled:p,title:u.inspector.boardScreenshotTitle,children:p?u.inspector.capturing:u.inspector.boardScreenshot})]}),n.host&&s.jsx(Um,{comments:Oe}),s.jsx("ul",{className:"comments",children:ue.map(Ve)})]})]}),n.section==="comments"?null:pe?s.jsxs("footer",{className:"pp-actions","aria-label":u.inspector.actions,ref:ee,children:[n.onDuplicate&&s.jsx("button",{className:"btn",onClick:n.onDuplicate,children:u.properties.duplicate}),s.jsx("button",{className:"btn",onClick:Ae,children:N?u.inspector.copied:u.inspector.copy}),s.jsx("button",{className:"btn",onClick:ze,disabled:p,title:u.inspector.screenshotTitle,children:p?u.inspector.capturing:u.inspector.screenshot}),n.onDelete&&s.jsx("button",{className:"icon-btn pp-del","aria-label":u.properties.delete,title:u.boardOptions.deleteTitleKey,onClick:n.onDelete,children:s.jsx(Q,{name:"trash"})})]}):n.footer]})}const uw=(n,o)=>n.x<o.x+o.w+(n.w+o.w)/2&&o.x<n.x+n.w+(n.w+o.w)/2&&n.y<o.y+o.h+(n.h+o.h)/2&&o.y<n.y+n.h+(n.h+o.h)/2;function dw(n){const o=new Set,i=[];for(const f of n){if(o.has(f))continue;const m=[f];o.add(f);for(let p=0;p<m.length;p++)for(const b of n)!o.has(b)&&uw(b,m[p])&&(o.add(b),m.push(b));i.push(n.filter(p=>m.includes(p)))}return i}function fw(n){const o=Math.min(...n.map(i=>i.y));return n.filter(i=>i.y-o<i.h/2).reduce((i,f)=>f.x<i.x?f:i)}function hw(n){const o=Math.min(...n.map(f=>f.x)),i=Math.min(...n.map(f=>f.y));return{x:o,y:i,w:Math.max(...n.map(f=>f.x+f.w))-o,h:Math.max(...n.map(f=>f.y+f.h))-i}}function mw(n,o,i,f){const m=new Set(i.map(p=>p??"")).size===1&&i[0]?i[0]:null;return{long:m?f.forkBlockWhile(n,o,m):null,medium:f.forkBlock(n,o),short:f.forkBlockShort(n)}}function pw(n,o,i,f){if(n.long&&i(n.long)<=o&&!f(i(n.long)))return n.long;for(const m of[n.medium,n.short])if(!f(i(m)))return m;return null}const qm=n=>n.kind==="person"&&n.client===Cf,Du=n=>n.by??n.person??u.occupancy.someone,av=(n,o)=>(n[o]??[]).filter(i=>i.kind==="agent"&&i.state==="editing");function gw({list:n}){return s.jsx(s.Fragment,{children:n.map(o=>{const i=qm(o),f=i?u.occupancy.you:o.state==="done"?u.occupancy.done(Du(o),u.occupancy.clock(o.doneAt??Date.now())):o.kind==="person"?u.occupancy.personEditing(Du(o)):u.occupancy.editing(Du(o));return s.jsxs("span",{className:`occ-tag ${i?"you":""} ${o.state==="done"?"done":""}`,"data-occ":o.key,title:f,children:[i?s.jsx("span",{className:"idot","aria-hidden":"true"}):o.state==="editing"&&o.kind==="agent"?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(Q,{name:Ef(o.kind==="agent"?{by:o.by??""}:{person:o.person??""}),size:16}),s.jsx("span",{className:"act-tag-text",children:f})]},o.key)})})}function yw(n,o){const i=(n[o]??[]).find(f=>f.state==="editing");return i?{color:qm(i)?"var(--select)":"var(--text)",label:qm(i)?u.occupancy.youListDot:u.occupancy.listDot(Du(i))}:null}function ff(n,o){var p;const i=n.boards[o];if(!i)return null;const f=(b,N)=>Object.keys(n.boards).filter(j=>{var E,S;return j!==b&&((E=n.boards[j].origin)==null?void 0:E.of)===b&&((S=n.boards[j].origin)==null?void 0:S.kind)===N});if((p=i.origin)!=null&&p.of&&n.boards[i.origin.of])return{original:i.origin.of,kind:i.origin.kind,chosen:o,alts:f(i.origin.of,i.origin.kind)};const m=f(o,"fork");return m.length?{original:o,kind:"fork",chosen:o,alts:m}:null}const bw=(n,o)=>[o.original,...o.alts].flatMap(i=>av(n,i))[0]??null,vw=n=>n.replace(/:.*$/,"");function xw({file:n,group:o,busy:i,open:f,onOpen:m,compact:p=!1}){const b=o.kind==="variant"?u.occupancy.useThis:u.occupancy.useThisOne;return s.jsxs("button",{className:`icon-btn sm use-btn ${i?"":"ready"} ${f?"pressed":""} ${p?"icon-only":""}`,"data-use":n,"aria-disabled":i?!0:void 0,"aria-haspopup":"dialog","aria-expanded":f,"aria-label":p?b:void 0,title:i?u.occupancy.waitFor(Du(i)):p?b:o.kind==="variant"?u.occupancy.useThisTitle:u.occupancy.useThisOneTitle(o.alts.length),onPointerDown:N=>N.stopPropagation(),onDoubleClick:N=>N.stopPropagation(),onClick:N=>{N.stopPropagation(),i||m()},children:[s.jsx(Q,{name:"check",size:14}),!p&&s.jsx("span",{className:"use-label",children:b})]})}function ww(n){const o=v.useRef(null),[i,f]=v.useState(null),m=()=>document.querySelector(`[data-use="${CSS.escape(n.file)}"]`),p=w=>{var k;return((k=n.board.boards[w])==null?void 0:k.title)??w},b=n.group,N=p(b.original),j=u.occupancy,[E,S]=b.kind==="variant"?[j.confirmVariant(p(b.chosen),N),j.confirmVariantBody(N,b.alts.length-1)]:b.chosen===b.original?[j.confirmKeep(N),j.confirmKeepBody(b.alts.map(p).join(", "),b.alts.length)]:[j.confirmFork(p(b.chosen),N),j.confirmForkBody(N,b.alts.length-1)];return v.useLayoutEffect(()=>{var V,M;const w=m();if(!w)return void n.onClose();const k=w.getBoundingClientRect(),z=((V=o.current)==null?void 0:V.offsetWidth)??288,R=Math.round(Math.max(8,Math.min(k.right-z,window.innerWidth-z-8))),K=((M=o.current)==null?void 0:M.offsetHeight)??120,B=Math.round(Math.max(8,Math.min(k.bottom+8,window.innerHeight-K-8)));(!i||i.x!==R||i.y!==B)&&f({x:R,y:B})}),v.useEffect(()=>{var k,z;(z=(k=o.current)==null?void 0:k.querySelector("button"))==null||z.focus();const w=R=>{var B,V;const K=R.target;(B=o.current)!=null&&B.contains(K)||(V=m())!=null&&V.contains(K)||n.onClose()};return window.addEventListener("pointerdown",w,!0),()=>window.removeEventListener("pointerdown",w,!0)},[n.file]),s.jsxs("div",{ref:o,className:"menu confirm entering",role:"dialog","aria-label":E,style:{left:(i==null?void 0:i.x)??-9999,top:(i==null?void 0:i.y)??-9999},onKeyDown:w=>{var k;w.key==="Escape"&&(w.stopPropagation(),n.onClose(),(k=m())==null||k.focus())},children:[s.jsx("p",{className:"c-title",children:E}),s.jsx("p",{className:"c-body",children:S}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn oc-strong",disabled:n.busy,onClick:n.onApply,children:j.apply}),s.jsx("button",{className:"btn oc-plain",disabled:n.busy,onClick:n.onKeepAll,children:b.kind==="variant"||b.alts.length>1?j.keepAll:j.keepBoth})]})]})}function jw({board:n,files:o,zoom:i}){const f=new Set(o),m=new Map;for(const p of o){const b=n.boards[p].origin;(b==null?void 0:b.kind)==="fork"&&f.has(b.of)&&n.boards[b.of]&&m.set(b.of,[...m.get(b.of)??[],{...n.boards[p],f:p}])}return m.size?s.jsx(s.Fragment,{children:[...m].flatMap(([p,b])=>dw(b).map(N=>s.jsx(Nw,{of:p,from:n.boards[p],forks:N,zoom:Math.max(i,.05),board:n},N.map(j=>j.f).join(" "))))}):null}function Nw({of:n,from:o,forks:i,zoom:f,board:m}){const p=v.useRef(null),b=v.useRef(null),N=fw(i),j=hw(i),E=i.length,S=o.title??n,w=mw(E,S,i.map(he=>{var fe;return(fe=he.origin)==null?void 0:fe.while}),u.occupancy),[k,z]=v.useState(w.medium),R={left:j.x,top:j.y+j.h+10/f,transform:`scale(${1/f})`,transformOrigin:"0 0"};v.useLayoutEffect(()=>{var ze;const he=b.current,fe=(ze=p.current)==null?void 0:ze.getBoundingClientRect();if(!he||!fe)return;const pe=document.createElement("canvas").getContext("2d"),Oe=getComputedStyle(he),Ye=parseFloat(Oe.paddingLeft)+parseFloat(Oe.paddingRight);pe&&(pe.font=`${Oe.fontWeight} ${Oe.fontSize} ${Oe.fontFamily}`);const ue=parseFloat(Oe.lineHeight)||16,pt=fe.left+j.x*f,Fe=fe.top+(j.y+j.h)*f+10,me=[...document.querySelectorAll(".canvas .note, .canvas .board-frame, .canvas .board-label")].map(qe=>qe.getBoundingClientRect()),Ae=pw(w,j.w*f,qe=>(pe?pe.measureText(qe).width:qe.length*7)+Ye,qe=>me.some(Ve=>Ve.left<pt+qe&&Ve.right>pt&&Ve.top<Fe+ue&&Ve.bottom>Fe));Ae!==k&&z(Ae)},[f,j.x,j.y,j.w,j.h,w.long,w.medium,w.short,m]);const K=Sw(o,N),B=K[K.length-1],V=K[0];if(Math.hypot(B.x-V.x,B.y-V.y)<4)return null;const M=1.5/f,X=K[K.length-2],te=Math.atan2(B.y-X.y,B.x-X.x),ee=6/f,ce=Math.min(...K.map(he=>he.x))-ee,ie=Math.min(...K.map(he=>he.y))-ee;return s.jsxs("div",{ref:p,className:"fork-link","data-fork":N.f,"data-forks":i.map(he=>he.f).join(" "),"aria-label":w.long??w.medium,role:"img",children:[s.jsx("svg",{className:"fork-svg",style:{left:ce,top:ie,width:Math.max(...K.map(he=>he.x))+ee-ce,height:Math.max(...K.map(he=>he.y))+ee-ie},"aria-hidden":"true",children:s.jsxs("g",{transform:`translate(${-ce} ${-ie})`,children:[s.jsx("path",{d:K.map((he,fe)=>`${fe?"L":"M"}${he.x} ${he.y}`).join(""),strokeWidth:M,strokeDasharray:`${4*M} ${4*M}`}),s.jsx("path",{d:`M${B.x-ee*Math.cos(te-.6)} ${B.y-ee*Math.sin(te-.6)}L${B.x} ${B.y}L${B.x-ee*Math.cos(te+.6)} ${B.y-ee*Math.sin(te+.6)}`,strokeWidth:M})]})}),s.jsx("div",{className:"fork-caption",style:{...R,visibility:k?void 0:"hidden"},"aria-hidden":"true",children:s.jsx("span",{ref:b,children:k??w.short})})]})}function Sw(n,o){const i=Math.max(n.y,o.y)+Math.min(48,Math.min(n.h,o.h)/4),f=i<Math.min(n.y+n.h,o.y+o.h);if(f&&o.x>=n.x+n.w)return[{x:n.x+n.w+8,y:i},{x:o.x-8,y:i}];if(f&&o.x+o.w<=n.x)return[{x:n.x-8,y:i},{x:o.x+o.w+8,y:i}];const m=N=>Math.min(48,N.h/4);if(o.x<n.x+n.w&&o.x+o.w>n.x){const N=Math.min(n.x,o.x)-40,j=o.y>=n.y,E=j?n.y+n.h-m(n):n.y+m(n),S=j?o.y+m(o):o.y+o.h-m(o);return[{x:n.x-8,y:E},{x:N,y:E},{x:N,y:S},{x:o.x-8,y:S}]}const p={x:n.x+n.w/2,y:n.y+n.h/2},b={x:o.x+o.w/2,y:o.y+o.h/2};return o.y>=n.y+n.h?[{x:p.x,y:n.y+n.h+8},{x:b.x,y:o.y-8}]:[{x:p.x,y:n.y-8},{x:b.x,y:o.y+o.h+8}]}const wm=n=>n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",db=n=>Number(n.split("/").pop());function Vm(n){var te;const[o,i]=v.useState([]),[f,m]=v.useState(()=>n.bare?{}:{0:!0}),[p,b]=v.useState(null),[N,j]=v.useState(null),[E,S]=v.useState(null);v.useEffect(()=>{xe.get(`/api/outline?f=${encodeURIComponent(n.file)}`).then(ee=>i(ee.tree)).catch(()=>i([]))},[n.file,n.version]),v.useEffect(()=>{const ee={};for(const ce of n.selected){const ie=ce.split("/");for(let he=1;he<ie.length;he++)ee[ie.slice(0,he).join("/")]=!0}Object.keys(ee).length&&m(ce=>({...ce,...ee}))},[n.selected.join("|")]);const w=ee=>{if(!p||p===ee||ee.startsWith(p+"/"))return;const ce=wm(ee);let ie=db(ee);wm(p)===ce&&db(p)<ie&&(ie-=1),n.onMove(p,ce,ie)},k=[],z=new Map,R=ee=>{for(const ce of ee)k.push(ce),z.set(ce.path,ce),ce.children.length&&f[ce.path]&&R(ce.children)};R(o);const K=E??n.selected[n.selected.length-1]??((te=k[0])==null?void 0:te.path)??null,B=ee=>{ee==null||!z.has(ee)||(S(ee),n.onSelect(ee,!1))},V=ee=>{if(!K)return;const ce=k.findIndex(pe=>pe.path===K),ie=z.get(K),fe={ArrowDown:()=>{var pe;return B((pe=k[ce+1])==null?void 0:pe.path)},ArrowUp:()=>{var pe;return B((pe=k[ce-1])==null?void 0:pe.path)},ArrowRight:()=>ie!=null&&ie.children.length?f[K]?B(ie.children[0].path):m(pe=>({...pe,[K]:!0})):void 0,ArrowLeft:()=>ie!=null&&ie.children.length&&f[K]?m(pe=>({...pe,[K]:!1})):B(K.includes("/")?wm(K):null),Home:()=>{var pe;return B((pe=k[0])==null?void 0:pe.path)},End:()=>{var pe;return B((pe=k[k.length-1])==null?void 0:pe.path)},Enter:()=>B(K)," ":()=>B(K)}[ee.key];fe&&(ee.preventDefault(),ee.stopPropagation(),fe())},M=(ee,ce)=>{const ie=ee.children.length>0,he=f[ee.path];return s.jsxs("li",{children:[s.jsxs("div",{role:"treeitem","aria-selected":n.selected.includes(ee.path),"aria-expanded":ie?!!he:void 0,"aria-level":ce+1,className:`layer ${n.selected.includes(ee.path)?"on":""} ${N===ee.path?"over":""} ${K===ee.path?"kbd-focus":""}`,style:{paddingLeft:8+(ce+(n.bare?1:0))*16},draggable:!0,onDragStart:fe=>{b(ee.path),fe.dataTransfer.effectAllowed="move"},onDragEnd:()=>{b(null),j(null)},onDragOver:fe=>{p&&(fe.preventDefault(),j(ee.path))},onDragLeave:()=>j(fe=>fe===ee.path?null:fe),onDrop:fe=>{fe.preventDefault(),w(ee.path),j(null)},onClick:fe=>{S(ee.path),n.onSelect(ee.path,fe.shiftKey)},children:[s.jsx("button",{className:"twisty",tabIndex:-1,"aria-label":he?u.layers.collapse:u.layers.expand,style:{visibility:ie?"visible":"hidden"},onClick:fe=>{fe.stopPropagation(),m(pe=>({...pe,[ee.path]:!he}))},children:s.jsx(Q,{name:he?"chevronDown":"chevronRight",size:14})}),s.jsx("span",{className:"tag",children:ee.tag}),s.jsxs("span",{className:"lname",children:[ee.cls&&`.${ee.cls}`,ee.cls&&ee.text&&" · ",ee.text]})]}),ie&&he&&s.jsx("ul",{children:ee.children.map(fe=>M(fe,ce+1))})]},ee.path)},X=s.jsx("ul",{className:"layer-tree",role:n.bare?"group":"tree","aria-label":n.bare?void 0:u.layers.title,title:u.layers.hint,tabIndex:0,onKeyDown:V,children:o.map(ee=>M(ee,0))});return n.bare?X:s.jsxs("section",{className:"pp-group layers",children:[s.jsx("h3",{className:"pp-group-h",title:u.layers.hint,children:u.layers.title}),X]})}function fb(n){const[o,i]=v.useState({});return n.boards.length?s.jsx("section",{className:"pp-group layers page-outline","aria-label":u.layers.outline,children:s.jsx("ul",{className:"layer-tree",role:"tree","aria-label":u.layers.outline,children:n.boards.map(f=>s.jsxs("li",{children:[s.jsxs("div",{role:"treeitem","aria-expanded":!!o[f.file],"aria-level":1,className:"layer board-layer",style:{paddingLeft:8},onClick:()=>n.onPickBoard(f.file),children:[s.jsx("button",{className:"twisty",tabIndex:-1,"aria-label":o[f.file]?u.layers.collapse:u.layers.expand,onClick:m=>{m.stopPropagation(),i(p=>({...p,[f.file]:!p[f.file]}))},children:s.jsx(Q,{name:o[f.file]?"chevronDown":"chevronRight",size:14})}),s.jsx(Q,{name:"board",size:14,className:"layer-icon"}),s.jsx("span",{className:"lname",children:f.title})]}),o[f.file]&&s.jsx(Vm,{bare:!0,file:f.file,version:n.versions[f.file]??0,selected:[],onSelect:m=>n.onPickElement(f.file,m),onMove:()=>{}})]},f.file))})}):s.jsx("p",{className:"oc-empty pp-nothing",children:u.comments.nothingSelected})}const kw=12,hb=n=>{var o;return((o=/^([a-z]+)[-_]/i.exec(n))==null?void 0:o[1].toUpperCase())??""},Tw=v.forwardRef(function(o,i){var B;const[f,m]=v.useState(""),[p,b]=v.useState(null),[N,j]=v.useState(null),E=(B=o.pages[0])==null?void 0:B.id,S=v.useMemo(()=>{const V=f.trim().toLowerCase();return[...new Set(o.board.order)].filter(M=>{const X=o.board.boards[M];return X?V?M.toLowerCase().includes(V)||(X.title??"").toLowerCase().includes(V):!o.pages.length||(X.page??E)===o.currentPage:!1})},[f,o.board,o.pages,o.currentPage,E]),w=v.useMemo(()=>{if(f.trim()||S.length<kw)return null;const V=new Map;for(const te of S){const ee=hb(te);V.has(ee)||V.set(ee,[]),V.get(ee).push(te)}const M=[...V.keys()].filter(te=>te&&V.get(te).length>=2);if(M.length<2)return null;const X=S.filter(te=>!M.includes(hb(te)));return[...M.map(te=>({key:te,label:te,files:V.get(te)})),...X.length?[{key:"",label:u.boardList.otherGroup,files:X}]:[]]},[S,f]),[k,z]=v.useState(()=>{try{return JSON.parse(localStorage.getItem("design-canvas:groups-closed")??"{}")}catch{return{}}}),R=V=>z(M=>{const X={...M,[V]:!M[V]};try{localStorage.setItem("design-canvas:groups-closed",JSON.stringify(X))}catch{}return X}),K=V=>{var ee;const M=o.board.boards[V],X=!!M.title&&M.title!==V.replace(/\.html$/,""),te=(ee=o.dotOf)==null?void 0:ee.call(o,V);return s.jsx("li",{children:s.jsxs("button",{className:`row oc-row ${o.selected.includes(V)?"on":""}`,"aria-current":o.selected.includes(V)||void 0,onClick:ce=>o.onPick(V,ce.shiftKey||ce.metaKey),onContextMenu:ce=>{o.onBoardMenu&&(ce.preventDefault(),o.onBoardMenu(V,ce))},title:V,children:[s.jsx("span",{className:"row-title",children:M.title??V}),o.missing.includes(V)&&s.jsx(Q,{name:"warn",size:14,className:"warn-icon","aria-label":u.boardList.fileMissing}),te&&s.jsx("span",{className:"idot occ-dot",style:{background:te.color},role:"img","aria-label":te.label,title:te.label}),X&&s.jsx("span",{className:"row-file",children:V})]})},V)};return s.jsxs("aside",{ref:o.cardRef,className:o.className??"left",style:o.style,"aria-label":u.boardList.aria,children:[o.header,o.showPages!==!1&&s.jsxs("section",{className:"left-pages",children:[s.jsxs("div",{className:"oc-sec",children:[s.jsx("span",{children:u.boardList.pages}),o.onAddPage&&s.jsx("button",{className:"icon-btn oc-ib","aria-label":u.boardList.addPage,title:u.boardList.addPage,onClick:o.onAddPage,children:s.jsx(Q,{name:"plus",size:16})})]}),o.pages.length===0?s.jsx("p",{className:"oc-empty",children:u.boardList.singlePage}):s.jsx("ul",{className:"oc-list",role:"tablist","aria-label":u.boardList.pages,children:o.pages.map((V,M)=>s.jsx("li",{draggable:!!o.onMovePage,onDragStart:X=>{b(V.id),X.dataTransfer.effectAllowed="move"},onDragOver:X=>{p&&(X.preventDefault(),j(M))},onDragEnd:()=>{b(null),j(null)},onDrop:X=>{var ee;X.preventDefault();const te=o.pages.findIndex(ce=>ce.id===p);p&&te!==M&&((ee=o.onMovePage)==null||ee.call(o,p,M)),b(null),j(null)},children:s.jsxs("button",{role:"tab",title:u.boardList.pageTabTitle,"aria-selected":V.id===o.currentPage,className:`row oc-row ${V.id===o.currentPage?"on":""} ${N===M&&p!==V.id?"drop-before":""}`,onClick:()=>o.onPage(V.id),onContextMenu:X=>{o.onPageMenu&&(X.preventDefault(),o.onPageMenu(V.id,X))},children:[s.jsx("span",{className:"row-title",children:V.name}),s.jsx("span",{className:"row-count",children:Object.values(o.board.boards).filter(X=>(X.page??E)===V.id).length})]})},V.id))})]}),s.jsxs("section",{className:"left-boards",children:[s.jsx("div",{className:"oc-sec",children:s.jsxs("span",{children:[u.boardList.boardsHead,s.jsx("span",{className:"oc-count",children:S.length})]})}),s.jsxs("label",{className:"oc-search",children:[s.jsx(Q,{name:"search",size:16}),s.jsx("input",{ref:i,value:f,placeholder:u.boardList.searchPlaceholder,"aria-label":u.boardList.search,onChange:V=>m(V.target.value),onKeyDown:V=>{V.nativeEvent.isComposing||(V.key==="Enter"&&S[0]&&o.onPick(S[0],!1),V.key==="Escape"&&(m(""),V.target.blur()))}})]}),S.length===0?s.jsx("p",{className:"oc-empty",children:f?u.boardList.noMatch(f):u.boardList.emptyPage}):w?s.jsx("ul",{className:"oc-list board-list",children:w.map(V=>{var X;const M=!k[V.key]||V.files.some(te=>o.selected.includes(te));return s.jsxs("li",{className:`group ${M?"open":""}`,children:[s.jsxs("div",{className:"row oc-row group-head",role:"button",tabIndex:0,"aria-expanded":M,title:u.boardList.groupTitle(V.files.length),onClick:()=>R(V.key),onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),R(V.key))},onDoubleClick:()=>{var te;return V.key&&((te=o.onGroupRename)==null?void 0:te.call(o,V.key))},onContextMenu:te=>{o.onGroupMenu&&(te.preventDefault(),o.onGroupMenu(V.key,V.files,te))},children:[s.jsx(Q,{name:"chevronRight",size:14,className:"chev"}),s.jsx("span",{className:"row-title",children:V.key&&((X=o.board.groupNames)==null?void 0:X[V.key])||V.label}),s.jsx("span",{className:"row-count",children:V.files.length}),o.onGroupMenu&&s.jsx("button",{className:"icon-btn sm group-more","aria-label":u.boardList.groupMenu,title:u.boardList.groupMenu,onClick:te=>{te.stopPropagation();const ee=te.currentTarget.getBoundingClientRect();o.onGroupMenu(V.key,V.files,{clientX:ee.left,clientY:ee.bottom+4})},children:s.jsx(Q,{name:"more",size:14})})]}),M&&s.jsx("ul",{className:"oc-list oc-sub",children:V.files.map(K)})]},V.key)})}):s.jsx("ul",{className:"oc-list board-list",children:S.map(K)})]}),o.footer]})});function Cw({rects:n,selected:o,view:i,size:f,onJump:m,w:p=200,h:b=130,inset:N=0,reserve:j=0,className:E="minimap"}){const S=v.useMemo(()=>{if(!n.length)return{x:0,y:0,w:1,h:1};const M=Math.min(...n.map(te=>te.x)),X=Math.min(...n.map(te=>te.y));return{x:M,y:X,w:Math.max(...n.map(te=>te.x+te.w))-M,h:Math.max(...n.map(te=>te.y+te.h))-X}},[n]),w=b-N-Math.max(N,j),k=Math.min((p-N*2)/S.w,w/S.h),z=(p-S.w*k)/2,R=N+(w-S.h*k)/2,K={x:(-i.x/i.zoom-S.x)*k+z,y:(-i.y/i.zoom-S.y)*k+R,w:Math.max(0,f.w/i.zoom*k),h:Math.max(0,f.h/i.zoom*k)},B=v.useRef(!1),V=M=>{const X=M.currentTarget.getBoundingClientRect(),te=X.width/p;m(((M.clientX-X.left)/te-z)/k+S.x,((M.clientY-X.top)/te-R)/k+S.y)};return s.jsx("div",{className:`${E} ${n.length>30?"many":""}`,role:"img","aria-label":u.minimap.aria,onPointerDown:M=>{B.current=!0,M.currentTarget.setPointerCapture(M.pointerId),V(M)},onPointerMove:M=>B.current&&V(M),onPointerUp:()=>B.current=!1,children:s.jsxs("svg",{width:p,height:b,children:[n.map(M=>s.jsx("rect",{x:(M.x-S.x)*k+z,y:(M.y-S.y)*k+R,width:Math.max(1,M.w*k),height:Math.max(1,M.h*k),rx:2,className:o.includes(M.file)?"mm-sel":"mm-board"},M.file)),j>0&&s.jsx("clipPath",{id:`mm-clip-${p}`,children:s.jsx("rect",{x:0,y:0,width:p,height:b-j+2})}),s.jsx("rect",{x:Math.round(K.x)+.5,y:Math.round(K.y)+.5,width:Math.max(0,Math.round(K.w)-1),height:Math.max(0,Math.round(K.h)-1),rx:3,className:"mm-view",clipPath:j>0?`url(#mm-clip-${p})`:void 0})]})})}function Ew(n){const o=n.item,i=u.boardOptions,f=(m,p,b,N,j=!1)=>s.jsx($w,{label:p,bare:j,value:o[m]??0,min:b,max:N,onCommit:E=>n.onPatch({[m]:E})},m+n.file+(o[m]??""));return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"pp-head","aria-label":i.aria,children:[s.jsx("button",{className:"pp-file",onClick:n.onRenameFile,title:i.renameFileTitle,children:n.file}),s.jsxs("h2",{className:"pp-name",children:[s.jsx("span",{children:o.title??n.file}),s.jsx("button",{className:"icon-btn pp-ib","aria-label":u.menu.rename,title:i.renameTitle,onClick:n.onRename,children:s.jsx(Q,{name:"edit",size:16})})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:i.positionAndSize}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:i.position}),s.jsxs("span",{className:"pp-two",children:[f("x","X"),f("y","Y")]})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.boardOptions.size}),s.jsxs("span",{className:"pp-two",children:[f("w",i.width,40,8e3),f("h",i.height,40,8e3)]})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:i.radius}),s.jsx("span",{className:"pp-two",children:f("radius",i.radius,0,200,!0)})]}),s.jsxs("div",{className:"pp-row",title:"bg",children:[s.jsx("span",{className:"pp-l",children:i.bg}),s.jsxs("span",{className:"tw-color",children:[s.jsx("label",{className:"sw-btn",style:{background:o.bg??"transparent"},children:s.jsx("input",{type:"color",value:/^#[0-9a-f]{6}$/i.test(o.bg??"")?o.bg:"#ffffff","aria-label":i.bg,onChange:m=>n.onPatch({bg:m.target.value.toUpperCase()})})}),s.jsx(Mw,{value:o.bg??"",placeholder:i.bgNone,label:`${i.bg} (hex)`,onCommit:m=>n.onPatch({bg:m||void 0})},n.file+(o.bg??""))]})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:i.print}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:i.printMode}),s.jsx("span",{className:"pp-seg",role:"radiogroup","aria-label":i.print,children:["continuous","fixed"].map(m=>s.jsx("button",{role:"radio","aria-checked":(o.print??"continuous")===m,className:(o.print??"continuous")===m?"on":"",onClick:()=>n.onPatch({print:m==="fixed"?"fixed":void 0,...m==="continuous"?{paper:void 0}:{}}),children:i.printModes[m]},m))})]}),o.print==="fixed"&&s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:i.paper}),s.jsx("span",{className:"pp-seg",role:"radiogroup","aria-label":i.paper,children:["letter","a4"].map(m=>s.jsx("button",{role:"radio","aria-checked":(o.paper??"letter")===m,className:(o.paper??"letter")===m?"on":"",onClick:()=>n.onPatch({paper:m==="letter"?void 0:m}),children:i.papers[m]},m))})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:i.options}),s.jsx(hf,{on:!!o.is_interactive,label:i.interactive,title:i.interactiveTitle,onChange:m=>n.onPatch({is_interactive:m||void 0})}),s.jsx(hf,{on:!!o.frameless,label:i.frameless,onChange:m=>n.onPatch({frameless:m||void 0})}),s.jsx(hf,{on:o.expand==="fill",label:i.fill,onChange:m=>n.onPatch({expand:m?"fill":void 0})}),s.jsx(hf,{on:n.isLaunch,label:i.launch,onChange:n.onLaunch}),n.pages.length>0&&s.jsxs("label",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:i.page}),s.jsx("select",{value:o.page??n.pages[0].id,onChange:m=>n.onPatch({page:m.target.value}),children:n.pages.map(m=>s.jsx("option",{value:m.id,children:m.name},m.id))})]})]})]})}function Mw(n){const[o,i]=v.useState(n.value);return s.jsx("input",{className:"tw-hex","aria-label":n.label,value:o,placeholder:n.placeholder,spellCheck:!1,onChange:f=>i(f.target.value),onBlur:()=>o.trim()!==n.value&&n.onCommit(o.trim()),onKeyDown:f=>{f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&i(n.value)}})}function Aw(n){const o=u.boardOptions;return s.jsxs("footer",{className:"pp-actions","aria-label":u.inspector.boardActions,children:[s.jsx("button",{className:"icon-btn","aria-label":o.focus,title:o.focusTitle,onClick:n.onFocus,children:s.jsx(Q,{name:"focus"})}),s.jsx("button",{className:"icon-btn","aria-label":o.duplicate,title:o.duplicateTitle,onClick:n.onDuplicate,children:s.jsx(Q,{name:"copy"})}),s.jsx("button",{className:"icon-btn","aria-label":o.front,title:o.frontTitle,onClick:n.onFront,children:s.jsx(Q,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":o.back,title:o.backTitle,onClick:n.onBack,children:s.jsx(Q,{name:"back"})}),s.jsx("button",{className:"icon-btn pp-del","aria-label":o.delete,title:o.deleteTitleKey,onClick:n.onDelete,children:s.jsx(Q,{name:"trash"})})]})}function hf(n){return s.jsxs("label",{className:"check",title:n.title,children:[s.jsx("input",{type:"checkbox",checked:n.on,onChange:o=>n.onChange(o.target.checked)}),s.jsx("i",{className:n.on?"on":"","aria-hidden":"true",children:n.on&&s.jsx(Q,{name:"check",size:12})}),n.label]})}function $w({label:n,value:o,min:i,max:f,bare:m,onCommit:p}){const[b,N]=v.useState(String(o));v.useEffect(()=>N(String(o)),[o]);const j=()=>{let E=Math.round(Number(b));if(!Number.isFinite(E))return N(String(o));i!=null&&(E=Math.max(i,E)),f!=null&&(E=Math.min(f,E)),E!==o&&p(E),N(String(E))};return s.jsxs("label",{className:"num",children:[!m&&s.jsx("span",{children:n}),s.jsx("input",{inputMode:"numeric","aria-label":m?n:void 0,value:b,onChange:E=>N(E.target.value),onBlur:j,onKeyDown:E=>{if(!E.nativeEvent.isComposing&&(E.key==="Enter"&&E.target.blur(),E.key==="ArrowUp"||E.key==="ArrowDown")){E.preventDefault();const S=Number(b)+(E.key==="ArrowUp"?1:-1)*(E.shiftKey?10:1);N(String(S))}}})]})}function zw({store:n,...o}){return s.jsx(Cw,{...o,view:Zm(n)})}const mb="https://screens.invalid/",Ow=n=>n.split("/").map(encodeURIComponent).join("/");function Rw({board:n,file:o,onClose:i,onLocate:f,screens:m=Ob}){var B;const p=v.useRef(null),[b,N]=v.useState(o),[j,E]=v.useState({list:[o],i:0}),S=!!m.html,w=S?j.list[j.i]:b,k=n.boards[w]??n.boards[o],z=V=>E(M=>({list:[...M.list.slice(0,M.i+1),V],i:M.i+1})),R=V=>{var M,X,te,ee;if(S)return E(ce=>({...ce,i:Math.max(0,Math.min(ce.list.length-1,ce.i+V))}));try{V<0?(X=(M=p.current)==null?void 0:M.contentWindow)==null||X.history.back():(ee=(te=p.current)==null?void 0:te.contentWindow)==null||ee.history.forward()}catch{}},K=()=>{var M,X,te;let V=null;try{V=((M=p.current)==null?void 0:M.contentDocument)??null}catch{}if(V==null||V.addEventListener("click",ee=>{var he,fe,pe;const ce=(fe=(he=ee.target)==null?void 0:he.closest)==null?void 0:fe.call(he,"a[href]");if(!ce)return;if(S){const Oe=new URL(ce.getAttribute("href")??"",mb+Ow(w));if(Oe.href.startsWith(mb)){const Ye=decodeURIComponent(Oe.pathname.slice(1));if(Ye===w&&Oe.hash)return;ee.preventDefault(),((pe=m.html)==null?void 0:pe.call(m,Ye))!=null&&z(Ye);return}ee.preventDefault(),window.open(Oe.href,"_blank","noopener");return}const ie=new URL(ce.href,V.baseURI);ie.origin!==location.origin&&(ee.preventDefault(),window.open(ie.href,"_blank","noopener"))}),!S)try{const ee=new URL(m.url(""),location.href).href,ce=((te=(X=p.current)==null?void 0:X.contentWindow)==null?void 0:te.location.href)??"";ce.startsWith(ee)&&N(decodeURIComponent(ce.slice(ee.length).split(/[?#]/)[0]))}catch{}};return v.useEffect(()=>{const V=M=>M.key==="Escape"&&i();return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[i]),s.jsxs("div",{className:"play",onPointerDown:V=>V.target===V.currentTarget&&i(),children:[s.jsxs("div",{className:"play-bar",children:[s.jsx("button",{onClick:()=>R(-1),title:u.play.back,disabled:S&&j.i===0,children:"←"}),s.jsx("button",{onClick:()=>R(1),title:u.play.forward,disabled:S&&j.i>=j.list.length-1,children:"→"}),s.jsx("strong",{children:(k==null?void 0:k.title)??w}),s.jsx("span",{className:"muted",children:w}),s.jsx("div",{className:"spacer"}),s.jsx("button",{onClick:()=>{f(w),i()},children:u.play.viewOnCanvas}),s.jsx("button",{onClick:i,title:u.play.closeTitle,children:u.play.close})]}),s.jsx("iframe",{ref:p,className:"play-frame",src:S?void 0:m.url(o),srcDoc:S?(B=m.html)==null?void 0:B.call(m,w):void 0,title:u.viewer.play,onLoad:K,style:{width:Math.min((k==null?void 0:k.w)??390,window.innerWidth-32)}})]})}function Dw(n,o){return n.length===1&&Object.hasOwn(o,n[0])?"play":"pen"}function pb(n){return(n.split(/[\\/]/).pop()||"board.html").replace(/\.html?$/i,"")+".png"}function jm(n,o){return n===501||/executable doesn't exist|playwright install|playwright is not installed|failed to launch|browserType\.launch/i.test(o)?"browser":"render"}const Nm=n=>(n.split(`
67
+ `)[0]??"").trim().slice(0,140),$t=u.design,Bw=[{prop:"width",label:u.properties.fields.width},{prop:"height",label:u.properties.fields.height},{prop:"margin",label:"margin"},{prop:"color",label:u.properties.fields.color,color:!0},{prop:"background",label:u.properties.fields.background,color:!0},{prop:"display",label:"display",options:["","block","flex","grid","inline-flex","none"]},{prop:"flex-direction",label:u.properties.fields.flexDirection,options:["","row","column"]},{prop:"align-items",label:u.properties.fields.alignItems,options:["","flex-start","center","flex-end","stretch","baseline"]},{prop:"justify-content",label:u.properties.fields.justifyContent,options:["","flex-start","center","flex-end","space-between"]},{prop:"flex-wrap",label:u.properties.fields.flexWrap,options:["","nowrap","wrap"]},{prop:"flex-grow",label:u.properties.fields.flexGrow,options:["","0","1"]},{prop:"align-self",label:u.properties.fields.alignSelf,options:["","auto","flex-start","center","flex-end","stretch"]},{prop:"line-height",label:u.properties.fields.lineHeight},{prop:"text-align",label:u.properties.fields.textAlign,options:["","left","center","right"]},{prop:"border",label:u.properties.fields.border},{prop:"box-shadow",label:u.properties.fields.boxShadow},{prop:"opacity",label:u.properties.fields.opacity}];function gb(n){if(!n||n==="none")return null;const o=n.match(/^\s*repeat\(\s*(\d+)\s*,/);if(o)return Number(o[1]);let i=0,f=0,m=!1;for(const p of n)p==="("&&i++,p===")"&&i--,/\s/.test(p)&&i===0?m=!1:m||(m=!0,f++);return f||null}const Hw=n=>`repeat(${n}, minmax(0, 1fr))`,Lw=[{dir:"left",label:u.properties.alignButtons.left,icon:"alignLeft"},{dir:"hcenter",label:u.properties.alignButtons.hcenter,icon:"alignHcenter"},{dir:"right",label:u.properties.alignButtons.right,icon:"alignRight"},{dir:"top",label:u.properties.alignButtons.top,icon:"alignTop"},{dir:"vcenter",label:u.properties.alignButtons.vcenter,icon:"alignVcenter"},{dir:"bottom",label:u.properties.alignButtons.bottom,icon:"alignBottom"}],_w={a:["href"],img:["src","alt"],input:["placeholder"],button:["aria-label"]};function Uw(n){var K;const o=n.selection,i=_w[o.tag]??[],f=Gb(n.tokens),m=Yb(o,n.inline),p=!!o.text.trim(),[b,N]=v.useState(null);v.useEffect(()=>N(null),[o.file,o.path]);const j=o.path+o.hash,E=B=>tb(B,n.inline[B]??"",n.tokens),S=B=>{var M;const V=ba(B);return V==="#FFFFFF"?$t.white:V==="#000000"?$t.black:((M=Bu(B,f))==null?void 0:M.name)??V??B},w=ba(o.styles["background-color"]),k=p?m.prop==="background"?yf(o.styles.color??"",w??n.bg):yf(o.styles.color??"",n.bg):null,z=k==null?null:m.prop==="background"?$t.contrastWith(k.toFixed(1),S(o.styles.color??""),$t.grade(k)):$t.contrastOn(k.toFixed(1),S(n.bg),$t.grade(k)),R=[...new Set([...(K=n.tokens)!=null&&K.registered?n.tokens.fontWeights:[],100,200,300,400,500,600,700,800,900])].sort((B,V)=>B-V);return s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:$t.fill}),s.jsx(Ol,{word:$t.color,css:m.css,children:s.jsx(bb,{value:m.value,computed:m.prop==="color"?o.styles.color:o.styles["background-color"],colors:f,css:m.css,label:$t.fill,open:b==="fill",onToggle:()=>N(B=>B==="fill"?null:"fill")})}),z&&s.jsx("div",{className:"pp-row",children:s.jsx("span",{className:`pp-note contrast ${k>=4.5?"ok":k>=3?"mid":"bad"}`,title:u.properties.contrastTitle,children:z})}),b==="fill"&&s.jsx(Dm,{title:$t.fill,value:m.value,colors:f,vars:n.vars,onPick:B=>n.onStyle(m.css,B)})]}),p&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:$t.text}),s.jsx(Ol,{word:$t.font,css:"font-family",children:s.jsx(ii,{label:$t.font,value:_y(n.inline["font-family"]),placeholder:_y(o.styles["font-family"]),onCommit:B=>n.onStyle("font-family",B?b0(B):"")},"ff"+j)}),s.jsx(Ol,{word:$t.size,css:"font-size",warn:E("font-size"),children:s.jsx(ii,{label:$t.size,value:Fa(n.inline["font-size"]),placeholder:Fa(o.styles["font-size"]),onCommit:B=>n.onStyle("font-size",bf(B))},"fs"+j)}),s.jsx(Ol,{word:$t.weight,css:"font-weight",warn:E("font-weight"),children:s.jsxs("select",{"aria-label":$t.weight,defaultValue:n.inline["font-weight"]??"",onChange:B=>n.onStyle("font-weight",B.target.value),children:[s.jsx("option",{value:"",children:$t.inherited(Am(o.styles["font-weight"],$t.weights))}),R.map(B=>s.jsx("option",{value:String(B),children:Am(B,$t.weights)},B))]},"fw"+j)}),s.jsx(Ol,{word:At.letterSpacing,css:"letter-spacing",children:s.jsx(ii,{label:At.letterSpacing,value:Fa(n.inline["letter-spacing"]),placeholder:o.styles["letter-spacing"]==="normal"?"0":Fa(o.styles["letter-spacing"]),onCommit:B=>n.onStyle("letter-spacing",qw(B))},"ls"+j)}),m.prop==="background"&&s.jsxs(s.Fragment,{children:[s.jsx(Ol,{word:$t.color,css:"color",children:s.jsx(bb,{value:n.inline.color??"",computed:o.styles.color,colors:f,css:"color",label:$t.color,open:b==="color",onToggle:()=>N(B=>B==="color"?null:"color")})}),b==="color"&&s.jsx(Dm,{title:$t.color,value:n.inline.color||o.styles.color||"",colors:f,vars:n.vars,onPick:B=>n.onStyle("color",B)})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.properties.layout}),s.jsx(Ol,{word:$t.cornerRadius,css:"border-radius",warn:E("border-radius"),children:s.jsx(ii,{label:$t.cornerRadius,value:Fa(n.inline["border-radius"]),placeholder:Fa(o.styles["border-radius"]),onCommit:B=>n.onStyle("border-radius",bf(B))},"br"+j)}),s.jsx(Ol,{word:$t.padding,css:"padding",warn:E("padding"),children:s.jsx(ii,{label:$t.padding,value:Mm(n.inline.padding),placeholder:Mm(o.styles.padding),onCommit:B=>n.onStyle("padding",g0(B))},"pd"+j)}),s.jsx(Ol,{word:$t.gap,css:"gap",warn:E("gap"),children:s.jsx(ii,{label:$t.gap,value:Fa(n.inline.gap),placeholder:Fa(o.styles.gap==="normal"?"":o.styles.gap),onCommit:B=>n.onStyle("gap",bf(B))},"gp"+j)}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.properties.align}),s.jsx("span",{className:"align-set",role:"group","aria-label":u.properties.align,children:Lw.map(B=>s.jsx("button",{className:"icon-btn","aria-label":B.label,title:B.label,onClick:()=>n.onAlign(B.dir),children:s.jsx(Q,{name:B.icon,size:16})},B.dir))})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.properties.wrap}),s.jsxs("span",{className:"pp-btns",children:[s.jsx("button",{className:"btn",onClick:()=>n.onWrap("flex"),disabled:!n.canWrap,title:u.properties.wrapTitle,children:u.properties.wrapFlex}),s.jsx("button",{className:"btn",onClick:()=>n.onWrap("grid"),disabled:!n.canWrap,title:u.properties.wrapTitle,children:u.properties.wrapGrid})]})]}),n.onReplaceImage&&s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.properties.image}),s.jsx("span",{className:"pp-btns",children:s.jsx("button",{className:"btn",onClick:n.onReplaceImage,children:u.properties.replaceImage})})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:At.size}),["width","height"].map(B=>s.jsx(Vw,{axis:B,inline:n.inline[B]??"",computed:o.styles[B]??"",onStyle:n.onStyle},B+j)),s.jsx(Ol,{word:At.position,css:"position",children:s.jsxs("select",{"aria-label":At.position,value:n.inline.position==="absolute"?"absolute":"",onChange:B=>n.onStyle("position",B.target.value),children:[s.jsx("option",{value:"",children:At.flow}),s.jsx("option",{value:"absolute",children:At.absolute})]},"ps"+j)})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:At.look}),s.jsx(Gw,{inline:n.inline.opacity??"",computed:o.styles.opacity??"1",onStyle:n.onStyle},"op"+j),s.jsxs("div",{className:"pp-row",title:"border-style",children:[s.jsx("span",{className:"pp-l",children:At.border}),s.jsx("span",{className:"pp-seg",role:"radiogroup","aria-label":At.border,children:["none","solid","dashed","dotted"].map(B=>{const V=n.inline["border-style"]||(n.inline.border??"").split(/\s+/).find(M=>["solid","dashed","dotted","none"].includes(M))||(o.styles["border-style"]&&o.styles["border-width"]!=="0px"?o.styles["border-style"]:"none");return s.jsx("button",{role:"radio","aria-checked":V===B,className:V===B?"on":"",onClick:()=>{if(B==="none")return n.onStyle("border-style",n.inline.border?"none":"");!n.inline.border&&(o.styles["border-width"]??"0px").startsWith("0")?n.onStyle("border",`1px ${B} currentColor`):n.onStyle("border-style",B)},children:At.borderStyles[B]},B)})})]}),s.jsx(Ol,{word:At.shadow,css:"box-shadow",children:s.jsxs("select",{"aria-label":At.shadow,value:yb(n.inline["box-shadow"]??""),onChange:B=>n.onStyle("box-shadow",Gm[B.target.value]??""),children:[Object.keys(Gm).map(B=>s.jsx("option",{value:B,children:At.shadows[B]},B)),yb(n.inline["box-shadow"]??"")==="custom"&&s.jsx("option",{value:"custom",disabled:!0,children:At.shadows.custom})]},"sh"+j)})]}),o.tag==="a"&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:At.link}),s.jsx(Ol,{word:At.href,css:"href",children:s.jsx(ii,{label:At.href,value:n.attrs.href??"",placeholder:"https://",onCommit:B=>n.onAttr("href",B||null)},"hr"+j)}),s.jsxs("div",{className:"pp-row",title:"target",children:[s.jsx("span",{className:"pp-l",children:At.newTab}),s.jsx("span",{className:"pp-v",children:s.jsx("button",{type:"button",role:"switch","aria-checked":n.attrs.target==="_blank","aria-label":At.newTab,className:`switch ${n.attrs.target==="_blank"?"on":""}`,onClick:()=>n.onAttr("target",n.attrs.target==="_blank"?null:"_blank")})})]})]}),n.onExport&&s.jsx(Yw,{onExport:n.onExport},"ex"+j),n.children,s.jsx(Cu,{id:"more-css",title:$t.more,children:s.jsxs("div",{className:"more-css",children:[Bw.map(B=>s.jsx(Sm,{label:B.label,value:n.inline[B.prop]??(B.prop==="background"?n.inline["background-color"]??"":""),placeholder:o.styles[B.prop==="background"?"background-color":B.prop]??"",options:B.options,color:B.color,swatches:B.color?f:void 0,warn:tb(B.prop,n.inline[B.prop]??(B.prop==="background"?n.inline["background-color"]??"":""),n.tokens),ratio:B.prop==="color"?yf(n.inline.color||o.styles.color||"",n.bg):null,onCommit:V=>n.onStyle(B.prop,V)},B.prop+j)),(n.inline.display??o.styles.display??"").includes("grid")&&["grid-template-columns","grid-template-rows"].map(B=>s.jsx(Sm,{label:B.endsWith("columns")?u.properties.columns:u.properties.rows,value:String(gb(n.inline[B])??""),placeholder:String(gb(o.styles[B])??""),onCommit:V=>n.onStyle(B,/^\d+$/.test(V)&&Number(V)>0?Hw(Math.min(24,Number(V))):V)},B+j)),i.map(B=>s.jsx(Sm,{label:B,value:n.attrs[B]??"",placeholder:"",onCommit:V=>n.onAttr(B,V===""?null:V)},B+j))]})})]})}const At=u.extra,Gm={none:"",small:"0 1px 2px rgba(0, 0, 0, 0.12)",medium:"0 4px 12px rgba(0, 0, 0, 0.16)",large:"0 12px 32px rgba(0, 0, 0, 0.2)"},yb=n=>{var o;return((o=Object.entries(Gm).find(([,i])=>i.replace(/\s+/g,"")===n.replace(/\s+/g,"")))==null?void 0:o[0])??(n?"custom":"none")},qw=n=>/^-?\d*(?:\.\d+)?$/.test(n.trim())&&n.trim()?`${Number(n)}em`:n.trim();function Vw(n){const o=n.inline==="fit-content"||n.inline==="auto"?"hug":n.inline==="100%"?"fill":n.inline?"fixed":"hug",i=n.axis==="width"?At.width:At.height,f=Math.round(parseFloat(n.computed)||0);return s.jsxs("div",{className:"pp-row",title:n.axis,children:[s.jsx("span",{className:"pp-l",children:i}),s.jsxs("span",{className:"pp-two",children:[s.jsx(ii,{label:i,value:o==="fixed"?Fa(n.inline):"",placeholder:String(f),onCommit:m=>n.onStyle(n.axis,bf(m))}),s.jsxs("select",{"aria-label":At.mode(i),value:o,onChange:m=>n.onStyle(n.axis,m.target.value==="hug"?n.inline?"fit-content":"":m.target.value==="fill"?"100%":`${f}px`),children:[s.jsx("option",{value:"fixed",children:At.fixed}),s.jsx("option",{value:"hug",children:At.hug}),s.jsx("option",{value:"fill",children:At.fill})]})]})]})}function Gw(n){const o=Math.round(Number(n.inline||n.computed||1)*100),[i,f]=v.useState(o);v.useEffect(()=>f(o),[o]);const m=p=>{const b=Math.max(0,Math.min(100,Math.round(p)));b!==o&&n.onStyle("opacity",b===100?"":String(b/100))};return s.jsxs("div",{className:"pp-row",title:"opacity",children:[s.jsx("span",{className:"pp-l",children:At.opacity}),s.jsxs("span",{className:"pp-v op-row",children:[s.jsxs("span",{className:"num",children:[s.jsx("input",{type:"number",min:0,max:100,value:i,"aria-label":At.opacity,onChange:p=>f(Number(p.target.value)),onBlur:()=>m(i),onKeyDown:p=>p.key==="Enter"&&m(i)}),s.jsx("span",{children:"%"})]}),s.jsx("input",{type:"range",min:0,max:100,value:i,"aria-label":`${At.opacity} (slider)`,onChange:p=>f(Number(p.target.value)),onPointerUp:()=>m(i),onKeyUp:()=>m(i)})]})]})}function Yw(n){const[o,i]=v.useState(!1);return s.jsx("section",{className:"pp-group","aria-label":At.export,children:s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:At.export}),s.jsx("span",{className:"pp-btns",children:s.jsx("button",{className:"btn",disabled:o,onClick:()=>{i(!0),n.onExport().finally(()=>i(!1))},children:o?At.exporting:At.exportPng})})]})})}const bf=n=>/^-?\d+(?:\.\d+)?$/.test(n.trim())?`${Number(n)}px`:n.trim();function Ol(n){return s.jsxs("label",{className:"pp-row",title:n.css,children:[s.jsxs("span",{className:"pp-l",children:[n.word,n.warn&&s.jsxs("span",{className:"tok-warn",title:n.warn,"aria-label":u.properties.offToken(n.warn),children:[" ","⚠"]})]}),n.children]})}function ii(n){const[o,i]=v.useState(n.value);v.useEffect(()=>i(n.value),[n.value]);const f=()=>o.trim()!==n.value.trim()&&n.onCommit(o.trim());return s.jsx("input",{"aria-label":n.label,value:o,placeholder:n.placeholder,onChange:m=>i(m.target.value),onBlur:f,onKeyDown:m=>{m.nativeEvent.isComposing||(m.key==="Enter"&&m.currentTarget.blur(),m.key==="Escape"&&(i(n.value),m.stopPropagation()))}})}function bb(n){const o=n.value||n.computed||"",i=Bu(o,n.colors),f=ba(o)??ba(n.computed)??(i?ba(i.value):null);return s.jsxs("button",{className:`fillv ${n.open?"on":""}`,"aria-expanded":n.open,"aria-label":$t.openFill(n.label),title:n.css,onClick:m=>{m.preventDefault(),n.onToggle()},children:[s.jsx("span",{className:"sw",style:{background:f??"transparent"}}),s.jsx("span",{className:"fillv-name",children:(i==null?void 0:i.name)??f??$t.none}),i&&f&&s.jsx("span",{className:"muted",children:f})]})}function Sm(n){const[o,i]=v.useState(n.value);v.useEffect(()=>i(n.value),[n.value]);const f=(m=o)=>{m.trim()!==n.value.trim()&&n.onCommit(m.trim())};return s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:[n.label,n.warn&&s.jsxs("span",{className:"tok-warn",title:n.warn,"aria-label":u.properties.offToken(n.warn),children:[" ","⚠"]})]}),n.options?s.jsx("select",{value:o,onChange:m=>{i(m.target.value),f(m.target.value)},children:n.options.map(m=>s.jsx("option",{value:m,children:m||`(${n.placeholder||u.properties.none})`},m))}):s.jsx("input",{value:o,placeholder:n.placeholder,onChange:m=>i(m.target.value),onBlur:()=>f(),onKeyDown:m=>{m.nativeEvent.isComposing||(m.key==="Enter"&&m.currentTarget.blur(),m.key==="Escape"&&(i(n.value),m.currentTarget.blur()))}}),n.ratio!=null&&s.jsxs("span",{className:`ratio ${n.ratio>=4.5?"ok":n.ratio>=3?"mid":"bad"}`,title:u.properties.contrastTitle,children:[u.properties.contrast," ",n.ratio.toFixed(2),":1 · ",n.ratio>=7?"AAA":n.ratio>=4.5?"AA":n.ratio>=3?u.properties.largeTextOnly:u.properties.tooLow]}),n.chips&&s.jsx("span",{className:"chips-row",children:n.chips.map(m=>s.jsx("button",{className:`tchip ${o===m?"on":""}`,onClick:p=>{p.preventDefault(),i(m),f(m)},children:m.replace("px","")},m))}),n.color&&s.jsx("span",{className:"swatches",children:(n.swatches??[]).map(m=>s.jsx("button",{className:`swatch ${o.toUpperCase()===m.value?"on":""}`,title:`${m.name} ${m.value}`,style:{background:m.value},onClick:p=>{p.preventDefault(),i(m.value),f(m.value)}},m.value))})]})}const vb=384,xb=n=>/^[\w./@:,=+-]+$/.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`,Xw=n=>n>=1048576?`${(n/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(n/1024))} KB`;function Kw(n){const o=["npx easel-canvas export"];return n.dirFlag&&o.push(n.dirFlag),n.scope==="page"&&n.page&&o.push(`--page ${xb(n.pages.filter(i=>i.name===n.page.name).length>1?n.page.id:n.page.name)}`),n.scope==="boards"&&n.boards.length&&o.push(`--boards ${xb(n.boards.join(","))}`),n.single&&o.push("--single-file"),o.join(" ")}function Zw({pages:n,currentPage:o,selected:i,owner:f="",onRename:m}){const p=Pm(),b=Im(),N=b.status==="on",[j,E]=v.useState(!1),[S,w]=v.useState("all"),[k,z]=v.useState(!1),[R,K]=v.useState(null),[B,V]=v.useState(null),[M,X]=v.useState(null),[te,ee]=v.useState({}),[ce,ie]=v.useState({}),[he,fe]=v.useState({left:0,top:0,width:vb}),pe=v.useRef(null),Oe=v.useRef(null),Ye=n.find(de=>de.id===o)??n[0],ue=S==="boards"&&!i.length||S==="page"&&!n.length?"all":S,pt={scope:ue,page:ue==="page"?Ye==null?void 0:Ye.id:void 0,boards:ue==="boards"?i:void 0},Fe=(de=!0)=>{var U;E(!1),de&&((U=pe.current)==null||U.focus())},me=()=>{if(j)return Fe();w(i.length?"boards":"all"),E(!0)};v.useLayoutEffect(()=>{if(!j)return;const de=()=>{var Et;const U=pe.current.getBoundingClientRect(),ae=((Et=pe.current.closest(".oc-card"))==null?void 0:Et.getBoundingClientRect())??U,ge=Math.min(vb,window.innerWidth-16);fe({width:ge,top:Math.round(U.bottom+8),left:Math.round(Math.max(8,Math.min(ae.right-ge,window.innerWidth-ge-8)))})};return de(),window.addEventListener("resize",de),()=>window.removeEventListener("resize",de)},[j]),v.useLayoutEffect(()=>{j&&ns(Oe.current,".oc-seg button, .btn")}),v.useEffect(()=>{var ae,ge;if(!j)return;(ge=(ae=Oe.current)==null?void 0:ae.querySelector(".live-sec .btn, .oc-seg [aria-checked='true']"))==null||ge.focus();const de=Et=>{var Ht,Be;const Jt=Et.target;!((Ht=Oe.current)!=null&&Ht.contains(Jt))&&!((Be=pe.current)!=null&&Be.contains(Jt))&&Fe(!1)},U=Et=>{Et.key==="Escape"&&(Et.stopPropagation(),Fe())};return document.addEventListener("pointerdown",de,!0),window.addEventListener("keydown",U,!0),()=>{document.removeEventListener("pointerdown",de,!0),window.removeEventListener("keydown",U,!0)}},[j]),v.useEffect(()=>{j&&!R&&xe.get("/api/export").then(K,()=>{})},[j]);const Ae=JSON.stringify(pt);v.useEffect(()=>{if(!j||!k)return;let de=!0;return V(null),xe.post("/api/export/estimate",pt).then(U=>de&&V(U.bytes),()=>{}),()=>{de=!1}},[j,k,Ae]);const ze=async de=>{if(!M){X(de),ie(U=>({...U,[de]:void 0}));try{const U=await xe.post("/api/export",{...pt,format:de==="pdf"||de==="png"?de:"web",singleFile:de==="single"});ee(ae=>({...ae,[de]:U})),de==="single"&&V(U.bytes)}catch(U){ie(ae=>({...ae,[de]:U.message}))}finally{X(null)}}},qe=()=>xe.post("/api/export/reveal",{}).catch(de=>p({tone:"error",text:de.message})),Ve=async de=>{try{await navigator.clipboard.writeText(de),p({tone:"ok",text:u.share.copied(de)})}catch{p({tone:"error",text:u.share.copyFailed})}},re=k?"single":"web",Ne=te[re],at=R&&!R.browser.ok?R.browser.reason??"":null,H=(R==null?void 0:R.project)??"",se=de=>`${H?H+"/":""}${de.mainRel.endsWith("/")||de.kind==="web"?de.outRel:de.mainRel}`,ve=(R==null?void 0:R.single)??`${H}-canvas.html`,Ce=(de,U)=>s.jsxs("span",{className:"oc-res",role:"status",children:[s.jsxs("span",{className:"oc-rline",children:[s.jsx(Q,{name:"check",size:16}),s.jsx("code",{children:de.kind==="single"?de.mainRel.split("/").pop():se(de)})," ",de.kind==="single"?u.share.saved:u.share.exported]}),s.jsxs("span",{className:"oc-racts",children:[s.jsx("button",{className:"btn",title:u.share.revealTitle,onClick:()=>void qe(),children:u.share.reveal}),U.deploy&&de.deploy&&s.jsx("button",{className:"btn",title:u.share.copyDeployTitle(de.deploy),onClick:()=>void Ve(de.deploy),children:u.share.copyDeploy})]}),U.hint&&s.jsx("span",{className:"oc-rhint",children:u.share.attachHint}),de.skipped.length>0&&s.jsx("span",{className:"oc-rhint",title:de.skipped.map(ae=>`${ae.ref} (${ae.from}): ${ae.reason}`).join(`
68
+ `),children:u.share.skipped(de.skipped.length)})]}),Qe=(de,U,ae,ge)=>s.jsxs("div",{className:"oc-orow",children:[s.jsx("span",{className:"out-ic",children:s.jsx(Q,{name:U})}),s.jsxs("span",{className:"oc-otext",children:[s.jsx("strong",{children:ae}),s.jsx("span",{children:at?`${u.share.unavailable} ${at}`:ge})]}),s.jsx("button",{className:"btn",disabled:!!at,"aria-busy":M===de,onClick:()=>void ze(de),children:M===de?u.share.working:u.share.export}),ce[de]&&s.jsx(wb,{text:ce[de]}),te[de]&&!ce[de]&&Ce(te[de],{})]});return s.jsxs("div",{className:"share-wrap",children:[s.jsx("button",{ref:pe,className:`share-btn ${j?"on":""} ${N?"is-live":""}`,"aria-haspopup":"dialog","aria-expanded":j,"aria-label":N?`${u.share.button}, ${b.reconnecting?u.live.ownerReconnecting:u.live.on}${b.guests.length?`, ${u.live.presence(b.guests.map(de=>de.name).join(", "))}`:""}`:u.share.button,title:N&&b.reconnecting?u.live.ownerReconnectingHint:N&&b.guests.length?u.live.presence(b.guests.map(de=>de.name).join(", ")):u.share.buttonTitle,onClick:me,children:N?s.jsx(Z1,{live:b}):s.jsxs(s.Fragment,{children:[s.jsx(Q,{name:"share",size:16})," ",s.jsx("span",{className:"share-label",children:u.share.button})]})}),j&&s.jsxs("div",{ref:Oe,className:"share-pop oc-share entering",role:"dialog","aria-label":u.share.title,style:{left:he.left,top:he.top,width:he.width},onKeyDown:de=>{de.stopPropagation()},children:[s.jsx(F1,{owner:f,onRename:m}),s.jsx("h4",{children:u.share.title}),s.jsxs("div",{className:"oc-seg",role:"radiogroup","aria-label":u.share.scope,children:[s.jsx("button",{role:"radio","aria-checked":ue==="all",className:ue==="all"?"on":"",onClick:()=>w("all"),children:u.share.whole}),s.jsx("button",{role:"radio","aria-checked":ue==="page",className:ue==="page"?"on":"",disabled:!n.length,title:n.length?Ye==null?void 0:Ye.name:u.share.pageNone,onClick:()=>w("page"),children:u.share.page}),i.length>0&&s.jsx("button",{role:"radio","aria-checked":ue==="boards",className:ue==="boards"?"on":"",onClick:()=>w("boards"),children:u.share.selected(i.length)})]}),s.jsxs("div",{className:"oc-out",children:[s.jsxs("div",{className:"oc-orow first",children:[s.jsx("span",{className:"out-ic",children:s.jsx(Q,{name:k?"file":"folder"})}),s.jsxs("span",{className:"oc-otext",children:[s.jsx("strong",{children:k?u.share.singleTitle:u.share.webTitle}),s.jsx("span",{children:k?s.jsxs(s.Fragment,{children:[s.jsx("code",{children:ve}),u.share.singleHint(B==null?u.share.measuring:Xw(B))]}):u.share.webHint}),s.jsxs("label",{className:"oc-sw",children:[s.jsx("button",{type:"button",role:"switch","aria-checked":k,className:`switch ${k?"on":""}`,onClick:()=>z(de=>!de)}),s.jsx("span",{children:u.share.singleSwitch})]})]}),s.jsx("button",{className:"btn","aria-busy":M===re,onClick:()=>void ze(re),children:M===re?u.share.working:k?u.share.save:u.share.export}),ce[re]&&s.jsx(wb,{text:ce[re]}),Ne&&!ce[re]&&Ce(Ne,{deploy:!k,hint:k})]}),Qe("pdf","pdf",u.share.pdfTitle,u.share.pdfHint),Qe("png","image",u.share.pngTitle,u.share.pngHint)]}),s.jsxs("div",{className:"oc-pfoot",children:[k&&s.jsx("span",{children:u.share.largeFiles}),s.jsxs("span",{children:[u.share.sameAs," ",s.jsx("code",{children:Kw({dirFlag:R==null?void 0:R.dirFlag,scope:ue,page:Ye,pages:n,boards:i,single:k})})]})]})]})]})}function wb({text:n}){return s.jsxs("span",{className:"oc-err",role:"alert",children:[s.jsx(Q,{name:"warn",size:16}),s.jsx("span",{children:n})]})}function jb(n){const o=n.board.boards[n.file],i=v.useRef(null),[f,m]=v.useState({w:0,h:0});v.useLayoutEffect(()=>{const w=i.current;if(!w)return;const k=()=>m({w:w.clientWidth,h:w.clientHeight});k();const z=new ResizeObserver(k);return z.observe(w),()=>z.disconnect()},[]);const p=v.useRef(null);v.useEffect(()=>{var w;n.bare||(w=p.current)==null||w.focus({preventScroll:!0})},[n.bare]);const b=v.useRef(n.onKey);b.current=n.onKey;const N=w=>{const k=w.contentDocument;k&&k.addEventListener("keydown",z=>{if(!b.current||!["Escape","ArrowLeft","ArrowRight"].includes(z.key))return;const R=z.target;R&&(R.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(R.tagName))||(z.preventDefault(),b.current(z.key))})};if(!o)return null;const j=o.title??n.file,E=24,S=Math.min(1,(f.w-E*2)/o.w,(f.h-E*2)/o.h);return s.jsxs("div",{className:`oc-full ${n.bare?"bare":""} ${n.className??""}`,style:n.style,role:"dialog","aria-label":u.full.aria(j),children:[!n.bare&&s.jsxs("div",{className:"oc-full-bar",children:[s.jsx("button",{ref:p,className:"icon-btn oc-ib","aria-label":u.full.back,title:u.full.back,onClick:n.onClose,children:s.jsx(Q,{name:"chevronLeft"})}),n.title??s.jsx("strong",{className:"oc-full-name",title:`${j} · ${n.file}`,children:j}),n.nav,s.jsx("span",{className:"oc-full-gap"}),n.onExport&&s.jsx("button",{className:"icon-btn oc-ib","aria-label":u.canvas.exportBoard,title:u.canvas.exportBoard,onClick:n.onExport,children:s.jsx(Q,{name:"download"})}),s.jsx("div",{className:"oc-seg oc-full-mode",role:"radiogroup","aria-label":u.full.mode,children:["fill","fit"].map(w=>s.jsx("button",{role:"radio","aria-checked":n.mode===w,className:n.mode===w?"on":"",title:w==="fill"?u.full.fillTitle:u.full.fitTitle,onClick:()=>n.onMode(w),children:w==="fill"?u.full.fill:u.full.fit},w))})]}),s.jsx("div",{ref:i,className:`oc-full-stage ${n.mode}`,children:n.mode==="fill"?s.jsx("iframe",{src:`/screens/${n.file}`,title:j,className:"oc-full-fill",onLoad:w=>N(w.currentTarget)},`${n.file}-fill-${n.reloadKey??0}`):f.w>0&&s.jsx("div",{className:"oc-full-frame",style:{width:Math.round(o.w*S),height:Math.round(o.h*S),borderRadius:(o.radius??0)*S},children:s.jsx("iframe",{src:`/screens/${n.file}`,title:j,style:{width:o.w,height:o.h,transform:`scale(${S})`,transformOrigin:"0 0"},onLoad:w=>N(w.currentTarget)},`${n.file}-fit-${n.reloadKey??0}`)})})]})}function lv(n,o){const i=v.useRef(null),[f,m]=v.useState({left:n.x+12,top:n.y-8});return v.useLayoutEffect(()=>{const p=i.current;if(!p)return;const b=p.getBoundingClientRect(),N=n.x+12+o>window.innerWidth-8?n.x-12-o:n.x+12,j=Math.min(Math.max(48,n.y-8),window.innerHeight-b.height-8);m({left:Math.max(8,Math.round(N)),top:Math.round(j)})},[n.x,n.y,o]),{ref:i,pos:f}}function Fw(n){const{ref:i,pos:f}=lv(n.at,300),[m,p]=v.useState(""),[b,N]=v.useState(!1),[j,E]=v.useState(!1),S=async()=>{if(!(!m.trim()||j)){E(!0);try{await n.onSubmit(m.trim(),b)}finally{E(!1)}}};return s.jsxs("div",{ref:i,className:"cmt-pop cmt-composer",role:"dialog","aria-label":u.comments.title,style:{left:f.left,top:f.top,width:300},onPointerDown:w=>w.stopPropagation(),children:[s.jsx("p",{className:"cmt-crumbs",title:n.crumbs.join(" › "),children:n.crumbs.map((w,k)=>s.jsxs("span",{children:[k>0&&s.jsx("span",{className:"cmt-sep","aria-hidden":"true",children:" › "}),w]},k))}),s.jsx("textarea",{autoFocus:!0,value:m,"aria-label":u.comments.title,placeholder:u.comments.placeholder,onChange:w=>p(w.target.value),onKeyDown:w=>{w.nativeEvent.isComposing||(w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&S(),w.key==="Escape"&&(w.stopPropagation(),n.onCancel()))}}),s.jsxs("div",{className:"cmt-bar",children:[n.host&&s.jsxs("label",{className:"check req-check",title:u.requests.forAiCheckTitle,children:[s.jsx("input",{type:"checkbox",checked:b,onChange:w=>N(w.target.checked)}),s.jsx("i",{className:b?"on":"","aria-hidden":"true",children:b&&s.jsx(Q,{name:"check",size:12})}),u.requests.forAiCheck]}),s.jsx("span",{className:"cmt-gap"}),s.jsx("button",{className:"btn",onClick:n.onCancel,children:u.requests.cancel}),s.jsx("button",{className:"btn primary",disabled:!m.trim()||j,onClick:()=>void S(),children:u.comments.add})]})]})}function Qw(n){const{ref:i,pos:f}=lv(n.at,320);return v.useEffect(()=>{const m=b=>{var j;const N=b.target;N&&((j=i.current)!=null&&j.contains(N)||N.closest(".pin, .menu, .dialog"))||n.onClose()},p=b=>{b.key==="Escape"&&!(document.activeElement instanceof HTMLTextAreaElement)&&n.onClose()};return window.addEventListener("pointerdown",m,!0),window.addEventListener("keydown",p),()=>{window.removeEventListener("pointerdown",m,!0),window.removeEventListener("keydown",p)}},[n.onClose]),s.jsx("div",{ref:i,className:"cmt-pop cmt-thread",style:{left:f.left,top:f.top,width:320},onPointerDown:m=>m.stopPropagation(),children:n.children})}const Pw=["font-family","font-size","font-weight","line-height","letter-spacing","color","text-align"];function km(n){return n.split(";").map(o=>o.trim()).filter(Boolean).map(o=>{const i=o.indexOf(":");return i<0?`${o};`:`${o.slice(0,i).trim()}: ${o.slice(i+1).trim()};`}).join(`
69
+ `)}function Jw(n){const o=document.createElement("div").style;return n.split(/;|\n/).map(i=>i.trim()).filter(Boolean).filter(i=>{const f=i.indexOf(":");if(f<=0)return!0;const m=i.slice(0,f).trim(),p=i.slice(f+1).trim();return m.startsWith("--")?!p:(o.cssText="",o.setProperty(m,p),!o.getPropertyValue(m))})}function Iw(n){var z;const o=n.el.getAttribute("style")??"",[i,f]=v.useState(()=>km(o)),[m,p]=v.useState([]),b=v.useRef(km(o)),N=v.useRef(null);v.useEffect(()=>{const R=km(o);(document.activeElement!==N.current||R!==b.current)&&(f(R),p([])),b.current=R},[n.path,o]);const j=async()=>{if(i.trim()===b.current.trim())return;const R=Jw(i);p(R),!R.length&&await n.onSave(i)&&(b.current=i)},E=(z=n.el.ownerDocument.defaultView)==null?void 0:z.getComputedStyle(n.el),S=new Set(o.split(";").map(R=>R.split(":")[0].trim().toLowerCase())),w=E?Pw.filter(R=>!S.has(R)).map(R=>[R,E.getPropertyValue(R)]):[],k=Math.max(3,i.split(`
70
+ `).length+1);return s.jsx("div",{className:"pp inspector oc-code",children:s.jsxs("div",{className:"pp-scroll",children:[s.jsxs("p",{className:"code-target",children:[s.jsxs("code",{children:["<",n.tag,">"]}),n.label&&s.jsxs("span",{children:[" “",n.label.slice(0,40),"”"]})]}),s.jsx("textarea",{ref:N,className:"code-css","aria-label":u.code.inline,spellCheck:!1,rows:k,value:i,placeholder:u.code.placeholder,onChange:R=>{f(R.target.value),m.length&&p([])},onBlur:()=>void j(),onKeyDown:R=>{R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),j()),R.key==="Escape"&&(R.stopPropagation(),f(b.current),p([]))}}),m.length>0&&s.jsx("p",{className:"pp-note warn code-bad",role:"alert",children:u.code.bad(m.join("; "))}),w.length>0&&s.jsxs("section",{className:"pp-group code-inh","aria-label":u.code.computed,children:[s.jsx("h3",{className:"pp-group-h",children:u.code.computed}),w.map(([R,K])=>s.jsxs("div",{className:"code-row",children:[s.jsx("span",{className:"code-k",children:R}),s.jsxs("span",{className:"code-v",title:K,children:[R==="color"&&s.jsx("i",{className:"sw",style:{background:K}}),K]})]},R))]})]})})}const sv="design-canvas:hint",Tm={picks:2,edits:2,sessions:3},vf={picks:0,edits:0,sessions:0};function Ww(){try{const n=JSON.parse(localStorage.getItem(sv)??"null");return n&&typeof n=="object"?{...vf,...n}:vf}catch{return vf}}let $u=typeof window>"u"?vf:Ww();const ej=new Set;function tj(n){$u=n;try{localStorage.setItem(sv,JSON.stringify(n))}catch{}for(const o of ej)o()}const nj=n=>!n.on&&(!!n.off||n.picks>=Tm.picks&&n.edits>=Tm.edits||n.sessions>=Tm.sessions);function Nb(n){nj($u)||$u.on||tj({...$u,[n]:$u[n]+1})}const aj=["tools","edit","element","move","view","ai"],lj=[{id:"select",section:"tools",combos:["v"]},{id:"hand",section:"tools",combos:["h"]},{id:"board",section:"tools",combos:["b"]},{id:"title",section:"tools",combos:["t"]},{id:"note",section:"tools",combos:["n"]},{id:"rect",section:"tools",combos:["r"]},{id:"oval",section:"tools",combos:["o"]},{id:"line",section:"tools",combos:["l"]},{id:"arrow",section:"tools",combos:["a"]},{id:"penOrPlay",section:"tools",combos:["p"]},{id:"undo",section:"edit",combos:["cmd+z"]},{id:"redo",section:"edit",combos:["cmd+shift+z","cmd+y"]},{id:"copy",section:"edit",combos:["cmd+c"]},{id:"paste",section:"edit",combos:["cmd+v"]},{id:"duplicate",section:"edit",combos:["cmd+d"]},{id:"delete",section:"edit",combos:["delete","backspace"]},{id:"selectAll",section:"edit",combos:["cmd+a"]},{id:"lock",section:"edit",combos:["cmd+l"]},{id:"rename",section:"edit",combos:["f2"]},{id:"front",section:"edit",combos:["cmd+]"]},{id:"back",section:"edit",combos:["cmd+["]},{id:"copyPng",section:"element",combos:["cmd+shift+c"]},{id:"copyProps",section:"element",combos:["cmd+alt+c"]},{id:"pasteProps",section:"element",combos:["cmd+alt+v"]},{id:"flipH",section:"element",combos:["shift+h"]},{id:"flipV",section:"element",combos:["shift+v"]},{id:"wrap",section:"element",combos:["cmd+g"]},{id:"reorder",section:"element",combos:["alt+arrowup","alt+arrowdown"]},{id:"enter",section:"move",combos:["enter"]},{id:"next",section:"move",combos:["tab"]},{id:"arrows",section:"move",combos:["arrowup","arrowdown","arrowleft","arrowright"]},{id:"escape",section:"move",combos:["escape"]},{id:"regions",section:"move",combos:["f6"]},{id:"zoomIn",section:"view",combos:["cmd+="]},{id:"zoomOut",section:"view",combos:["cmd+-"]},{id:"zoom100",section:"view",combos:["cmd+0"]},{id:"fitAll",section:"view",combos:["shift+1","cmd+1"]},{id:"zoomSel",section:"view",combos:["shift+2"]},{id:"guides",section:"view",combos:["ctrl+g"]},{id:"minimap",section:"view",combos:["m"]},{id:"prototype",section:"view",combos:["f"]},{id:"panel",section:"view",combos:["cmd+\\"]},{id:"clean",section:"view",combos:["cmd+shift+\\"]},{id:"ai",section:"ai",combos:["cmd+j"]},{id:"find",section:"ai",combos:["cmd+k"]},{id:"comments",section:"ai",combos:["alt+c"]}],sj={arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→",escape:"Esc",enter:"↵",tab:"Tab",delete:"⌦",backspace:"⌫",f2:"F2",f6:"F6","=":"+"};function oj(n,o){const i=n.split("+"),f=n.endsWith("+")?"+":i[i.length-1],m=p=>i.slice(0,-1).includes(p);return`${m("ctrl")?"⌃":""}${m("alt")?"⌥":""}${m("shift")?"⇧":""}${m("cmd")?o:""}${sj[f]??f.toUpperCase()}`}const ij=400,mf="design-canvas:updating",mt=navigator.platform.includes("Mac")?"⌘":"Ctrl+",Sb=1200,Cm=7,cj=120,oi=335,Tf=n=>`design-canvas:${n}`;function rj(n){try{return JSON.parse(sessionStorage.getItem(Tf(n))??localStorage.getItem(Tf(n))??"{}")}catch{return{}}}const kb=[{id:"blank",label:u.templates.blank,size:"390×844",w:390,h:844,group:0},{id:"watch",label:u.templates.watch,size:"198×242",w:198,h:242,group:1},{id:"mobile",label:u.templates.mobile,size:"390×844",w:390,h:844,group:1},{id:"tablet",label:u.templates.tablet,size:"834×1194",w:834,h:1194,group:1},{id:"desktop",label:u.templates.desktop,size:"1440×900",w:1440,h:900,group:1},{id:"doc",label:u.templates.doc,size:"800×1000",w:800,h:1e3,group:2},{id:"email",label:u.templates.email,size:"600×1200",w:600,h:1200,group:2}],ci=[{id:"select",icon:"select",label:u.tools.select,hint:u.toolHints.select,key:"V"},{id:"hand",icon:"hand",label:u.tools.hand,hint:u.toolHints.hand,key:"H"},{id:"board",icon:"board",label:u.tools.board,hint:u.toolHints.board,key:"B"},{id:"title",icon:"title",label:u.tools.title,hint:u.toolHints.title,key:"T"},{id:"sticky",icon:"sticky",label:u.tools.sticky,hint:u.toolHints.sticky,key:"N"},{id:"rect",icon:"rect",label:u.tools.rect,hint:u.toolHints.rect,key:"R"},{id:"oval",icon:"oval",label:u.tools.oval,hint:u.toolHints.oval,key:"O"},{id:"line",icon:"line",label:u.tools.line,hint:u.toolHints.line,key:"L"},{id:"arrow",icon:"arrow",label:u.tools.arrow,hint:u.toolHints.arrow,key:"A"},{id:"pen",icon:"pen",label:u.tools.pen,hint:u.toolHints.pen,key:"P"}],uj=["rect","oval","line","arrow","pen"];function dj(){var Dc,Bc,Hc,ca,gn,Yi,Xo,Xi,Lc,Ml,Ki,_c,Uc,Xr,Kr,Zr,Fr,Qr,Pr,qc,Jr,md;const[n,o]=v.useState(null),[i,f]=v.useState(null),m=B0({x:0,y:0,zoom:.1}),p=Im().status==="on",b=G1();X1(m,p),v.useEffect(()=>void Lm(),[]);const N=m.set,[j,E]=v.useState(null),[S,w]=v.useState("select"),[k,z]=v.useState([]),[R,K]=v.useState([]),B=R.length===1?R[0]:null,V=c=>K(c?[c]:[]),[M,X]=v.useState(null),[te,ee]=v.useState(null),[ce,ie]=v.useState(null),[he,fe]=v.useState(null),pe=v.useRef(null),[Oe,Ye]=v.useState(null),[ue,pt]=v.useState(null),Fe=v.useRef(new Set),[me,Ae]=v.useState([]),[ze,qe]=v.useState(!1),[Ve,re]=v.useState(""),[Ne,at]=v.useState(null),[H,se]=v.useState(null),[ve,Ce]=v.useState("fit"),[Qe,de]=v.useState(0),[U,ae]=v.useState(!0),[ge,Et]=v.useState(()=>({w:window.innerWidth,h:window.innerHeight}));v.useEffect(()=>{const c=()=>Et({w:window.innerWidth,h:window.innerHeight});return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);const Jt=ge.w<=1e3,Ht=ge.w<=480,Be=ge.w<=Sb,ot=36,Pe=Be?32:36,on=Ht?8:12,fn=on+40+8,Nn=v.useRef(!0),[It,xa]=v.useState(!1),D=ge,[Z,ne]=v.useState(null),[Re,_e]=v.useState(!0),[Je,it]=v.useState(null),[Nt,cn]=v.useState(0);v.useLayoutEffect(()=>{if(!Je)return;const c=()=>cn(Math.round(Je.getBoundingClientRect().bottom));c();const h=new ResizeObserver(c);return h.observe(Je),()=>h.disconnect()},[Je,D.w,D.h]);const[Ft,Qt]=v.useState(0),[Pn,ct]=v.useState(0),Sn=v.useCallback((c,h)=>{Qt(c),ct(h)},[]),[Lt,rt]=v.useState(0),bt=v.useRef(null),[Ea,Dl]=v.useState(!1);v.useLayoutEffect(()=>{var x;const c=((x=document.querySelector(".oc .oc-dock"))==null?void 0:x.offsetWidth)??0;c!==Lt&&rt(c);const h=bt.current,g=!!h&&[...document.querySelectorAll(".oc .etb.oc-anchored, .oc .canvas-hint, .oc .oc-ask, .oc .oc-result")].some(T=>{const A=T.getBoundingClientRect();return A.width>0&&A.left<h.right+8&&A.right>h.left-8&&A.top<h.bottom+8&&A.bottom>h.top-8});g!==Ea&&Dl(g)});const[qt,St]=v.useState(null),[as,fr]=v.useState({canUndo:!1,canRedo:!1,undo:[],redo:[]}),[Ls,ml]=v.useState({}),[hn,wa]=v.useState({}),[Jn,ls]=v.useState({}),ss=c=>h=>({...h,[c]:(h[c]??0)+1}),pl=v.useRef(C1()).current,Oa=v.useRef(()=>{});Oa.current=(c,h,g=!1)=>{const x=ut.current.get(c),T=pl.decide(c,h,{shown:qb(x,c),patched:Wy(x,c)},g);if(!(T==="queue"||T==="keep")){if(T==="check")return void xe.get(`/api/file-hash?f=${encodeURIComponent(c)}`).then(A=>Oa.current(c,A.hash,!0)).catch(()=>Oa.current(c,void 0));pl.reset(c),ml(ss(c))}};const[gl,os]=v.useState(null),[_n,is]=v.useState(null),[tn,ri]=v.useState([]),Ot=J1(),[ho,ac]=v.useState(null),[$,I]=v.useState(null),Le=v.useRef(null),[we,Me]=v.useState(null),[nt,Ge]=v.useState(null),[kn,sa]=v.useState(new Set),[vt,zn]=sw(),da=v.useRef(null),Ra=v.useRef(null),[ui,hr]=v.useState(null),[lc,mr]=v.useState(!1),[nn,Qa]=v.useState("inspect"),[di,cs]=v.useState(""),[mo,po]=v.useState({comments:[],refs:[]}),[Bl,Un]=v.useState({}),fi=v.useRef(new Set),Lu=v.useCallback(c=>(fi.current.add(c),()=>void fi.current.delete(c)),[]),pr=v.useRef(null),Hl=v.useRef(0),[ja,hi]=v.useState("boards"),[gr,_u]=v.useState(0),[sc,ft]=v.useState(null),[In,Da]=v.useState([]),yl=In.length===1?In[0]:null,bl=c=>Da(c?[c]:[]),[Na,yr]=v.useState(0),On=E1(Na),[Pa,br]=v.useState(()=>{try{return localStorage.getItem("design-canvas:author")??""}catch{return""}});v.useEffect(()=>{Pa||xe.get("/api/me").then(c=>c.name&&br(c.name)).catch(()=>{})},[]),v.useEffect(()=>Xx(Pa),[Pa]);const rs=Pa||u.app.defaultAuthor;v.useEffect(()=>{if(!Sr.current)return;const c=new Map(tn.filter(va).map(x=>[x.id,x.request.state])),h=da.current;if(da.current=c,!h)return;const g=tn.filter(x=>{if(!va(x))return!1;const T=h.get(x.id),A=x.request.state;return T?T!==A&&(A==="done"||A==="failed"):A==="waiting"&&x.author===rs});g.length&&sa(x=>new Set([...x,...g.map(T=>T.id)]))},[tn]);const[Rn,mi]=v.useState(null),[Ll,oc]=v.useState(null),us=v.useRef(null),vr=v.useRef(()=>{}),[xr,_s]=v.useState(!0),[pi,Uu]=v.useState(()=>{try{return localStorage.getItem("design-canvas:theme")||"system"}catch{return"system"}});v.useEffect(()=>{pi==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",pi);try{localStorage.setItem("design-canvas:theme",pi)}catch{}},[pi]);const[go,Ja]=v.useState(null),yo=v.useRef(!1),ut=v.useRef(new Map),[_l,vl]=v.useState(0),ic=vj(),gi=v.useRef(null),ye=Pm(),Tn=r1(),wr=async()=>{const c=await Tn.prompt({title:u.dialog.authorTitle,label:u.dialog.name,value:Pa,ok:u.dialog.save});if(c!=null&&c.value.trim()){br(c.value.trim());try{localStorage.setItem("design-canvas:author",c.value.trim())}catch{}}},[Rt,jr]=v.useState(null),Ia=v.useCallback(()=>xe.update().then(c=>(jr(c),c),()=>null),[]);v.useEffect(()=>{Ia().then(h=>{let g=null;try{g=JSON.parse(sessionStorage.getItem(mf)??"null"),sessionStorage.removeItem(mf)}catch{}g&&h&&h.current===g.to&&ye({tone:"ok",text:u.update.done(g.to),ms:6e3})});const c=window.setInterval(()=>void Ia(),10800*1e3);return()=>window.clearInterval(c)},[Ia,ye]);const Ba=c=>c&&u.update.why[c]||u.update.why.failed,Us=c=>void navigator.clipboard.writeText(c).then(()=>ye({tone:"ok",text:u.update.copied,code:c,ms:8e3}),()=>ye({text:u.update.copied,code:c,ms:12e3})),bo=async()=>{var x;const c=Rt==null?void 0:Rt.update;if(!c)return;if(!c.self)return Us(c.command);const{pid:h}=await xe.health().catch(()=>({pid:0})),g=await xe.applyUpdate().catch(()=>({status:0,body:{}}));if(g.status!==202)return Ia(),ye({tone:"error",text:u.update.failed(c.latest,Ba(g.body.why)),action:{label:u.update.copy,run:()=>Us(g.body.command??c.command)},ms:12e3,slot:"update"});try{sessionStorage.setItem(mf,JSON.stringify({to:c.latest}))}catch{}jr(T=>T&&{...T,state:{phase:"installing",to:c.latest}}),ye({dot:!0,text:u.update.updating(c.latest),ms:6e5,slot:"update"});for(let T=0;T<600;T++){await new Promise(W=>setTimeout(W,1e3));const A=await xe.health().catch(()=>null);if(A&&h&&A.pid!==h)return window.location.reload();if(!A)continue;const L=await Ia();if(((x=L==null?void 0:L.state)==null?void 0:x.phase)==="failed"){try{sessionStorage.removeItem(mf)}catch{}return ye({tone:"error",text:u.update.failed(c.latest,Ba(L.state.why)),action:{label:u.update.copy,run:()=>{var W;return Us(((W=L.state)==null?void 0:W.command)??c.command)}},ms:15e3,slot:"update"})}}},ds=(c=Rt)=>{const h=c==null?void 0:c.update;if(!h)return[];const g=c==null?void 0:c.state,T=g&&g.phase!=="failed"?{label:u.update.updating(h.latest),note:u.update.versions(h.current,h.latest),dot:!0,disabled:!0,run:()=>{}}:(g==null?void 0:g.phase)==="failed"?{label:u.update.copyRow,note:Ba(g.why),dot:!0,run:()=>Us(g.command??h.command)}:h.self?c!=null&&c.busy?{label:u.update.row(h.latest),note:u.update.why.busy,dot:!0,disabled:!0,run:()=>{}}:{label:u.update.row(h.latest),note:u.update.versions(h.current,h.latest),dot:!0,run:()=>void bo()}:{label:u.update.row(h.latest),note:`${u.update.versions(h.current,h.latest)} · ${Ba(h.why)}`,dot:!0,tip:h.command,run:()=>Us(h.command)},A=(g==null?void 0:g.phase)==="failed"&&h.self&&!(c!=null&&c.busy)?[{label:u.update.retry,run:()=>void bo()}]:[];return[T,...A,"sep"]},Nr=v.useCallback(c=>ut.current.get(c)??null,[_l]),fs=v.useRef(null),Sa=v.useRef(null);Sa.current=i;const hs=v.useRef(null),an=v.useCallback(async()=>{try{const c=await xe.board();o(c),ls(c.stamps??{}),f(h=>xj(h,c.board)),os(null)}catch(c){os(String(c.message))}},[]),Sr=v.useRef(!1),Dn=v.useCallback(()=>xe.get("/api/comments").then(c=>{Sr.current=!0,ri(c.comments)}).catch(()=>{}),[]),Bn=v.useCallback(()=>xe.get("/api/history").then(fr).catch(()=>{}),[]),qs=v.useCallback(()=>xe.get("/api/errors").then(c=>Un(h=>JSON.stringify(h)===JSON.stringify(c.errors)?h:c.errors)).catch(()=>{}),[]),kt=i0((n==null?void 0:n.dir)??null),[Wt,xl]=v.useState(null),[Wa,vo]=v.useState(null),[Vs,kr]=v.useState(!1),[Ul,$f]=v.useState({}),[ql,wl]=v.useState(null),[zf,qu]=v.useState(!1),Vu=v.useRef(null),Gu=v.useRef(null),Yu=v.useRef(null),cc=v.useRef(null);v.useLayoutEffect(()=>{var aa,lo;ns(Gu.current),ns(Yu.current),ns(cc.current);const c=cc.current,h=c==null?void 0:c.querySelector(".oc-cmts");if(!c||!h)return;const g=[...c.children].filter(Mt=>Mt.getClientRects().length).pop();if(!g||!h.getClientRects().length)return;const x=Math.ceil(g.getBoundingClientRect().right-h.getBoundingClientRect().left),T=((aa=c.closest(".oc-right.is-rest"))==null?void 0:aa.offsetWidth)??0;T!==Tr&&Of(T);const A=document.querySelector(".oc-left .oc-head"),L=A==null?void 0:A.closest(".oc-left");if(!A||!L)return;const W=(Mt,so)=>[...Mt.children].filter(Zi=>Zi.getClientRects().length).pop().getBoundingClientRect().right-Mt.getBoundingClientRect().left+parseFloat(getComputedStyle(Mt).paddingRight)-so.getBoundingClientRect().width,ke=(Mt,so)=>{const Ga=Mt==null?void 0:Mt.querySelector(so);return Mt&&Ga?Math.ceil(W(Mt,Ga)+Math.max(Ga.scrollWidth,Ga.getBoundingClientRect().width)):0},Ee=A.querySelector(".oc-project"),$e=A.querySelector(".oc-page"),Ze=((Ee==null?void 0:Ee.getBoundingClientRect().width)??0)+(($e==null?void 0:$e.getBoundingClientRect().width)??0),ln=(Mt,so)=>{const Ga=Mt==null?void 0:Mt.querySelector(so);if(!Mt||!Ga)return 0;const Zi=[...Ga.textContent??""];let pd=0;const gd=Zi.findIndex(yd=>/\S/.test(yd)&&++pd>4);if(gd<0)return ke(Mt,so);const Fi=rc.current??(rc.current=document.createElement("canvas").getContext("2d"));return Fi?(Fi.font=getComputedStyle(Ga).font,Math.ceil(W(Mt,Ga)+Fi.measureText(Zi.slice(0,gd).join("").trimEnd()+"…").width)):0},je=ln(Ee,".app-title"),Gt=ln($e,".oc-page-name");Ee&&Ee.style.minWidth!==`${je}px`&&(Ee.style.minWidth=`${je}px`),$e&&$e.style.minWidth!==`${Gt}px`&&($e.style.minWidth=`${Gt}px`);const Ln=Mt=>Mt<2?Math.min(ke(Ee,".app-title"),cj)+ke($e,".oc-page-name"):Mt<6?je+Gt:Gt,Es=(((lo=[...A.children].filter(Mt=>Mt.getClientRects().length).pop())==null?void 0:lo.getBoundingClientRect().right)??0)-A.getBoundingClientRect().left+parseFloat(getComputedStyle(A).paddingRight)-Ze,Xe=L.classList.contains("is-collapsed"),Pt=Math.ceil(Es+Math.min(200,ke(Ee,".app-title"))+ke($e,".oc-page-name"));Pt!==Fu&&Rf(Pt);const ht=Mt=>Mt>=Cm?1/0:Math.min(Ne?1/0:oi-4-16,ge.w-on*2-8-8-(Xe?Es+Ln(Mt):L.offsetWidth)),ha=[ge.w,Xe,Ne,i==null?void 0:i.title,rn,Rc,Tt].join("|");if(ha!==Zu.current&&(Zu.current=ha,Ha!==0))return Ku(0);x>ht(Ha)&&Ha<Cm&&Ku(Ha+1)});const[Tr,Of]=v.useState(0),[Cr,Xu]=v.useState([]),xo=()=>xe.get("/api/projects").then(c=>Xu(c.projects),()=>Xu([]));v.useEffect(()=>(xo(),window.addEventListener("focus",xo),()=>window.removeEventListener("focus",xo)),[]);const[Ha,Ku]=v.useState(0),Zu=v.useRef(""),rc=v.useRef(null),[Fu,Rf]=v.useState(240);v.useEffect(()=>{an(),Dn(),Bn(),qs()},[an,Dn,Bn,qs]),v.useEffect(()=>{document.title=i!=null&&i.title?u.app.docTitle(i.title):u.app.title},[i==null?void 0:i.title]),v.useEffect(()=>{const c=new Map,h=x=>{const T=c.get(x);window.clearTimeout(T.t),T.t=window.setTimeout(()=>void xe.put("/api/errors",{file:x,errors:T.list}).catch(()=>{}),200)},g=x=>{const T=x.data;if(!T||T.type!=="dc-error"||typeof T.file!="string")return;if(T.start)return void c.set(T.file,{list:[],loaded:!1});const A=c.get(T.file)??{list:[],loaded:!0};if(c.set(T.file,A),T.loaded)return A.loaded=!0,h(T.file);A.list.length<20&&!A.list.some(L=>L.message===T.message)&&A.list.push({kind:T.kind,message:T.message,line:T.line}),A.loaded&&h(T.file)};return window.addEventListener("message",g),()=>window.removeEventListener("message",g)},[]);const bn=v.useCallback((c,h)=>{const g=Sa.current;if(!g)return;const x=c(g);if(Sa.current=x,f(x),!h)return;hs.current&&window.clearTimeout(hs.current);const T=()=>(Hl.current++,xe.saveBoard(Sa.current,h==="draft"?void 0:h).catch(A=>ye({tone:"error",text:u.toast.saveFailed(A.message)})).finally(()=>Hl.current--));h==="draft"?hs.current=window.setTimeout(()=>{hs.current=null,T()},ij):T()},[ye]),jl=v.useCallback(async c=>{try{const h=await xe.post(`/api/history/${c}`,{});h.label?ye({text:u.toast.undoRedoDone(c,u.activity.stepName(h.label))}):ye({text:c==="undo"?u.toast.nothingToUndo:u.toast.nothingToRedo}),await an()}catch(h){ye({tone:"error",text:String(h.message)})}Bn()},[ye,an,Bn]),Cn={label:u.toast.undoAction,run:()=>void jl("undo")},mn=v.useCallback(async(c,h=M)=>{var g;if(!h)return!1;pl.begin(h);try{const x=await xe.post("/api/edit",{file:h,...c});return x.base&&x.hash&&T1(ut.current.get(h),h,x)&&(pl.patched(h,x.base,x.hash),wa(ss(h))),!0}catch(x){return(g=fs.current)==null||g.setError(String(x.message)),ye({tone:"error",text:String(x.message)}),!1}finally{for(const x of pl.end(h))Oa.current(h,x)}},[M,ye,pl]),Qu=v.useCallback((c,h,g)=>{var Es,Xe,Pt;if(Array.from(h.children).some(ht=>ht.tagName!=="BR")){(Es=fs.current)==null||Es.setError(u.toast.textOnly);return}const x=h.innerText??"";Nb("edits"),ee(c);const T=h.getAttribute("contenteditable");h.contentEditable="true",h.focus();const A=h.ownerDocument,L=A.createRange();L.selectNodeContents(h),(Xe=A.getSelection())==null||Xe.removeAllRanges(),(Pt=A.getSelection())==null||Pt.addRange(L);const W=ht=>{if(h.contains(ht.target))return void(ht.type==="click"&&ht.preventDefault());ht.preventDefault(),ht.stopPropagation(),ht.type==="mousedown"&&h.blur()};A.addEventListener("mousedown",W,!0),A.addEventListener("click",W,!0);let ke=!1;const Ee=async()=>{var aa;h.removeEventListener("keydown",$e),A.removeEventListener("mousedown",W,!0),A.removeEventListener("click",W,!0),T==null?h.removeAttribute("contenteditable"):h.setAttribute("contenteditable",T),ee(null),document.activeElement===((aa=A.defaultView)==null?void 0:aa.frameElement)&&Tb();const ht=(h.innerText??"").replace(/\n$/,"");if(ke||ht===x){ke&&(h.innerText=x);return}const ha=await La(c,g);await mn({op:"setText",path:g,hash:ha,text:ht},c)||(h.innerText=x)},$e=ht=>{ht.isComposing||ht.keyCode===229||(ht.key==="Enter"&&!ht.shiftKey?(ht.preventDefault(),h.blur()):ht.key==="Escape"&&(ke=!0,h.blur()))};let Ze=!1,ln=!1;const je=()=>Ze=!0,Gt=()=>{Ze=!1,ln&&Ln()},Ln=()=>{h.removeEventListener("compositionstart",je),h.removeEventListener("compositionend",Gt),h.removeEventListener("blur",Yt),Ee()},Yt=()=>{Ze?ln=!0:Ln()};h.addEventListener("compositionstart",je),h.addEventListener("compositionend",Gt),h.addEventListener("keydown",$e),h.addEventListener("blur",Yt)},[mn]),La=(c,h)=>xe.get(`/api/element?f=${encodeURIComponent(c)}&path=${encodeURIComponent(h)}`).then(g=>(g.fileHash&&Wy(ut.current.get(c),c)&&Oa.current(c,g.fileHash,!0),g.hash)),Pu=async(c,h)=>{var x;if(!M)return;const g=await La(M,c);await mn({op:"move",path:c,hash:g,...h})&&((x=fs.current)==null||x.select([fj(c,h.toParentPath,h.index)]),ye({text:h.freeze.length?u.toast.movedFrozen:u.toast.moved,action:Cn}))},Ju=async()=>{var g;const c=Se.state.selection;if(!M||!c)return;const{source:h}=await xe.get(`/api/element?f=${encodeURIComponent(M)}&path=${encodeURIComponent(c.path)}&full=1`);try{localStorage.setItem("design-canvas:clip",JSON.stringify({source:h,file:M,path:c.path,tag:c.tag}))}catch{}await((g=navigator.clipboard)==null?void 0:g.writeText(h).catch(()=>{})),ye({tone:"ok",text:u.toast.copiedElement(c.tag,mt)})},Iu=async()=>{if(!M)return;let c=null;try{c=JSON.parse(localStorage.getItem("design-canvas:clip")??"null")}catch{c=null}if(!c)return ye({text:u.toast.nothingCopied});const h=Se.state.selection,g=(h==null?void 0:h.file)===M?h.path:"";if(await mn({op:"insert",path:g,hash:g?h.hash:void 0,position:"after",html:c.source})&&(ye({tone:"ok",text:u.toast.pasted(c.file,c.tag),action:Cn}),g)){const x=g.split("/");x[x.length-1]=String(Number(x[x.length-1])+1),setTimeout(()=>{var T;return void((T=fs.current)==null?void 0:T.select([x.join("/")]))},600)}},uc=(c,h)=>ft(()=>async g=>{if(ft(null),!M)return;const x=await La(M,c);(h?await mn({op:"setAttr",path:c,hash:x,name:"src",value:g.ref}):await mn({op:"setStyle",path:c,hash:x,prop:"background-image",value:`url("${g.ref}")`}))&&ye({tone:"ok",text:u.toast.imageReplaced(g.name),action:Cn})}),el=v.useRef(null),Se=z0(M,Nr);fs.current=Se;const Er=v.useRef(Promise.resolve()),dc=(c,h)=>{var T;const g=M,x=(T=Se.state.selection)==null?void 0:T.path;!g||!x||(Er.current=Er.current.then(async()=>{const A=await La(g,x).catch(()=>null);A&&await mn({op:"setStyle",path:x,hash:A,prop:c,value:h},g)}))};v.useEffect(()=>Kx(c=>{if(V1(c),c.type==="file-changed")wa(ss(c.file)),c.stamp&&ls(h=>h[c.file]===c.stamp?h:{...h,[c.file]:c.stamp}),c.kind!=="change"?(pl.reset(c.file),ml(ss(c.file)),an()):Oa.current(c.file,c.hash);else if(c.type==="board-changed"&&c.source!==Xm)an(),kt.reload();else if(c.type==="comments-changed")Dn();else if(c.type==="update-state")Ia();else if(c.type==="history-changed")Dn(),Bn(),kt.reload();else if(c.type==="errors-changed")qs();else if(c.type==="assets-changed")_u(h=>h+1);else if(c.type==="tokens-changed")yr(h=>h+1);else if(c.type==="app-changed")window.location.reload();else if(c.type==="chat")for(const h of fi.current)h(c.id,c.ev);else if(c.type==="hello")for(const h of fi.current)h("",{kind:"boot",boot:c.boot});else c.type==="occupancy"?$f(c.boards):(c.type==="requests-settings"||c.type==="agents-changed")&&Ot.reload()}),[an,Dn,Bn,qs,kt.reload,Ot.reload]);const Ie=(i==null?void 0:i.pages)??[],rn=((Dc=Ie.find(c=>c.id===j))==null?void 0:Dc.id)??((Bc=Ie[0])==null?void 0:Bc.id)??null,ms=v.useCallback(c=>!Ie.length||(c.page??Ie[0].id)===rn,[Ie,rn]),dt=v.useMemo(()=>i?[...new Set(i.order)].filter(c=>i.boards[c]&&ms(i.boards[c])):[],[i,ms]),Mr=v.useMemo(()=>i?Object.keys(i.notes).filter(c=>ms(i.notes[c])):[],[i,ms]),En=_n??D,Df=jf(m,c=>c.zoom>=.25),Wu=v.useCallback(c=>i?s.jsx(jw,{board:i,files:dt,zoom:c}):null,[i,dt]),tl=()=>{const c=on;if(It)return{x:0,y:0,w:En.w,h:En.h};const h=!Be&&U?c+240+c:0,g=!Be&&ea?En.w-oi:En.w,x=c+ot,T=En.h-fn-Pe;return{x:h,y:x,w:g-h,h:T-x}},yi=(c,h)=>{const g=tl();N(x=>({...x,x:Math.round(g.x+g.w/2-c*x.zoom),y:Math.round(g.y+g.h/2-h*x.zoom)}))};v.useEffect(()=>{if(yo.current||!i||!_n)return;yo.current=!0;const c=rj(i.title);c.left!=null&&(Nn.current=c.left),window.innerWidth<=Sb?ae(c.leftPane??!1):c.left!=null&&ae(c.left),c.minimap!=null&&_e(c.minimap);const h=i.launch;if(h!=null&&h.page?E(h.page):c.page&&E(c.page),(h==null?void 0:h.view)==="focused"&&h.file&&i.boards[h.file]&&at(h.file),c.view&&!(h!=null&&h.page))N(c.view);else if(!c.view&&i.order.length>0){const g=i.order.find(T=>i.boards[T]&&ms(i.boards[T]))??i.order[0],x=i.boards[g];if(x){const T=tc([x],_n,80,tl());N({...T,zoom:Math.min(T.zoom,1)}),qe(!0)}else N(tc(Object.values(i.boards),_n,60,tl()))}else N(tc(Object.values(i.boards),_n,60,tl()));location.hash&&Si(location.hash)},[i,_n]),v.useEffect(()=>{const c=()=>Si(location.hash);return window.addEventListener("popstate",c),()=>window.removeEventListener("popstate",c)});const wo=v.useRef(null);v.useEffect(()=>{if(!i||!yo.current)return;const c=M??(k.length===1?k[0]:null),h=Ne?`#play-${encodeURIComponent(Ne)}`:c?`#artboard-${encodeURIComponent(c)}`:rn&&Ie.length>1?`#page-${encodeURIComponent(rn)}`:"",g=`${Ne?"play":"canvas"}:${rn??""}:${Ne??""}`,x=wo.current;if(wo.current={hash:h,step:g},location.hash===h||!h&&!location.hash)return;const T=`${location.pathname}${location.search}${h}`;x&&x.step!==g&&!bc.current?history.pushState(null,"",T):history.replaceState(null,"",T)},[i,rn,Ne,k,M,Ie.length]),v.useEffect(()=>{if(!i)return;let c=0;const h=()=>{window.clearTimeout(c),yo.current&&(c=window.setTimeout(()=>{try{const x={view:m.get(),page:rn,left:Be?Nn.current:U,minimap:Re};localStorage.setItem(Tf(i.title),JSON.stringify(x)),sessionStorage.setItem(Tf(i.title),JSON.stringify({...x,leftPane:Be?U:void 0}))}catch{}},300))};h();const g=m.subscribe(h);return()=>{g(),window.clearTimeout(c)}},[rn,U,Re,i==null?void 0:i.title,Be]);const ed=v.useRef(Be);v.useEffect(()=>{if(ed.current!==Be){ed.current=Be,yo.current&&ae(Be?!1:Nn.current);return}!Be&&yo.current&&(Nn.current=U)},[Be,U]),v.useEffect(()=>{if(!i)return;let c=0;const h=()=>{window.clearTimeout(c),c=window.setTimeout(()=>{var Ee;const x=m.get(),T=-x.x/x.zoom,A=-x.y/x.zoom,L=En.w/x.zoom,W=En.h/x.zoom,ke=H?[H]:Ne?[Ne]:dt.filter($e=>{const Ze=i.boards[$e];return Ze.x<T+L&&Ze.x+Ze.w>T&&Ze.y<A+W&&Ze.y+Ze.h>A});xe.put("/api/context",{mode:Oe?"play":Ne||H?"focus":M?"edit":"canvas",page:rn,pageName:((Ee=Ie.find($e=>$e.id===rn))==null?void 0:Ee.name)??null,visibleArtboards:ke,selectedArtboards:k,dirty:Hl.current>0||!!hs.current}).catch(()=>{})},300)};h();const g=m.subscribe(h);return()=>{g(),window.clearTimeout(c)}},[rn,k,M,Ne,H,Oe,dt,En.w,En.h]),v.useEffect(()=>{!go||!i||!go.every(c=>i.boards[c])||(z(go),N(tc(go.map(c=>i.boards[c]),En,80,tl())),Ja(null))},[go,i]);const fc=c=>({x:c.x,y:c.y,w:c.w??c.maxW??400,h:c.kind==="title"?90:200}),jo=()=>{i&&N(tc([...dt.map(c=>i.boards[c]),...Mr.map(c=>fc(i.notes[c]))],En,60,tl()))},Vl=c=>{!i||!c.length||N(tc(c.map(h=>i.boards[h]).filter(Boolean),En,80,tl()))},ps=c=>N(h=>{const g=dr(h.zoom*c,Fm,Qm),x=tl(),T=x.x+x.w/2,A=x.y+x.h/2;return{zoom:g,x:Math.round(T-(T-h.x)/h.zoom*g),y:Math.round(A-(A-h.y)/h.zoom*g)}}),bi=c=>ps(c/m.get().zoom);v.useEffect(()=>{if(!ze)return;let c=!1;const h=window.setTimeout(()=>c=!0,1500),g=()=>c&&qe(!1),x=window.setTimeout(()=>qe(!1),8e3);return window.addEventListener("pointerdown",g,!0),window.addEventListener("keydown",g,!0),()=>{window.clearTimeout(h),window.clearTimeout(x),window.removeEventListener("pointerdown",g,!0),window.removeEventListener("keydown",g,!0)}},[ze]);const nl=(c,h="replace")=>{z(g=>h==="replace"?c:h==="add"?[...new Set([...g,...c])]:c.reduce((x,T)=>x.includes(T)?x.filter(A=>A!==T):[...x,T],g)),h==="replace"&&X(null),c.length&&h==="replace"&&(K([]),Da([]))},No=()=>Ie.length&&rn?{page:rn}:{},vi=async(c,h="blank")=>{try{const g=await xe.post("/api/boards/create",{...c,template:h,...No()});return await an(),z([g.file]),w("select"),ye({tone:"ok",text:u.toast.boardCreated(g.file),action:Cn}),g}catch(g){return ye({tone:"error",text:u.toast.boardCreateFailed(g.message)}),null}},hc=async c=>{if(!c.length||!i)return;const h=c.map(x=>{var T;return((T=i.boards[x])==null?void 0:T.title)??x});if(await Tn.confirm({title:u.dialog.deleteBoardsTitle(c.length,h[0]),body:u.dialog.deleteBoardsBody,ok:u.dialog.delete,danger:!0}))try{await xe.post("/api/boards/delete",{files:c}),M&&c.includes(M)&&X(null),z([]),await an(),ye({text:u.toast.boardsDeleted(c.length),action:Cn})}catch(x){ye({tone:"error",text:String(x.message)})}},Ar=async c=>{try{const h=await xe.post("/api/boards/duplicate",{file:c});await an(),z([h.file]),ye({tone:"ok",text:u.toast.duplicated(h.file),action:Cn})}catch(h){ye({tone:"error",text:String(h.message)})}},mc=async c=>{var x;const h=(x=Sa.current)==null?void 0:x.boards[c];if(!h)return;const g=await Tn.prompt({title:u.dialog.renameBoardTitle,label:u.dialog.name,value:h.title??c.replace(/\.html$/,""),ok:u.dialog.rename});if(!(!g||g.value.trim()===(h.title??"")))try{await xe.post("/api/boards/rename",{file:c,title:g.value.trim()}),await an(),ye({tone:"ok",text:u.toast.renamed,action:Cn})}catch(T){ye({tone:"error",text:String(T.message)})}},td=async c=>{const{refs:h}=await xe.get(`/api/boards/refs?file=${encodeURIComponent(c)}`).catch(()=>({refs:[]})),g=await Tn.prompt({title:u.dialog.renameFileTitle,label:u.dialog.fileName,value:c,hint:h.length?u.dialog.renameFileRefs(h.map(T=>T.file).join(", ")):u.dialog.renameFileNoRefs,ok:u.dialog.rename,extra:h.length?{label:u.dialog.renameFileExtra(h.reduce((T,A)=>T+(A.count??1),0)),checked:!0}:void 0});if(!g)return;let x=g.value.trim();if(x.endsWith(".html")||(x+=".html"),x!==c)try{await xe.post("/api/boards/rename",{file:c,newFile:x,updateRefs:g.extra}),M===c&&X(x),z([x]),await an(),ye({tone:"ok",text:u.toast.fileRenamed(x,!!g.extra),action:Cn})}catch(T){ye({tone:"error",text:String(T.message)})}},Bf=c=>{const h=tl(),g=m.get(),x=(h.x+h.w/2-g.x)/g.zoom,T=(h.y+h.h/2-g.y)/g.zoom,A=k.length===1&&(i!=null&&i.boards[k[0]])?k[0]:null,L=A?{beside:A,w:c.w,h:c.h}:{x:Math.round(x-c.w/2),y:Math.round(T-c.h/2),w:c.w,h:c.h,near:!0};vi(L,c.id).then(W=>W&&N(tc([{x:W.x,y:W.y,w:W.w,h:W.h}],En,80,tl())))},Ma=c=>St({x:c.clientX,y:c.clientY,up:!0,title:u.menu.newBoard,items:kb.flatMap((h,g)=>[...g&&kb[g-1].group!==h.group?["sep"]:[],{label:`${h.label} · ${h.size}`,shortcut:h.id==="blank"?u.menu.drawWithB:void 0,run:()=>Bf(h)}])}),_a=(c,h)=>{Qa("chat"),Vn(!0),h!=null&&h.length&&z(h),c!=null&&cs(c),setTimeout(()=>{var g;return(g=pr.current)==null?void 0:g.focus()},0)},gs=()=>{const c=Se.state.selection;if(!M||!c||c.file!==M)return null;const h=u.inspector.kindName(c.kind??c.tag);return{file:M,path:c.path,kind:"element",label:c.label?`${h} “${c.label.slice(0,40)}”`:h}},al=(c,h="board",g,x)=>{var T,A;return{file:c,path:"",kind:h,label:h==="board"?((T=i==null?void 0:i.boards[c])==null?void 0:T.title)??c:`${((A=i==null?void 0:i.boards[c])==null?void 0:A.title)??c} · ${u.requests.kind[h]}`,...g?{text:g}:{},...x&&x.length>1?{boards:x}:{}}},ll=(c,h)=>{if(Ot.host)return $r(c);if(Ot.ready&&!Ot.settings.intro&&P1()&&Ot.agents.some(g=>g.here))return void hr({target:c,chat:h});h()},$r=c=>{hr(null),typeof c=="function"?c():So(c)},So=c=>{var W;if(Ge(null),(W=Ra.current)==null||W.check(),c&&c.kind==="element")return I({kind:"element",file:c.file,path:c.path,about:c.label,target:c});if(c)return I({kind:"board",file:c.file,about:c.label,target:c});const h=m.get(),g=-h.x/h.zoom,x=-h.y/h.zoom,T=En.w/h.zoom,A=En.h/h.zoom,L=dt.filter(ke=>{const Ee=i.boards[ke];return Ee.x<g+T&&Ee.x+Ee.w>g&&Ee.y<x+A&&Ee.y+Ee.h>x});I({kind:"canvas",about:u.inline.visible(L.length),target:L.length?al(L[0],"board",void 0,L):null})},zr=async(c,h)=>{if(Ot.host){const T=c.target??(dt[0]?al(dt[0],"board",void 0,dt):null);if(!T)return u.app.emptyPage;try{return await xe.post("/api/requests",{action:"create",file:T.file,path:T.path,text:h,author:rs,attach:{kind:T.kind,label:T.label,...T.boards?{boards:T.boards}:{}}}),I(null),null}catch(A){return A.message}}const g=Ra.current;if(!g)return"";const x=await g.send(h);return"error"in x?x.error:(Le.current={id:x.id,at:c},Me({id:x.id,at:c}),I(null),null)},Hf=c=>{var h;((h=Le.current)==null?void 0:h.id)===c.id&&(Ge({...c,at:Le.current.at}),Me(null),Le.current=null)},Nl=c=>ye({tone:"error",text:c.message}),xi=c=>{po(h=>({...h,comments:h.comments.some(g=>g.id===c.id)?h.comments:[...h.comments,{id:c.id,text:c.text,file:c.file}]})),_a(di||u.prompts.fixComment,[c.file])},ko=c=>void xe.post("/api/requests",{action:"mark",id:c.id,attach:{kind:c.path?"element":"comment"}}).then(()=>ye({tone:"ok",text:u.requests.added})).catch(Nl),To={onCancel:c=>void xe.post("/api/requests",{action:"cancel",id:c.id}).then(()=>ye({text:u.requests.cancelled})).catch(Nl),onChat:c=>void xe.post("/api/requests",{action:"chat",id:c.id}).then(()=>{mr(!0),xi(c)}).catch(Nl),onRetry:c=>void xe.post("/api/requests",{action:"retry",id:c.id}).catch(Nl),undoFor:c=>{var T,A,L;const h=c.request,g=(T=h==null?void 0:h.changed)==null?void 0:T[0];if(!h||!g||(A=h.steps)!=null&&A.length&&h.undo!=="ready")return null;if((L=h.steps)!=null&&L.length)return()=>void xe.post("/api/history/undo-steps",{ids:h.steps}).then(async()=>{var W;ye({text:u.toast.undoRedoDone("undo",h.steps.length===1?((W=i==null?void 0:i.boards[g])==null?void 0:W.title)??g:u.activity.changes(h.steps.length)),action:{label:u.toolbar.redo,run:()=>void jl("redo")}}),await an(),Bn(),kt.reload()}).catch(Nl);const x=kt.tagsOf(g).find(W=>h.by?W.by===h.by:W.outside);return x?()=>{Ja([g]),window.setTimeout(()=>js(g,x.key),450)}:null},onBoard:c=>{z([c]),Ja([c])},titleOf:c=>{var h;return((h=i==null?void 0:i.boards[c])==null?void 0:h.title)??c},connected:Ot.agents.length},Or=c=>{const h=u.prompts.fixErrors(c.map(x=>`- ${x}: ${(Bl[x]??[{message:n!=null&&n.missing.includes(x)?u.menu.fileMissing:u.prompts.error}])[0].message}`).join(`
71
+ `)),g=c.filter(x=>i==null?void 0:i.boards[x]);ll(g.length?al(g[0],"errors",h,g):null,()=>_a(h,g))},ka=(c,h)=>bn(g=>{const x=g.order.filter(A=>!c.includes(A)),T=g.order.filter(A=>c.includes(A));return{...g,order:h==="front"?[...x,...T]:[...T,...x]}},h==="front"?u.history.front:u.history.back),Co=(c,h,g=u.history.boardOptions)=>bn(x=>{const T={...x.boards[c],...h};for(const A of Object.keys(T))T[A]===void 0&&delete T[A];return{...x,boards:{...x.boards,[c]:T}}},g),Eo=(c,h,g,x=k,T=R,A=In)=>({...c,boards:{...c.boards,...Object.fromEntries(x.filter(L=>c.boards[L]).map(L=>[L,{...c.boards[L],x:c.boards[L].x+h,y:c.boards[L].y+g,autoPlaced:void 0}]))},notes:{...c.notes,...Object.fromEntries(T.filter(L=>c.notes[L]).map(L=>[L,{...c.notes[L],x:c.notes[L].x+h,y:c.notes[L].y+g}]))},shapes:{...c.shapes??{},...Object.fromEntries(A.filter(L=>{var W;return(W=c.shapes)==null?void 0:W[L]}).map(L=>[L,{...c.shapes[L],x:c.shapes[L].x+h,y:c.shapes[L].y+g}]))}}),nd=(c,h)=>bn(g=>Eo(g,c,h,k.filter(x=>{var T;return!((T=g.boards[x])!=null&&T.locked)}),R.filter(x=>{var T;return!((T=g.notes[x])!=null&&T.locked)})),k.length?u.history.moveBoard:R.length?u.history.moveNote:u.history.moveShape),ys=()=>{var h;let c="";do c=`n${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((h=Sa.current)!=null&&h.notes[c]);return c},pc=(c,h)=>{var A;if(Object.keys(((A=Sa.current)==null?void 0:A.notes)??{}).length>=Uy)return ye({tone:"error",text:u.toast.notesMax(Uy)});const g=ys(),x=Math.round(h.x),T=Math.round(h.y);bn(L=>({...L,notes:{...L.notes,[g]:c==="title"?{kind:c,x,y:T,text:u.defaults.newTitle,maxW:2e3,...No()}:{kind:c,x,y:T,text:u.defaults.note,w:400,...No()}}}),c==="title"?u.history.addTitle:u.history.addNote),V(g),z([]),w("select")},Mo=c=>{bn(h=>{const g={...h.notes};for(const x of c)delete g[x];return{...h,notes:g}},u.history.deleteNote),K([]),ye({text:u.toast.noteDeleted,action:Cn})},Gl=(i==null?void 0:i.shapes)??{},ad=v.useMemo(()=>Object.keys(Gl).filter(c=>ms(Gl[c])).sort((c,h)=>(Gl[c].z??0)-(Gl[h].z??0)||(c<h?-1:1)),[Gl,ms]),ld=(c,h=u.history.addShape)=>{var T,A,L;let g="";do g=`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((A=(T=Sa.current)==null?void 0:T.shapes)!=null&&A[g]);const x=Math.max(0,...Object.values(((L=Sa.current)==null?void 0:L.shapes)??{}).map(W=>W.z??0))+1;return bn(W=>({...W,shapes:{...W.shapes??{},[g]:{...c,z:x,...No()}}}),h),bl(g),z([]),V(null),w("select"),g},sd=(c,h,g)=>bn(x=>({...x,shapes:{...x.shapes??{},[c]:{...x.shapes[c],...h}}}),g),wi=c=>{bn(h=>{const g={...h.shapes??{}};for(const x of c)delete g[x];return{...h,shapes:g}},u.history.deleteShape),Da([]),ye({text:c.length===1?u.toast.shapeDeleted:u.toast.shapesDeleted(c.length),action:Cn})},ji=(c,h)=>{var x;const g=Object.values(((x=Sa.current)==null?void 0:x.shapes)??{}).map(T=>T.z??0);sd(c,{z:h==="front"?Math.max(0,...g)+1:Math.min(0,...g)-1},h==="front"?u.history.shapeFront:u.history.shapeBack)},Ao=(c,h)=>{const g=new Image;g.onload=()=>{const x=Math.min(1,600/Math.max(g.naturalWidth,g.naturalHeight)),T=Math.round(g.naturalWidth*x)||300,A=Math.round(g.naturalHeight*x)||200,L=m.get(),W=h??{x:(En.w/2-L.x)/L.zoom-T/2,y:(En.h/2-L.y)/L.zoom-A/2};ld({kind:"image",x:Math.round(W.x),y:Math.round(W.y),w:T,h:A,src:c.ref},u.history.addImage)},g.onerror=()=>ye({tone:"error",text:u.toast.imageReadFailed}),g.src=c.url};v.useEffect(()=>{const c=async h=>{var x,T,A;if(M||(T=(x=h.target)==null?void 0:x.closest)!=null&&T.call(x,"input,textarea,[contenteditable=true]"))return;const g=Array.from(((A=h.clipboardData)==null?void 0:A.files)??[]).filter(L=>L.type.startsWith("image/"));if(g.length){h.preventDefault();try{const[L]=await Om(g.map(W=>W.name?W:new File([W],u.defaults.pastedImage,{type:W.type})));Ao(L)}catch(L){ye({tone:"error",text:String(L.message)})}}};return window.addEventListener("paste",c),()=>window.removeEventListener("paste",c)});const sl=async(c,h)=>{var T,A;let g=Math.round(h.x);const x=[];for(const L of c)try{if(/\.html?$/i.test(L.name)){const W=await L.text(),ke=W.match(/<meta[^>]+name=["']board-size["'][^>]+content=["'](\d+)x(\d+)/i),Ee=ke?Number(ke[1]):390,$e=ke?Number(ke[2]):844,Ze=((A=(T=W.match(/<title>([^<]*)<\/title>/i))==null?void 0:T[1])==null?void 0:A.trim())||L.name.replace(/\.html?$/i,""),ln=L.name.toLowerCase().replace(/\.htm$/,".html").replace(/[^a-z0-9._-]+/g,"-"),je=await xe.post("/api/boards/create",{file:ln,html:W,title:Ze,x:g,y:Math.round(h.y),w:Ee,h:$e,...No()});x.push(je.file),g+=Ee+80}else if(L.type.startsWith("image/")){const[W]=await Om([L]);Ao(W,{x:g,y:h.y}),g+=400}else ye({tone:"error",text:u.toast.importOnly(L.name)})}catch(W){ye({tone:"error",text:`${L.name}: ${W.message}`})}x.length&&(await an(),Ja(x),ye({tone:"ok",text:u.toast.imported(x.length),action:Cn}))},od=async c=>{var g;if(!i)return;const h=await Tn.prompt({title:u.dialog.renameGroupTitle,label:u.dialog.name,value:((g=i.groupNames)==null?void 0:g[c])??c,ok:u.dialog.save});h!=null&&h.value.trim()&&bn(x=>({...x,groupNames:{...x.groupNames??{},[c]:h.value.trim()}}),u.history.renameGroup)},Ta=async(c,h)=>{try{const g=await xe.post("/api/pages",c);return await an(),h&&ye({tone:"ok",text:h,action:Cn}),g}catch(g){return ye({tone:"error",text:String(g.message)}),null}},Rr=async()=>{if(Ie.length>=40)return ye({tone:"error",text:u.toast.pagesMax});const c=await Tn.prompt({title:u.dialog.newPageTitle,label:u.dialog.name,value:u.dialog.newPageName(Math.max(Ie.length,1)+1),ok:u.dialog.create});if(!(c!=null&&c.value.trim()))return;const h=await Ta({action:"add",name:c.value.trim()});h!=null&&h.id&&E(h.id)},Yl=async c=>{const h=Ie.find(x=>x.id===c),g=await Tn.prompt({title:u.dialog.renamePageTitle,label:u.dialog.name,value:(h==null?void 0:h.name)??"",ok:u.dialog.rename});!(g!=null&&g.value.trim())||g.value.trim()===(h==null?void 0:h.name)||await Ta({action:"rename",id:c,name:g.value.trim()})},gc=async c=>{const h=Ie.find(x=>x.id===c),g=Object.values((i==null?void 0:i.boards)??{}).filter(x=>{var T;return(x.page??((T=Ie[0])==null?void 0:T.id))===c}).length;await Tn.confirm({title:u.dialog.deletePageTitle((h==null?void 0:h.name)??""),body:u.dialog.deletePageBody(g),ok:u.dialog.delete,danger:!0})&&(rn===c&&E(null),await Ta({action:"delete",id:c},u.toast.pageDeleted))},Ca=(c,h)=>void Ta({action:"move",id:c,index:h}),Gs=(c,h)=>{var x,T;const g=Ie.findIndex(A=>A.id===c);St({x:h.clientX,y:h.clientY,title:(x=Ie[g])==null?void 0:x.name,items:[{label:u.toolbar.copyPageLink,run:()=>void Sl($o("page",c))},{label:u.menu.rename,run:()=>void Yl(c)},{label:u.menu.moveUp,disabled:g<=0,run:()=>Ca(c,g-1)},{label:u.menu.moveDown,disabled:g>=Ie.length-1,run:()=>Ca(c,g+1)},{label:((T=i==null?void 0:i.launch)==null?void 0:T.page)===c?u.menu.unsetLaunchPage:u.menu.setLaunchPage,run:()=>bn(A=>{var L;return{...A,launch:{...A.launch??{view:"canvas"},page:((L=A.launch)==null?void 0:L.page)===c?void 0:c}}},u.history.launchPage)},...k.length?[{label:u.menu.moveSelectedToPage(k.length),run:()=>bn(A=>({...A,boards:{...A.boards,...Object.fromEntries(k.map(L=>{var W;return[L,{...A.boards[L],page:c===((W=Ie[0])==null?void 0:W.id)?void 0:c}]}))}}),u.history.moveToPage)}]:[],"sep",{label:u.menu.delete,danger:!0,disabled:Ie.length<=1,run:()=>void gc(c)}]})},Ys=async c=>{if(Fe.current.has(c))return;Fe.current.add(c),Ae([...Fe.current]);const h=pb(c);ye({text:u.toast.pngExporting(h)});try{const g=await xe.blob("/api/screenshot",{file:c,inline:!0}),x=URL.createObjectURL(g),T=document.createElement("a");T.href=x,T.download=h,document.body.append(T),T.click(),T.remove(),setTimeout(()=>URL.revokeObjectURL(x),1e4),ye({tone:"ok",text:u.toast.pngExported(h)})}catch(g){const x=g;jm(x.status,x.message)==="browser"?ye({tone:"error",text:u.toast.pngNeedsBrowser,code:"npx playwright install chromium",ms:1e4}):ye({tone:"error",text:u.toast.pngFailed(Nm(x.message))})}finally{Fe.current.delete(c),Ae([...Fe.current])}},Ni=v.useRef(new WeakMap),yc=v.useCallback(c=>{var x;const h=(x=ut.current.get(c))==null?void 0:x.contentDocument;if(!h)return!1;let g=Ni.current.get(h);return g===void 0&&(g=!!Ou(h),h.readyState==="complete"&&Ni.current.set(h,g)),g},[]),$o=(c,h)=>`${location.origin}${location.pathname}${location.search}#${c}-${encodeURIComponent(h)}`,Sl=async c=>{try{await navigator.clipboard.writeText(c),ye({tone:"ok",text:u.toast.linkCopied})}catch(h){ye({tone:"error",text:String(h.message)})}},bc=v.useRef(!1),Si=c=>{if(!i)return!1;const h=/^#(page|artboard|play)-(.+)$/.exec(c);if(!h)return!1;const g=decodeURIComponent(h[2]),x=T=>{var A,L;return((A=i.boards[T])==null?void 0:A.page)??((L=Ie[0])==null?void 0:L.id)??null};return bc.current=!0,window.setTimeout(()=>bc.current=!1,0),h[1]==="page"?Ie.some(T=>T.id===g)?(se(null),at(null),E(g),!0):!1:i.boards[g]?(se(null),E(x(g)),h[1]==="play"?(at(g),!0):(at(null),X(null),Ja([g]),!0)):!1},Xs=()=>{H&&z([H]),se(null)},vc=v.useMemo(()=>i?(Ie.length?Ie.map(h=>h.id):[null]).map(h=>({page:h,files:i.order.filter(g=>{var x;return i.boards[g]&&(h===null||(i.boards[g].page??((x=Ie[0])==null?void 0:x.id))===h)})})):[],[i,Ie]),qn=c=>{Ss(),se(null),at(c)},zo=()=>{Ne&&z([Ne]),at(null)},Ua=c=>{const h=vc.flatMap(T=>T.files),g=h.indexOf(Ne??""),x=h[g+c];x&&at(x)},id=c=>St({x:c.clientX,y:c.clientY,title:kl(u.toolbar.protoBoards,c).title,className:"proto-menu",items:[...kl(u.toolbar.protoBoards,c).items,...vc.flatMap(h=>{var g;return[...Ie.length>1?[{label:((g=Ie.find(x=>x.id===h.page))==null?void 0:g.name)??"",heading:!0,run:()=>{}}]:[],...h.files.map(x=>({label:i.boards[x].title??x,tip:x,check:x===Ne,run:()=>at(x)}))]})]}),ki=c=>Ha===6&&i?[{label:i.title??"",shortcut:"›",dot:!!(Rt!=null&&Rt.update),aria:u.toolbar.projectMenu(i.title??""),tip:(n==null?void 0:n.dir)??i.title,run:()=>window.setTimeout(()=>void _r(c),0)},"sep"]:[],kl=(c,h)=>ki(h).length?{items:[...ki(h),{label:c,heading:!0,run:()=>{}}]}:{title:c,items:[]},Dr=c=>{const h=dt.filter(T=>{var A;return(A=i.boards[T])==null?void 0:A.is_interactive}),g=dt.filter(T=>{var A;return!((A=i.boards[T])!=null&&A.is_interactive)}),x=T=>({label:i.boards[T].title??T,tip:T,check:Ne?T===Ne:void 0,run:()=>qn(T)});St({x:c.clientX,y:c.clientY,right:!0,className:"play-menu oc-menu",title:u.toolbar.playMenu,items:[...h.length?[{label:u.toolbar.protoHeading,heading:!0,run:()=>{}},...h.map(x)]:[],...h.length&&g.length?["sep"]:[],...g.length?[{label:u.toolbar.staticHeading,heading:!0,run:()=>{}},...g.map(x)]:[],...dt.length?[]:[{label:u.toolbar.noBoards,disabled:!0,run:()=>{}}]]})},cd=(c,h,g)=>{if(h==="export")return void Ys(c);if(h==="expand")return se(c);if(h==="tweaks"){Mn("tweaks"),Kl(!1),X(null),z([c]),K([]),Da([]),Qa("inspect"),Vn(!0);return}St({x:g.clientX,y:g.clientY,className:"play-menu",items:[{label:u.menu.playInPlace,shortcut:"P",run:()=>ue===c?Wn():pt(c)},{label:u.menu.playFullScreen,run:()=>Ye(c)}]})},Ti=(c=k,h=R)=>{if(!i||!c.length&&!h.length)return;const g=c.every(T=>{var A;return(A=i.boards[T])==null?void 0:A.locked})&&h.every(T=>{var A;return(A=i.notes[T])==null?void 0:A.locked}),x=T=>{const A={...T};return g?delete A.locked:A.locked=!0,A};bn(T=>({...T,boards:{...T.boards,...Object.fromEntries(c.filter(A=>T.boards[A]).map(A=>[A,x(T.boards[A])]))},notes:{...T.notes,...Object.fromEntries(h.filter(A=>T.notes[A]).map(A=>[A,x(T.notes[A])]))}}),g?u.history.unlock:u.history.lock)},Ci=async(c,h)=>{try{const g=await xe.blob("/api/screenshot",{file:c,path:h??"",inline:!0});await navigator.clipboard.write([new ClipboardItem({"image/png":g})]),ye({tone:"ok",text:u.toast.copiedPng})}catch(g){const x=g;ye({tone:"error",text:jm(x.status,x.message)==="browser"?u.toast.pngNeedsBrowser:u.toast.pngFailed(Nm(x.message))})}},qa=async c=>{const h=(await(await fetch(`/screens/${encodeURIComponent(c)}`)).text()).replace(/<script data-dc-probe[\s\S]*?<\/script>/,"");await navigator.clipboard.writeText(h),ye({tone:"ok",text:u.toast.copiedHtml})},Ks=()=>{var x;const c=Se.state.selection,h=M?(x=ut.current.get(M))==null?void 0:x.contentDocument:null,g=c&&h?dn(h,c.path):null;if(g){try{localStorage.setItem("design-canvas:props",g.getAttribute("style")??"")}catch{}ye({tone:"ok",text:u.toast.copiedProps})}},Zs=async()=>{let c=null;try{c=localStorage.getItem("design-canvas:props")}catch{}if(!(c==null||!M))for(const h of Se.state.paths){const g=await La(M,h).catch(()=>null);g&&await mn({op:"setStyleText",path:h,hash:g,text:c},M)}},Oo=c=>{var W;const h=Se.state.selection,g=M?(W=ut.current.get(M))==null?void 0:W.contentDocument:null,x=h&&g?dn(g,h.path):null;if(!x)return;const T=c==="x"?"scaleX(-1)":"scaleY(-1)",A=x.style.transform||"",L=A.includes(T)?A.replace(T,"").trim():`${A} ${T}`.trim();dc("transform",L)},Ro=c=>{const h=k.includes(c)?k:[c],g=h.length>1;return[{label:u.menu.selectInside,shortcut:"Enter",disabled:g,run:()=>Yn(c)},{label:u.menu.focusView,shortcut:"F",disabled:g,run:()=>qn(c)},{label:u.menu.goToBoard,shortcut:"⇧2",run:()=>Vl(h)},"sep",{label:ue===c?u.menu.stopPlay:u.menu.playInPlace,shortcut:"P",disabled:g,run:()=>ue===c?Wn():pt(c)},{label:u.menu.playFullScreen,disabled:g,run:()=>Ye(c)},"sep",{label:u.menu.rename,shortcut:"F2",disabled:g,run:()=>void mc(c)},{label:u.menu.renameFile,disabled:g,run:()=>void td(c)},{label:u.menu.duplicate,shortcut:`${mt}D`,disabled:g,run:()=>void Ar(c)},{label:h.every(x=>{var T;return(T=i==null?void 0:i.boards[x])==null?void 0:T.locked})?u.menu.unlock:u.menu.lock,shortcut:`${mt}L`,run:()=>Ti(h,[])},"sep",{label:u.toolbar.copyLink,disabled:g,run:()=>void Sl($o("artboard",c))},{label:u.menu.copyPng,shortcut:`⇧${mt}C`,disabled:g||!!(n!=null&&n.missing.includes(c)),run:()=>void Ci(c)},{label:u.menu.copyHtml,disabled:g,run:()=>void qa(c)},{label:me.includes(c)?u.menu.exportingPng:u.menu.exportPng,disabled:g||me.includes(c)||!!(n!=null&&n.missing.includes(c)),run:()=>void Ys(c)},"sep",{label:u.menu.front,shortcut:`${mt}]`,run:()=>ka(h,"front")},{label:u.menu.back,shortcut:`${mt}[`,run:()=>ka(h,"back")},"sep",{label:u.menu.askReview,run:()=>ll(al(c,"review",u.prompts.review,h),()=>_a(u.prompts.review,h))},{label:u.menu.askAI,aria:u.menu.askAIAria,shortcut:`${mt}J`,run:()=>ll(al(c,"board",void 0,h),()=>So(al(c,"board",void 0,h)))},...Bl[c]||n!=null&&n.missing.includes(c)?[{label:u.menu.askFixErrors,run:()=>Or([c])}]:[],"sep",{label:g?u.menu.deleteBoards(h.length):u.menu.delete,shortcut:"⌫",danger:!0,run:()=>void hc(h)}]},Va=(c,h)=>{var g,x,T;i&&(c.type==="board"?(k.includes(c.file)||nl([c.file]),St({x:h.clientX,y:h.clientY,title:((g=i.boards[c.file])==null?void 0:g.title)??c.file,items:Ro(c.file)})):c.type==="note"?(V(c.id),St({x:h.clientX,y:h.clientY,title:((x=i.notes[c.id])==null?void 0:x.kind)==="title"?u.menu.title:u.menu.note,items:[{label:u.menu.duplicateInFront,shortcut:`${mt}D`,run:()=>{const A=i.notes[c.id],L=ys();bn(W=>({...W,notes:{...W.notes,[L]:{...A,x:A.x+40,y:A.y+40}}}),u.history.duplicateNote),V(L)}},{label:(T=i.notes[c.id])!=null&&T.locked?u.menu.unlock:u.menu.lock,shortcut:`${mt}L`,run:()=>Ti([],[c.id])},"sep",{label:u.menu.delete,shortcut:"⌫",danger:!0,run:()=>Mo([c.id])}]})):St({x:h.clientX,y:h.clientY,items:[{label:u.menu.newBoardHere,shortcut:"B",run:()=>void vi({x:Math.round(c.x),y:Math.round(c.y),w:390,h:844})},{label:u.menu.mobileFrameHere,run:()=>void vi({x:Math.round(c.x),y:Math.round(c.y)},"mobile")},{label:u.menu.titleHere,shortcut:"T",run:()=>pc("title",c)},{label:u.menu.noteHere,shortcut:"N",run:()=>pc("sticky",c)},"sep",{label:u.menu.selectAll,shortcut:`${mt}A`,run:()=>nl(dt)},{label:u.menu.fitAll,shortcut:"⇧1",run:jo},{label:u.menu.zoom100,shortcut:`${mt}0`,run:()=>bi(1)},"sep",{label:u.menu.undo,shortcut:`${mt}Z`,disabled:!as.canUndo,run:()=>void jl("undo")},{label:u.menu.redo,shortcut:`⇧${mt}Z`,disabled:!as.canRedo,run:()=>void jl("redo")}]}))};el.current=(c,h)=>{var A;if(!M)return;const g=()=>La(M,c),x=(A=ut.current.get(M))!=null&&A.contentDocument?dn(ut.current.get(M).contentDocument,c):null,T=c.includes("/")?c.slice(0,c.lastIndexOf("/")):null;St({x:h.clientX,y:h.clientY,title:x?`<${x.tagName.toLowerCase()}>`:u.menu.element,items:[{label:u.menu.openProps,shortcut:`${mt}\\`,run:()=>{Qa("inspect"),Mn("props"),Kl(!1),xc(!0),Vn(!0)}},"sep",{label:u.menu.editText,disabled:!x||x.children.length>0,run:()=>x&&Qu(M,x,c)},{label:u.menu.selectParent,shortcut:"↑",disabled:T==null,run:()=>T!=null&&void Se.select([T])},...(x==null?void 0:x.tagName)==="IMG"?[{label:u.menu.replaceImage,run:()=>uc(c,!0)}]:[],"sep",{label:u.menu.copy,shortcut:`${mt}C`,run:()=>void Ju()},{label:u.menu.pasteAfter,shortcut:`${mt}V`,run:()=>void Iu()},{label:u.menu.duplicate,shortcut:`${mt}D`,run:async()=>void mn({op:"duplicate",path:c,hash:await g()})},"sep",{label:u.menu.copyPng,shortcut:`⇧${mt}C`,run:()=>void Ci(M,c)},{label:u.menu.copyProps,shortcut:`⌥${mt}C`,run:Ks},{label:u.menu.pasteProps,shortcut:`⌥${mt}V`,run:()=>void Zs()},{label:u.menu.copyForAI,run:()=>void navigator.clipboard.writeText(`${M} ${c} <${x==null?void 0:x.tagName.toLowerCase()}> "${((x==null?void 0:x.textContent)??"").trim().slice(0,60)}"`).then(()=>ye({tone:"ok",text:u.toast.copied}))},"sep",{label:u.menu.flipH,shortcut:"⇧H",run:()=>Oo("x")},{label:u.menu.flipV,shortcut:"⇧V",run:()=>Oo("y")},"sep",{label:u.menu.delete,shortcut:"⌫",danger:!0,run:async()=>{await mn({op:"delete",path:c,hash:await g()})&&(Se.select([]),ye({text:u.toast.elementDeleted,action:Cn}))}}]})};const Wn=()=>{var h,g;const c=ue;pt(null),(g=(h=document.activeElement)==null?void 0:h.blur)==null||g.call(h),Tb(),c&&(pl.reset(c),ml(ss(c)),wa(ss(c)))};v.useEffect(()=>{if(!ue)return;const c=ut.current.get(ue);if(!c)return;const h=T=>T.key==="Escape"&&Xl.current();let g=null;const x=()=>{g==null||g.removeEventListener("keydown",h,!0),g=c.contentDocument,g==null||g.addEventListener("keydown",h,!0)};return x(),c.addEventListener("load",x),()=>{c.removeEventListener("load",x),g==null||g.removeEventListener("keydown",h,!0)}},[ue,_l]);const Xl=v.useRef(()=>{});Xl.current=Wn;const[ea,Vn]=v.useState(!1),[bs,xc]=v.useState(!1),[fa,Kl]=v.useState(!1),[vs,Mn]=v.useState("props"),Vt=v.useRef(0),[et,Zl]=v.useState(!1),[pn,xs]=v.useState(null),[Gn,Do]=v.useState(null),Ei=v.useRef(!1),Fs=v.useRef(Be);v.useEffect(()=>{if(Fs.current!==Be){Fs.current=Be,Vn(Be?!1:Ei.current);return}Be||(Ei.current=ea)},[Be,ea]);const Qs=jf(m,c=>{if(!i||!ea||nn!=="chat")return 0;const h=-c.x/c.zoom,g=-c.y/c.zoom,x=En.w/c.zoom,T=En.h/c.zoom;return dt.filter(A=>{const L=i.boards[A];return L.x<h+x&&L.x+L.w>h&&L.y<g+T&&L.y+L.h>g}).length}),Br=H0(m,Ht&&ea),Mi=v.useRef(!1);v.useEffect(()=>{const c=setTimeout(()=>Mi.current=!0,1500);return()=>clearTimeout(c)},[]);const wc=v.useRef(!1),[Bo,Fl]=v.useState(0);!M||((Hc=Se.state.selection)==null||Hc.file),v.useEffect(()=>{Date.now()-Vt.current<600||(M||k.length||R.length||In.length)&&Kl(!1)},[M,k,R,In]),v.useEffect(()=>{Jt&&U&&Vn(!1)},[Jt,U]),v.useEffect(()=>{Jt&&ea&&ae(!1)},[Jt,ea]);const ol=()=>{re(It?u.app.cleanOff:u.app.cleanOn),xa(!It)},Ql=c=>{const h=[".oc-left",".canvas",".oc-right",".oc-dock"].map(A=>document.querySelector(A)).filter(Boolean),g=h.findIndex(A=>A.contains(document.activeElement)),x=h[(g+(c?-1:1)+h.length)%h.length],T=x.matches(".canvas")?x:x.querySelector("button:not([disabled]), input, select, textarea, [tabindex]");x.matches(".canvas")&&(x.tabIndex=-1),(T??x).focus()},jc=async c=>{if(!M)return;const h=[...Se.state.paths].sort((x,T)=>Number(x.split("/").pop())-Number(T.split("/").pop())),g=await Promise.all(h.map(x=>La(M,x)));await mn({op:"wrap",paths:h,hashes:g,display:c})&&(Se.select([h[0]]),ye({tone:"ok",text:u.toast.wrapped(c),action:Cn}))},Nc=async(c,h)=>{try{await xe.put("/api/tokens",{...c,label:h}),yr(g=>g+1),ye({tone:"ok",text:h===u.history.changeTheme?u.toast.theme(c.active):u.toast.tokensSaved,action:Cn})}catch(g){ye({tone:"error",text:String(g.message)})}},Hn=(c,h)=>{if(M===c){h.join()!==Se.state.paths.join()&&Se.select(h);return}us.current={file:c,paths:h},X(c),z([c]),K([]),Da([])},Ai=(c,h)=>Hn(c,[h]),ws=(c,h,g)=>{const x=of(ut.current.get(c),h.clientX,h.clientY);if(!x)return void(!g.add&&M===c&&X(null));if(g.add&&M===c){const T=Se.state.paths;return void Se.select(T.includes(x.path)?T.filter(A=>A!==x.path):[...T,x.path])}Hn(c,[x.path]),g.double||Nb("picks"),g.double&&Qu(c,x.el,x.path)};vr.current=ws,v.useEffect(()=>{var x,T;const c=us.current,h=c&&M===c.file?ut.current.get(c.file):null;if(!c||!h)return;const g=()=>{us.current=null,Se.select(c.paths)};return((x=h.contentDocument)==null?void 0:x.readyState)==="complete"&&((T=h.contentDocument.body)!=null&&T.childElementCount)?g():(h.addEventListener("load",g,{once:!0}),()=>h.removeEventListener("load",g))},[M,_l]);const Yn=c=>{var T,A;const h=(T=ut.current.get(c))==null?void 0:T.contentDocument,g=h?Array.from(((A=h.body)==null?void 0:A.children)??[]).find(L=>!/^(SCRIPT|STYLE|TEMPLATE)$/.test(L.tagName)):null,x=g?hl(g):"0";x!=null&&Hn(c,[x])};v.useEffect(()=>{M&&!(k.length===1&&k[0]===M)&&X(null)},[k]),v.useEffect(()=>{ie(null),fe(null)},[M,S]),v.useEffect(()=>{ue&&M===ue&&X(null)},[ue]);const vn=M??(k.length===1?k[0]:null),Hr=v.useMemo(()=>{var c;return R1(M?(c=ut.current.get(M))==null?void 0:c.contentDocument:null)},[M,_l,hn[M??""],(ca=Se.state.selection)==null?void 0:ca.hash]);v.useEffect(()=>{if(!vn)return mi(null);xe.get(`/api/lint?f=${encodeURIComponent(vn)}`).then(c=>mi(c.files[vn]??[])).catch(()=>mi(null))},[vn,hn[vn??""],Na]),v.useEffect(()=>{if(!vn)return oc(null);const c=()=>{var x;const g=(x=ut.current.get(vn))==null?void 0:x.contentDocument;oc((g==null?void 0:g.readyState)==="complete"?M1(g,(On==null?void 0:On.minTarget)??48):null)},h=window.setTimeout(c,600);return()=>window.clearTimeout(h)},[vn,_l,hn[vn??""],On==null?void 0:On.minTarget,Df]);const Lr=c=>{var x;const h=c.currentTarget.getBoundingClientRect(),g=((x=c.currentTarget.closest(".oc-dock"))==null?void 0:x.getBoundingClientRect())??h;return{clientX:h.left,clientY:g.top-8}},Lf=c=>St({x:c.clientX,y:c.clientY,up:!0,title:u.toolbar.canvasTools,icons:!0,items:ci.slice(0,5).map(h=>({label:h.label,icon:h.icon,shortcut:h.key,check:S===h.id,run:()=>w(h.id)}))}),_f=c=>St({x:c.clientX,y:c.clientY,up:!0,title:u.toolbar.shapes,icons:!0,items:[...ci.slice(5).map(h=>({label:h.label,icon:h.icon,shortcut:h.key,check:S===h.id,run:()=>w(h.id)})),"sep",{label:u.toolbar.insertImage,icon:"image",run:()=>ft(()=>h=>{ft(null),Ao(h)})}]}),xn=(c,h=!1)=>{const g=Math.round(m.get().zoom*100);St({x:c.clientX,y:c.clientY,right:!h,up:h,className:"zoom-menu oc-menu",items:[{label:u.toolbar.zoomIn,shortcut:`${mt}+`,run:()=>ps(2)},{label:u.toolbar.zoomOut,shortcut:`${mt}−`,run:()=>ps(1/2)},{label:u.toolbar.fitAll,shortcut:"⇧1",run:jo},{label:u.toolbar.zoomToSelection,shortcut:"⇧2",disabled:!k.length,run:()=>Vl(k)},"sep",{label:u.toolbar.zoomNow(g),disabled:!0,run:()=>{}},...[50,100,200].map(x=>({label:`${x}%`,shortcut:x===100?`${mt}0`:void 0,check:g===x,run:()=>bi(x/100)})),"sep",{label:u.toolbar.layoutGuides,shortcut:"⌃G",check:xr,run:()=>_s(x=>!x)},{label:u.toolbar.minimap,shortcut:"M",check:Re,run:Sc},{label:u.toolbar.cleanView,shortcut:`⇧${mt}\\`,check:It,run:ol}]})},Sc=()=>_e(c=>!c),$i=c=>St({x:c.clientX,y:c.clientY,title:u.toolbar.shortcuts,className:"keys-menu",items:aj.flatMap(h=>[{label:u.keys.sections[h],heading:!0,run:()=>{}},...lj.filter(g=>g.section===h).map(g=>({label:u.keys.rows[g.id],shortcut:g.combos.map(x=>oj(x,mt)).join(" "),run:()=>{}}))])}),_r=async c=>{const h=Rt!=null&&Rt.update?await Promise.race([Ia(),new Promise(A=>setTimeout(A,400))]).then(A=>A??Rt):Rt,g=On?Object.keys(On.themes):[];xo();const x=A=>A.split(/[\\/]/).filter(Boolean).pop()??A,T=A=>Cr.some(L=>L!==A&&L.title===A.title)||A.title===(i==null?void 0:i.title)?`${A.title} · ${x(A.root)}`:A.title;St({x:c.clientX,y:c.clientY,title:(n==null?void 0:n.dir)??(i==null?void 0:i.title),className:"project-menu oc-menu",items:[...ds(h),{label:u.boardList.search,shortcut:`${mt}K`,run:()=>{hi("boards"),ae(!0),setTimeout(()=>{var A;return(A=gi.current)==null?void 0:A.focus()},0)}},{label:u.toolbar.shareMenu,run:()=>{var A;return(A=document.querySelector(".oc-rhead .share-btn"))==null?void 0:A.click()}},{label:u.toolbar.snapshot,run:()=>void Oi(c)},...Jt?[{label:u.toolbar.history,run:()=>Tc()}]:[],"sep",{label:u.toolbar.appearance(pi),run:()=>Uu(A=>A==="system"?"light":A==="light"?"dark":"system")},...g.length>1?g.map(A=>({label:u.toolbar.themeOption(A),check:On.active===A,run:()=>void Nc({...On,active:A},u.history.changeTheme)})):[],{label:u.toolbar.language(sf.find(A=>A.id===wf).name),run:()=>l0(sf[(sf.findIndex(A=>A.id===wf)+1)%sf.length].id)},"sep",{label:u.requests.menuChat,check:!Ot.host,run:()=>void Ot.save({mode:"chat",intro:!0})},{label:u.requests.menuHost,check:Ot.host,run:()=>void Ot.save({mode:"host",intro:!0})},...!Ot.host&&Ra.current?(()=>{const A=Ra.current;return[{label:u.inline.agentItem(A.label),run:()=>window.setTimeout(()=>A.openAgentMenu({right:Math.max(8,window.innerWidth-c.clientX-340),top:c.clientY}),0)},...A.isCustom?[]:[{label:u.inline.modelItem(A.model),run:()=>void Tn.prompt({title:u.inline.modelTitle,label:u.inline.modelLabel,value:A.model,ok:u.dialog.ok}).then(L=>{var W;return L&&((W=Ra.current)==null?void 0:W.setModel(L.value.trim()))})}]]})():[],"sep",{label:u.toolbar.shortcuts,run:()=>window.setTimeout(()=>$i(c),0)},...Cr.length?["sep",{label:u.toolbar.otherProjects,heading:!0,run:()=>{}},...Cr.map(A=>({label:T(A),tip:A.root,run:()=>window.location.assign(`http://localhost:${A.port}/`)}))]:[]]})},zi=c=>St({x:c.clientX,y:c.clientY,title:kl(u.boardList.pages,c).title,className:"pages-menu",items:[...kl(u.boardList.pages,c).items,...Ie.length?Ie.map(h=>({label:h.name,tip:h.name,check:h.id===rn,run:()=>E(h.id),more:{label:u.boardList.pageMore(h.name),open:g=>Gs(h.id,g)}})):[{label:u.boardList.mainPage,check:!0,run:()=>{}}],"sep",{label:u.boardList.newPage,disabled:Ie.length>=40,run:()=>void Rr()}]}),Uf=(c,h)=>{!i||!n||St({x:c.clientX,y:c.clientY,title:u.toolbar.erroredBoardsN(h.length),items:[...h.slice(0,12).map(g=>{var x,T,A;return{label:`${((x=i.boards[g])==null?void 0:x.title)??g} — ${(((A=(T=Bl[g])==null?void 0:T[0])==null?void 0:A.message)??u.menu.fileMissing).slice(0,40)}`,run:()=>{nl([g]),Vl([g])}}}),"sep",{label:u.menu.askFixAll,run:()=>Or(h)},...n.missing.length?[{label:u.menu.cleanMissing(n.missing.length),danger:!0,run:()=>{bn(g=>{const x={...g.boards};for(const T of n.missing)delete x[T];return{...g,boards:x,order:g.order.filter(T=>!n.missing.includes(T))}},u.history.cleanMissing),ye({text:u.toast.cleanedUp(n.missing.length),action:Cn})}}]:[]]})},Oi=async(c,h=!1)=>{const g=await xe.get("/api/snapshots").catch(()=>null);if(!(g!=null&&g.git))return St({x:c.clientX,y:c.clientY,right:h,title:u.menu.snapshot,items:[{label:u.menu.notGit,disabled:!0,run:()=>{}}]});St({x:c.clientX,y:c.clientY,right:h,title:u.menu.snapshotStatus(g.branch??"",g.changed),items:[{label:g.changed?u.menu.snapshotNow:u.menu.nothingChanged,disabled:!g.changed,run:async()=>{const x=await Tn.prompt({title:u.dialog.snapshotTitle,label:u.dialog.snapshotLabel,value:u.dialog.snapshotMessage(new Date().toLocaleDateString("en-CA")),hint:u.dialog.snapshotHint,ok:u.dialog.commit});if(x)try{const T=await xe.post("/api/snapshot",{message:x.value});ye({tone:"ok",text:T.nothing?u.toast.nothingChanged:u.toast.snapshot(T.hash??"")})}catch(T){ye({tone:"error",text:String(T.message)})}}},"sep",...g.snapshots.slice(0,10).map(x=>({label:`${x.hash} ${x.subject.slice(0,40)} · ${x.when}`,disabled:!0,run:()=>{}}))]})};v.useEffect(()=>Eb(M),[M]);const Ur=async c=>{const h=Sa.current,g=h&&ff(h,c);if(!h||!g)return;const x=T=>{var A;return((A=h.boards[T])==null?void 0:A.title)??T};wl(T=>T&&{...T,busy:!0});try{const T=await xe.post("/api/boards/use",{file:c});wl(null),M&&g.alts.includes(M)&&X(null),await an(),Ja([g.original]);const A=g.chosen===g.original?u.occupancy.kept(x(g.original),g.alts.length):u.occupancy.applied(vw(x(g.chosen)),x(g.original));ye({tone:"ok",text:A,action:T.step?{label:u.occupancy.undo,run:()=>void Js(T.step,A,[g.original,...g.alts])}:Cn})}catch(T){wl(A=>A&&{...A,busy:!1}),ye({tone:"error",text:String(T.message)})}Bn(),kt.reload()},Ps=async c=>{const h=Sa.current,g=h&&ff(h,c);if(!(!h||!g)){wl(x=>x&&{...x,busy:!0});try{const x=await xe.post("/api/boards/keep",{file:c});wl(null),await an();const T=u.occupancy.keptAll(g.kind,g.alts.length);ye({text:T,action:x.step?{label:u.occupancy.undo,run:()=>void Js(x.step,T)}:Cn})}catch(x){wl(T=>T&&{...T,busy:!1}),ye({tone:"error",text:String(x.message)})}Bn(),kt.reload()}},Js=async(c,h,g=[])=>{try{await xe.post("/api/history/undo-steps",{ids:[c],mode:"rest"}),await an(),g.length&&Ja(g),ye({text:u.toast.undoRedoDone("undo",h),action:{label:u.toolbar.redo,run:()=>void jl("redo")}})}catch(x){ye({tone:"error",text:String(x.message)})}Bn(),kt.reload()},rd=v.useRef([]);v.useEffect(()=>{const c=[...k,...M?[M]:[]],h=c.filter(g=>!rd.current.includes(g));rd.current=c;for(const g of h)kt.markSeen(kt.tagsOf(g).flatMap(x=>x.steps))},[k,M]);const Ri=(c,h)=>kt.tagsOf(c).find(g=>g.key===h)??null,ud=(c,h)=>{Ri(c,h)&&xl(g=>(g==null?void 0:g.file)===c&&g.key===h?null:{file:c,key:h,conflict:null,busy:!1})},qr=v.useRef(ud);qr.current=ud;const js=v.useCallback((c,h)=>qr.current(c,h),[]),Di=v.useRef(null);v.useEffect(()=>{var g;const c=Di.current,h=Wt&&Ri(Wt.file,Wt.key);Di.current=h?{id:`${Wt.file}|${h.key}`,steps:h.steps}:null,c&&c.id!==((g=Di.current)==null?void 0:g.id)&&kt.markSeen(c.steps)},[Wt==null?void 0:Wt.file,Wt==null?void 0:Wt.key]);const kc=async(c,h,g)=>{var T,A,L;xl(W=>W&&{...W,busy:!0});const x=u.activity.stepName(((A=(T=kt.data)==null?void 0:T.steps.find(W=>W.id===h.steps[0]))==null?void 0:A.name)??"");try{const W=()=>xe.post("/api/history/undo-steps",{ids:h.steps,mode:g});h.run?await xe.post("/api/chat/undo-run",{id:h.run,mode:g}).catch(ke=>ke.status===404?W():Promise.reject(ke)):await W(),xl(null),ye({text:u.toast.undoRedoDone("undo",h.steps.length===1?x:u.activity.changes(h.steps.length)),action:{label:u.toolbar.redo,run:()=>void jl("redo")}}),await an()}catch(W){const ke=W,Ee=ke.status===409?(L=ke.body)==null?void 0:L.conflicts:void 0;Ee?xl($e=>$e&&{...$e,busy:!1,conflict:[...new Set(Ee.map(Ze=>{var ln,je;return Ze.file.endsWith(".html")?((je=(ln=Sa.current)==null?void 0:ln.boards[Ze.file])==null?void 0:je.title)??Ze.file:Ze.file}))]}):(xl($e=>$e&&{...$e,busy:!1}),ye({tone:"error",text:ke.message}))}Bn(),kt.reload()},dd=async c=>{qu(!0);try{await xe.post("/api/history/goto",{id:c.id}),ye({text:u.activity.wentBack(u.activity.stepName(c.name))}),await an()}catch(h){ye({tone:"error",text:String(h.message)})}finally{qu(!1),Bn(),kt.reload()}},Is=v.useCallback(()=>kr(!1),[]),Tc=()=>{kt.reload(),kr(!0)};v.useEffect(()=>{Wt&&!Ri(Wt.file,Wt.key)&&xl(null)},[kt.data,kt.now]);const Bi=v.useRef(()=>{});Bi.current=c=>{var ke,Ee,$e,Ze,ln,je,Gt,Ln,Yt,Es;if(!i||Tn.state||Oe)return;if(Ne){if(ku(c)||qt||(ke=document.activeElement)!=null&&ke.closest(".menu"))return;if(c.altKey&&c.code==="KeyC")return c.preventDefault(),Cl();(c.key==="Escape"||c.key==="ArrowLeft"||c.key==="ArrowRight")&&(c.preventDefault(),c.key==="Escape"?zo():Ua(c.key==="ArrowLeft"?-1:1));return}if(H){c.key==="Escape"&&!ku(c)&&(c.preventDefault(),Xs());return}if((c.metaKey||c.ctrlKey)&&!c.shiftKey&&c.key==="\\"&&!c.isComposing&&ku(c))return c.preventDefault(),Tl();if(ku(c)||c.isComposing||(c.key==="Enter"||c.key===" ")&&c.target instanceof Element&&c.target.closest("button, a[href], [role=button]"))return;const h=c.metaKey||c.ctrlKey,g=c.key.toLowerCase(),x=k.length===1?k[0]:null,T=Xe=>{c.preventDefault(),Xe()};if(h&&g==="z")return T(()=>void jl(c.shiftKey?"redo":"undo"));if(h&&g==="y")return T(()=>void jl("redo"));if(h&&g==="j")return T(()=>nn==="chat"&&Be&&!Tt?Ss():nn==="chat"&&!Be?Qa("inspect"):ll(gs()??(x?al(x):null),()=>So(gs()??(x?al(x):null))));if(h&&g==="k")return T(()=>{ae(!0),setTimeout(()=>{var Xe;return(Xe=gi.current)==null?void 0:Xe.focus()},0)});if(h&&g==="a"&&!M)return T(()=>nl(dt));if(h&&g==="a"&&M){const Xe=(Ee=ut.current.get(M))==null?void 0:Ee.contentDocument,Pt=($e=Se.state.selection)==null?void 0:$e.path,ht=Xe&&(Pt?(Ze=dn(Xe,Pt))==null?void 0:Ze.parentElement:Xe.body.firstElementChild),ha=ht?Array.from(ht.children).filter(aa=>!/^(SCRIPT|STYLE)$/.test(aa.tagName)).map(aa=>hl(aa)).filter(aa=>aa!=null):[];return T(()=>ha.length&&void Se.select(ha))}if(h&&g==="l"&&(k.length||R.length))return T(()=>Ti());if(h&&c.altKey&&c.code==="KeyC"&&M&&Se.state.selection)return T(Ks);if(h&&c.altKey&&c.code==="KeyV"&&M&&Se.state.paths.length)return T(()=>void Zs());if(h&&c.shiftKey&&g==="c"&&M&&Se.state.selection)return T(()=>void Ci(M,Se.state.selection.path));if(h&&c.shiftKey&&g==="c"&&x&&!M)return T(()=>void Ci(x));if(!h&&c.shiftKey&&(g==="h"||g==="v")&&M&&Se.state.selection)return T(()=>Oo(g==="h"?"x":"y"));if(h&&g==="c"&&M&&Se.state.selection)return T(()=>void Ju());if(h&&g==="v"&&M)return T(()=>void Iu());if(h&&g==="d"&&M&&Se.state.selection){const Xe=Se.state.selection;return T(()=>void mn({op:"duplicate",path:Xe.path,hash:Xe.hash}))}if(h&&g==="d"&&x&&!M)return T(()=>void Ar(x));if(h&&c.key==="]"&&k.length)return T(()=>ka(k,"front"));if(h&&c.key==="["&&k.length)return T(()=>ka(k,"back"));if(h&&c.key==="0")return T(()=>bi(1));if(h&&c.key==="1")return T(jo);if(h&&(c.key==="="||c.key==="+"))return T(()=>ps(2));if(h&&c.key==="-")return T(()=>ps(1/2));if(h&&c.shiftKey&&c.code==="Backslash")return T(()=>ol());if(h&&c.key==="\\")return T(()=>Tl());if(c.ctrlKey&&!c.metaKey&&g==="g")return T(()=>_s(Xe=>!Xe));if(h&&g==="g"&&M&&Se.state.paths.length>=2)return T(()=>void jc("flex"));if(h)return;if(c.shiftKey&&c.code==="Digit1")return T(jo);if(c.shiftKey&&c.code==="Digit2")return T(()=>Vl(k));if(c.altKey&&!h&&c.code==="KeyC")return T(Cl);if(c.key==="Escape"){if(pn)return T(()=>xs(null));if(Gn)return T(Uo);if(et)return T(()=>Zl(!1));if(It)return T(()=>ol());if(ue)return T(()=>Wn());if(Be&&U)return T(()=>ae(!1));const Xe=!!((ln=document.activeElement)!=null&&ln.closest(".oc-right"))&&!((je=document.activeElement)!=null&&je.closest(".oc-rhead"));if(!Tt&&(Be||(Li||fa||nn==="chat")&&!Xe))return T(Ss);if(M)return T(()=>X(null));if(S!=="select")return T(()=>w("select"));z([]),V(null),bl(null);return}if(c.key==="F6")return T(()=>Ql(c.shiftKey));const A=document.activeElement,L=!A||A===document.body||!!((Gt=A.closest)!=null&&Gt.call(A,".canvas"))||A.tagName==="IFRAME";if(c.key==="Tab"&&!c.shiftKey&&L&&M&&Se.state.selection){const Xe=document.querySelector('.etb button[tabindex="0"]');if(Xe)return T(()=>Xe.focus())}if(c.key==="Tab"&&L&&!M&&dt.length){const Xe=k.length?dt.indexOf(k[k.length-1]):-1,Pt=dt[(Xe+(c.shiftKey?-1:1)+dt.length)%dt.length];return T(()=>{var ht;nl([Pt]),Vl([Pt]),re(u.app.announceBoard(((ht=i.boards[Pt])==null?void 0:ht.title)??Pt,dt.indexOf(Pt)+1,dt.length))})}if(c.key==="Enter"&&!M&&k.length===1&&L)return T(()=>Yn(k[0]));if(c.key==="Enter"&&M&&Se.state.selection){const Xe=(Ln=ut.current.get(M))==null?void 0:Ln.contentDocument,Pt=Xe&&dn(Xe,Se.state.selection.path),ht=c.shiftKey?Pt==null?void 0:Pt.parentElement:Pt==null?void 0:Pt.firstElementChild,ha=ht&&ht!==(Xe==null?void 0:Xe.body)?hl(ht):null;return ha!=null?T(()=>void Se.select([ha])):void 0}if(g==="p"&&!h&&Dw(k,i.boards)==="play")return T(()=>ue===k[0]?Wn():pt(k[0]));if((c.key==="Delete"||c.key==="Backspace")&&In.length&&!M)return T(()=>wi(In));if(c.key==="Delete"||c.key==="Backspace"){if(M&&Se.state.selection){const Xe=Se.state.selection;return T(async()=>{await mn({op:"delete",path:Xe.path,hash:Xe.hash})&&(Se.select([]),ye({text:u.toast.elementDeleted,action:Cn}))})}return R.length||k.length&&!M?T(()=>{R.length&&Mo(R),k.length&&!M&&hc(k)}):void 0}if((c.key.startsWith("Arrow")||c.key==="Enter")&&M&&Se.state.selection){const Xe=Se.state.selection,Pt=(Yt=ut.current.get(M))==null?void 0:Yt.contentDocument,ht=Pt&&dn(Pt,Xe.path);if(!ht)return;if(c.altKey&&(c.key==="ArrowUp"||c.key==="ArrowDown")){const aa=Xe.path.includes("/")?Xe.path.slice(0,Xe.path.lastIndexOf("/")):"",lo=Number(Xe.path.split("/").pop()),Mt=c.key==="ArrowUp"?lo-1:lo+1;return Mt<0||Mt>=(((Es=ht.parentElement)==null?void 0:Es.children.length)??0)?T(()=>{}):T(()=>void Pu(Xe.path,{toParentPath:aa,index:Mt,freeze:[]}))}const ha=c.key==="ArrowUp"||c.key==="Enter"&&c.shiftKey?ht.parentElement:c.key==="ArrowDown"||c.key==="Enter"?ht.firstElementChild:c.key==="ArrowRight"?ht.nextElementSibling:ht.previousElementSibling;if(ha&&ha!==Pt.body){const aa=hl(ha);if(aa!=null)return T(()=>void Se.select([aa]))}return T(()=>{})}if(c.key.startsWith("Arrow")&&(k.length||R.length||In.length)&&!M){const Xe=c.altKey?100:c.shiftKey?10:1;return T(()=>nd(c.key==="ArrowLeft"?-Xe:c.key==="ArrowRight"?Xe:0,c.key==="ArrowUp"?-Xe:c.key==="ArrowDown"?Xe:0))}if(c.key==="F2"&&x)return T(()=>void mc(x));if(g==="f"&&x)return T(()=>qn(x));if(g==="m")return T(Sc);const W=ci.find(Xe=>Xe.key.toLowerCase()===g);if(W)return T(()=>w(W.id))},v.useEffect(()=>{const c=h=>Bi.current(h);return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[]);const Hi=v.useRef(new Map),fd=c=>{var W,ke;if(!n||!i)return null;const h=((W=i.boards[c])==null?void 0:W.title)??c,g=M===c&&((ke=Se.state.selection)==null?void 0:ke.file)===c?Se.state.selection:null,x=g?`${u.inspector.kindName(g.kind??g.tag)}${g.label?` "${g.label.slice(0,40)}"`:""}`:void 0,T={file:`${n.screens??"screens"}/${c}`,...g?{path:g.path,element:x}:{},label:x?u.requests.frameElement(h,x):u.requests.frameBoard(h)},A=JSON.stringify(T),L=Hi.current.get(c);return(L==null?void 0:L.sig)===A?L.v:(Hi.current.set(c,{sig:A,v:T}),T)},Cc=c=>{var h;if(Tt){const g=(h=document.querySelector(`.pin-layer [data-comment="${c.id}"]`))==null?void 0:h.getBoundingClientRect();Do({id:c.id,x:g?g.right:D.w/2,y:g?g.top:80}),ne(c.id);return}Do(null),ne(c.id),Vn(!0),Qa("inspect"),Vt.current=Date.now(),Kl(!0),c.path?Hn(c.file,[c.path]):(X(null),z([c.file]),K([]),Da([])),window.setTimeout(()=>{var A,L;const g=(A=document.querySelector(`.pin-layer [data-comment="${c.id}"]`))==null?void 0:A.getBoundingClientRect(),x=(L=document.querySelector(".oc-right"))==null?void 0:L.getBoundingClientRect();if(!g||!x||g.right+12<=x.left||g.left>=x.right)return;const T=g.right+24-x.left;N(W=>({...W,x:W.x-T}))},260)},Ws=(c,h)=>{var A;const g=tn.filter(L=>L.file===c&&(!L.resolved||Nu(L,vt)));if(!g.length)return null;const x=(A=ut.current.get(c))==null?void 0:A.contentDocument,T=S==="select"&&!It&&ue!==c&&!Oe;return s.jsx("div",{className:`pins ${T?"live":""}`,children:g.map((L,W)=>{const ke=x&&L.path?dn(x,L.path):null,Ee=ke?Rl(ke):null,$e=1/Math.max(h,.25);return s.jsxs("button",{className:`pin ${va(L)?`req-pin is-${L.request.state}`:""} ${Z===L.id?"on":""}`,title:L.text,"aria-label":va(L)?u.requests.pinLabel(W+1,L.request.state==="waiting",L.text.split(`
72
+ `)[0].slice(0,80)):u.comments.pinLabel(W+1,L.author,L.text.split(`
73
+ `)[0].slice(0,80)),"aria-pressed":Z===L.id,tabIndex:T?0:-1,"data-comment":L.id,onPointerDown:Ze=>Ze.stopPropagation(),onDoubleClick:Ze=>Ze.stopPropagation(),onClick:()=>Nu(L,vt)?_t(L):Cc(L),style:Ee?{left:Ee.x+Ee.w-12,top:Math.max(Ee.y-12,24/Math.max(h,.25)-24),transform:`scale(${1/Math.max(h,.25)})`}:{right:32*$e-24,top:(8+W*30)*$e+24*$e-24,transform:`scale(${$e})`},children:[W+1,va(L)&&s.jsx("span",{className:"req-flag","aria-hidden":"true",title:u.requests.forAi,children:L.request.state==="taken"?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(Q,{name:L.request.state==="waiting"?"clock":L.request.state==="done"?"check":"warn",size:14})})]},L.id)})})},eo=(c,h)=>{var Ze,ln;const g=(Ze=ut.current.get(c))==null?void 0:Ze.contentDocument,x=M===c,T=xr?(((ln=i==null?void 0:i.guides)==null?void 0:ln[c])??[]).filter(je=>!je.hidden):[],A=ue===c?void 0:kt.tagsOf(c).find(je=>je.paths.length&&kt.stateOf(je)==="fresh"),L=(ce==null?void 0:ce.file)===c&&ue!==c&&!(x&&Se.state.paths.includes(ce.path))?ce:null,W=(he==null?void 0:he.file)===c?he.rect:null,ke=me.includes(c),Ee=g&&!It&&ue!==c?[...new Set(tn.filter(je=>{var Gt;return je.file===c&&je.path&&((Gt=je.request)==null?void 0:Gt.state)!=="done"&&Nu(je,vt)}).map(je=>je.path))].map(je=>dn(g,je)).filter(je=>!!je):[];if(!x&&!T.length&&!A&&!L&&!W&&!ke&&!Ee.length)return null;const $e=1/Math.max(h,.05);return s.jsxs("div",{className:"overlay",children:[ke&&s.jsx("div",{className:"export-badge",role:"status",style:{transform:`scale(${1/Math.max(h,.25)})`},children:u.canvas.exportingPng}),A&&s.jsx(d0,{frame:ut.current.get(c)??null,paths:A.paths,zoom:h}),T.length>0&&i&&s.jsx(A0,{guides:T,w:i.boards[c].w,h:i.boards[c].h}),Ee.map((je,Gt)=>s.jsx(pf,{r:Rl(je),cls:"req-out",px:$e},`req${Gt}`)),L&&s.jsx(pf,{r:L.rect,cls:"hover",px:$e}),x&&Se.state.rects.map((je,Gt)=>s.jsx(pf,{r:je,cls:"sel",px:$e},Gt)),W&&s.jsx(pf,{r:W,cls:"marquee-el",px:$e}),x&&te!==c&&g&&Se.state.paths.length===1&&Se.state.rects[0]&&s.jsx(U1,{doc:g,path:Se.state.paths[0],rect:Se.state.rects[0],zoom:h,onMove:je=>void Pu(Se.state.paths[0],je),onPosition:async(je,Gt)=>{const Ln=Se.state.paths[0],Yt=await La(c,Ln);await mn({op:"batch",ops:[{op:"setStyle",path:Ln,hash:Yt,prop:"left",value:`${je}px`},{op:"setStyle",path:Ln,hash:Yt,prop:"top",value:`${Gt}px`}]})},onResize:async(je,Gt)=>{const Ln=Se.state.paths[0],Yt=await La(c,Ln);await mn({op:"batch",ops:[{op:"setStyle",path:Ln,hash:Yt,prop:"width",value:`${je}px`},{op:"setStyle",path:Ln,hash:Yt,prop:"height",value:`${Gt}px`}]})}})]})};if(!i||!n)return s.jsx("div",{className:"loading",role:"status",children:gl?s.jsxs(s.Fragment,{children:[s.jsx(Q,{name:"warn"})," ",u.app.loadFailed," ",gl,s.jsx("button",{onClick:()=>void an(),children:u.app.retry})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spinner","aria-hidden":"true"})," ",u.app.loadingBoards]})});const lt=k.length===1?k[0]:null,Ho=[...new Set([...n.missing,...Object.keys(Bl)])],Lo=s.jsxs("div",{className:"oc-tabs",role:"tablist","aria-label":u.tabs.left,ref:Gu,children:[s.jsx("button",{role:"tab","aria-selected":ja==="boards",className:ja==="boards"?"on":"",onClick:()=>hi("boards"),children:u.tabs.boards}),s.jsx("button",{role:"tab","aria-selected":ja==="assets",className:ja==="assets"?"on":"",onClick:()=>hi("assets"),children:u.tabs.assets}),s.jsx("button",{role:"tab","aria-selected":ja==="tokens",className:ja==="tokens"?"on":"",onClick:()=>hi("tokens"),children:u.tabs.tokens})]}),_o=dt.map(c=>({file:c,...i.boards[c]})),Li=!M&&!k.length&&!R.length&&!In.length,Ns=Be&&nn==="inspect"&&!!M&&!(((gn=Se.state.selection)==null?void 0:gn.file)===M&&Se.state.paths.length>0),Tt=!ea||Ns,Xn=Ht&&!Tt,wn=on,Ss=()=>{Vn(!1),ne(null),xc(!1),Kl(!1)},Tl=()=>{if(!Tt)return Ss();Qa("inspect"),Kl(!1),xc(!0),Vn(!0)},Uo=()=>{Do(null),ne(null)},Ec=(c,h)=>St({x:h.clientX,y:h.clientY,items:[{label:u.comments.edit,run:async()=>{const g=await Tn.prompt({title:u.comments.edit,label:u.comments.title,value:c.text,ok:u.dialog.save});g!=null&&g.value.trim()&&g.value.trim()!==c.text&&await xe.post("/api/comments",{action:"edit",id:c.id,text:g.value.trim()})}},"sep",{label:u.comments.deleteThread,danger:!0,run:async()=>{(Gn==null?void 0:Gn.id)===c.id&&Uo(),await xe.post("/api/comments",{action:"delete",id:c.id})}}]}),Cl=()=>{xs(null),Do(null),Zl(c=>!c)},ks=()=>{if(fa&&!Tt)return Ss();ne(null),Qa("inspect"),Kl(!0),Vn(!0)},to=M??lt??dt[0]??null,Vr=nn==="chat"&&(!Ot.host||lc),Mc=Be&&nn==="inspect"&&!!Z&&tn.some(c=>c.id===Z),qo=c=>{if(!Be||It)return;const h=c.target instanceof Element?c.target:null;if(!h||h.closest(".pin, .oc-card, .etb, .req-composer, .oc-dock"))return;if(Tt){c.type==="pointerdown"&&c.button===0&&!h.matches(".canvas, .pan-capture")&&h.closest(".board")&&!document.querySelector(".canvas.tool-hand")&&(ne(null),Fl(T=>T+1));return}const g=nn==="chat"&&!Vr||Mc;c.type==="wheel"||c.button===1||document.querySelector(".canvas.tool-hand")||(h.matches(".canvas, .pan-capture")||g)&&Ss()},_i=oi,Ui=!Tt&&!Xn,hd=fn+Math.max(Pe,Ft)+8,il=Be?144:192,no=Be?96:128,ao=Lt>0&&Math.floor((D.w-Lt)/2)>=wn+il+8?wn:fn,Ac=Lt>0&&D.h-ao-no>=wn+ot+8;bt.current=Ac?{left:wn,right:wn+il,top:D.h-ao-no,bottom:D.h-ao}:null;const Kn=Ac&&Re&&_o.length>0&&(!U||!Be)&&!Xn&&!Ne&&!Ea,Zn=Math.max(ot,D.h-wn-(Kn&&!Be?ao+no+8:hd)),oa=U&&!Ne,Vo=`oc-card oc-left ${oa?"":"is-collapsed"} ${oa&&ja!=="boards"?"is-tall":""}`,$c=Math.max(0,D.w-wn-8-(!Tt&&!Xn?oi:Ha>=Cm?wn-8:Tr>0?Tr+wn:0)),El=Math.max(240,Math.min(Fu,$c)),ia=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"oc-head",children:[s.jsxs("div",{className:"oc-views",role:"radiogroup","aria-label":u.toolbar.viewToggle,children:[s.jsx("button",{role:"radio","aria-checked":!Ne,className:`icon-btn oc-vb ${Ne?"":"on"}`,"aria-label":u.toolbar.viewCanvas,title:u.toolbar.viewCanvas,onClick:()=>Ne&&zo(),children:s.jsx(Q,{name:"canvas"})}),s.jsx("button",{role:"radio","aria-checked":!!Ne,className:`icon-btn oc-vb ${Ne?"on":""}`,"aria-label":u.toolbar.viewPrototype,title:u.toolbar.viewPrototypeTitle,disabled:!to,onClick:()=>!Ne&&to&&qn(to),children:s.jsx(Q,{name:"focus"})})]}),!Ne&&s.jsx("button",{className:`icon-btn oc-ib oc-lp ${oa?"on":""}`,"aria-label":u.toolbar.boardsPanel,"aria-pressed":oa,title:u.toolbar.boardsPanel,onClick:()=>ae(c=>!c),children:s.jsx(Q,{name:"panel"})}),s.jsx("span",{className:"oc-hsep","aria-hidden":"true"}),Ha!==6&&s.jsxs("button",{className:"oc-project",title:(n==null?void 0:n.dir)??i.title,"aria-haspopup":"menu","aria-label":u.toolbar.projectMenu(i.title??""),"aria-expanded":!!((Yi=qt==null?void 0:qt.className)!=null&&Yi.startsWith("project")),onClick:c=>{const h=c.currentTarget.closest(".oc-head").getBoundingClientRect();_r({clientX:h.left,clientY:h.bottom+8})},children:[s.jsx("span",{className:"app-title",children:i.title}),s.jsx(Q,{name:"chevronDown",size:16}),(Rt==null?void 0:Rt.update)&&s.jsx("span",{className:"oc-news",role:"img","aria-label":u.update.dotTitle(Rt.update.latest),title:u.update.dotTitle(Rt.update.latest)})]}),Ha!==6&&s.jsx("span",{className:"oc-crumb","aria-hidden":"true",children:s.jsx(Q,{name:"chevronRight",size:14})}),Ne&&i.boards[Ne]?s.jsxs("button",{className:"oc-page oc-proto-board",title:`${i.boards[Ne].title??Ne} · ${Ne}`,"aria-haspopup":"menu","aria-label":u.toolbar.protoBoard(i.boards[Ne].title??Ne),onClick:c=>{const h=c.currentTarget.closest(".oc-head").getBoundingClientRect();id({clientX:h.left,clientY:h.bottom+8})},children:[s.jsx("span",{className:"oc-page-name",children:i.boards[Ne].title??Ne}),s.jsx(Q,{name:"chevronDown",size:16}),Ha===6&&(Rt==null?void 0:Rt.update)&&s.jsx("span",{className:"oc-news",role:"img","aria-label":u.update.dotTitle(Rt.update.latest),title:u.update.dotTitle(Rt.update.latest)})]}):s.jsxs("button",{className:"oc-page",title:((Xo=Ie.find(c=>c.id===rn))==null?void 0:Xo.name)??u.boardList.mainPage,"aria-haspopup":"menu","aria-label":u.boardList.pageSwitch(((Xi=Ie.find(c=>c.id===rn))==null?void 0:Xi.name)??u.boardList.mainPage),onClick:c=>{const h=c.currentTarget.closest(".oc-head").getBoundingClientRect();zi({clientX:h.left,clientY:h.bottom+8})},children:[Ie.length>1&&s.jsx("span",{className:"oc-pcount","aria-label":u.toolbar.pageCount(Ie.length),children:Ie.length}),s.jsx("span",{className:"oc-page-name",children:((Lc=Ie.find(c=>c.id===rn))==null?void 0:Lc.name)??u.boardList.mainPage}),s.jsx(Q,{name:"chevronDown",size:16}),Ha===6&&(Rt==null?void 0:Rt.update)&&s.jsx("span",{className:"oc-news",role:"img","aria-label":u.update.dotTitle(Rt.update.latest),title:u.update.dotTitle(Rt.update.latest)})]})]}),(Ho.length>0||gl)&&s.jsxs("div",{className:"oc-status",children:[Ho.length>0&&s.jsxs("button",{className:"err-chip","aria-haspopup":"menu",title:u.toolbar.erroredBoards,onClick:c=>{const h=c.currentTarget.getBoundingClientRect();Uf({clientX:h.left,clientY:h.bottom+8},Ho)},children:[s.jsx(Q,{name:"warn",size:16})," ",u.toolbar.errors(Ho.length)]}),gl&&s.jsx("span",{className:"warn",children:gl})]}),oa&&Lo]}),Dt=Se.state.selection,ta={left:wn,top:on+ot+8,right:D.w-wn-(!Tt&&!Xn?oi:0),bottom:D.h-fn},qi=()=>{const c=M?Se.state.rects[0]:null,h=M?i.boards[M]:null;if(!c||!h)return null;const g=m.get();return{x:g.x+(h.x+c.x)*g.zoom,y:g.y+(h.y+c.y)*g.zoom,w:c.w*g.zoom,h:c.h*g.zoom}},zc=c=>{const h=i.boards[c];if(!h)return null;const g=m.get();return{x:g.x+h.x*g.zoom,y:g.y+h.y*g.zoom-28,w:h.w*g.zoom,h:h.h*g.zoom+28}},Pl=()=>{var h;const c=(h=document.querySelector(".oc-rhead .ask-ai"))==null?void 0:h.getBoundingClientRect();return c?{x:c.left,y:c.top,w:c.width,h:c.height}:null},tt=(()=>{var g;if(Xn||Oe)return[];const c=new Set(dt),h=new Map;for(const x of tn){if(!c.has(x.file)||!Nu(x,vt))continue;const T=x.path?(g=ut.current.get(x.file))==null?void 0:g.contentDocument:null,A=`${x.file}|${T&&dn(T,x.path)?x.path:""}`;h.set(A,[...h.get(A)??[],x])}return[...h].map(([x,T])=>({key:x,file:T[0].file,path:x.slice(T[0].file.length+1),items:T})).sort((x,T)=>+!x.path-+!T.path)})(),_t=c=>{const h=tt.find(g=>g.items.some(x=>x.id===c.id));sa(new Set(((h==null?void 0:h.items)??[c]).map(g=>g.id)))},An=(c,h)=>{var L,W;const g=i.boards[c];if(!g)return null;const x=h?(L=ut.current.get(c))==null?void 0:L.contentDocument:null,T=x?dn(x,h):null;let A;if(T){const ke=Rl(T),Ee=m.get();A={x:Ee.x+(g.x+ke.x)*Ee.zoom,y:Ee.y+(g.y+ke.y)*Ee.zoom,w:ke.w*Ee.zoom,h:ke.h*Ee.zoom}}else{const ke=document.querySelector(`.board[data-file="${CSS.escape(c)}"] .board-label`),Ee=[...(ke==null?void 0:ke.querySelectorAll(".act-tags > *"))??[]].map(Yt=>Yt.getBoundingClientRect()).filter(Yt=>Yt.width>0),$e=Ee.length?Ee.filter(Yt=>Math.abs(Yt.top-Ee[0].top)<4):[(W=ke==null?void 0:ke.querySelector(".board-title"))==null?void 0:W.getBoundingClientRect()].filter(Yt=>!!Yt&&Yt.width>0);if(!$e.length)return null;const Ze=Math.min(...$e.map(Yt=>Yt.left)),ln=Math.max(...$e.map(Yt=>Yt.right));A={x:Ze,y:$e[0].top,w:ln-Ze,h:$e[0].height};const je=m.get(),Gt=je.x+g.x*je.zoom,Ln=je.y+g.y*je.zoom;return Gt+g.w*je.zoom<ta.left||Gt>ta.right||Ln+g.h*je.zoom<ta.top||Ln-56>ta.bottom?null:A}return!A||A.x+A.w<ta.left||A.x>ta.right||A.y+A.h<ta.top||A.y>ta.bottom?null:A},Go=c=>{var h;return c.kind==="element"&&c.file===M&&((h=Se.state.selection)==null?void 0:h.path)===c.path?qi():c.file?zc(c.file):Pl()},Ts=!!M&&!!i.boards[M]&&!!Dt&&Dt.file===M&&Se.state.paths.length===1&&!te&&S==="select"&&ue!==M,Cs=Vs||!!(qt!=null&&qt.up),Vi=ze&&dt.length>0,Yo=!Ts&&S==="select"&&!te&&!Cs&&!(lt&&ue===lt)&&Vi,un=Lt>0&&(D.w+Lt)/2>D.w-oi?!Xn&&(!!ui||Yo)?fn+Pe+8:fn:0,Oc=(()=>{if(!Xn)return 0;const c=M?i.boards[M]:lt?i.boards[lt]:null,h=M?Se.state.rects[0]:null,g=Br??m.get(),x=c?g.y+(c.y+(h?h.y+h.h:c.h))*g.zoom+4:0;return Math.round(dr(x+8,wn+ot+wn,D.h-8-(nn==="chat"?480:280)))})(),na=M&&((Ml=Se.state.selection)==null?void 0:Ml.file)===M?Se.state.selection:null,Gr=()=>!Xn&&(M??(In.length||R.length?null:lt))&&(()=>{const c=M??lt;return s.jsx(Vm,{file:c,version:hn[c]??0,selected:M?Se.state.paths:[],onSelect:(h,g)=>{const x=M?Se.state.paths:[];Hn(c,g?x.includes(h)?x.filter(T=>T!==h):[...x,h]:[h])},onMove:async(h,g,x)=>{const T=await La(c,h);await mn({op:"move",path:h,hash:T,toParentPath:g,index:x},c)&&Hn(c,[g?`${g}/${x}`:String(x)])}})})(),Yr=vn&&i.boards[vn]&&((Rn==null?void 0:Rn.length)??0)+((Ll==null?void 0:Ll.length)??0)>0&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.sections.checks}),On&&!On.registered?s.jsx(Cu,{variant:"row",id:"token-check",title:u.sections.tokenCheck,count:u.checks.off,children:s.jsx(z1,{onSetUp:()=>{hi("tokens"),ae(!0)}})}):s.jsx(Cu,{variant:"row",id:"token-check",title:u.sections.tokenCheck,count:(Rn==null?void 0:Rn.length)??0,children:s.jsx(nb,{title:u.checks.tokenCheck((On==null?void 0:On.active)??""),items:Rn,empty:u.checks.noOffToken,onPick:c=>Ai(vn,c),onAskAI:()=>{const c=u.prompts.fixTokens((Rn??[]).slice(0,12).map(h=>`- ${h.path??u.prompts.line+h.line}: ${h.message}`).join(`
74
+ `));ll(al(vn,"tokens",c),()=>_a(c,[vn]))}})}),s.jsx(Cu,{variant:"row",id:"a11y",title:u.sections.a11y,count:(Ll==null?void 0:Ll.length)??0,children:s.jsx(nb,{title:u.checks.a11y,items:Ll,empty:u.checks.a11yOk,onPick:c=>Ai(vn,c),onAskAI:()=>{const c=u.prompts.fixA11y((Ll??[]).slice(0,12).map(h=>`- ${h.path}: ${h.message}`).join(`
75
+ `));ll(al(vn,"a11y",c),()=>_a(c,[vn]))}})})]}),Rc=tn.filter(c=>!c.resolved&&dt.includes(c.file)).length;return s.jsx(s.Fragment,{children:s.jsxs("div",{className:`app oc oc-cd rs-${Ha} ${et?"is-cmt-mode":""} ${Jt?"oc-n":""} ${Be?"oc-pane":""} ${D.w<=760?"narrow":""} ${Ht?"oc-phone":""} ${It?"oc-clean":""} ${Ne?"is-proto":""} ${ue?"is-playing":""}`,children:[oa&&ja==="tokens"?s.jsxs("aside",{ref:it,className:Vo,style:{maxHeight:Zn,width:El},"aria-label":u.app.tokensAside,children:[ia,On?s.jsx(A1,{tokens:On,onSave:(c,h)=>void Nc(c,h)}):s.jsx("p",{className:"oc-empty",children:u.app.loading})]}):oa&&ja==="assets"?s.jsxs("aside",{ref:it,className:Vo,style:{maxHeight:Zn,width:El},"aria-label":u.app.assetsAside,children:[ia,s.jsx(Db,{version:gr,onError:c=>ye({tone:"error",text:c}),onUploaded:c=>ye({tone:"ok",text:u.toast.uploaded(c.map(h=>h.name).join(", "))})})]}):oa?s.jsx(Tw,{cardRef:it,className:Vo,style:{maxHeight:Zn,width:El},header:ia,ref:gi,board:i,pages:Ie,currentPage:rn,selected:k,missing:Ho,onPage:E,onAddPage:()=>void Rr(),onPageMenu:Gs,onMovePage:Ca,onPick:(c,h)=>{const g=i.boards[c];Ie.length&&g&&(g.page??Ie[0].id)!==rn&&E(g.page??Ie[0].id),nl([c],h?"toggle":"replace"),h||Vl([c]),Be&&!h&&ae(!1)},onGroupRename:c=>void od(c),onGroupMenu:(c,h,g)=>{var x;return St({x:g.clientX,y:g.clientY,title:c&&((x=i.groupNames)==null?void 0:x[c])||c||u.boardList.otherGroup,items:[...c?[{label:u.menu.renameGroup,run:()=>void od(c)}]:[],{label:u.menu.pageFromGroup,run:async()=>{var A;if(!Ie.length&&!await Ta({action:"add",name:u.boardList.mainPage}))return;const T=await Ta({action:"add",name:c&&((A=i.groupNames)==null?void 0:A[c])||c||u.boardList.otherGroup});T!=null&&T.id&&(bn(L=>({...L,boards:{...L.boards,...Object.fromEntries(h.filter(W=>L.boards[W]).map(W=>[W,{...L.boards[W],page:T.id}]))}}),u.history.pageFromGroup),E(T.id))}}]})},dotOf:c=>yw(Ul,c),onBoardMenu:(c,h)=>{var g;k.includes(c)||nl([c]),St({x:h.clientX,y:h.clientY,title:((g=i.boards[c])==null?void 0:g.title)??c,items:Ro(c)})}}):s.jsx("aside",{ref:it,className:Vo,style:!oa&&$c>0?{maxWidth:$c}:void 0,"aria-label":u.boardList.aria,children:ia}),s.jsxs("div",{className:"canvas-wrap",onPointerDownCapture:c=>{var x;const h=c.target instanceof Element?c.target:null,g=h==null?void 0:h.closest(".board");if(et&&S==="select"&&c.button===0&&g&&!h.closest(".pin, .board-btns, .board-resize")){c.stopPropagation(),c.preventDefault();const T=g.dataset.file,A=of(ut.current.get(T),c.clientX,c.clientY),L=A&&h.closest(".board-frame")?A:null,W=L?(()=>{const{kind:ke,label:Ee}=Su(L.el);return Ee?`${u.inspector.kindName(ke)} “${Ee.slice(0,24)}”`:u.inspector.kindName(ke)})():null;Do(null),xs({file:T,path:(L==null?void 0:L.path)??"",x:c.clientX,y:c.clientY,crumbs:[((x=i.boards[T])==null?void 0:x.title)??T,...W?[W]:[]]});return}Be&&U&&ae(!1),qo(c)},onWheelCapture:qo,onDragOver:c=>{Array.from(c.dataTransfer.items).some(h=>h.kind==="file")&&c.preventDefault()},onDrop:c=>{const h=Array.from(c.dataTransfer.files);if(!h.length)return;c.preventDefault();const g=c.currentTarget.getBoundingClientRect(),x=m.get(),T={x:(c.clientX-g.left-x.x)/x.zoom,y:(c.clientY-g.top-x.y)/x.zoom};sl(h,T)},children:[s.jsx(G0,{board:i,files:n.files,view:m,tool:S,setTool:w,visibleBoards:dt,visibleNotes:Mr,selected:k,selectedNotes:R,editFile:M,reloadKeys:Ls,stamps:Jn,onSelect:nl,onSelectNote:(c,h)=>{if(!c)return K([]);K(g=>h?g.includes(c)?g.filter(x=>x!==c):[...g,c]:[c]),h||(z([]),Da([]))},onMarquee:(c,h)=>{z(g=>h?[...new Set([...g,...c.boards])]:c.boards),K(g=>h?[...new Set([...g,...c.notes])]:c.notes),Da(g=>h?[...new Set([...g,...c.shapes])]:c.shapes)},onMoveBoards:(c,h)=>bn(g=>{const x=Object.entries(c),T=x.length>0&&x.every(([,$e])=>$e.w==null&&$e.h==null&&$e.x!=null&&$e.y!=null),[A,L]=x[0]??[],W=T&&A&&g.boards[A]?L.x-g.boards[A].x:0,ke=T&&A&&g.boards[A]?L.y-g.boards[A].y:0,Ee=T&&R.length&&x.every(([$e])=>k.includes($e))?Eo(g,W,ke,[],R):g;return{...Ee,boards:{...Ee.boards,...Object.fromEntries(x.map(([$e,Ze])=>[$e,{...Ee.boards[$e],...Ze,autoPlaced:void 0}]))}}},h?Object.values(c).some(g=>g.w!=null)?u.history.resizeBoard:u.history.moveBoard:void 0),onMoveNote:(c,h,g)=>bn(x=>{const T=x.notes[c],A=h.x!=null?h.x-T.x:0,L=h.y!=null?h.y-T.y:0,ke=(A||L)&&!("text"in h)&&R.includes(c)?Eo(x,A,L,k,R.filter(Ee=>Ee!==c)):x;return{...ke,notes:{...ke.notes,[c]:{...T,...h}}}},g?"text"in h?u.history.editNote:u.history.moveNote:void 0),onDeleteNote:c=>Mo([c]),onPlay:c=>ue===c?Wn():pt(c),onBoardAction:cd,hasTweaks:yc,playing:ue,typing:te,onPickElement:(c,h,g)=>{const x=ut.current.get(c),T=x==null?void 0:x.contentDocument;if(x&&(!(T!=null&&T.body)||T.readyState==="loading")){const A={clientX:h.clientX,clientY:h.clientY};return x.addEventListener("load",()=>vr.current(c,A,g),{once:!0})}ws(c,h,g)},onHoverElement:(c,h)=>{const g=c&&h?of(ut.current.get(c),h.clientX,h.clientY):null;ie(x=>!g||!c?null:(x==null?void 0:x.file)===c&&x.path===g.path?x:{file:c,path:g.path,rect:Rl(g.el)})},onElementMarquee:(c,h,g)=>{const x=ut.current.get(c),T=x==null?void 0:x.contentDocument;if(!x||!T||!h)return fe(null);const A=x.getBoundingClientRect(),L=A.width/(x.offsetWidth||A.width)||1,W={x:(h.x-A.left)/L,y:(h.y-A.top)/L,w:h.w/L,h:h.h/L};if(!g)return fe({file:c,rect:W});fe(null);const ke=M===c?Se.state.paths:[],Ee=R0(T,W);Hn(c,[...ke,...Ee.filter($e=>!ke.includes($e))])},onElementContext:(c,h)=>{const g=of(ut.current.get(c),h.clientX,h.clientY);return g?(M===c&&Se.state.paths.includes(g.path)||Hn(c,[g.path]),window.setTimeout(()=>{var x;return(x=el.current)==null?void 0:x.call(el,g.path,h)},0),!0):!1},onRename:c=>void mc(c),onCreateBoard:c=>void vi(c),onCreateNote:pc,onContext:Va,onSize:is,renderBoardOverlay:eo,renderBoardPins:Ws,frameInfo:fd,renderBoardTags:c=>{var Ee,$e,Ze,ln;const h=kt.tagsOf(c),g=Ot.host?ob(tn,c):0,x=tn.filter(je=>je.file===c&&!je.path&&Nu(je,vt)),T=x.find(je=>je.request.state==="taken"),A=T?T.request.by??"AI":null;if(!h.length&&!((Ee=Ul[c])!=null&&Ee.length)&&!g&&!A)return null;const L=(Wt==null?void 0:Wt.file)===c?Wt.key:null,W=JSON.stringify([Ul[c],rs,L,g,A,x.map(je=>je.id),h.map(je=>[je.key,je.by,je.person,je.outside,je.count,je.newBoard,u.activity.ago(kt.now-je.at),kt.stateOf(je)])]),ke=g||A||($e=Ul[c])!=null&&$e.length?s.jsxs(s.Fragment,{children:[s.jsx(W1,{n:g,working:A,short:!!((Ze=Ul[c])!=null&&Ze.length),onOpen:x.length?()=>sa(new Set(x.map(je=>je.id))):void 0}),(ln=Ul[c])!=null&&ln.length?s.jsx(gw,{list:Ul[c]}):null]}):null;return ic(`tags:${c}`,W,()=>s.jsx(c0,{file:c,act:kt,me:rs,onOpen:js,open:L,lead:ke}))},renderBoardButtons:(c,h)=>{const g=ff(i,c);if(!g)return null;const x=bw(Ul,g),T=(ql==null?void 0:ql.file)===c;return ic(`use:${c}`,JSON.stringify([g,x,h,T]),()=>s.jsx(xw,{file:c,group:g,busy:x,compact:h,open:T,onOpen:()=>wl(A=>(A==null?void 0:A.file)===c?null:{file:c,busy:!1})}))},boardRing:c=>av(Ul,c).length?"var(--line-strong)":null,underLayer:Wu,worldLayer:c=>s.jsxs(s.Fragment,{children:[s.jsx(S0,{shapes:Gl,ids:ad,zoom:c,selected:In,interactive:S==="select",onSelect:(h,g)=>{Da(x=>g?x.includes(h)?x.filter(T=>T!==h):[...x,h]:x.includes(h)?x:[h]),g||(z([]),K([]))},onChange:(h,g,x)=>bn(T=>{var $e;const A=($e=T.shapes)==null?void 0:$e[h];if(!A)return T;const L=g.x!=null?g.x-A.x:0,W=g.y!=null?g.y-A.y:0,Ee=(L||W)&&g.w==null&&In.includes(h)?Eo(T,L,W,k,R,In.filter(Ze=>Ze!==h)):T;return{...Ee,shapes:{...Ee.shapes??{},[h]:{...A,...g}}}},x?g.w!=null?u.history.resizeShape:u.history.moveShape:void 0),onContext:(h,g)=>St({x:g.clientX,y:g.clientY,title:u.menu.shape,items:[{label:u.menu.front,shortcut:`${mt}]`,run:()=>ji(h,"front")},{label:u.menu.back,shortcut:`${mt}[`,run:()=>ji(h,"back")},"sep",{label:u.menu.delete,shortcut:"⌫",danger:!0,run:()=>wi([h])}]})}),b.length>0&&s.jsx(K1,{peers:b,zoom:c})]}),iframeRef:(c,h)=>{h&&ut.current.get(c)!==h&&(ut.current.set(c,h),(c===M||c===ue||c===vn||c===lt||tn.some(x=>x.file===c&&!x.resolved)||kt.tagsOf(c).some(x=>x.paths.length))&&vl(x=>x+1))}}),uj.includes(S)&&s.jsx(bj,{store:m,tool:S,onDone:c=>ld(c)}),dt.length===0&&Mr.length===0&&ad.length===0&&s.jsxs("div",{className:"canvas-empty",children:[s.jsx(Q,{name:"board",size:32}),s.jsx("p",{children:u.app.emptyPage}),s.jsxs("button",{className:"primary",onClick:()=>w("board"),children:[u.app.drawBoard," ",s.jsx("kbd",{children:"B"})]})]})]}),!Xn&&ui?s.jsx(aw,{win:D,bottom:fn,room:Jt&&!Tt?D.w-wn-_i:D.w,onSwitch:()=>{const c=ui.target;Ot.save({mode:"host",intro:!0}).then(()=>$r(c))},onKeep:()=>{const c=ui.chat;hr(null),Ot.save({intro:!0}),c()}}):!Xn&&Yo&&s.jsx(pj,{win:D,first:Vi,onSize:Sn}),!Xn&&Ts&&Dt&&!Cs&&!$&&!nt&&!(we&&we.at.kind==="element"&&we.at.file===M&&we.at.path===Dt.path)&&s.jsx(D1,{store:m,target:qi,bounds:ta,selection:Dt,inline:(()=>{var g;const c=(g=ut.current.get(M))==null?void 0:g.contentDocument,h=c?dn(c,Dt.path):null;return h?Ry(h):{}})(),tokens:On,vars:Hr,onStyle:dc,onAskAi:()=>ll(gs(),()=>So(gs())),onComment:()=>{var g;const c=qi(),h=M;xs({file:h,path:Dt.path,x:c?c.x+c.w:D.w/2,y:c?c.y:80,crumbs:[((g=i.boards[h])==null?void 0:g.title)??h,...Dt.label?[Dt.label]:[]]})},onMore:c=>{var h;return(h=el.current)==null?void 0:h.call(el,Dt.path,c)}}),$&&s.jsx(j1,{store:m,target:()=>Go($),bounds:ta,gap:$.kind==="element"?Eu:8,about:$.about,onSend:c=>zr($,c),onClose:()=>I(null),onHistory:$.kind==="canvas"?()=>{I(null),_a()}:void 0,initial:(Ki=$.target)==null?void 0:Ki.text,sendLabel:Ot.host?u.requests.addForAi:void 0},`${$.kind}:${$.file??""}:${$.path??""}`),we&&!nt&&!$&&s.jsx(N1,{store:m,target:()=>Go(we.at),bounds:ta,gap:we.at.kind==="element"&&we.at.file===M&&((_c=Se.state.selection)==null?void 0:_c.path)===we.at.path?Eu:8,onOpen:()=>_a()},we.id),nt&&!$&&s.jsx(S1,{store:m,target:()=>Go(nt.at),bounds:ta,gap:nt.at.kind==="element"&&nt.at.file===M&&((Uc=Se.state.selection)==null?void 0:Uc.path)===nt.at.path?Eu:8,status:nt.status,reply:nt.reply,onUndo:nt.files.length||nt.at.file?()=>{var c;return((c=Ra.current)==null?void 0:c.undo(nt.id))??Promise.resolve()}:void 0,onOpen:()=>{Ge(null),_a()},onClose:()=>Ge(null)},nt.id),tt.map(c=>{var A;if($&&$.file===c.file&&($.kind==="element"?$.path===c.path:!c.path))return null;const h=!!c.path&&Ts&&M===c.file&&(Dt==null?void 0:Dt.path)===c.path,g=!!c.path&&M===c.file&&((A=Se.state.selection)==null?void 0:A.path)===c.path,x=c.items.some(L=>kn.has(L.id)),T=!!c.path&&c.items.some(L=>L.request.state==="taken");return!x&&!T?null:s.jsx(iw,{store:m,target:()=>An(c.file,c.path),bounds:ta,gap:c.path?{...h||g?Eu:{above:8,below:8},first:"below"}:{above:8,below:8,side:"right"},placer:(L,W,ke)=>{const Ee=i.boards[c.file],$e=m.get(),Ze=je=>({x:$e.x+je.x*$e.zoom,y:$e.y+je.y*$e.zoom,w:je.w*$e.zoom,h:je.h*$e.zoom}),ln=dt.filter(je=>je!==c.file&&i.boards[je]).map(je=>Ze(i.boards[je])).map(je=>({...je,y:je.y-56,h:je.h+56}));return w1(L,Ze(Ee),W,ke,h,ln)},items:c.items,open:x,onOpen:L=>sa(W=>{const ke=new Set(W);for(const Ee of c.items)L?ke.add(Ee.id):ke.delete(Ee.id);return ke}),a:To,onDismiss:zn,onComment:L=>{sa(new Set),window.setTimeout(()=>Cc(L),0)}},c.key)}),Kn&&s.jsxs("nav",{className:"oc-card oc-nav oc-nav-c",style:{left:wn,bottom:ao,width:il},"aria-label":u.app.navigation,children:[s.jsx(zw,{store:m,className:"oc-map",w:il,h:no,inset:6,reserve:32,rects:_o,selected:k,size:En,onJump:yi}),s.jsx(yj,{store:m,onZoom:ps,onPct:c=>{const h=c.currentTarget.getBoundingClientRect();xn({clientX:h.left,clientY:h.top-8},!0)},onFit:jo,over:!0})]}),s.jsxs("aside",{className:`oc-card oc-right ${Tt?"is-rest":""} ${Xn?"oc-sheet":""} ${Ui?"is-col":""} ${Ui&&un?"is-short":""}`,"aria-label":u.app.inspectorAside,style:Xn?{top:Oc,height:D.h-Oc-8}:Ui?{width:oi,bottom:0,paddingBottom:un}:void 0,children:[s.jsxs("div",{className:"oc-rhead",ref:cc,children:[s.jsxs("span",{className:"oc-cmts-pair",children:[s.jsxs("button",{className:`oc-abtn oc-cmts ${et?"on":""}`,"aria-label":u.toolbar.commentsTitle(Rc),"aria-pressed":et,title:u.comments.modeTitle,onClick:Cl,children:[s.jsx(Q,{name:"comment"}),Rc>0&&s.jsx("span",{className:"oc-acount",children:Rc})]}),s.jsx("button",{className:`oc-abtn oc-cmts-all ${fa&&!Tt?"on":""}`,"aria-label":u.comments.allTitle,"aria-pressed":fa&&!Tt,title:u.comments.allTitle,onClick:ks,children:s.jsx(Q,{name:"chevronDown",size:14})})]}),s.jsxs("button",{className:`ask-ai ${nn==="chat"&&!Tt||($==null?void 0:$.kind)==="canvas"?"on":""}`,"aria-label":u.toolbar.aiChat,"aria-pressed":nn==="chat"&&!Tt||($==null?void 0:$.kind)==="canvas",title:u.toolbar.aiChatTitle(mt),onClick:()=>($==null?void 0:$.kind)==="canvas"?I(null):nn==="chat"&&!Tt?Be?Ss():Qa("inspect"):ll(null,()=>So(null)),children:[s.jsx("span",{className:"ask-ai-label",children:u.toolbar.askAi}),s.jsx("span",{className:"ask-ai-short","aria-hidden":"true",children:"AI"}),Ot.host&&s.jsx(ew,{n:ob(tn)})]}),s.jsx(Zw,{pages:Ie,currentPage:rn,selected:k,owner:Pa,onRename:()=>void wr()}),!Ne&&s.jsx("button",{className:`icon-btn oc-ib oc-play ${(Xr=qt==null?void 0:qt.className)!=null&&Xr.startsWith("play-menu")?"on":""}`,"aria-label":u.toolbar.playMenu,"aria-haspopup":"menu","aria-expanded":!!((Kr=qt==null?void 0:qt.className)!=null&&Kr.startsWith("play-menu")),title:u.toolbar.playMenu,disabled:!dt.length,onClick:c=>{const h=c.currentTarget.closest(".oc-rhead").getBoundingClientRect();Dr({clientX:h.right,clientY:h.bottom+8})},children:s.jsx(Q,{name:"play"})}),Ne?s.jsxs(s.Fragment,{children:[Ha>=5?s.jsx("button",{className:`icon-btn oc-ib oc-proto-more ${(qt==null?void 0:qt.className)==="proto-more"?"on":""}`,"aria-label":u.toolbar.protoMore,"aria-haspopup":"menu",title:u.toolbar.protoMore,onClick:c=>{const h=c.currentTarget.getBoundingClientRect();St({x:h.left,y:h.bottom+8,className:"proto-more",items:[{label:u.toolbar.restart,run:()=>de(g=>g+1)},{label:u.canvas.exportBoard,run:()=>void Ys(Ne)},{label:u.toolbar.copyLink,run:()=>void Sl($o("play",Ne))}]})},children:s.jsx(Q,{name:"more"})}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"icon-btn oc-ib oc-restart","aria-label":u.toolbar.restart,title:u.toolbar.restart,onClick:()=>de(c=>c+1),children:s.jsx(Q,{name:"restore"})}),s.jsx("button",{className:"icon-btn oc-ib oc-export","aria-label":u.canvas.exportBoard,title:u.canvas.exportBoard,onClick:()=>void Ys(Ne),children:s.jsx(Q,{name:"download"})}),s.jsx("button",{className:"icon-btn oc-ib oc-copylink","aria-label":u.toolbar.copyLink,title:u.toolbar.copyLink,onClick:()=>void Sl($o("play",Ne)),children:s.jsx(Q,{name:"link"})})]}),s.jsx("button",{className:"icon-btn oc-ib oc-prev","aria-label":u.toolbar.prevBoard,title:u.toolbar.prevBoard,disabled:vc.flatMap(c=>c.files)[0]===Ne,onClick:()=>Ua(-1),children:s.jsx(Q,{name:"chevronLeft"})}),s.jsx("button",{className:"icon-btn oc-ib oc-next","aria-label":u.toolbar.nextBoard,title:u.toolbar.nextBoard,disabled:vc.flatMap(c=>c.files).slice(-1)[0]===Ne,onClick:()=>Ua(1),children:s.jsx(Q,{name:"chevronRight"})}),s.jsx("div",{className:"oc-seg oc-full-mode",role:"radiogroup","aria-label":u.full.mode,children:["fill","fit"].map(c=>s.jsx("button",{role:"radio","aria-checked":ve===c,className:ve===c?"on":"",title:c==="fill"?u.full.fillTitle:u.full.fitTitle,onClick:()=>Ce(c),children:c==="fill"?u.full.fill:u.full.fit},c))})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`icon-btn oc-ib oc-ptoggle ${Tt?"":"on"}`,"aria-label":u.toolbar.panelToggle,"aria-pressed":!Tt,title:u.toolbar.panelToggleTitle(mt),onClick:Tl,children:s.jsx(Q,{name:"panelRight"})}),s.jsx(mj,{store:m,expanded:!!((Zr=qt==null?void 0:qt.className)!=null&&Zr.startsWith("zoom")),onOpen:c=>{const h=c.currentTarget.getBoundingClientRect();xn({clientX:h.right,clientY:h.bottom+8})}})]})]}),!Tt&&s.jsx("div",{className:"oc-col-head",children:nn==="chat"?s.jsx("h2",{className:"oc-col-title",children:u.tabs.ai}):fa?s.jsx("h2",{className:"oc-col-title",children:u.comments.title}):s.jsx("div",{className:"oc-tabs oc-col-tabs",role:"tablist","aria-label":u.tabs.right,ref:Yu,children:(Xn?["props","layers","code","tweaks"]:["props","code","tweaks"]).map(c=>s.jsx("button",{role:"tab","aria-selected":vs===c,className:vs===c?"on":"",onClick:()=>Mn(c),children:c==="props"?u.tabs.properties:c==="code"?u.tabs.code:c==="tweaks"?u.tabs.tweaks:u.tabs.layers},c))})}),nn==="chat"&&!Tt&&Ot.host&&!lc&&s.jsx(nw,{req:Ot,comments:tn,actions:To,compact:Be,onOpen:c=>{wc.current=!0,window.setTimeout(()=>wc.current=!1,0),z([c.file]),Ja([c.file])}}),s.jsxs("div",{className:"chat-wrap",hidden:Tt||nn!=="chat"||Ot.host&&!lc,children:[Ot.host&&lc&&s.jsxs("button",{className:"req-back",onClick:()=>mr(!1),children:[s.jsx(Q,{name:"parent",size:14})," ",u.requests.backToRequests]}),s.jsx(v1,{selection:M&&((Fr=Se.state.selection)==null?void 0:Fr.file)===M?Se.state.selection:null,boards:M?[M]:k,visibleCount:Qs,titleOf:c=>{var h;return((h=i.boards[c])==null?void 0:h.title)??c},sizeOf:c=>i.boards[c]?{w:i.boards[c].w,h:i.boards[c].h}:null,storeKey:(n==null?void 0:n.dir)??null,confirm:Tn.confirm,attach:mo,setAttach:po,draft:di,setDraft:cs,subscribe:Lu,onLocate:Ja,inputRef:pr,open:nn==="chat"&&!Tt,handle:Ra,onRunEnd:Hf,settingsElsewhere:!0})]}),nn==="inspect"&&!Tt&&!fa&&vs==="code"&&(()=>{var g;const c=M?(g=ut.current.get(M))==null?void 0:g.contentDocument:null,h=na&&M&&c?dn(c,na.path):null;return h&&na&&M?s.jsx(Iw,{el:h,tag:na.tag,label:na.label,path:na.path,onSave:async x=>{const T=await La(M,na.path).catch(()=>null);return!!T&&!!await mn({op:"setStyleText",path:na.path,hash:T,text:x},M)}},`${M}:${na.path}`):s.jsx("div",{className:"pp inspector oc-code",children:s.jsx("p",{className:"oc-empty oc-col-empty",children:u.tabs.codeEmpty})})})(),nn==="inspect"&&!Tt&&!fa&&vs==="tweaks"&&(()=>{var g;const c=M??lt,h=c?(g=ut.current.get(c))==null?void 0:g.contentDocument:null;return s.jsx("div",{className:"pp inspector oc-tweaks",children:c&&Ou(h)?s.jsx("div",{className:"pp-scroll",children:s.jsx(O1,{doc:h,onSave:async x=>{try{await xe.post("/api/edit",{file:c,op:"setTweaks",values:x}),ye({tone:"ok",text:u.toast.tweaksSaved,action:Cn})}catch(T){ye({tone:"error",text:String(T.message)})}}},`${c}-${hn[c]??0}-${_l}`)}):s.jsx("p",{className:"oc-empty oc-col-empty",children:u.tabs.tweaksEmpty})})})(),nn==="inspect"&&!Tt&&!fa&&vs==="layers"&&Xn&&s.jsx("div",{className:"pp inspector oc-layers-tab",children:s.jsx("div",{className:"pp-scroll",children:M??lt?s.jsx(Vm,{file:M??lt,version:hn[M??lt]??0,selected:M?Se.state.paths:[],onSelect:(c,h)=>{const g=M??lt,x=M?Se.state.paths:[];Hn(g,h?x.includes(c)?x.filter(T=>T!==c):[...x,c]:[c])},onMove:()=>{}}):s.jsx(fb,{boards:dt.map(c=>({file:c,title:i.boards[c].title??c})),versions:hn,onPickBoard:c=>nl([c]),onPickElement:(c,h)=>Hn(c,[h])})})}),nn==="inspect"&&!Tt&&(fa||vs==="props"||vs==="layers"&&!Xn)&&s.jsxs(ub,{section:fa?"comments":"props",author:Pa||u.app.defaultAuthor,onAuthor:wr,onAskAI:c=>ll(()=>ko(c),()=>xi(c)),host:Ot.host,onAddForAi:async(c,h)=>{var g;await xe.post("/api/requests",{action:"create",file:M??lt,path:h,text:c,author:rs,attach:{kind:h?"element":"board",...h&&((g=gs())==null?void 0:g.path)===h?{label:gs().label}:{}}}),ye({tone:"ok",text:u.requests.added})},reqActions:To,file:M??lt,selection:Se.state.selection,crumbs:(()=>{var A,L;const c=Se.state.selection,h=M?(A=ut.current.get(M))==null?void 0:A.contentDocument:null;if(!M||!c||c.file!==M||!h)return null;const g=W=>{if(!W)return"";const{kind:ke,label:Ee}=Su(W);if(ke!=="container")return Ee?`${u.inspector.kindName(ke)} "${Ee.slice(0,24)}"`:u.inspector.kindName(ke);const $e=W.classList[0];return`${u.inspector.kindName(ke)}${W.id?` #${W.id}`:$e?` .${$e}`:""}`},{paths:x,skipped:T}=p0(c.path);return s.jsx(B1,{board:((L=i.boards[M])==null?void 0:L.title)??M,parents:x.map(W=>({path:W,name:g(dn(h,W))})),skipped:T,current:g(dn(h,c.path)),title:u.inspector.crumbElement(c.tag,c.path),onBoard:()=>X(null),onPath:W=>void Se.select([W])})})(),commentRef:pe,multi:Se.state.paths.length,error:Se.state.error,comments:tn,listAll:fa&&!(M??lt)?"comments":null,titleOf:c=>{var h;return((h=i.boards[c])==null?void 0:h.title)??c},pageFiles:dt,onCommentMenu:Ec,focusComment:Z,nameOf:(c,h)=>{var L;const g=(L=ut.current.get(c))==null?void 0:L.contentDocument,x=g?dn(g,h):null;if(!x)return null;const{kind:T,label:A}=Su(x);return A?`${u.inspector.kindName(T)} “${A.slice(0,24)}”`:u.inspector.kindName(T)},compact:Be,threadOnly:Mc,onOpenThread:c=>fa&&!(M??lt)?Cc(c):ne(c.id),onAllComments:()=>ne(null),onSelectPath:c=>{const h=M??lt;h&&Hn(h,[c])},onDuplicate:na?()=>void mn({op:"duplicate",path:na.path,hash:na.hash}):void 0,onDelete:na?async()=>{await mn({op:"delete",path:na.path,hash:na.hash})&&Se.select([])}:void 0,footer:!M&&lt&&i.boards[lt]?s.jsx(Aw,{onFocus:()=>qn(lt),onDuplicate:()=>void Ar(lt),onFront:()=>ka([lt],"front"),onBack:()=>ka([lt],"back"),onDelete:()=>void hc([lt])}):void 0,children:[Li&&s.jsx(fb,{boards:dt.map(c=>({file:c,title:i.boards[c].title??c})),versions:hn,onPickBoard:c=>nl([c]),onPickElement:(c,h)=>Hn(c,[h])}),M&&Gr(),!M&&yl&&Gl[yl]&&s.jsx(T0,{shape:Gl[yl],onPatch:c=>sd(yl,c,u.history.shapeStyle),onDelete:()=>wi([yl]),onFront:()=>ji(yl,"front"),onBack:()=>ji(yl,"back")}),!M&&B&&i.notes[B]&&s.jsx(C0,{note:i.notes[B],onPatch:c=>bn(h=>{const g={...h.notes[B],...c};for(const x of Object.keys(g))g[x]===void 0&&delete g[x];return{...h,notes:{...h.notes,[B]:g}}},u.history.noteStyle),onDelete:()=>Mo([B])}),!M&&lt&&i.boards[lt]&&s.jsx(Ew,{file:lt,item:i.boards[lt],pages:Ie,isLaunch:((Qr=i.launch)==null?void 0:Qr.view)==="focused"&&i.launch.file===lt,onPatch:c=>Co(lt,c),onRename:()=>void mc(lt),onRenameFile:()=>void td(lt),onLaunch:c=>bn(h=>({...h,launch:c?{view:"focused",file:lt}:{view:"canvas"}}),u.history.launchScreen)}),!M&&Yr,!M&&lt&&i.boards[lt]&&s.jsx(Cu,{id:"guides",title:u.sections.guides,count:(((Pr=i.guides)==null?void 0:Pr[lt])??[]).length,children:s.jsx($0,{guides:((qc=i.guides)==null?void 0:qc[lt])??[],onChange:(c,h)=>bn(g=>({...g,guides:{...g.guides??{},[lt]:c}}),h)})}),!M&&In.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.shapes.selectedN(In.length)}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":u.shapes.deleteAll,title:u.shapes.deleteAll,onClick:()=>wi(In),children:s.jsx(Q,{name:"trash"})})})]}),!M&&R.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.notes.selectedN(R.length)}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":u.notes.deleteAll,title:u.notes.deleteAll,onClick:()=>Mo(R),children:s.jsx(Q,{name:"trash"})})})]}),!M&&k.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.boardOptions.selectedN(k.length)}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.front,title:u.boardOptions.frontTitleMod(mt),onClick:()=>ka(k,"front"),children:s.jsx(Q,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.back,title:u.boardOptions.backTitleMod(mt),onClick:()=>ka(k,"back"),children:s.jsx(Q,{name:"back"})}),s.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.goToSelected,title:u.boardOptions.goToSelectedTitle,onClick:()=>Vl(k),children:s.jsx(Q,{name:"fit"})}),s.jsx("button",{className:"icon-btn danger","aria-label":u.boardOptions.delete,title:u.boardOptions.deleteTitleKey,onClick:()=>void hc(k),children:s.jsx(Q,{name:"trash"})})]})]}),M&&Se.state.selection&&Se.state.selection.file===M&&(()=>{var T;const c=Se.state.selection,h=(T=ut.current.get(M))!=null&&T.contentDocument?dn(ut.current.get(M).contentDocument,c.path):null,g={};if(h)for(const A of Array.from(h.attributes))g[A.name]=A.value;const x=Se.state.paths;return s.jsx(Uw,{tokens:On,bg:(()=>{let A=h;const L=h==null?void 0:h.ownerDocument.defaultView;for(;A&&L;A=A.parentElement){const W=L.getComputedStyle(A).backgroundColor;if(W&&!/rgba\(0, 0, 0, 0\)|transparent/.test(W))return W}return"rgb(255, 255, 255)"})(),onAlign:async A=>{var ke;const L=(ke=ut.current.get(M))==null?void 0:ke.contentDocument,W=L&&q1(L,c.path,c.hash,A);if(!W)return ye({text:u.toast.blockFlow});await mn({op:"batch",ops:W})},onExport:async()=>{try{const A=await xe.blob("/api/screenshot",{file:M,path:c.path,inline:!0}),L=URL.createObjectURL(A),W=document.createElement("a");W.href=L,W.download=`${pb(M).replace(/\.png$/,"")}-${c.tag}.png`,document.body.append(W),W.click(),W.remove(),setTimeout(()=>URL.revokeObjectURL(L),1e4)}catch(A){const L=A;jm(L.status,L.message)==="browser"?ye({tone:"error",text:u.toast.pngNeedsBrowser,code:"npx playwright install chromium",ms:1e4}):ye({tone:"error",text:u.toast.pngFailed(Nm(L.message))})}},onReplaceImage:c.tag==="img"||/url\(/.test(c.styles["background-image"]??"")?()=>uc(c.path,c.tag==="img"):null,selection:c,inline:h?Ry(h):{},attrs:g,canWrap:x.length>=2,vars:Hr,onStyle:dc,onAttr:(A,L)=>void mn({op:"setAttr",path:c.path,hash:c.hash,name:A,value:L}),onWrap:async A=>{const L=[...x].sort((ke,Ee)=>Number(ke.split("/").pop())-Number(Ee.split("/").pop())),W=await Promise.all(L.map(ke=>La(M,ke)));await mn({op:"wrap",paths:L,hashes:W,display:A})&&Se.select([L[0]])},children:Yr})})(),!M&&Gr()]})]}),!Xn&&s.jsx(gj,{tool:S,setTool:w,phone:Ht,foldShapes:!0,win:D,room:D.w,hist:as,histOpen:Vs,caretRef:Vu,onNewBoard:c=>Ma(Lr(c)),onToolsMenu:c=>Lf(Lr(c)),onShapesMenu:c=>_f(Lr(c)),onInsertImage:()=>ft(()=>c=>{ft(null),Ao(c)}),onUndo:()=>void jl("undo"),onRedo:()=>void jl("redo"),onHistory:()=>Vs?Is():Tc()}),Oe&&s.jsx(Rw,{board:i,file:Oe,onClose:()=>Ye(null),onLocate:c=>{z([c]),Vl([c])}}),H&&i.boards[H]&&s.jsx(jb,{board:i,file:H,mode:ve,onMode:Ce,onClose:Xs,onExport:()=>void Ys(H)}),Ne&&i.boards[Ne]&&s.jsx(jb,{bare:!0,className:"is-proto",board:i,file:Ne,mode:ve,onMode:Ce,onClose:zo,reloadKey:Qe,style:Ui?{right:oi}:void 0,onKey:c=>c==="Escape"?zo():Ua(c==="ArrowLeft"?-1:1)}),s.jsx(P0,{open:!!sc,version:gr,onClose:()=>ft(null),onPick:c=>sc==null?void 0:sc(c),onError:c=>ye({tone:"error",text:c})}),It&&s.jsx("button",{className:"icon-btn calm-handle","aria-label":u.toolbar.showTools,title:u.toolbar.showToolsTitle(mt),onClick:ol,children:s.jsx(Q,{name:"eye",size:16})}),s.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:Ve}),s.jsx(o1,{menu:qt,onClose:()=>St(null)}),Wt&&!Oe&&(()=>{const c=Ri(Wt.file,Wt.key);return c?s.jsx(u0,{file:Wt.file,tag:c,me:rs,now:kt.now,conflict:Wt.conflict,busy:Wt.busy,onCompare:()=>vo({file:Wt.file,step:c.steps[c.steps.length-1],added:c.newBoard}),onUndo:h=>void kc(Wt.file,c,h),onCancelConflict:()=>xl(h=>h&&{...h,conflict:null}),onClose:()=>xl(null)}):null})(),ql&&!Oe&&(()=>{const c=ff(i,ql.file);return c?s.jsx(ww,{file:ql.file,group:c,board:i,busy:ql.busy,onApply:()=>void Ur(ql.file),onKeepAll:()=>void Ps(ql.file),onClose:()=>wl(null)}):null})(),Wa&&i.boards[Wa.file]&&s.jsx(Bb,{before:I0(Wa.step),notBefore:u.compare.notBeforeChange,boards:[{file:Wa.file,kind:Wa.added?"added":"changed",title:i.boards[Wa.file].title??Wa.file,w:i.boards[Wa.file].w,h:i.boards[Wa.file].h}],onClose:()=>vo(null)}),Vs&&s.jsx(f0,{steps:((Jr=kt.data)==null?void 0:Jr.steps)??[],me:rs,now:kt.now,anchor:((md=Vu.current)==null?void 0:md.getBoundingClientRect())??null,busy:zf,onGo:c=>void dd(c),onClose:Is}),pn&&i.boards[pn.file]&&s.jsx(Fw,{at:{x:pn.x,y:pn.y},crumbs:pn.crumbs,host:Ot.host,onCancel:()=>xs(null),onSubmit:async(c,h)=>{Ot.host&&h?await xe.post("/api/requests",{action:"create",file:pn.file,path:pn.path,text:c,author:rs,attach:{kind:pn.path?"element":"board"}}):await xe.post("/api/comments",{file:pn.file,path:pn.path,text:c,author:Pa||u.app.defaultAuthor}),xs(null)}}),Gn&&Tt&&tn.some(c=>c.id===Gn.id)&&s.jsx(Qw,{at:{x:Gn.x,y:Gn.y},onClose:Uo,children:s.jsx(ub,{author:Pa||u.app.defaultAuthor,onAuthor:()=>{},file:tn.find(c=>c.id===Gn.id).file,selection:null,multi:0,error:null,comments:tn,focusComment:Gn.id,threadOnly:!0,section:"comments",host:Ot.host,reqActions:To,onAskAI:c=>ll(()=>ko(c),()=>xi(c)),onCommentMenu:Ec,nameOf:(c,h)=>{var L;const g=(L=ut.current.get(c))==null?void 0:L.contentDocument,x=g?dn(g,h):null;if(!x)return null;const{kind:T,label:A}=Su(x);return A?`${u.inspector.kindName(T)} “${A.slice(0,24)}”`:u.inspector.kindName(T)},onSelectPath:c=>{const h=tn.find(g=>g.id===Gn.id);Uo(),Hn(h.file,[c])}})}),s.jsx(c1,{state:Tn.state,onClose:Tn.close})]})})}function fj(n,o,i){const f=n.split("/").map(Number),m=o===""?[]:o.split("/").map(Number),p=f.length-1;return m.length>p&&m.slice(0,p).every((b,N)=>b===f[N])&&m[p]>f[p]&&m[p]--,[...m,i].join("/")}function pf({r:n,cls:o,px:i=1}){return s.jsx("div",{className:`box ${o}`,style:{left:n.x,top:n.y,width:n.w,height:n.h,"--px":`${i}px`}})}function Tb(){const n=document.querySelector(".canvas");n&&(n.tabIndex=-1,n.focus({preventScroll:!0}))}function hj(n){return s.jsxs("div",{className:`oc-zoom ${n.over?"is-over":""}`,children:[s.jsx("button",{className:"icon-btn oc-ib","aria-label":u.toolbar.zoomOut,title:u.toolbar.zoomOutTitle(mt),onClick:()=>n.onZoom(1/2),children:s.jsx(Q,{name:"minus"})}),s.jsxs("button",{className:"zoom","aria-haspopup":"menu","aria-label":u.toolbar.zoomMenu(Math.round(n.zoom*100)),onClick:n.onPct,children:[Math.round(n.zoom*100),"%"]}),s.jsx("button",{className:"icon-btn oc-ib","aria-label":u.toolbar.zoomIn,title:u.toolbar.zoomInTitle(mt),onClick:()=>n.onZoom(2),children:s.jsx(Q,{name:"plus"})}),s.jsx("button",{className:"icon-btn oc-ib oc-fit","aria-label":u.toolbar.fitAll,title:u.toolbar.fitAllTitle,onClick:n.onFit,children:s.jsx(Q,{name:"fit"})})]})}function mj({store:n,expanded:o,onOpen:i}){const f=Math.round(jf(n,m=>m.zoom)*100);return s.jsxs("button",{className:`oc-zoom-btn ${o?"on":""}`,"aria-haspopup":"menu","aria-expanded":o,"aria-label":u.toolbar.zoomMenu(f),onClick:i,children:[s.jsxs("span",{className:"zoom-pct",children:[f,"%"]}),s.jsx(Q,{name:"chevronDown",size:16})]})}function pj({win:n,first:o,onSize:i}){const f=v.useRef(null),[m,p]=v.useState(!1),[b,N]=v.useState(0);v.useLayoutEffect(()=>p(!1),[n.w,o]),v.useLayoutEffect(()=>{f.current&&(i==null||i(f.current.offsetHeight,f.current.offsetWidth))}),v.useEffect(()=>()=>i==null?void 0:i(0,0),[]),v.useLayoutEffect(()=>{var K;const z=f.current;if(!o||!z)return;const R=((K=document.querySelector(".oc-dock"))==null?void 0:K.offsetWidth)??0;R!==b&&N(R),!m&&z.scrollWidth>n.w-16&&p(!0)});const j=_b(f,n.w),E={left:j??void 0,visibility:j==null?"hidden":void 0};if(!o)return s.jsx("div",{ref:f,className:"canvas-hint","aria-hidden":"true",style:E,children:u.canvas.hint});const S=`${mt}J`,[w,k]=u.app.firstRunAi(mt).split(S);return s.jsxs("div",{ref:f,className:`canvas-hint oc-first ${m?"is-stacked":""}`,role:"status",style:{...E,minWidth:m?void 0:b||void 0},children:[s.jsxs("span",{className:"oc-fr",children:[s.jsx(Q,{name:"select"}),s.jsx("span",{children:u.app.firstRunEdit})]}),s.jsx("span",{className:"oc-fr-sep","aria-hidden":"true"}),s.jsxs("span",{className:"oc-fr",children:[s.jsx(Q,{name:"ai"}),s.jsxs("span",{children:[w,s.jsx("kbd",{children:S}),k]})]})]})}function gj(n){const o=v.useRef(null),i=_b(o,n.win.w,n.room),f=(b,N)=>s.jsx("button",{role:"radio","aria-checked":n.tool===b.id,"aria-label":u.toolbar.tool(b.label,b.key),title:N,className:`icon-btn tool ${n.tool===b.id?"on":""}`,onClick:()=>n.setTool(b.id),children:s.jsx(Q,{name:b.icon})},b.id),m=ci.slice(0,5).find(b=>b.id===n.tool),p=ci.slice(5).find(b=>b.id===n.tool);return s.jsxs("div",{ref:o,className:"oc-dock",role:"toolbar","aria-label":u.toolbar.aria,style:{left:i??void 0,visibility:i==null?"hidden":void 0},children:[s.jsxs("button",{className:"new-board","aria-haspopup":"menu","aria-label":n.phone?u.toolbar.newBoard:void 0,title:u.toolbar.newBoardTitle,onClick:n.onNewBoard,children:[s.jsx(Q,{name:"plus"}),!n.phone&&s.jsx("span",{children:u.toolbar.newBoard}),s.jsx(Q,{name:"chevronDown",size:16,className:"s"})]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),n.phone?s.jsxs("button",{className:`icon-btn tool oc-fold ${m?"on":""}`,"aria-label":u.toolbar.canvasTools,"aria-haspopup":"menu",title:u.toolbar.canvasTools,onClick:n.onToolsMenu,children:[s.jsx(Q,{name:(m==null?void 0:m.icon)??"select"}),s.jsx(Q,{name:"chevronDown",size:16,className:"s"})]}):s.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":u.toolbar.canvasTools,children:[ci.slice(0,2).map(b=>f(b,u.toolbar.tool(b.hint,b.key))),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),ci.slice(2,5).map(b=>f(b,u.toolbar.tool(b.hint,b.key)))]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),n.foldShapes?s.jsxs("button",{className:`icon-btn tool oc-fold ${p?"on":""}`,"aria-label":u.toolbar.shapes,"aria-haspopup":"menu",title:u.toolbar.shapes,onClick:n.onShapesMenu,children:[s.jsx(Q,{name:(p==null?void 0:p.icon)??"rect"}),s.jsx(Q,{name:"chevronDown",size:16,className:"s"})]}):s.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":u.toolbar.shapes,children:[ci.slice(5).map(b=>f(b,u.toolbar.shapeToolTitle(b.hint,b.key))),s.jsx("button",{className:"icon-btn","aria-label":u.toolbar.insertImage,title:u.toolbar.insertImageTitle,onClick:n.onInsertImage,children:s.jsx(Q,{name:"image"})})]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),s.jsxs("div",{className:"oc-group undo-split",children:[s.jsx("button",{className:"icon-btn","aria-label":u.toolbar.undo,title:u.toolbar.undoTitle(n.hist.undo.length?u.activity.stepName(n.hist.undo[n.hist.undo.length-1]):void 0,mt),disabled:!n.hist.canUndo,onClick:n.onUndo,children:s.jsx(Q,{name:"undo"})}),s.jsx("button",{ref:n.caretRef,className:`icon-btn caret-btn ${n.histOpen?"on":""}`,"aria-label":u.activity.historyButton,"aria-haspopup":"menu","aria-expanded":n.histOpen,title:u.activity.historyButton,onClick:n.onHistory,children:s.jsx(Q,{name:"chevronDown",size:16})}),s.jsx("button",{className:"icon-btn","aria-label":u.toolbar.redo,title:u.toolbar.redoTitle(n.hist.redo.length?u.activity.stepName(n.hist.redo[n.hist.redo.length-1]):void 0,mt),disabled:!n.hist.canRedo,onClick:n.onRedo,children:s.jsx(Q,{name:"redo"})})]})]})}function yj({store:n,...o}){return s.jsx(hj,{...o,zoom:jf(n,i=>i.zoom)})}function bj({store:n,...o}){return s.jsx(k0,{...o,view:Zm(n)})}function vj(){const n=v.useRef(new Map);return v.useCallback((o,i,f)=>{const m=n.current.get(o);if(m&&m.sig===i)return m.node;const p=f();return n.current.set(o,{sig:i,node:p}),p},[])}function xj(n,o){if(!n)return o;if(JSON.stringify(n)===JSON.stringify(o))return n;const i=(f,m)=>{if(!f||!m)return m;const p={};for(const[b,N]of Object.entries(m))p[b]=f[b]!==void 0&&JSON.stringify(f[b])===JSON.stringify(N)?f[b]:N;return p};return{...o,boards:i(n.boards,o.boards),notes:i(n.notes,o.notes),shapes:i(n.shapes,o.shapes)}}class wj extends v.Component{constructor(){super(...arguments);jy(this,"state",{error:null})}static getDerivedStateFromError(i){return{error:i}}render(){return this.state.error?s.jsxs("div",{className:"loading",role:"alert",children:[s.jsx(Q,{name:"warn"})," ",u.app.crashed," ",this.state.error.message,s.jsx("button",{onClick:()=>location.reload(),children:u.app.reload})]}):this.props.children}}document.documentElement.lang=wf;Yx.createRoot(document.getElementById("root")).render(s.jsx(wj,{children:s.jsx(s1,{children:s.jsx(dj,{})})}));